You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2002/01/07 19:10:54 UTC

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

jerenkrantz    02/01/07 10:10:54

  Modified:    modules/aaa mod_auth_dbm.c
  Log:
  Stylistic nitpicking before I go to work on this.
  
  Revision  Changes    Path
  1.41      +15 -29    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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- mod_auth_dbm.c	27 Dec 2001 06:12:44 -0000	1.40
  +++ mod_auth_dbm.c	7 Jan 2002 18:10:54 -0000	1.41
  @@ -94,27 +94,11 @@
   #include "http_request.h"   /* for ap_hook_(check_user_id | auth_checker)*/
   
   
  -/*
  - * Module definition information - the part between the -START and -END
  - * lines below is used by Configure. This could be stored in a separate
  - * instead.
  - *
  - * XXX: this needs updating for apache-2.0 configuration method
  - * MODULE-DEFINITION-START
  - * Name: auth_dbm_module
  - * ConfigStart
  -    . ./build/find-dbm-lib
  - * ConfigEnd
  - * MODULE-DEFINITION-END
  - */
  -
   typedef struct {
  -
       char *auth_dbmpwfile;
       char *auth_dbmgrpfile;
       char *auth_dbmtype;
       int auth_dbmauthoritative;
  -
   } dbm_auth_config_rec;
   
   static void *create_dbm_auth_dir_config(apr_pool_t *p, char *d)
  @@ -123,7 +107,7 @@
   
       conf->auth_dbmpwfile = NULL;
       conf->auth_dbmgrpfile = NULL;
  -    conf->auth_dbmtype ="default";
  +    conf->auth_dbmtype = "default";
       conf->auth_dbmauthoritative = 1;  /* fortress is secure by default */
   
       return conf;
  @@ -144,11 +128,10 @@
   {
       dbm_auth_config_rec *conf = dir_config;
      
  -    conf->auth_dbmtype = apr_pstrdup(cmd->pool ,arg);
  +    conf->auth_dbmtype = apr_pstrdup(cmd->pool, arg);
       return NULL;
   }
   
  -
   static const command_rec dbm_auth_cmds[] =
   {
       AP_INIT_TAKE1("AuthDBMUserFile", ap_set_file_slot,
  @@ -163,11 +146,9 @@
       AP_INIT_TAKE12("AuthGroupFile", set_dbm_slot,
        (void *) APR_XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile),
        OR_AUTHCFG, NULL),
  -
       AP_INIT_TAKE1("AuthDBMType", set_dbm_type,
        NULL,
        OR_AUTHCFG, "what type of DBM file the user file is"),
  -
       AP_INIT_FLAG("AuthDBMAuthoritative", ap_set_flag_slot,
        (void *) APR_XtOffsetOf(dbm_auth_config_rec, auth_dbmauthoritative),
        OR_AUTHCFG, "Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module"),
  @@ -195,10 +176,12 @@
   #endif
   
   #ifdef AP_AUTH_DBM_USE_APR
  -    retval  = apr_dbm_open_ex(&f, dbtype, auth_dbmpwfile, APR_DBM_READONLY, APR_OS_DEFAULT, r->pool);
  +    retval  = apr_dbm_open_ex(&f, dbtype, auth_dbmpwfile, APR_DBM_READONLY, 
  +                              APR_OS_DEFAULT, r->pool);
       if (retval != APR_SUCCESS) {
           ap_log_rerror(APLOG_MARK, APLOG_ERR, retval, r,
  -            "could not open dbm (type %s) auth file: %s", dbtype, auth_dbmpwfile);
  +                      "could not open dbm (type %s) auth file: %s", dbtype, 
  +                      auth_dbmpwfile);
           return NULL;
       }
       if (apr_dbm_fetch(f, q, &d) == APR_SUCCESS)
  @@ -237,7 +220,8 @@
    * mark@telescope.org, 22Sep95
    */
   
  -static char *get_dbm_grp(request_rec *r, char *user, char *auth_dbmgrpfile, char*dbtype)
  +static char *get_dbm_grp(request_rec *r, char *user, char *auth_dbmgrpfile, 
  +                         char *dbtype)
   {
       char *grp_data = get_dbm_pw(r, user, auth_dbmgrpfile,dbtype);
       char *grp_colon;
  @@ -270,11 +254,12 @@
       if (!conf->auth_dbmpwfile)
           return DECLINED;
   
  -    if (!(real_pw = get_dbm_pw(r, r->user, conf->auth_dbmpwfile,conf->auth_dbmtype))) {
  +    if (!(real_pw = get_dbm_pw(r, r->user, conf->auth_dbmpwfile,
  +                               conf->auth_dbmtype))) {
           if (!(conf->auth_dbmauthoritative))
               return DECLINED;
           ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
  -                    "DBM user %s not found: %s", r->user, r->filename);
  +                      "DBM user %s not found: %s", r->user, r->filename);
           ap_note_basic_auth_failure(r);
           return HTTP_UNAUTHORIZED;
       }
  @@ -328,7 +313,8 @@
               const char *orig_groups, *groups;
               char *v;
   
  -        if (!(groups = get_dbm_grp(r, user, conf->auth_dbmgrpfile,conf->auth_dbmtype))) {
  +            if (!(groups = get_dbm_grp(r, user, conf->auth_dbmgrpfile,
  +                                       conf->auth_dbmtype))) {
                   if (!(conf->auth_dbmauthoritative))
                       return DECLINED;
                   ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
  @@ -348,8 +334,8 @@
                   }
               }
               ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
  -                        "user %s not in right group: %s",
  -                        user, r->filename);
  +                          "user %s not in right group: %s",
  +                          user, r->filename);
               ap_note_basic_auth_failure(r);
               return HTTP_UNAUTHORIZED;
           }