httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] merge dbm auth configs
Date Tue, 01 Apr 1997 23:46:36 GMT
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.

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