]> granicus.if.org Git - apache/commitdiff
user and ap_auth_type fields were moved from connection_rec to request_rec
authorRoy T. Fielding <fielding@apache.org>
Thu, 26 Aug 1999 13:57:37 +0000 (13:57 +0000)
committerRoy T. Fielding <fielding@apache.org>
Thu, 26 Aug 1999 13:57:37 +0000 (13:57 +0000)
Submitted by: Ryan Bloom

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

modules/aaa/mod_auth.c
modules/aaa/mod_auth_anon.c
modules/aaa/mod_auth_db.c
modules/aaa/mod_auth_dbm.c
modules/loggers/mod_log_config.c
modules/mappers/mod_rewrite.c
modules/metadata/mod_setenvif.c

index e07dc453733f8533097dcee5dcd3a86ae543a315..39c74a3704cae5bdbd9131cf46373ebd895e69d1 100644 (file)
@@ -197,7 +197,6 @@ static int authenticate_basic_user(request_rec *r)
 {
     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;
     char *invalid_pw;
@@ -209,11 +208,11 @@ static int authenticate_basic_user(request_rec *r)
     if (!sec->auth_pwfile)
        return DECLINED;
 
-    if (!(real_pw = get_pw(r, c->user, sec->auth_pwfile))) {
+    if (!(real_pw = get_pw(r, r->user, sec->auth_pwfile))) {
        if (!(sec->auth_authoritative))
            return DECLINED;
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
-                   "user %s not found: %s", c->user, r->uri);
+                   "user %s not found: %s", r->user, r->uri);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -221,7 +220,7 @@ static int authenticate_basic_user(request_rec *r)
     if (invalid_pw != NULL) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
                      "user %s: authentication failure for \"%s\": %s",
-                     c->user, r->uri, invalid_pw);
+                     r->user, r->uri, invalid_pw);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -234,7 +233,7 @@ static int check_user_access(request_rec *r)
 {
     auth_config_rec *sec =
     (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module);
-    char *user = r->connection->user;
+    char *user = r->user;
     int m = r->method_number;
     int method_restricted = 0;
     register int x;
index e0c35b104fb2eae9144cf4da08bd753c77e79a3c..c137a7b07b81bb9e52c441a16c9fe29e18127342 100644 (file)
@@ -216,7 +216,6 @@ static int anon_authenticate_basic_user(request_rec *r)
     anon_auth_config_rec *sec =
     (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;
 
@@ -230,14 +229,14 @@ static int anon_authenticate_basic_user(request_rec *r)
     /* Do we allow an empty userID and/or is it the magic one
      */
 
-    if ((!(c->user[0])) && (sec->auth_anon_nouserid)) {
+    if ((!(r->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)))
+           if (!(strcasecmp(r->user, p->password)))
                res = OK;
            p = p->next;
        }
index e09e8eb6c4b98afd38afca0d050aae2ba7125626..a33f9df28a1b88200222d10805e4aaaa33ebc602 100644 (file)
@@ -223,7 +223,6 @@ static int db_authenticate_basic_user(request_rec *r)
     db_auth_config_rec *sec =
     (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;
     char *invalid_pw;
@@ -235,11 +234,11 @@ static int db_authenticate_basic_user(request_rec *r)
     if (!sec->auth_dbpwfile)
        return DECLINED;
 
-    if (!(real_pw = get_db_pw(r, c->user, sec->auth_dbpwfile))) {
+    if (!(real_pw = get_db_pw(r, r->user, sec->auth_dbpwfile))) {
        if (!(sec->auth_dbauthoritative))
            return DECLINED;
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
-                   "DB user %s not found: %s", c->user, r->filename);
+                   "DB user %s not found: %s", r->user, r->filename);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -252,7 +251,7 @@ static int db_authenticate_basic_user(request_rec *r)
     if (invalid_pw != NULL) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
                      "DB user %s: authentication failure for \"%s\": %s",
-                     c->user, r->uri, invalid_pw);
+                     r->user, r->uri, invalid_pw);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -266,7 +265,7 @@ static int db_check_auth(request_rec *r)
     db_auth_config_rec *sec =
     (db_auth_config_rec *) ap_get_module_config(r->per_dir_config,
                                             &db_auth_module);
-    char *user = r->connection->user;
+    char *user = r->user;
     int m = r->method_number;
 
     const array_header *reqs_arr = ap_requires(r);
index bb32361a6d983ce9ed6678c00603f56fb30cbe17..ed3036efc64a5c1643e3143fef93f95ef4348ea4 100644 (file)
@@ -210,7 +210,6 @@ static int dbm_authenticate_basic_user(request_rec *r)
     dbm_auth_config_rec *sec =
     (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;
     char *invalid_pw;
@@ -222,11 +221,11 @@ static int dbm_authenticate_basic_user(request_rec *r)
     if (!sec->auth_dbmpwfile)
        return DECLINED;
 
-    if (!(real_pw = get_dbm_pw(r, c->user, sec->auth_dbmpwfile))) {
+    if (!(real_pw = get_dbm_pw(r, r->user, sec->auth_dbmpwfile))) {
        if (!(sec->auth_dbmauthoritative))
            return DECLINED;
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
-                   "DBM user %s not found: %s", c->user, r->filename);
+                   "DBM user %s not found: %s", r->user, r->filename);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -239,7 +238,7 @@ static int dbm_authenticate_basic_user(request_rec *r)
     if (invalid_pw != NULL) {
        ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
                      "DBM user %s: authentication failure for \"%s\": %s",
-                     c->user, r->uri, invalid_pw);
+                     r->user, r->uri, invalid_pw);
        ap_note_basic_auth_failure(r);
        return AUTH_REQUIRED;
     }
@@ -253,7 +252,7 @@ static int dbm_check_auth(request_rec *r)
     dbm_auth_config_rec *sec =
     (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config,
                                              &dbm_auth_module);
-    char *user = r->connection->user;
+    char *user = r->user;
     int m = r->method_number;
 
     const array_header *reqs_arr = ap_requires(r);
index fcdebcc4f95f7138f45fc9126657d6208c0d6388..6ffb66991699ca1533679fdea4581b0d2a4520a7 100644 (file)
@@ -302,7 +302,7 @@ static const char *log_remote_logname(request_rec *r, char *a)
 
 static const char *log_remote_user(request_rec *r, char *a)
 {
-    char *rvalue = r->connection->user;
+    char *rvalue = r->user;
 
     if (rvalue == NULL) {
         rvalue = "-";
index c44de0dafab434a77d4c8c7713c55119a3452f23..4a036ddf3c550d92decd18255b1464914a5fd669 100644 (file)
@@ -3162,11 +3162,11 @@ static void rewritelog(request_rec *r, int level, const char *text, ...)
         return;
     }
 
-    if (conn->user == NULL) {
+    if (r->user == NULL) {
         ruser = "-";
     }
-    else if (strlen(conn->user) != 0) {
-        ruser = conn->user;
+    else if (strlen(r->user) != 0) {
+        ruser = r->user;
     }
     else {
         ruser = "\"\"";
@@ -3557,7 +3557,7 @@ static char *lookup_variable(request_rec *r, char *var)
                                          r->per_dir_config, REMOTE_NAME);
     }
     else if (strcasecmp(var, "REMOTE_USER") == 0) {
-        result = r->connection->user;
+        result = r->user;
     }
     else if (strcasecmp(var, "REMOTE_IDENT") == 0) {
         result = (char *)ap_get_remote_logname(r);
@@ -3584,7 +3584,7 @@ static char *lookup_variable(request_rec *r, char *var)
         result = r->args;
     }
     else if (strcasecmp(var, "AUTH_TYPE") == 0) {
-        result = r->connection->ap_auth_type;
+        result = r->ap_auth_type;
     }
     else if (strcasecmp(var, "IS_SUBREQ") == 0) { /* non-standard */
         result = (r->main != NULL ? "true" : "false");
index 27eef0aec94a317a4db7428008b902e1e808cfbf..fcf4c70d46f59cc235f4e0b2f748c51f53222104 100644 (file)
@@ -351,7 +351,7 @@ static int match_headers(request_rec *r)
                                          REMOTE_NAME);
                break;
            case SPECIAL_REMOTE_USER:
-               val = r->connection->user;
+               val = r->user;
                break;
            case SPECIAL_REQUEST_URI:
                val = r->uri;