cvs commit: apachen/src/modules/standard mod_auth_dbm.c

1997-12-18 Thread dgaudet
dgaudet 97/12/18 11:24:48

  Modified:src/modules/standard mod_auth_dbm.c
  Log:
  fix messed up indentation
  
  Revision  ChangesPath
  1.32  +15 -15apachen/src/modules/standard/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_dbm.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- mod_auth_dbm.c1997/10/22 20:30:16 1.31
  +++ mod_auth_dbm.c1997/12/18 19:24:44 1.32
  @@ -83,21 +83,21 @@
   if ./helpers/TestCompile func dbm_open; then
:
   else
  -case $PLAT in
  - *-linux*)
  - # many systems don't have -ldbm
  - DBM_LIB=
  - if ./helpers/TestCompile lib dbm; then
  - DBM_LIB=-ldbm
  - elif ./helpers/TestCompile lib ndbm; then
  - DBM_LIB=-lndbm
  - fi
  - ;;
  -esac
  -LIBS=$LIBS $DBM_LIB
  -if [ X$DBM_LIB != X ]; then
  - echo  + using $DBM_LIB for mod_auth_dbm
  -fi
  + case $PLAT in
  + *-linux*)
  + # many systems don't have -ldbm
  + DBM_LIB=
  + if ./helpers/TestCompile lib dbm; then
  + DBM_LIB=-ldbm
  + elif ./helpers/TestCompile lib ndbm; then
  + DBM_LIB=-lndbm
  + fi
  + ;;
  + esac
  + LIBS=$LIBS $DBM_LIB
  + if [ X$DBM_LIB != X ]; then
  + echo  + using $DBM_LIB for mod_auth_dbm
  + fi
   fi
* ConfigEnd
* MODULE-DEFINITION-END
  
  
  


cvs commit: apachen/src/modules/standard mod_auth_dbm.c

1997-08-31 Thread Randy Terbush
randy   97/08/31 15:23:22

  Modified:src/modules/standard mod_auth_dbm.c
  Log:
  Convert log_*() to aplog_error().
  Style changes.
  
  Revision  ChangesPath
  1.28  +34 -29apachen/src/modules/standard/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_dbm.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- mod_auth_dbm.c1997/08/24 16:43:26 1.27
  +++ mod_auth_dbm.c1997/08/31 22:23:20 1.28
  @@ -151,7 +151,8 @@
   
   module dbm_auth_module;
   
  -static char *get_dbm_pw(request_rec *r, char *user, char *auth_dbmpwfile) {
  +static char *get_dbm_pw (request_rec *r, char *user, char *auth_dbmpwfile)
  +{
   DBM *f; 
   datum d, q; 
   char *pw = NULL;
  @@ -164,15 +165,16 @@
   #endif
   
   
  -if(!(f=dbm_open(auth_dbmpwfile,O_RDONLY,0664))) {
  -log_reason (could not open dbm auth file, auth_dbmpwfile, r);
  +if (!(f=dbm_open(auth_dbmpwfile,O_RDONLY,0664))) {
  +aplog_error(APLOG_MARK, APLOG_ERR, r-server,
  + could not open dbm auth file: %s, auth_dbmpwfile);
return NULL;
   }
   
   d = dbm_fetch(f, q);
   
   if (d.dptr) {
  -pw = palloc (r-pool, d.dsize + 1);
  +pw = palloc(r-pool, d.dsize + 1);
strncpy(pw,d.dptr,d.dsize);
pw[d.dsize] = '\0'; /* Terminate the string */
   }
  @@ -209,36 +211,36 @@
   static int dbm_authenticate_basic_user (request_rec *r)
   {
   dbm_auth_config_rec *sec =
  -  (dbm_auth_config_rec *)get_module_config (r-per_dir_config,
  - dbm_auth_module);
  + (dbm_auth_config_rec *)get_module_config(r-per_dir_config,
  +  dbm_auth_module);
   conn_rec *c = r-connection;
   char *sent_pw, *real_pw, *colon_pw;
   char errstr[MAX_STRING_LEN];
   int res;
   
  -if ((res = get_basic_auth_pw (r, sent_pw)))
  +if ((res = get_basic_auth_pw(r, sent_pw)))
   return res;
   
  -if(!sec-auth_dbmpwfile)
  +if (!sec-auth_dbmpwfile)
   return DECLINED;

   if(!(real_pw = get_dbm_pw(r, c-user, sec-auth_dbmpwfile))) {
if (!(sec-auth_dbmauthoritative))
return DECLINED;
   ap_snprintf(errstr, sizeof(errstr), DBM user %s not found, 
c-user);
  - log_reason (errstr, r-filename, r);
  - note_basic_auth_failure (r);
  + aplog_error(APLOG_MARK, APLOG_ERR, r-server, %s: %s, errstr, 
r-filename);
  + note_basic_auth_failure(r);
return AUTH_REQUIRED;
   }
   /* Password is up to first : if exists */
   colon_pw = strchr(real_pw,':');
   if (colon_pw) *colon_pw='\0';   
   /* anyone know where the prototype for crypt is? */
  -if(strcmp(real_pw,(char *)crypt(sent_pw,real_pw))) {
  +if (strcmp(real_pw,(char *)crypt(sent_pw,real_pw))) {
   ap_snprintf(errstr, sizeof(errstr), 
  - user %s: password mismatch,c-user);
  - log_reason (errstr, r-uri, r);
  - note_basic_auth_failure (r);
  + user %s: password mismatch,c-user);
  + aplog_error(APLOG_MARK, APLOG_ERR, r-server, %s: %s, errstr, r-uri);
  + note_basic_auth_failure(r);
return AUTH_REQUIRED;
   }
   return OK;
  @@ -246,15 +248,16 @@
   
   /* Checking ID */
   
  -static int dbm_check_auth(request_rec *r) {
  +static int dbm_check_auth (request_rec *r)
  +{
   dbm_auth_config_rec *sec =
  -  (dbm_auth_config_rec *)get_module_config (r-per_dir_config,
  - dbm_auth_module);
  + (dbm_auth_config_rec *)get_module_config(r-per_dir_config,
  +  dbm_auth_module);
   char *user = r-connection-user;
   int m = r-method_number;
   char errstr[MAX_STRING_LEN];
   
  -array_header *reqs_arr = requires (r);
  +array_header *reqs_arr = requires(r);
   require_line *reqs = reqs_arr ? (require_line *)reqs_arr-elts : NULL;
   
   register int x;
  @@ -264,14 +267,14 @@
   if (!sec-auth_dbmgrpfile) return DECLINED;
   if (!reqs_arr) return DECLINED;
   
  -for(x=0; x  reqs_arr-nelts; x++) {
  +for (x = 0; x  reqs_arr-nelts; x++) {
 
if (! (reqs[x].method_mask  (1  m))) continue;

   t = reqs[x].requirement;
   w = getword(r-pool, t, ' ');

  -if(!strcmp(w,group)  sec-auth_dbmgrpfile) {
  +if (!strcmp(w,group)  sec-auth_dbmgrpfile) {
  const char *orig_groups,*groups;
   char *v;
   
  @@ -279,25 +282,27 @@
   if (!(sec-auth_dbmauthoritative))
   return DECLINED;
  ap_snprintf(errstr, sizeof(errstr), 
  - user %s not in DBM group file %s,
 

cvs commit: apachen/src/modules/standard mod_auth_dbm.c mod_status.c

1997-08-10 Thread Paul Sutton
pcs 97/08/10 06:32:01

  Modified:src/modules/standard mod_auth_dbm.c mod_status.c
  Log:
  Source re-org: add information required by Configure for this module
  
  Revision  ChangesPath
  1.22  +16 -0 apachen/src/modules/standard/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_dbm.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_auth_dbm.c1997/07/28 18:22:52 1.21
  +++ mod_auth_dbm.c1997/08/10 13:31:59 1.22
  @@ -71,6 +71,22 @@
   #include http_protocol.h
   #include ndbm.h
   
  +/*
  + * Module definition information - the part between the -START and -END
  + * lines below is used by Configure. This could be stored in a separate
  + * instead.
  + *
  + * MODULE-DEFINITION-START
  + * Name: dbm_auth_module
  + * ConfigStart
  +LIBS=$LIBS $DBM_LIB
  +if [ X$DBM_LIB != X ]; then
  + echo  + using $DBM_LIB for mod_auth_dbm
  +fi
  + * ConfigEnd
  + * MODULE-DEFINITION-END
  + */
  +
   typedef struct  {
   
   char *auth_dbmpwfile;
  
  
  
  1.59  +15 -0 apachen/src/modules/standard/mod_status.c
  
  Index: mod_status.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_status.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- mod_status.c  1997/07/28 18:23:05 1.58
  +++ mod_status.c  1997/08/10 13:31:59 1.59
  @@ -87,6 +87,21 @@
* 21.5.96  Additional Status codes (DNS and LOGGING only enabled if
extended STATUS is enabled) [George Burgyan/Jim J.]  */
   
  +/*
  + * Module definition information - the part between the -START and -END
  + * lines below is used by Configure. This could be stored in a separate
  + * instead.
  + *
  + * MODULE-DEFINITION-START
  + * Name: status_module
  + * ConfigStart
  +if [ $RULE_STATUS = yes ]; then
  + CFLAGS=$CFLAGS -DSTATUS
  +fi
  + * ConfigEnd
  + * MODULE-DEFINITION-END
  + */
  +
   #define IS_MODULE
   
   #include httpd.h
  
  
  


cvs commit: apachen/src/modules/standard mod_auth_dbm.c

1997-07-26 Thread Paul Sutton
pcs 97/07/26 14:26:46

  Modified:src/modules/standard  mod_auth_dbm.c
  Log:
  Example of building information required by Configure into the module source
  
  Revision  ChangesPath
  1.20  +17 -0 apachen/src/modules/standard/mod_auth_dbm.c
  
  Index: mod_auth_dbm.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_auth_dbm.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_auth_dbm.c1997/07/19 08:02:05 1.19
  +++ mod_auth_dbm.c1997/07/26 21:26:45 1.20
  @@ -71,6 +71,23 @@
   #include http_protocol.h
   #include ndbm.h
   
  +/*
  + * Module definition information - the part between the -START and -END
  + * lines below is used by Configure. This could be stored in a separate
  + * instead.
  + *
  + * MODULE-DEFINITION-START
  + * Name: dbm_auth_module
  + * ConfigStart
  +LIBS=$LIBS $DBM_LIB
  +if [ X$DBM_LIB != X ]; then
  + echo  + using $DBM_LIB for mod_auth_dbm
  +fi
  + * ConfigEnd
  + * MODULE-DEFINITION-END
  + */
  +
  +
   typedef struct  {
   
   char *auth_dbmpwfile;