rbb 99/03/24 10:39:58
Modified: pthreads/src/include httpd.h pthreads/src/main http_protocol.c util_script.c pthreads/src/modules/proxy proxy_ftp.c pthreads/src/modules/standard mod_auth.c mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c mod_digest.c mod_log_config.c mod_rewrite.c mod_setenvif.c Log: Moved user and auth_type from conn_rec struct to request_rec. Revision Changes Path 1.13 +5 -5 apache-apr/pthreads/src/include/httpd.h Index: httpd.h =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- httpd.h 1999/03/17 17:01:10 1.12 +++ httpd.h 1999/03/24 18:39:46 1.13 @@ -762,6 +762,11 @@ array_header *content_languages; /* array of (char*) */ char *vlist_validator; /* variant list validator (if negotiated) */ + + char *user; /* If an authentication check was made, + * this gets set to the user name. + */ + char *ap_auth_type; /* Ditto. */ int no_cache; int no_local_copy; @@ -831,11 +836,6 @@ char *remote_logname; /* Only ever set if doing rfc1413 lookups. * N.B. Only access this through * get_remote_logname() */ - char *user; /* If an authentication check was made, - * this gets set to the user name. We assume - * that there's only one user per connection(!) - */ - char *ap_auth_type; /* Ditto. */ unsigned aborted:1; /* Are we still talking? */ signed int keepalive:2; /* Are we using HTTP Keep-Alive? 1.15 +4 -4 apache-apr/pthreads/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/http_protocol.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- http_protocol.c 1999/03/21 10:51:44 1.14 +++ http_protocol.c 1999/03/24 18:39:47 1.15 @@ -934,8 +934,8 @@ conn->keptalive = conn->keepalive == 1; conn->keepalive = 0; - conn->user = NULL; - conn->ap_auth_type = NULL; + r->user = NULL; + r->ap_auth_type = NULL; r->headers_in = ap_make_table(r->pool, 50); r->subprocess_env = ap_make_table(r->pool, 50); @@ -1167,8 +1167,8 @@ * because it has the lifetime of the connection. The other allocations * are temporary and can be tossed away any time. */ - r->connection->user = ap_getword_nulls (r->connection->pool, &t, ':'); - r->connection->ap_auth_type = "Basic"; + r->user = ap_getword_nulls (r->pool, &t, ':'); + r->ap_auth_type = "Basic"; *pw = t; 1.5 +4 -4 apache-apr/pthreads/src/main/util_script.c Index: util_script.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/main/util_script.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- util_script.c 1999/03/17 17:01:25 1.4 +++ util_script.c 1999/03/24 18:39:47 1.5 @@ -279,11 +279,11 @@ ap_table_addn(e, "REMOTE_PORT", ap_psprintf(r->pool, "%d", ntohs(c->remote_addr.sin_port))); - if (c->user) { - ap_table_addn(e, "REMOTE_USER", c->user); + if (r->user) { + ap_table_addn(e, "REMOTE_USER", r->user); } - if (c->ap_auth_type) { - ap_table_addn(e, "AUTH_TYPE", c->ap_auth_type); + if (r->ap_auth_type) { + ap_table_addn(e, "AUTH_TYPE", r->ap_auth_type); } rem_logname = ap_get_remote_logname(r); if (rem_logname) { 1.6 +3 -3 apache-apr/pthreads/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- proxy_ftp.c 1999/03/22 20:43:39 1.5 +++ proxy_ftp.c 1999/03/24 18:39:49 1.6 @@ -507,9 +507,9 @@ * because it has the lifetime of the connection. The other allocations * are temporary and can be tossed away any time. */ - user = ap_getword_nulls (r->connection->pool, &password, ':'); - r->connection->ap_auth_type = "Basic"; - r->connection->user = r->parsed_uri.user = user; + user = ap_getword_nulls (r->pool, &password, ':'); + r->ap_auth_type = "Basic"; + r->user = r->parsed_uri.user = user; nocache = 1; /* This resource only accessible with username/password */ } else if ((user = r->parsed_uri.user) != NULL) { 1.3 +4 -4 apache-apr/pthreads/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_auth.c 1999/02/07 06:29:51 1.2 +++ mod_auth.c 1999/03/24 18:39:51 1.3 @@ -210,11 +210,11 @@ 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; } @@ -222,7 +222,7 @@ 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; } @@ -235,7 +235,7 @@ { 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; 1.3 +2 -2 apache-apr/pthreads/src/modules/standard/mod_auth_anon.c Index: mod_auth_anon.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_anon.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_auth_anon.c 1999/02/07 06:29:51 1.2 +++ mod_auth_anon.c 1999/03/24 18:39:51 1.3 @@ -230,14 +230,14 @@ /* 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; } 1.3 +4 -4 apache-apr/pthreads/src/modules/standard/mod_auth_db.c Index: mod_auth_db.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_db.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_auth_db.c 1999/02/07 06:29:51 1.2 +++ mod_auth_db.c 1999/03/24 18:39:52 1.3 @@ -236,11 +236,11 @@ 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; } @@ -253,7 +253,7 @@ 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; } @@ -267,7 +267,7 @@ 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); 1.3 +4 -4 apache-apr/pthreads/src/modules/standard/mod_auth_dbm.c Index: mod_auth_dbm.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_auth_dbm.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_auth_dbm.c 1999/02/07 06:29:51 1.2 +++ mod_auth_dbm.c 1999/03/24 18:39:52 1.3 @@ -218,11 +218,11 @@ 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; } @@ -235,7 +235,7 @@ 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; } @@ -249,7 +249,7 @@ 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); 1.3 +6 -6 apache-apr/pthreads/src/modules/standard/mod_digest.c Index: mod_digest.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_digest.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_digest.c 1999/02/07 06:29:52 1.2 +++ mod_digest.c 1999/03/24 18:39:53 1.3 @@ -250,8 +250,8 @@ return AUTH_REQUIRED; } - r->connection->user = response->username; - r->connection->ap_auth_type = "Digest"; + r->user = response->username; + r->ap_auth_type = "Digest"; return OK; } @@ -298,15 +298,15 @@ if (!sec->pwfile) return DECLINED; - if (!(a1 = get_hash(r, c->user, sec->pwfile))) { + if (!(a1 = get_hash(r, r->user, sec->pwfile))) { 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_digest_auth_failure(r); return AUTH_REQUIRED; } if (strcmp(response->digest, find_digest(r, response, a1))) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r, - "user %s: password mismatch: %s", c->user, r->uri); + "user %s: password mismatch: %s", r->user, r->uri); ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } @@ -317,7 +317,7 @@ static int digest_check_auth(request_rec *r) { - char *user = r->connection->user; + char *user = r->user; int m = r->method_number; int method_restricted = 0; register int x; 1.4 +1 -1 apache-apr/pthreads/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_log_config.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_log_config.c 1999/03/05 05:24:30 1.3 +++ mod_log_config.c 1999/03/24 18:39:53 1.4 @@ -296,7 +296,7 @@ static const char *log_remote_user(request_rec *r, char *a) { - char *rvalue = r->connection->user; + char *rvalue = r->user; if (rvalue == NULL) { rvalue = "-"; 1.4 +5 -5 apache-apr/pthreads/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_rewrite.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_rewrite.c 1999/03/17 17:01:53 1.3 +++ mod_rewrite.c 1999/03/24 18:39:54 1.4 @@ -3155,11 +3155,11 @@ 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 = "\"\""; @@ -3568,7 +3568,7 @@ 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); @@ -3595,7 +3595,7 @@ 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"); 1.3 +1 -1 apache-apr/pthreads/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /home/cvs/apache-apr/pthreads/src/modules/standard/mod_setenvif.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mod_setenvif.c 1999/02/07 06:29:55 1.2 +++ mod_setenvif.c 1999/03/24 18:39:55 1.3 @@ -347,7 +347,7 @@ REMOTE_NAME); break; case SPECIAL_REMOTE_USER: - val = r->connection->user; + val = r->user; break; case SPECIAL_REQUEST_URI: val = r->uri;