]> granicus.if.org Git - apache/commitdiff
Update mod_auth_dbm to work with Apache 2.0. This has not been tested,
authorRyan Bloom <rbb@apache.org>
Fri, 31 Dec 1999 17:04:58 +0000 (17:04 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 31 Dec 1999 17:04:58 +0000 (17:04 +0000)
but at least it compiles now.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84381 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth_dbm.c

index f3a7c7475271c2090db4cc0fd7e0a145d7ce8c32..2c24d607788a5fe1ea1005189516e2e9ea1f4266 100644 (file)
@@ -212,7 +212,7 @@ static int dbm_authenticate_basic_user(request_rec *r)
                                              &dbm_auth_module);
     const char *sent_pw;
     char *real_pw, *colon_pw;
-    char *invalid_pw;
+    ap_status_t invalid_pw;
     int res;
 
     if ((res = ap_get_basic_auth_pw(r, &sent_pw)))
@@ -235,7 +235,7 @@ static int dbm_authenticate_basic_user(request_rec *r)
        *colon_pw = '\0';
     }
     invalid_pw = ap_validate_password(sent_pw, real_pw);
-    if (invalid_pw != NULL) {
+    if (invalid_pw != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
                      "DBM user %s: authentication failure for \"%s\": %s",
                      r->user, r->uri, invalid_pw);
@@ -309,26 +309,20 @@ static int dbm_check_auth(request_rec *r)
     return DECLINED;
 }
 
+static void register_hooks(void)
+{
+    ap_hook_check_user_id(dbm_authenticate_basic_user, NULL, NULL, HOOK_MIDDLE);
+    ap_hook_auth_checker(dbm_check_auth, NULL, NULL, HOOK_MIDDLE);
+}
 
 module dbm_auth_module =
 {
-    STANDARD_MODULE_STUFF,
-    NULL,                      /* initializer */
+    STANDARD20_MODULE_STUFF,
     create_dbm_auth_dir_config,        /* dir config creater */
     NULL,                      /* dir merger --- default is to override */
     NULL,                      /* server config */
     NULL,                      /* merge server config */
     dbm_auth_cmds,             /* command ap_table_t */
     NULL,                      /* handlers */
-    NULL,                      /* filename translation */
-    dbm_authenticate_basic_user,       /* check_user_id */
-    dbm_check_auth,            /* check auth */
-    NULL,                      /* check access */
-    NULL,                      /* type_checker */
-    NULL,                      /* fixups */
-    NULL,                      /* logger */
-    NULL,                      /* header parser */
-    NULL,                      /* child_init */
-    NULL,                      /* child_exit */
-    NULL                       /* post read-request */
+    register_hooks              /* register hooks */
 };