httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk vanGulik <Dirk.vanGu...@jrc.it>
Subject bad karma
Date Wed, 24 Jul 1996 17:55:12 GMT
Oh dear, screwed up that patch for mod_anon to 
let anyone in, here is a second try. 

THIS IS NOT FOR inclusion. voting or
whatever, just informative !!!

Dw.


*** mod_auth_anon.c	Wed Jul 24 19:50:32 1996
--- /enrm/httpd/depot/apache_19960606010017/src/mod_auth_anon.c	Wed May 29 09:00:22 1996
***************
*** 75,84 ****
   * Anonymous_LogEmail		[ on | off ] default = on
   * Anonymous_VerifyEmail	[ on | off ] default = off
   * Anonymous_NoUserId		[ on | off ] default = off
!  * Anonymous_Authoritative      [ on | off ] default = off
!  *
!  * This adds some functionality; allowing people in with 
!  * any password:
!  *
!  * Anonymous_AnyUsername        [ on | off ] default = off
!  *
!  * or with perhaps the constraint that it should look like 
!  * an email.
!  * Anonymous_EmailUsername      [ on | off ] default = off
!  *
!  * Do note that all these do horribly conflict. 
   *
   * The magic user id is something like 'anonymous', it is NOT case sensitive. 
   * 
--- 75,81 ----
   * Anonymous_LogEmail		[ on | off ] default = on
   * Anonymous_VerifyEmail	[ on | off ] default = off
   * Anonymous_NoUserId		[ on | off ] default = off
!  * Anonymous_Authorative        [ on | off ] default = off
   *
   * The magic user id is something like 'anonymous', it is NOT case sensitive. 
   * 
***************
*** 112,119 ****
      int   auth_anon_verifyemail;
      int   auth_anon_mustemail;
      int   auth_anon_authorative;
-     int   auth_anon_any;
-     int   auth_anon_emailuid;
  
  } anon_auth_config_rec;
  
--- 109,114 ----
***************
*** 132,139 ****
      sec -> auth_anon_verifyemail	=0;
      sec -> auth_anon_mustemail		=1;
      sec -> auth_anon_authorative        =0;
-     sec -> auth_anon_any	        =0;
-     sec -> auth_anon_emailuid	        =0;
      return sec;
  }
  
--- 127,132 ----
***************
*** 164,181 ****
      return NULL;
  }
  
- char *anon_set_any_flag (cmd_parms *cmd, 
- 	anon_auth_config_rec *sec, int arg) {
-     sec->auth_anon_any=arg;
-     return NULL;
- }
- 
- char *anon_set_emailuid_flag (cmd_parms *cmd, 
- 	anon_auth_config_rec *sec, int arg) {
-     sec->auth_anon_emailuid=arg;
-     return NULL;
- }
- 
  char *anon_set_string_slots (cmd_parms *cmd, 
  	anon_auth_config_rec *sec, char *arg) {
    
--- 157,162 ----
***************
*** 211,220 ****
  	"Limited to 'on' or 'off'" },
  { "Anonymous_Authorative", anon_set_authorative_flag, NULL, OR_AUTHCFG, FLAG, 
  	"Limited to 'on' or 'off'" },
- { "Anonymous_AnyUsername", anon_set_any_flag, NULL, OR_AUTHCFG, FLAG, 
- 	"Limited to 'on' or 'off'" },
- { "Anonymous_EmailUsername", anon_set_emailuid_flag, NULL, OR_AUTHCFG, FLAG, 
- 	"Limited to 'on' or 'off'" },
  
  { NULL }
  };
--- 192,197 ----
***************
*** 240,275 ****
  
      /* Do we allow an empty userID and/or is it the magic one
       */
! 
!     /* the empty one.. */
!     if ( (!(c->user[0])) && (sec->auth_anon_nouserid) )
!       res=OK; 
! 
!     /* accept about anything.. */
!     if ((res != OK) && 
! 	(sec->auth_anon_any) && 
! 	strlen(c->user)
! 	) res=OK;
! 
!     /* let in if email likenesss */
!     if ((res != OK) && (sec->auth_anon_emailuid) && 
! 	 (strlen(c->user)) &&
! 	 (strpbrk("@",c->user) != NULL) &&
! 	 (strpbrk(".",c->user) != NULL)
! 	) res=OK;
! 
!     /* any of the given ones, like 'anonymous', 'guest'.... */
!     if (res != OK) {
        auth_anon *p=sec->auth_anon_passwords;
        res=DECLINED;
!       while ((res == DECLINED) && (p !=NULL) && (res != OK)) {
  	if (!(strcasecmp(c->user,p->password)))
  	  res=OK;
  	p=p->next;
!       };
      }
! 
!     if ( /* username is OK */
  	(res == OK) &&
  	/* password been filled out ? */ 
  	( (!sec->auth_anon_mustemail) || strlen(send_pw)  ) &&
--- 217,236 ----
  
      /* Do we allow an empty userID and/or is it the magic one
       */
!     
!     if ( (!(c->user[0])) && (sec->auth_anon_nouserid) ) {
!       res=OK;
!     } else {
        auth_anon *p=sec->auth_anon_passwords;
        res=DECLINED;
!       while ((res == DECLINED) && (p !=NULL)) {
  	if (!(strcasecmp(c->user,p->password)))
  	  res=OK;
  	p=p->next;
!       }
      }
!     if (
! 	/* username is OK */
  	(res == OK) &&
  	/* password been filled out ? */ 
  	( (!sec->auth_anon_mustemail) || strlen(send_pw)  ) &&



Mime
View raw message