diff options
author | foobar <sniper@php.net> | 2005-03-17 13:43:32 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2005-03-17 13:43:32 +0000 |
commit | 9c2c04b580c9f5605263392eefdafd45563e2c57 (patch) | |
tree | a48f09a0447bf3837ec9b741c0aa0f337797f3bc | |
parent | 04d44c8a5c2790f01069ee2807ec0def0afd0cf8 (diff) | |
download | php-git-9c2c04b580c9f5605263392eefdafd45563e2c57.tar.gz |
- Made CLI option -d output error and exit if an non-existing (or unmodifyable) entry is passed
-rw-r--r-- | sapi/cli/php_cli.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index aab039a8f6..6fe8982f35 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -395,7 +395,7 @@ static void php_cli_usage(char *argv0) } /* }}} */ -static void define_command_line_ini_entry(char *arg TSRMLS_DC) +static int define_command_line_ini_entry(char *arg TSRMLS_DC) { char *name, *value; @@ -413,8 +413,9 @@ static void define_command_line_ini_entry(char *arg TSRMLS_DC) ZVAL_STRING(&extension, value, 0); php_dl(&extension, MODULE_PERSISTENT, &zval TSRMLS_CC); } else { - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + return zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); } + return SUCCESS; } @@ -661,7 +662,10 @@ int main(int argc, char *argv[]) switch (c) { case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(php_optarg TSRMLS_CC); + if (define_command_line_ini_entry(php_optarg TSRMLS_CC) == FAILURE) { + zend_printf("Invalid php.ini entry '%s'.\n", php_optarg); + goto err; + } break; case 'h': /* help & quit */ |