Skip to content

Commit

Permalink
fix mail.log openbasedir interaction with .htaccess
Browse files Browse the repository at this point in the history
  • Loading branch information
smalyshev committed Jul 9, 2009
1 parent fb235dc commit 4bb8672
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion main/main.c
Expand Up @@ -365,6 +365,26 @@ static PHP_INI_MH(OnUpdateErrorLog)
}
/* }}} */

/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnUpdateMailLog)
{
/* Only do the safemode/open_basedir check at runtime */
if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) {
if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
return FAILURE;
}

if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) {
return FAILURE;
}

}
OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
return SUCCESS;
}
/* }}} */

/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnChangeMailForceExtra)
Expand Down Expand Up @@ -487,7 +507,7 @@ PHP_INI_BEGIN()
PHP_INI_ENTRY("SMTP", "localhost",PHP_INI_ALL, NULL)
PHP_INI_ENTRY("smtp_port", "25", PHP_INI_ALL, NULL)
STD_PHP_INI_BOOLEAN("mail.add_x_header", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, mail_x_header, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("mail.log", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, mail_log, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("mail.log", NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateMailLog, mail_log, php_core_globals, core_globals)
PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL)
PHP_INI_ENTRY("memory_limit", "128M", PHP_INI_ALL, OnChangeMemoryLimit)
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
Expand Down

0 comments on commit 4bb8672

Please sign in to comment.