You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Paul Sutton <pc...@hyperreal.com> on 1996/11/04 10:43:09 UTC
cvs commit: apache/src http_core.c http_core.h
pcs 96/11/04 01:43:08
Modified: src http_core.c http_core.h
Log:
Reviewed-by: Brian Behlendorf, Mark Cox, Chuck Murcko
Allow options to be set/unset individually, rather than replacing existing
options settings. Used as: "Options +Indexes -Multiviews", etc.
Revision Changes Path
1.43 +34 -11 apache/src/http_core.c
Index: http_core.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_core.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -C3 -r1.42 -r1.43
*** http_core.c 1996/11/04 00:55:18 1.42
--- http_core.c 1996/11/04 09:43:07 1.43
***************
*** 87,92 ****
--- 87,93 ----
else conf->d = pstrcat (a, dir, "/", NULL);
conf->opts = dir ? OPT_UNSET : OPT_ALL;
+ conf->opts_add = conf->opts_remove = OPT_NONE;
conf->override = dir ? OR_UNSET : OR_ALL;
conf->content_md5 = 2;
***************
*** 123,128 ****
--- 124,132 ----
conf->r = new->r;
if (new->opts != OPT_UNSET) conf->opts = new->opts;
+ if (new->opts_add) conf->opts |= new->opts_add;
+ if (new->opts_remove) conf->opts &= ~(new->opts_remove);
+
if (new->override != OR_UNSET) conf->override = new->override;
if (new->default_type) conf->default_type = new->default_type;
***************
*** 469,499 ****
const char *set_options (cmd_parms *cmd, core_dir_config *d, const char *l)
{
! d->opts = OPT_NONE;
while(l[0]) {
char *w = getword_conf(cmd->pool, &l);
if(!strcasecmp(w,"Indexes"))
! d->opts |= OPT_INDEXES;
else if(!strcasecmp(w,"Includes"))
! d->opts |= OPT_INCLUDES;
else if(!strcasecmp(w,"IncludesNOEXEC"))
! d->opts |= (OPT_INCLUDES | OPT_INCNOEXEC);
else if(!strcasecmp(w,"FollowSymLinks"))
! d->opts |= OPT_SYM_LINKS;
else if(!strcasecmp(w,"SymLinksIfOwnerMatch"))
! d->opts |= OPT_SYM_OWNER;
else if(!strcasecmp(w,"execCGI"))
! d->opts |= OPT_EXECCGI;
else if (!strcasecmp(w,"MultiViews"))
! d->opts |= OPT_MULTI;
else if (!strcasecmp(w,"RunScripts")) /* AI backcompat. Yuck */
! d->opts |= OPT_MULTI|OPT_EXECCGI;
else if(!strcasecmp(w,"None"))
! d->opts = OPT_NONE;
else if(!strcasecmp(w,"All"))
! d->opts = OPT_ALL;
else
return pstrcat (cmd->pool, "Illegal option ", w, NULL);
}
return NULL;
--- 473,522 ----
const char *set_options (cmd_parms *cmd, core_dir_config *d, const char *l)
{
! char opt;
! int first = 1;
! char action;
!
while(l[0]) {
char *w = getword_conf(cmd->pool, &l);
+ action = '\0';
+
+ if (*w == '+' || *w == '-')
+ action = *(w++);
+ else if (first) {
+ d->opts = OPT_NONE;
+ first = 0;
+ }
+
if(!strcasecmp(w,"Indexes"))
! opt = OPT_INDEXES;
else if(!strcasecmp(w,"Includes"))
! opt = OPT_INCLUDES;
else if(!strcasecmp(w,"IncludesNOEXEC"))
! opt = (OPT_INCLUDES | OPT_INCNOEXEC);
else if(!strcasecmp(w,"FollowSymLinks"))
! opt = OPT_SYM_LINKS;
else if(!strcasecmp(w,"SymLinksIfOwnerMatch"))
! opt = OPT_SYM_OWNER;
else if(!strcasecmp(w,"execCGI"))
! opt = OPT_EXECCGI;
else if (!strcasecmp(w,"MultiViews"))
! opt = OPT_MULTI;
else if (!strcasecmp(w,"RunScripts")) /* AI backcompat. Yuck */
! opt = OPT_MULTI|OPT_EXECCGI;
else if(!strcasecmp(w,"None"))
! opt = OPT_NONE;
else if(!strcasecmp(w,"All"))
! opt = OPT_ALL;
else
return pstrcat (cmd->pool, "Illegal option ", w, NULL);
+
+ if (action == '-')
+ d->opts_remove |= opt;
+ else if (action == '+')
+ d->opts_add |= opt;
+ else
+ d->opts |= opt;
}
return NULL;
1.15 +2 -0 apache/src/http_core.h
Index: http_core.h
===================================================================
RCS file: /export/home/cvs/apache/src/http_core.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C3 -r1.14 -r1.15
*** http_core.h 1996/11/03 21:25:07 1.14
--- http_core.h 1996/11/04 09:43:07 1.15
***************
*** 125,130 ****
--- 125,132 ----
typedef struct {
char *d;
allow_options_t opts;
+ allow_options_t opts_add;
+ allow_options_t opts_remove;
overrides_t override;
/* MIME typing --- the core doesn't do anything at all with this,