https://bz.apache.org/bugzilla/show_bug.cgi?id=52439

--- Comment #11 from Alexis Maiquez <[email protected]> ---
Comment on attachment 34093
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34093
Honour nonfatal on Options All specific case

--- httpd/server/core.c    2016-06-14 01:08:08.000000000 +0200
+++ httpd/server/core.c    2016-08-03 13:00:56.472620572 +0200
@@ -1971,13 +1971,38 @@
             all_none = 1;
         }
         else {
-            return apr_pstrcat(cmd->pool, "Illegal option ", w, NULL);
+            if (cmd->override & NONFATAL_UNKNOWN) {
+                opt = 0;
+                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
"Unknown Option %s in line %d of %s.",
+                    w, cmd->directive->line_num, cmd->directive->filename);
+            } else {
+                return apr_pstrcat(cmd->pool, "Illegal option ", w, NULL);
+            }
         }

         if ( (cmd->override_opts & opt) != opt ) {
-            return apr_pstrcat(cmd->pool, "Option ", w, " not allowed here",
NULL);
+            if (cmd->override & NONFATAL_OVERRIDE) {
+                ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server,
"Option %s not allowed in line %d of %s.",
+                    w, cmd->directive->line_num, cmd->directive->filename);
+
+                /* special case for Options All, we might want to enable every
possible (and allowed) parameter */
+                if (opt != OPT_ALL) {
+                    first = 0;
+                    continue;
+                } else {
+                    /*
+                     * OPT_ALL doesnt include OPT_SYM_OWNER but its important
to enable that one too
+                     * also take in mind that Options All does not have + or -
so it'll be added to the already enabled options
+                     * this means it'll enable everything that is allowed to
be overriden
+                     */
+                    opt = (OPT_ALL | OPT_SYM_OWNER) & cmd->override_opts;
+                }
+            } else {
+                return apr_pstrcat(cmd->pool, "Option ", w, " not allowed
here", NULL);
+            }
         }
-        else if (action == '-') {
+
+        if (action == '-') {
             /* we ensure the invariant (d->opts_add & d->opts_remove) == 0 */
             d->opts_remove |= opt;
             d->opts_add &= ~opt;

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to