You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/12/19 16:09:07 UTC

cvs commit: httpd-2.0/modules/aaa mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c mod_auth_digest.c

rbb         00/12/19 07:09:05

  Modified:    .        CHANGES
               modules/aaa mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c
                        mod_auth_digest.c
  Log:
  Get all of the auth modules to the point that they will install and
  be loadable into the server.  Our new build/install mechanism expects
  that all modules will have a common name format.  The auth modules
  didn't use that format, so we didn't install them properly.
  
  Revision  Changes    Path
  1.12      +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- CHANGES	2000/12/18 17:51:34	1.11
  +++ CHANGES	2000/12/19 15:08:56	1.12
  @@ -1,5 +1,11 @@
   Changes with Apache 2.0b1
   
  +  *) Get all of the auth modules to the point that they will install and
  +     be loadable into the server.  Our new build/install mechanism expects
  +     that all modules will have a common name format.  The auth modules 
  +     didn't use that format, so we didn't install them properly.
  +     [Ryan Bloom]
  +
     *) API routines ap_pgethostbyname() and ap_pduphostent() are no longer
        available.  Use apr_getaddrinfo() instead.  [Jeff Trawick]
   
  
  
  
  1.19      +38 -38    httpd-2.0/modules/aaa/mod_auth_anon.c
  
  Index: mod_auth_anon.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_anon.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_auth_anon.c	2000/10/30 19:52:09	1.18
  +++ mod_auth_anon.c	2000/12/19 15:09:00	1.19
  @@ -102,19 +102,19 @@
   #include "http_request.h"
   #include "apr_strings.h"
   
  -typedef struct auth_anon {
  +typedef struct anon_auth {
       char *password;
  -    struct auth_anon *next;
  -} auth_anon;
  +    struct anon_auth *next;
  +} anon_auth;
   
   typedef struct {
   
  -    auth_anon *auth_anon_passwords;
  -    int auth_anon_nouserid;
  -    int auth_anon_logemail;
  -    int auth_anon_verifyemail;
  -    int auth_anon_mustemail;
  -    int auth_anon_authoritative;
  +    anon_auth *anon_auth_passwords;
  +    int anon_auth_nouserid;
  +    int anon_auth_logemail;
  +    int anon_auth_verifyemail;
  +    int anon_auth_mustemail;
  +    int anon_auth_authoritative;
   
   } anon_auth_config_rec;
   
  @@ -127,13 +127,13 @@
   	return NULL;		/* no memory... */
   
       /* just to illustrate the defaults really. */
  -    sec->auth_anon_passwords = NULL;
  +    sec->anon_auth_passwords = NULL;
   
  -    sec->auth_anon_nouserid = 0;
  -    sec->auth_anon_logemail = 1;
  -    sec->auth_anon_verifyemail = 0;
  -    sec->auth_anon_mustemail = 1;
  -    sec->auth_anon_authoritative = 0;
  +    sec->anon_auth_nouserid = 0;
  +    sec->anon_auth_logemail = 1;
  +    sec->anon_auth_verifyemail = 0;
  +    sec->anon_auth_mustemail = 1;
  +    sec->anon_auth_authoritative = 0;
       return sec;
   }
   
  @@ -141,7 +141,7 @@
   				 void *dummy, int arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    sec->auth_anon_mustemail = arg;
  +    sec->anon_auth_mustemail = arg;
       return NULL;
   }
   
  @@ -149,7 +149,7 @@
   				 void *dummy, int arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    sec->auth_anon_nouserid = arg;
  +    sec->anon_auth_nouserid = arg;
       return NULL;
   }
   
  @@ -157,7 +157,7 @@
   				   void *dummy, int arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    sec->auth_anon_logemail = arg;
  +    sec->anon_auth_logemail = arg;
       return NULL;
   }
   
  @@ -165,14 +165,14 @@
   				      void *dummy, int arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    sec->auth_anon_verifyemail = arg;
  +    sec->anon_auth_verifyemail = arg;
       return NULL;
   }
   static const char *anon_set_authoritative_flag(cmd_parms *cmd,
   					void *dummy, int arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    sec->auth_anon_authoritative = arg;
  +    sec->anon_auth_authoritative = arg;
       return NULL;
   }
   
  @@ -180,20 +180,20 @@
   				  void *dummy, const char *arg)
   {
       anon_auth_config_rec *sec = dummy;
  -    auth_anon *first;
  +    anon_auth *first;
   
       if (!(*arg))
   	return "Anonymous string cannot be empty, use Anonymous_NoUserId instead";
   
       /* squeeze in a record */
  -    first = sec->auth_anon_passwords;
  +    first = sec->anon_auth_passwords;
   
  -    if (!(sec->auth_anon_passwords = apr_palloc(cmd->pool, sizeof(auth_anon))) ||
  -       !(sec->auth_anon_passwords->password = apr_pstrdup(cmd->pool, arg)))
  +    if (!(sec->anon_auth_passwords = apr_palloc(cmd->pool, sizeof(anon_auth))) ||
  +       !(sec->anon_auth_passwords->password = apr_pstrdup(cmd->pool, arg)))
   	     return "Failed to claim memory for an anonymous password...";
   
       /* and repair the next */
  -    sec->auth_anon_passwords->next = first;
  +    sec->anon_auth_passwords->next = first;
   
       return NULL;
   }
  @@ -215,13 +215,13 @@
       {NULL}
   };
   
  -module AP_MODULE_DECLARE_DATA auth_anon_module;
  +module AP_MODULE_DECLARE_DATA anon_auth_module;
   
   static int anon_authenticate_basic_user(request_rec *r)
   {
       anon_auth_config_rec *sec =
       (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -					       &auth_anon_module);
  +					       &anon_auth_module);
       const char *sent_pw;
       int res = DECLINED;
   
  @@ -229,17 +229,17 @@
   	return res;
   
       /* Ignore if we are not configured */
  -    if (!sec->auth_anon_passwords)
  +    if (!sec->anon_auth_passwords)
   	return DECLINED;
   
       /* Do we allow an empty userID and/or is it the magic one
        */
   
  -    if ((!(r->user[0])) && (sec->auth_anon_nouserid)) {
  +    if ((!(r->user[0])) && (sec->anon_auth_nouserid)) {
   	res = OK;
       }
       else {
  -	auth_anon *p = sec->auth_anon_passwords;
  +	anon_auth *p = sec->anon_auth_passwords;
   	res = DECLINED;
   	while ((res == DECLINED) && (p != NULL)) {
   	    if (!(strcasecmp(r->user, p->password)))
  @@ -251,12 +251,12 @@
       /* username is OK */
   	   (res == OK)
       /* password been filled out ? */
  -	   && ((!sec->auth_anon_mustemail) || strlen(sent_pw))
  +	   && ((!sec->anon_auth_mustemail) || strlen(sent_pw))
       /* does the password look like an email address ? */
  -	   && ((!sec->auth_anon_verifyemail)
  +	   && ((!sec->anon_auth_verifyemail)
   	       || ((strpbrk("@", sent_pw) != NULL)
   		   && (strpbrk(".", sent_pw) != NULL)))) {
  -	if (sec->auth_anon_logemail && ap_is_initial_req(r)) {
  +	if (sec->anon_auth_logemail && ap_is_initial_req(r)) {
   	    ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, APR_SUCCESS, r,
   			"Anonymous: Passwd <%s> Accepted",
   			sent_pw ? sent_pw : "\'none\'");
  @@ -264,7 +264,7 @@
   	return OK;
       }
       else {
  -	if (sec->auth_anon_authoritative) {
  +	if (sec->anon_auth_authoritative) {
   	    ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_SUCCESS, r,
   			"Anonymous: Authoritative, Passwd <%s> not accepted",
   			sent_pw ? sent_pw : "\'none\'");
  @@ -282,12 +282,12 @@
       conn_rec *c = r->connection;
       anon_auth_config_rec *sec =
       (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -					       &auth_anon_module);
  +					       &anon_auth_module);
   
  -    if (!sec->auth_anon)
  +    if (!sec->anon_auth)
   	return DECLINED;
   
  -    if (strcasecmp(r->connection->user, sec->auth_anon))
  +    if (strcasecmp(r->connection->user, sec->anon_auth))
   	return DECLINED;
   
       return OK;
  @@ -300,7 +300,7 @@
       ap_hook_auth_checker(check_anon_access,NULL,NULL,AP_HOOK_MIDDLE);
   }
   
  -module AP_MODULE_DECLARE_DATA auth_anon_module =
  +module AP_MODULE_DECLARE_DATA anon_auth_module =
   {
       STANDARD20_MODULE_STUFF,
       create_anon_auth_dir_config,/* dir config creater */
  
  
  
  1.19      +5 -5      httpd-2.0/modules/aaa/mod_auth_db.c
  
  Index: mod_auth_db.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_db.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_auth_db.c	2000/10/31 00:53:34	1.18
  +++ mod_auth_db.c	2000/12/19 15:09:01	1.19
  @@ -75,7 +75,7 @@
    *           instead of   AuthDBMUserFile    AuthDBMGroupFile
    *
    * Also, in the configuration file you need to specify
  - *  auth_db_module rather than auth_dbm_module
  + *  db_auth_module rather than auth_dbm_module
    *
    * On some BSD systems (e.g. FreeBSD and NetBSD) dbm is automatically
    * mapped to Berkeley DB. You can use either mod_auth_dbm or
  @@ -158,7 +158,7 @@
       {NULL}
   };
   
  -module auth_db_module;
  +module db_auth_module;
   
   static char *get_db_pw(request_rec *r, char *user, const char *auth_dbpwfile)
   {
  @@ -288,7 +288,7 @@
   {
       db_auth_config_rec *sec =
       (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -						&auth_db_module);
  +						&db_auth_module);
       const char *sent_pw;
       char *real_pw, *colon_pw;
       apr_status_t invalid_pw;
  @@ -336,7 +336,7 @@
   {
       db_auth_config_rec *sec =
       (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -						&auth_db_module);
  +						&db_auth_module);
       char *user = r->user;
       int m = r->method_number;
   
  @@ -399,7 +399,7 @@
       ap_hook_auth_checker(db_check_auth,NULL,NULL,AP_HOOK_MIDDLE);
   }
   
  -module auth_db_module =
  +module db_auth_module =
   {
       STANDARD20_MODULE_STUFF,
       create_db_auth_dir_config,	/* dir config creater */
  
  
  
  1.22      +5 -5      httpd-2.0/modules/aaa/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_dbm.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_auth_dbm.c	2000/12/08 18:27:53	1.21
  +++ mod_auth_dbm.c	2000/12/19 15:09:01	1.22
  @@ -98,7 +98,7 @@
    *
    * XXX: this needs updating for apache-2.0 configuration method
    * MODULE-DEFINITION-START
  - * Name: auth_dbm_module
  + * Name: dbm_auth_module
    * ConfigStart
       . ./helpers/find-dbm-lib
    * ConfigEnd
  @@ -153,7 +153,7 @@
       {NULL}
   };
   
  -module AP_MODULE_DECLARE_DATA auth_dbm_module;
  +module AP_MODULE_DECLARE_DATA dbm_auth_module;
   
   static char *get_dbm_pw(request_rec *r, char *user, char *auth_dbmpwfile)
   {
  @@ -234,7 +234,7 @@
   {
       dbm_auth_config_rec *sec =
       (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -					      &auth_dbm_module);
  +					      &dbm_auth_module);
       const char *sent_pw;
       char *real_pw, *colon_pw;
       apr_status_t invalid_pw;
  @@ -277,7 +277,7 @@
   {
       dbm_auth_config_rec *sec =
       (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  -					      &auth_dbm_module);
  +					      &dbm_auth_module);
       char *user = r->user;
       int m = r->method_number;
   
  @@ -341,7 +341,7 @@
       ap_hook_auth_checker(dbm_check_auth, NULL, NULL, AP_HOOK_MIDDLE);
   }
   
  -module AP_MODULE_DECLARE_DATA auth_dbm_module =
  +module AP_MODULE_DECLARE_DATA dbm_auth_module =
   {
       STANDARD20_MODULE_STUFF,
       create_dbm_auth_dir_config,	/* dir config creater */
  
  
  
  1.27      +9 -9      httpd-2.0/modules/aaa/mod_auth_digest.c
  
  Index: mod_auth_digest.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_auth_digest.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mod_auth_digest.c	2000/10/31 01:02:33	1.26
  +++ mod_auth_digest.c	2000/12/19 15:09:02	1.27
  @@ -262,7 +262,7 @@
   static long num_buckets = DEF_NUM_BUCKETS;
   
   
  -module AP_MODULE_DECLARE_DATA auth_digest_module;
  +module AP_MODULE_DECLARE_DATA digest_auth_module;
   
   /*
    * initialization code
  @@ -963,7 +963,7 @@
       resp->raw_request_uri = r->unparsed_uri;
       resp->psd_request_uri = &r->parsed_uri;
       resp->needed_auth = 0;
  -    ap_set_module_config(r->request_config, &auth_digest_module, resp);
  +    ap_set_module_config(r->request_config, &digest_auth_module, resp);
   
       res = get_digest_rec(r, resp);
       resp->client = get_client(resp->opaque_num, r);
  @@ -1574,14 +1574,14 @@
       while (mainreq->main != NULL)  mainreq = mainreq->main;
       while (mainreq->prev != NULL)  mainreq = mainreq->prev;
       resp = (digest_header_rec *) ap_get_module_config(mainreq->request_config,
  -						      &auth_digest_module);
  +						      &digest_auth_module);
       resp->needed_auth = 1;
   
   
       /* get our conf */
   
       conf = (digest_config_rec *) ap_get_module_config(r->per_dir_config,
  -						      &auth_digest_module);
  +						      &digest_auth_module);
   
   
       /* check for existence and syntax of Auth header */
  @@ -1810,7 +1810,7 @@
   {
       const digest_config_rec *conf =
   		(digest_config_rec *) ap_get_module_config(r->per_dir_config,
  -							   &auth_digest_module);
  +							   &digest_auth_module);
       const char *user = r->user;
       int m = r->method_number;
       int method_restricted = 0;
  @@ -1880,7 +1880,7 @@
   
       note_digest_auth_failure(r, conf,
   	(digest_header_rec *) ap_get_module_config(r->request_config,
  -						   &auth_digest_module),
  +						   &digest_auth_module),
   	0);
       return HTTP_UNAUTHORIZED;
   }
  @@ -1905,10 +1905,10 @@
   {
       const digest_config_rec *conf =
   		(digest_config_rec *) ap_get_module_config(r->per_dir_config,
  -							   &auth_digest_module);
  +							   &digest_auth_module);
       digest_header_rec *resp =
   		(digest_header_rec *) ap_get_module_config(r->request_config,
  -							   &auth_digest_module);
  +							   &digest_auth_module);
       const char *ai = NULL, *digest = NULL, *nextnonce = "";
   
       if (resp == NULL || !resp->needed_auth || conf == NULL)
  @@ -2062,7 +2062,7 @@
       ap_hook_fixups(add_auth_info, NULL, NULL, AP_HOOK_MIDDLE);
   }
   
  -module AP_MODULE_DECLARE_DATA auth_digest_module =
  +module AP_MODULE_DECLARE_DATA digest_auth_module =
   {
       STANDARD20_MODULE_STUFF,
       create_digest_dir_config,	/* dir config creater */
  
  
  

Re: cvs commit: httpd-2.0/modules/aaa mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c mod_auth_digest.c

Posted by rb...@covalent.net.
> >   Get all of the auth modules to the point that they will install and
> >   be loadable into the server.  Our new build/install mechanism expects
> >   that all modules will have a common name format.  The auth modules
> >   didn't use that format, so we didn't install them properly.
> 
> What was causing this problem? This change seems to be overdone.
> 
> Was it the module structure name? That is easily changed in the
> APACHE_MODULE() config macro.
> 
> If it *was* the structure name, I can see changing that, but this particular
> patch changed a bunch of other things, too. Wondering why...

It should have just been a structure name change, which is what two of the
three auth modules were.  mod_auth_anon was me not paying attention to my
regex, and when it built and worked, I assumed I had gotten it right.

Sorry  ;-)


Ryan


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------



Re: cvs commit: httpd-2.0/modules/aaa mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c mod_auth_digest.c

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Dec 19, 2000 at 03:09:07PM -0000, rbb@locus.apache.org wrote:
> rbb         00/12/19 07:09:05
> 
>   Modified:    .        CHANGES
>                modules/aaa mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c
>                         mod_auth_digest.c
>   Log:
>   Get all of the auth modules to the point that they will install and
>   be loadable into the server.  Our new build/install mechanism expects
>   that all modules will have a common name format.  The auth modules
>   didn't use that format, so we didn't install them properly.

What was causing this problem? This change seems to be overdone.

Was it the module structure name? That is easily changed in the
APACHE_MODULE() config macro.

If it *was* the structure name, I can see changing that, but this particular
patch changed a bunch of other things, too. Wondering why...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/