Changes with Apache 2.3.15
+ *) core: Add ap_check_cmd_context()-check if a command is executed in
+ .htaccess file. [Stefan Fritsch]
+
*) mod_deflate: Fix endless loop if first bucket is metadata. PR 51590.
[Torsten Foertsch <torsten foertsch gmx net>]
<li>New ap_process_fnmatch_configs() to process wildcards</li>
<li>Change ap_configfile_t, ap_cfg_getline(), ap_cfg_getc() to return error
code, new ap_pcfg_strerror().</li>
+ <li>Any config directive permitted in ACCESS_CONF context must now
+ correctly handle being called from an .htaccess file via the new
+ <code class="directive"><a href="../mod/core.html#allowoverridelist">AllowOverrideList</a></code> directive.
+ ap_check_cmd_context() accepts a new flag NOT_IN_HTACCESS to detect
+ this case.</li>
</ul>
<li>New ap_process_fnmatch_configs() to process wildcards</li>
<li>Change ap_configfile_t, ap_cfg_getline(), ap_cfg_getc() to return error
code, new ap_pcfg_strerror().</li>
+ <li>Any config directive permitted in ACCESS_CONF context must now
+ correctly handle being called from an .htaccess file via the new
+ <directive module="core">AllowOverrideList</directive> directive.
+ ap_check_cmd_context() accepts a new flag NOT_IN_HTACCESS to detect
+ this case.</li>
</ul>
</section>
* 20110724.0 (2.3.14-dev) Add override_list as parameter to ap_parse_htaccess
* Add member override_list to cmd_parms_struct,
* core_dir_config and htaccess_result
+ * 20110724.1 (2.3.15-dev) add NOT_IN_HTACCESS
*/
#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20110724
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
#define NOT_IN_DIRECTORY 0x04 /**< Forbidden in <Directory> */
#define NOT_IN_LOCATION 0x08 /**< Forbidden in <Location> */
#define NOT_IN_FILES 0x10 /**< Forbidden in <Files> */
+#define NOT_IN_HTACCESS 0x20 /**< Forbidden in .htaccess files */
/** Forbidden in <Directory>/<Location>/<Files>*/
#define NOT_IN_DIR_LOC_FILE (NOT_IN_DIRECTORY|NOT_IN_LOCATION|NOT_IN_FILES)
/** Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files> */
"section", NULL);
}
+ if ((forbidden & NOT_IN_HTACCESS) && (cmd->pool == cmd->temp_pool)) {
+ return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
+ " cannot occur within htaccess files", NULL);
+ }
+
if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
if (cmd->path != NULL) {
return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
static const char *set_define(cmd_parms *cmd, void *dummy,
const char *name, const char *value)
{
+ const char *err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS);
+ if (err)
+ return err;
if (ap_strchr_c(name, ':') != NULL)
return "Variable name must not contain ':'";
{
int i;
char **defines;
+ const char *err = ap_check_cmd_context(cmd, NOT_IN_HTACCESS);
+ if (err)
+ return err;
if (ap_strchr_c(name, ':') != NULL)
return "Variable name must not contain ':'";