[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-09-14 Thread Jérôme Loyet
fat  Tue, 14 Sep 2010 15:33:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=303365

Log:
- remove a memory leak (missing efree())

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-09-14 
14:26:37 UTC (rev 303364)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-09-14 
15:33:43 UTC (rev 303365)
@@ -716,11 +716,13 @@
 #ifdef GLOB_NOMATCH
if (i == GLOB_NOMATCH) {
zlog(ZLOG_STUFF, ZLOG_WARNING, Nothing matches 
the include pattern '%s' from %s at line %d., inc, filename, ini_lineno);
+   efree(filename);
return;
}
 #endif /* GLOB_NOMATCH */
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to globalize '%s' 
(ret=%d) from %s at line %d., inc, i, filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}

@@ -731,6 +733,7 @@
if (0  fpm_conf_load_ini_file(g.gl_pathv[i] 
TSRMLS_CC)) {
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to include 
%s from %s at line %d, g.gl_pathv[i], filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}
}
@@ -740,9 +743,12 @@
if (0  fpm_conf_load_ini_file(inc TSRMLS_CC)) {
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to include %s from %s at 
line %d, inc, filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}
 #endif /* HAVE_GLOB */
+
+   efree(filename);
 }
 /* }}} */


Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-09-14 14:26:37 UTC (rev 
303364)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-09-14 15:33:43 UTC (rev 
303365)
@@ -716,11 +716,13 @@
 #ifdef GLOB_NOMATCH
if (i == GLOB_NOMATCH) {
zlog(ZLOG_STUFF, ZLOG_WARNING, Nothing matches 
the include pattern '%s' from %s at line %d., inc, filename, ini_lineno);
+   efree(filename);
return;
}
 #endif /* GLOB_NOMATCH */
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to globalize '%s' 
(ret=%d) from %s at line %d., inc, i, filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}

@@ -731,6 +733,7 @@
if (0  fpm_conf_load_ini_file(g.gl_pathv[i] 
TSRMLS_CC)) {
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to include 
%s from %s at line %d, g.gl_pathv[i], filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}
}
@@ -740,9 +743,12 @@
if (0  fpm_conf_load_ini_file(inc TSRMLS_CC)) {
zlog(ZLOG_STUFF, ZLOG_ERROR, Unable to include %s from %s at 
line %d, inc, filename, ini_lineno);
*error = 1;
+   efree(filename);
return;
}
 #endif /* HAVE_GLOB */
+
+   efree(filename);
 }
 /* }}} */


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-08-20 Thread Jérôme Loyet
fat  Fri, 20 Aug 2010 17:00:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=302566

Log:
- typo (thx to sixd)

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-08-20 
16:37:33 UTC (rev 302565)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-08-20 
17:00:57 UTC (rev 302566)
@@ -847,7 +847,7 @@
void *config;

if (!Z_STRVAL_P(key) || !Z_STRVAL_P(value) || !*Z_STRVAL_P(key)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ?, 
ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Misspelled  array ?, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -859,7 +859,7 @@

if (!strcmp(env, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -868,7 +868,7 @@

} else if (!strcmp(php_value, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -877,7 +877,7 @@

} else if (!strcmp(php_admin_value, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-08-20 16:37:33 UTC (rev 
302565)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-08-20 17:00:57 UTC (rev 
302566)
@@ -847,7 +847,7 @@
void *config;

if (!Z_STRVAL_P(key) || !Z_STRVAL_P(value) || !*Z_STRVAL_P(key)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ?, 
ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Misspelled  array ?, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -859,7 +859,7 @@

if (!strcmp(env, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -868,7 +868,7 @@

} else if (!strcmp(php_value, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}
@@ -877,7 +877,7 @@

} else if (!strcmp(php_admin_value, Z_STRVAL_P(name))) {
if (!*Z_STRVAL_P(value)) {
-   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] Mispell array ? 
(empty value), ini_filename, ini_lineno);
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] empty value, 
ini_filename, ini_lineno);
*error = 1;
return;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-08-02 Thread Jérôme Loyet
fat  Mon, 02 Aug 2010 21:46:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301807

Log:
BUG: all value comparaisons were not case insensitive in the conf file parser

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-08-02 
21:45:23 UTC (rev 301806)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-08-02 
21:46:52 UTC (rev 301807)
@@ -204,7 +204,7 @@
 {
char *val = Z_STRVAL_P(value);

-   if (!strcmp(val, debug)) {
+   if (!strcasecmp(val, debug)) {
fpm_globals.log_level = ZLOG_DEBUG;
} else if (!strcasecmp(val, notice)) {
fpm_globals.log_level = ZLOG_NOTICE;
@@ -227,7 +227,7 @@
char *val = Z_STRVAL_P(value);
struct fpm_worker_pool_config_s *c = *config;

-   if (!strcmp(val, unlimited)) {
+   if (!strcasecmp(val, unlimited)) {
c-rlimit_core = -1;
} else {
int int_value;
@@ -255,9 +255,9 @@
 {
char *val = Z_STRVAL_P(value);
struct fpm_worker_pool_config_s  *c = *config;
-   if (!strcmp(val, static)) {
+   if (!strcasecmp(val, static)) {
c-pm = PM_STYLE_STATIC;
-   } else if (!strcmp(val, dynamic)) {
+   } else if (!strcasecmp(val, dynamic)) {
c-pm = PM_STYLE_DYNAMIC;
} else {
return invalid process manager (static or dynamic);

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-08-02 21:45:23 UTC (rev 
301806)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-08-02 21:46:52 UTC (rev 
301807)
@@ -204,7 +204,7 @@
 {
char *val = Z_STRVAL_P(value);

-   if (!strcmp(val, debug)) {
+   if (!strcasecmp(val, debug)) {
fpm_globals.log_level = ZLOG_DEBUG;
} else if (!strcasecmp(val, notice)) {
fpm_globals.log_level = ZLOG_NOTICE;
@@ -227,7 +227,7 @@
char *val = Z_STRVAL_P(value);
struct fpm_worker_pool_config_s *c = *config;

-   if (!strcmp(val, unlimited)) {
+   if (!strcasecmp(val, unlimited)) {
c-rlimit_core = -1;
} else {
int int_value;
@@ -255,9 +255,9 @@
 {
char *val = Z_STRVAL_P(value);
struct fpm_worker_pool_config_s  *c = *config;
-   if (!strcmp(val, static)) {
+   if (!strcasecmp(val, static)) {
c-pm = PM_STYLE_STATIC;
-   } else if (!strcmp(val, dynamic)) {
+   } else if (!strcasecmp(val, dynamic)) {
c-pm = PM_STYLE_DYNAMIC;
} else {
return invalid process manager (static or dynamic);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-07-06 Thread Antony Dovgal
tony2001 Tue, 06 Jul 2010 11:37:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301020

Log:
fix typos and use correct directive names in error messages

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c	2010-07-06 09:43:49 UTC (rev 301019)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c	2010-07-06 11:37:19 UTC (rev 301020)
@@ -436,7 +436,7 @@
 		}

 		if (wp-config-pm_max_children  1) {
-			zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm_max_children must be a positiive value, wp-config-name);
+			zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.max_children must be a positive value, wp-config-name);
 			return -1;
 		}

@@ -444,32 +444,32 @@
 			struct fpm_worker_pool_config_s *config = wp-config;

 			if (config-pm_min_spare_servers = 0) {
-zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] min_spare_servers(%d) must be a positive value, wp-config-name, config-pm_min_spare_servers);
+zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.min_spare_servers(%d) must be a positive value, wp-config-name, config-pm_min_spare_servers);
 return -1;
 			}

 			if (config-pm_max_spare_servers = 0) {
-zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] max_spare_servers(%d) must be a positive value, wp-config-name, config-pm_max_spare_servers);
+zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.max_spare_servers(%d) must be a positive value, wp-config-name, config-pm_max_spare_servers);
 return -1;
 			}

 			if (config-pm_min_spare_servers  config-pm_max_children ||
 	config-pm_max_spare_servers  config-pm_max_children) {
-zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] min_spare_servers(%d) and max_spare_servers(%d) cannot be greater than max_children(%d),
+zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.min_spare_servers(%d) and pm.max_spare_servers(%d) cannot be greater than pm.max_children(%d),
 		wp-config-name, config-pm_min_spare_servers, config-pm_max_spare_servers, config-pm_max_children);
 return -1;
 			}

 			if (config-pm_max_spare_servers  config-pm_min_spare_servers) {
-zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] max_spare_servers(%d) must not be less than min_spare_servers(%d), wp-config-name, config-pm_max_spare_servers, config-pm_min_spare_servers);
+zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.max_spare_servers(%d) must not be less than pm.min_spare_servers(%d), wp-config-name, config-pm_max_spare_servers, config-pm_min_spare_servers);
 return -1;
 			}

 			if (config-pm_start_servers = 0) {
 config-pm_start_servers = config-pm_min_spare_servers + ((config-pm_max_spare_servers - config-pm_min_spare_servers) / 2);
-zlog(ZLOG_STUFF, ZLOG_WARNING, [pool %s] start_servers is not set. It's been set to %d., wp-config-name, config-pm_start_servers);
+zlog(ZLOG_STUFF, ZLOG_WARNING, [pool %s] pm.start_servers is not set. It's been set to %d., wp-config-name, config-pm_start_servers);
 			} else if (config-pm_start_servers  config-pm_min_spare_servers || config-pm_start_servers  config-pm_max_spare_servers) {
-zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] start_servers(%d) must not be less than min_spare_servers(%d) and not greater than max_spare_servers(%d), wp-config-name, config-pm_start_servers, config-pm_min_spare_servers, config-pm_max_spare_servers);
+zlog(ZLOG_STUFF, ZLOG_ALERT, [pool %s] pm.start_servers(%d) must not be less than pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d), wp-config-name, config-pm_start_servers, config-pm_min_spare_servers, config-pm_max_spare_servers);
 return -1;
 			}

@@ -563,7 +563,7 @@

 			for (i=0; istrlen(status); i++) {
 if (!isalnum(status[i])  status[i] != '/'  status[i] != '-'  status[i] != '_'  status[i] != '.') {
-	zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the status path '%s' must containt only the following characters '[alphanum]/_-.', wp-config-name, status);
+	zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the status path '%s' must contain only the following characters '[alphanum]/_-.', wp-config-name, status);
 	return -1;
 }
 			}
@@ -607,7 +607,7 @@
 }
 snprintf(buf, len, %s%s, wp-config-chroot, wp-config-chdir);
 if (!fpm_conf_is_dir(buf)) {
-	zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the chdir path '%s' wihtin the chroot path '%s' ('%s') does not exist or is not a directory, wp-config-name, wp-config-chdir, wp-config-chroot, buf);
+	zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the chdir path '%s' within the chroot path '%s' ('%s') does not exist or is not a directory, wp-config-name, wp-config-chdir, wp-config-chroot, buf);
 	free(buf);
 	return -1;
 }
@@ -714,7 +714,7 @@
 		if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, g)) != 0) {
 #ifdef GLOB_NOMATCH
 			if (i == 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-06-19 Thread Jérôme Loyet
fat  Sat, 19 Jun 2010 16:31:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=300604

Log:
- Fixed bug #52086 (No new line at the end of a included file crahes the PHP 
FPM daemon)

Bug: http://bugs.php.net/52086 (Analyzed) No new line at the end of a included 
pool file crahes the PHP FPM daemon
  
Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-19 
16:24:17 UTC (rev 300603)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-19 
16:31:19 UTC (rev 300604)
@@ -950,9 +950,7 @@
for (n=0; n1024  (nb_read = read(fd, c, sizeof(char))) == 
sizeof(char)  c != '\n'; n++) {
buf[n] = c;
}
-   if (c == '\n') {
-   buf[n++] = c;
-   }
+   buf[n++] = '\n';
ini_lineno++;
ini_filename = filename;
tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_RAW, 
(zend_ini_parser_cb_t)fpm_conf_ini_parser, error TSRMLS_CC);
@@ -972,7 +970,7 @@
free(tmp);
ini_recursion--;
close(fd);
-   ret = -1;
+   return -1;
}
free(tmp);
}

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-19 16:24:17 UTC (rev 
300603)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-19 16:31:19 UTC (rev 
300604)
@@ -950,9 +950,7 @@
for (n=0; n1024  (nb_read = read(fd, c, sizeof(char))) == 
sizeof(char)  c != '\n'; n++) {
buf[n] = c;
}
-   if (c == '\n') {
-   buf[n++] = c;
-   }
+   buf[n++] = '\n';
ini_lineno++;
ini_filename = filename;
tmp = zend_parse_ini_string(buf, 1, ZEND_INI_SCANNER_RAW, 
(zend_ini_parser_cb_t)fpm_conf_ini_parser, error TSRMLS_CC);
@@ -972,7 +970,7 @@
free(tmp);
ini_recursion--;
close(fd);
-   ret = -1;
+   return -1;
}
free(tmp);
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-06-13 Thread Jérôme Loyet
fat  Sun, 13 Jun 2010 10:30:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=300418

Log:
Fix #52067, chroot and chdir path were not checked at startup. If configured 
with unexistant directories, FPM entered in an error loop.

Bug: http://bugs.php.net/52067 (Assigned) chdir to a nonexisting directory when 
chrooting is buggy
  
Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-13 
07:55:10 UTC (rev 300417)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-13 
10:30:35 UTC (rev 300418)
@@ -99,6 +99,18 @@
{ 0, 0, 0 }
 };

+static int fpm_conf_is_dir(char *path) /* {{{ */
+{
+   struct stat sb;
+
+   if (stat(path, sb) != 0) {
+   return 0;
+   }
+
+   return (sb.st_mode  S_IFMT) == S_IFDIR;
+}
+/* }}} */
+
 static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset) 
/* {{{ */
 {
char *val = Z_STRVAL_P(value);
@@ -565,6 +577,48 @@
fpm_status_set_pm(wp-shm_status, wp-config-pm);
/* memset(fpm_status.last_update, 0, 
sizeof(fpm_status.last_update)); */
}
+
+   if (wp-config-chroot  *wp-config-chroot) {
+   if (*wp-config-chroot != '/') {
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the 
chroot path '%s' must start with a '/', wp-config-name, wp-config-chroot);
+   return -1;
+   }
+   if (!fpm_conf_is_dir(wp-config-chroot)) {
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the 
chroot path '%s' does not exist or is not a directory, wp-config-name, 
wp-config-chroot);
+   return -1;
+   }
+   }
+
+   if (wp-config-chdir  *wp-config-chdir) {
+   if (*wp-config-chdir != '/') {
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] the 
chdir path '%s' must start with a '/', wp-config-name, wp-config-chdir);
+   return -1;
+   }
+
+   if (wp-config-chroot) {
+   char *buf;
+   size_t len;
+
+   len = strlen(wp-config-chroot) + 
strlen(wp-config-chdir) + 1;
+   buf = malloc(sizeof(char) * len);
+   if (!buf) {
+   zlog(ZLOG_STUFF, ZLOG_SYSERROR, [pool 
%s] malloc() failed, wp-config-name);
+   return -1;
+   }
+   snprintf(buf, len, %s%s, wp-config-chroot, 
wp-config-chdir);
+   if (!fpm_conf_is_dir(buf)) {
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] 
the chdir path '%s' wihtin the chroot path '%s' ('%s') does not exist or is not 
a directory, wp-config-name, wp-config-chdir, wp-config-chroot, buf);
+   free(buf);
+   return -1;
+   }
+   free(buf);
+   } else {
+   if (!fpm_conf_is_dir(wp-config-chdir)) {
+   zlog(ZLOG_STUFF, ZLOG_ERROR, [pool %s] 
the chdir path '%s' does not exist or is not a directory, wp-config-name, 
wp-config-chdir);
+   return -1;
+   }
+   }
+   }
}
return 0;
 }

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-13 07:55:10 UTC (rev 
300417)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-13 10:30:35 UTC (rev 
300418)
@@ -99,6 +99,18 @@
{ 0, 0, 0 }
 };

+static int fpm_conf_is_dir(char *path) /* {{{ */
+{
+   struct stat sb;
+
+   if (stat(path, sb) != 0) {
+   return 0;
+   }
+
+   return (sb.st_mode  S_IFMT) == S_IFDIR;
+}
+/* }}} */
+
 static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset) 
/* {{{ */
 {
char *val = Z_STRVAL_P(value);
@@ -565,6 +577,48 @@
fpm_status_set_pm(wp-shm_status, wp-config-pm);
/* memset(fpm_status.last_update, 0, 
sizeof(fpm_status.last_update)); */
}
+
+   if (wp-config-chroot  *wp-config-chroot) {
+   if (*wp-config-chroot != 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-06-08 Thread Antony Dovgal
tony2001 Tue, 08 Jun 2010 18:59:11 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=300290

Log:
support both 'warn' and 'warning' as error levels

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-08 
18:27:23 UTC (rev 300289)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-06-08 
18:59:11 UTC (rev 300290)
@@ -196,7 +196,7 @@
fpm_globals.log_level = ZLOG_DEBUG;
} else if (!strcasecmp(val, notice)) {
fpm_globals.log_level = ZLOG_NOTICE;
-   } else if (!strcasecmp(val, warn)) {
+   } else if (!strcasecmp(val, warning) || !strcasecmp(val, warn)) {
fpm_globals.log_level = ZLOG_WARNING;
} else if (!strcasecmp(val, error)) {
fpm_globals.log_level = ZLOG_ERROR;

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-08 18:27:23 UTC (rev 
300289)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-06-08 18:59:11 UTC (rev 
300290)
@@ -196,7 +196,7 @@
fpm_globals.log_level = ZLOG_DEBUG;
} else if (!strcasecmp(val, notice)) {
fpm_globals.log_level = ZLOG_NOTICE;
-   } else if (!strcasecmp(val, warn)) {
+   } else if (!strcasecmp(val, warning) || !strcasecmp(val, warn)) {
fpm_globals.log_level = ZLOG_WARNING;
} else if (!strcasecmp(val, error)) {
fpm_globals.log_level = ZLOG_ERROR;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c

2010-05-27 Thread Jérôme Loyet
fat  Thu, 27 May 2010 22:31:28 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=299881

Log:
bug: include paths were not evaluated to to full path

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
U   php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-05-27 
22:18:58 UTC (rev 299880)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c2010-05-27 
22:31:28 UTC (rev 299881)
@@ -742,7 +742,6 @@
}

if (!strcmp(Z_STRVAL_P(name), include)) {
-   //  fpm_conf_ini_parser_include(value, error);
if (ini_include) {
zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] two includes at 
the same time !, ini_filename, ini_lineno);
*error = 1;
@@ -913,6 +912,7 @@
if (ini_include) {
char *tmp = ini_include;
ini_include = NULL;
+   fpm_evaluate_full_path(tmp);
fpm_conf_ini_parser_include(tmp, error TSRMLS_CC);
if (error) {
free(tmp);

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c
===
--- php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-05-27 22:18:58 UTC (rev 
299880)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c   2010-05-27 22:31:28 UTC (rev 
299881)
@@ -742,7 +742,6 @@
}

if (!strcmp(Z_STRVAL_P(name), include)) {
-   //  fpm_conf_ini_parser_include(value, error);
if (ini_include) {
zlog(ZLOG_STUFF, ZLOG_ERROR, [%s:%d] two includes at 
the same time !, ini_filename, ini_lineno);
*error = 1;
@@ -913,6 +912,7 @@
if (ini_include) {
char *tmp = ini_include;
ini_include = NULL;
+   fpm_evaluate_full_path(tmp);
fpm_conf_ini_parser_include(tmp, error TSRMLS_CC);
if (error) {
free(tmp);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php