ASF Bugzilla – Attachment 21764 Details for
Bug 33078
Mixing "+" and non-"+" options in <Directory> result in strange behavour
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Reject option combinations that (at best) don't make much sense.
core.c.diff (text/plain), 2.50 KB, created by
Sönke Tesch
on 2008-04-02 03:00:13 UTC
(
hide
)
Description:
Reject option combinations that (at best) don't make much sense.
Filename:
MIME Type:
Creator:
Sönke Tesch
Created:
2008-04-02 03:00:13 UTC
Size:
2.50 KB
patch
obsolete
>--- server/core.c.2.2.8 2007-11-29 21:21:10.000000000 +0100 >+++ server/core.c 2008-04-02 11:34:31.000000000 +0200 >@@ -1411,6 +1411,8 @@ > allow_options_t opt; > int first = 1; > char action; >+ int merge = 0; >+ int allNone = 0; > > while (l[0]) { > char *w = ap_getword_conf(cmd->pool, &l); >@@ -1418,10 +1420,18 @@ > > if (*w == '+' || *w == '-') { > action = *(w++); >+ if (!merge && !first && !allNone) { >+ return "Options: Either all or no option may start with + or -, " >+ "you cannot merge just a few options."; >+ } >+ merge = 1; > } > else if (first) { >- d->opts = OPT_NONE; >- first = 0; >+ d->opts = OPT_NONE; >+ } >+ else if (merge) { >+ return "Options: Either all or no option may start with + or -, " >+ "you cannot merge just a few options."; > } > > if (!strcasecmp(w, "Indexes")) { >@@ -1449,17 +1459,31 @@ > opt = OPT_MULTI|OPT_EXECCGI; > } > else if (!strcasecmp(w, "None")) { >+ if (!first) { >+ return "Options: 'None' must be the first option given."; >+ } >+ else if (merge) { /* Only works since None may not follow any other option. */ >+ return "Options: You may not use +None or -None."; >+ } > opt = OPT_NONE; >+ allNone = 1; > } > else if (!strcasecmp(w, "All")) { >+ if (!first) { >+ return "Options: 'All' must be the first option given."; >+ } >+ else if (merge) { /* Only works since All may not follow any other option. */ >+ return "Options: You may not use +All or -All."; >+ } > opt = OPT_ALL; >+ allNone = 1; > } > else { >- return apr_pstrcat(cmd->pool, "Illegal option ", w, NULL); >+ return apr_pstrcat(cmd->pool, "Options: Unknown option ", w, ".", NULL); > } > > if (!(cmd->override_opts & opt) && opt != OPT_NONE) { >- return apr_pstrcat(cmd->pool, "Option ", w, " not allowed here", NULL); >+ return apr_pstrcat(cmd->pool, "Options: Option ", w, " not allowed here.", NULL); > } > else if (action == '-') { > /* we ensure the invariant (d->opts_add & d->opts_remove) == 0 */ >@@ -1475,6 +1499,8 @@ > else { > d->opts |= opt; > } >+ >+ first = 0; > } > > return NULL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33078
: 21764