httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@opengroup.org>
Subject Re: [PATCH] merge dbm auth configs
Date Wed, 02 Apr 1997 00:39:34 GMT
Dean Gaudet <dgaudet@arctic.org> wrote:

> All the (stock?) auth modules have this feature... they don't merge, they
> only override.  I'm all for merging, but we should be consistent about it. 
> It also changes the semantics of existing configuration files.

I think it's fine if mod_auth_* stay as is.  I only noticed this when
a mod_perl user had the "normal" mod_perl httpd.conf configuration:
<Location /perl>
SetHandler "perl-script"
PerlHandler Apache::Registry
</Location>

Then, no other Perl*Handlers would be picked up from .htaccess under
that location, e.g. PerlAuthenHandler.  
I came across mod_auth_dbm's behavior tracking this down.  It seemed
to me, one might want to have:  

<Location />
AuthDBMGroupFile /path/groups
</Location>

and .htaccess files that point to AuthDBMUserFile's (or vice-versa),
but that will not work without merging.  If there are +1's for merging
in mod_auth_*, I'll put together a complete patch for consistency.

-Doug

> 
> Dean
> 
> On Tue, 1 Apr 1997, Doug MacEachern wrote:
> 
> > I'm not sure if this is considered a bug or a feature, but if a
> > <Location *> block contains, say:
> > 
> >   AuthDBMGroupFile /some/file 
> > 
> > and a .htaccess under that location (Alias) contains:
> > 
> >  AuthDBMUserFile /some/otherfile
> > 
> > this is clobbered resulting in a server error, where error_log says: 
> > "couldn't check user.  No userfile?"  
> > 
> > If this is considered a bug, the patch below will fix it.
> > 
> > -Doug
> > 
> > *** mod_auth_dbm.c.orig	Tue Apr  1 18:11:14 1997
> > --- mod_auth_dbm.c	Tue Apr  1 18:12:39 1997
> > ***************
> > *** 79,84 ****
> > --- 79,101 ----
> >   
> >   } dbm_auth_config_rec;
> >   
> > + void *merge_dbm_auth_dir_config (pool *p, void *basev, void *addv)
> > + {
> > +     dbm_auth_config_rec *new = 
> > + 	(dbm_auth_config_rec *)pcalloc (p, sizeof(dbm_auth_config_rec));
> > +     dbm_auth_config_rec *base = (dbm_auth_config_rec *)basev;
> > +     dbm_auth_config_rec *add = (dbm_auth_config_rec *)addv;
> > + 
> > +     new->auth_dbmpwfile = add->auth_dbmpwfile ? 
> > + 	add->auth_dbmpwfile : base->auth_dbmpwfile;
> > +     new->auth_dbmgrpfile = add->auth_dbmgrpfile ? 
> > + 	add->auth_dbmgrpfile : base->auth_dbmgrpfile;
> > +     new->auth_dbmauthoritative = add->auth_dbmauthoritative ? 
> > + 	add->auth_dbmauthoritative : base->auth_dbmauthoritative; 
> > + 
> > +     return new;
> > + }
> > + 
> >   void *create_dbm_auth_dir_config (pool *p, char *d)
> >   {
> >       dbm_auth_config_rec *sec
> > ***************
> > *** 275,281 ****
> >      STANDARD_MODULE_STUFF,
> >      NULL,			/* initializer */
> >      create_dbm_auth_dir_config,	/* dir config creater */
> > !    NULL,			/* dir merger --- default is to override */
> >      NULL,			/* server config */
> >      NULL,			/* merge server config */
> >      dbm_auth_cmds,		/* command table */
> > --- 292,298 ----
> >      STANDARD_MODULE_STUFF,
> >      NULL,			/* initializer */
> >      create_dbm_auth_dir_config,	/* dir config creater */
> > !    merge_dbm_auth_dir_config,	/* dir merger --- default is to override */
> >      NULL,			/* server config */
> >      NULL,			/* merge server config */
> >      dbm_auth_cmds,		/* command table */
> > 
> 

Mime
View raw message