From: Roy T. Fielding Date: Thu, 26 Aug 1999 13:57:37 +0000 (+0000) Subject: user and ap_auth_type fields were moved from connection_rec to request_rec X-Git-Tag: PRE_APR_CHANGES~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb1bab0f1ae987afb0ad4c14938489589de9eec5;p=apache user and ap_auth_type fields were moved from connection_rec to request_rec Submitted by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83767 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth.c b/modules/aaa/mod_auth.c index e07dc45373..39c74a3704 100644 --- a/modules/aaa/mod_auth.c +++ b/modules/aaa/mod_auth.c @@ -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; diff --git a/modules/aaa/mod_auth_anon.c b/modules/aaa/mod_auth_anon.c index e0c35b104f..c137a7b07b 100644 --- a/modules/aaa/mod_auth_anon.c +++ b/modules/aaa/mod_auth_anon.c @@ -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; } diff --git a/modules/aaa/mod_auth_db.c b/modules/aaa/mod_auth_db.c index e09e8eb6c4..a33f9df28a 100644 --- a/modules/aaa/mod_auth_db.c +++ b/modules/aaa/mod_auth_db.c @@ -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); diff --git a/modules/aaa/mod_auth_dbm.c b/modules/aaa/mod_auth_dbm.c index bb32361a6d..ed3036efc6 100644 --- a/modules/aaa/mod_auth_dbm.c +++ b/modules/aaa/mod_auth_dbm.c @@ -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); diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index fcdebcc4f9..6ffb669916 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -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 = "-"; diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index c44de0dafa..4a036ddf3c 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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"); diff --git a/modules/metadata/mod_setenvif.c b/modules/metadata/mod_setenvif.c index 27eef0aec9..fcf4c70d46 100644 --- a/modules/metadata/mod_setenvif.c +++ b/modules/metadata/mod_setenvif.c @@ -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;