httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk-Willem van Gulik <dirk.vangu...@jrc.it>
Subject Re: [BUILD] ap_get_basic_auth_pw
Date Thu, 02 Jul 1998 21:10:01 GMT

On Thu, 2 Jul 1998, Ben Hyde wrote: about build errors.

Yup, it is because we (now?) have in .include/http_protocol.h

	API_EXPORT(int)
		ap_get_basic_auth_pw(request_rec *r, const char **pw)

i.e. the const char, rather than the char ** each of the auth modules
is using (auth, dbm, gdbm, *sql and anon). Same for the req_array
in a few places as well.

Anyone relegious ? Not sure _why_ the const was added, but it seems to
make sense to mo. Otherwise I propose the following patch; which just
addes the const to the declaration in the modules.

Dw.

Index: mod_auth.c
===================================================================
RCS file: /home/cvs//apache-1.3/src/modules/standard/mod_auth.c,v
retrieving revision 1.36
diff -c -3 -r1.36 mod_auth.c
*** mod_auth.c	1998/07/01 21:19:58	1.36
--- mod_auth.c	1998/07/02 21:02:47
***************
*** 201,207 ****
      auth_config_rec *sec =
      (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module);
      conn_rec *c = r->connection;
!     char *sent_pw, *real_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
--- 201,208 ----
      auth_config_rec *sec =
      (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module);
      conn_rec *c = r->connection;
!     const char *sent_pw;
!     char *real_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
Index: mod_auth_anon.c
===================================================================
RCS file: /home/cvs//apache-1.3/src/modules/standard/mod_auth_anon.c,v
retrieving revision 1.33
diff -c -3 -r1.33 mod_auth_anon.c
*** mod_auth_anon.c	1998/04/11 12:00:44	1.33
--- mod_auth_anon.c	1998/07/02 21:02:47
***************
*** 217,226 ****
      (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					       &anon_auth_module);
      conn_rec *c = r->connection;
!     char *send_pw;
      int res = DECLINED;
  
!     if ((res = ap_get_basic_auth_pw(r, &send_pw)))
  	return res;
  
      /* Ignore if we are not configured */
--- 217,226 ----
      (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					       &anon_auth_module);
      conn_rec *c = r->connection;
!     const char *sent_pw;
      int res = DECLINED;
  
!     if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
  	return res;
  
      /* Ignore if we are not configured */
***************
*** 246,260 ****
      /* username is OK */
  	   (res == OK)
      /* password been filled out ? */
! 	   && ((!sec->auth_anon_mustemail) || strlen(send_pw))
      /* does the password look like an email address ? */
  	   && ((!sec->auth_anon_verifyemail)
! 	       || ((strpbrk("@", send_pw) != NULL)
! 		   && (strpbrk(".", send_pw) != NULL)))) {
  	if (sec->auth_anon_logemail && ap_is_initial_req(r)) {
  	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r->server,
  			"Anonymous: Passwd <%s> Accepted",
! 			send_pw ? send_pw : "\'none\'");
  	}
  	return OK;
      }
--- 246,260 ----
      /* username is OK */
  	   (res == OK)
      /* password been filled out ? */
! 	   && ((!sec->auth_anon_mustemail) || strlen(sent_pw))
      /* does the password look like an email address ? */
  	   && ((!sec->auth_anon_verifyemail)
! 	       || ((strpbrk("@", sent_pw) != NULL)
! 		   && (strpbrk(".", sent_pw) != NULL)))) {
  	if (sec->auth_anon_logemail && ap_is_initial_req(r)) {
  	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r->server,
  			"Anonymous: Passwd <%s> Accepted",
! 			sent_pw ? sent_pw : "\'none\'");
  	}
  	return OK;
      }
***************
*** 262,268 ****
  	if (sec->auth_anon_authoritative) {
  	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  			"Anonymous: Authoritative, Passwd <%s> not accepted",
! 			send_pw ? send_pw : "\'none\'");
  	    return AUTH_REQUIRED;
  	}
  	/* Drop out the bottom to return DECLINED */
--- 262,268 ----
  	if (sec->auth_anon_authoritative) {
  	    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server,
  			"Anonymous: Authoritative, Passwd <%s> not accepted",
! 			sent_pw ? sent_pw : "\'none\'");
  	    return AUTH_REQUIRED;
  	}
  	/* Drop out the bottom to return DECLINED */
Index: mod_auth_db.c
===================================================================
RCS file: /home/cvs//apache-1.3/src/modules/standard/mod_auth_db.c,v
retrieving revision 1.30
diff -c -3 -r1.30 mod_auth_db.c
*** mod_auth_db.c	1998/04/11 12:00:44	1.30
--- mod_auth_db.c	1998/07/02 21:02:47
***************
*** 205,211 ****
      (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					     &db_auth_module);
      conn_rec *c = r->connection;
!     char *sent_pw, *real_pw, *colon_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
--- 205,212 ----
      (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					     &db_auth_module);
      conn_rec *c = r->connection;
!     const char *sent_pw;
!     char *real_pw, *colon_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
***************
*** 246,252 ****
      char *user = r->connection->user;
      int m = r->method_number;
  
!     array_header *reqs_arr = ap_requires(r);
      require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
  
      register int x;
--- 247,253 ----
      char *user = r->connection->user;
      int m = r->method_number;
  
!     const array_header *reqs_arr = ap_requires(r);
      require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
  
      register int x;
Index: mod_auth_dbm.c
===================================================================
RCS file: /home/cvs//apache-1.3/src/modules/standard/mod_auth_dbm.c,v
retrieving revision 1.37
diff -c -3 -r1.37 mod_auth_dbm.c
*** mod_auth_dbm.c	1998/04/11 12:00:44	1.37
--- mod_auth_dbm.c	1998/07/02 21:02:47
***************
*** 206,212 ****
      (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					      &dbm_auth_module);
      conn_rec *c = r->connection;
!     char *sent_pw, *real_pw, *colon_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
--- 206,213 ----
      (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
  					      &dbm_auth_module);
      conn_rec *c = r->connection;
!     const char *sent_pw;
!     char *real_pw, *colon_pw;
      int res;
  
      if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
***************
*** 247,253 ****
      char *user = r->connection->user;
      int m = r->method_number;
  
!     array_header *reqs_arr = ap_requires(r);
      require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
  
      register int x;
--- 248,254 ----
      char *user = r->connection->user;
      int m = r->method_number;
  
!     const array_header *reqs_arr = ap_requires(r);
      require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
  
      register int x;
> 
> Warnings like this appeared on all platforms this morning,
> some linked anyway.  - ben
> 
> gcc -c  -I../../os/unix -I../../include   -DOSF1 -DSTATUS -DUSE_HSREGEX '-DHTTPD_ROOT="/tmp/httpd"'
mod_auth.c
> mod_auth.c: In function `authenticate_basic_user':
> mod_auth.c:207: warning: passing arg 2 of `ap_get_basic_auth_pw' from incompatible pointer
type
> gcc -c  -I../../os/unix -I../../include   -DOSF1 -DSTATUS -DUSE_HSREGEX '-DHTTPD_ROOT="/tmp/httpd"'
mod_auth_anon.c
> mod_auth_anon.c: In function `anon_authenticate_basic_user':
> mod_auth_anon.c:223: warning: passing arg 2 of `ap_get_basic_auth_pw' from incompatible
pointer type
> 
>   - ben hyde
> 
> Full reports at: http://zap.ml.org/ap 
> 
> 
> 


Mime
View raw message