? configure ? merge.log ? separateident.diff ? icons/anthony-binhex.gif ? icons/anthony-bomb.gif ? icons/anthony-box.gif ? icons/anthony-box2.gif ? icons/anthony-c.gif ? icons/anthony-compressed.gif ? icons/anthony-dir.gif ? icons/anthony-dirup.gif ? icons/anthony-dvi.gif ? icons/anthony-f.gif ? icons/anthony-image.gif ? icons/anthony-image2.gif ? icons/anthony-layout.gif ? icons/anthony-link.gif ? icons/anthony-movie.gif ? icons/anthony-pdf.gif ? icons/anthony-portal.gif ? icons/anthony-ps.gif ? icons/anthony-quill.gif ? icons/anthony-script.gif ? icons/anthony-sound.gif ? icons/anthony-tar.gif ? icons/anthony-tex.gif ? icons/anthony-text.gif ? icons/anthony-unknown.gif ? icons/anthony-xbm.gif ? icons/anthony-xpm.gif ? include/autoconf.h.in ? src/.acl.c.swp Index: src/access_log.c =================================================================== RCS file: /cvsroot/squid/squid/src/access_log.c,v retrieving revision 1.1.1.3.12.4.2.3 diff -U5 -r1.1.1.3.12.4.2.3 access_log.c --- src/access_log.c 2000/11/07 07:52:51 1.1.1.3.12.4.2.3 +++ src/access_log.c 2000/11/09 08:32:40 @@ -180,10 +180,19 @@ } *buf_cursor = '\0'; return buf; } + +static const char * +accessLogFormatName(const char *name) +{ + if (NULL == name) + return dash_str; + return rfc1738_escape(name); +} + static void accessLogSquid(AccessLogEntry * al) { const char *client = NULL; if (Config.onoff.log_fqdn) @@ -198,11 +207,12 @@ log_tags[al->cache.code], al->http.code, al->cache.size, al->private.method_str, al->url, - al->cache.ident, + accessLogFormatName(al->cache.authuser ? + al->cache.authuser : al->cache.rfc931), al->hier.ping.timedout ? "TIMEOUT_" : "", hier_strings[al->hier.code], al->hier.host, al->http.content_type); } @@ -213,13 +223,14 @@ const char *client = NULL; if (Config.onoff.log_fqdn) client = fqdncache_gethostbyaddr(al->cache.caddr, 0); if (client == NULL) client = inet_ntoa(al->cache.caddr); - logfilePrintf(logfile, "%s %s - [%s] \"%s %s HTTP/%.1f\" %d %d %s:%s", + logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%.1f\" %d %d %s:%s", client, - al->cache.ident, + accessLogFormatName(al->cache.rfc931), + accessLogFormatName(al->cache.authuser), mkhttpdlogtime(&squid_curtime), al->private.method_str, al->url, al->http.version, al->http.code, @@ -229,28 +240,16 @@ } void accessLogLog(AccessLogEntry * al) { -#ifdef UNUSED_CODE - LOCAL_ARRAY(char, ident_buf, USER_IDENT_SZ); -#endif - if (LogfileStatus != LOG_ENABLE) return; if (al->url == NULL) al->url = dash_str; if (!al->http.content_type || *al->http.content_type == '\0') al->http.content_type = dash_str; - if (!al->cache.ident || *al->cache.ident == '\0') { - al->cache.ident = dash_str; - } else { - /* Why are we escaping the username? It's in a http header as base64, - * and it gets written to disk?! RBCollins */ -/* xstrncpy(ident_buf, rfc1738_escape(al->cache.ident), USER_IDENT_SZ); - al->cache.ident = ident_buf; */ - } if (al->icp.opcode) al->private.method_str = icp_opcode_str[al->icp.opcode]; else al->private.method_str = RequestMethodStr[al->http.method]; if (al->hier.host[0] == '\0') Index: src/acl.c =================================================================== RCS file: /cvsroot/squid/squid/src/acl.c,v retrieving revision 1.1.1.3.12.24.2.17 diff -U5 -r1.1.1.3.12.24.2.17 acl.c --- src/acl.c 2000/11/08 10:12:55 1.1.1.3.12.24.2.17 +++ src/acl.c 2000/11/09 08:32:47 @@ -1069,11 +1069,11 @@ return 0; debug(28, 3) ("aclMatchUser: checking '%s'\n", user); while (data) { debug(28, 3) ("aclMatchUser: looking for '%s'\n", data->key); if (strcmp(data->key, "REQUIRED") == 0 && *user != '\0' - && strcmp(user, "-") != 0) + && strcmp(user, dash_str) != 0) return 1; if (strcmp(data->key, user) == 0) return 1; data = data->next; } @@ -1368,12 +1368,12 @@ /* * copy username to failed request for logging on * client-side unless ident is known (do not override ident * with false proxy auth names) */ - if (!*checklist->request->user_ident) - xstrncpy(checklist->request->user_ident, + if (!checklist->rfc931[0]) + xstrncpy(checklist->request->authuser, auth_user->auth_data.basic_auth.username, USER_IDENT_SZ); aclAuthUserUnlock(auth_user); aclFreeProxyAuthUser(auth_user); return -2; @@ -1435,11 +1435,11 @@ /* if it's in the hash why did it go past the authenticator? */ assert(checklist->auth_user==NULL); if (auth_user->expiretime > current_time.tv_sec) { /* copy username to request for logging on client-side */ /* the username/password was correct at this point */ - xstrncpy(checklist->request->user_ident, + xstrncpy(checklist->request->authuser, auth_user->auth_data.basic_auth.username, USER_IDENT_SZ); if (authenticateCheckAuthUserIP(checklist->src_addr, auth_user)){ /* Once the match is completed we have finished with the * auth_user structure */ @@ -1609,11 +1609,11 @@ assert(checklist->auth_user == NULL); assert(checklist->conn->auth_user != NULL); /* we have a valid username. */ auth_user = checklist->conn->auth_user; /* store the username in the request for logging */ - xstrncpy(checklist->request->user_ident, + xstrncpy(checklist->request->authuser, auth_user->auth_data.ntlm_auth.username, USER_IDENT_SZ); if (auth_user->expiretime > current_time.tv_sec) { auth_user->expiretime = current_time.tv_sec + Config.authenticateTTL; @@ -1907,20 +1907,20 @@ case ACL_MY_PORT: return aclMatchIntegerRange(ae->data, (int) checklist->my_port); /* NOTREACHED */ #if USE_IDENT case ACL_IDENT: - if (checklist->ident[0]) { - return aclMatchUser(ae->data, checklist->ident); + if (checklist->rfc931[0]) { + return aclMatchUser(ae->data, checklist->rfc931); } else { checklist->state[ACL_IDENT] = ACL_LOOKUP_NEEDED; return 0; } /* NOTREACHED */ case ACL_IDENT_REGEX: - if (checklist->ident[0]) { - return aclMatchRegex(ae->data, checklist->ident); + if (checklist->rfc931[0]) { + return aclMatchRegex(ae->data, checklist->rfc931); } else { checklist->state[ACL_IDENT] = ACL_LOOKUP_NEEDED; return 0; } /* NOTREACHED */ @@ -2218,22 +2218,24 @@ static void aclLookupIdentDone(const char *ident, void *data) { aclCheck_t *checklist = data; if (ident) { - xstrncpy(checklist->ident, ident, sizeof(checklist->ident)); - xstrncpy(checklist->request->user_ident, ident, - sizeof(checklist->request->user_ident));} else { - xstrncpy(checklist->ident, "-", sizeof(checklist->ident)); + xstrncpy(checklist->rfc931, ident, USER_IDENT_SZ); +#if DONT + xstrncpy(checklist->request->authuser, ident, USER_IDENT_SZ); +#endif + } else { + xstrncpy(checklist->rfc931, dash_str, USER_IDENT_SZ); } /* * Cache the ident result in the connection, to avoid redoing ident lookup * over and over on persistent connections */ - if (cbdataValid(checklist->conn) && !checklist->conn->ident[0]) - xstrncpy(checklist->conn->ident, checklist->ident, - sizeof(checklist->conn->ident)); aclCheck(checklist); + if (cbdataValid(checklist->conn) && !checklist->conn->rfc931[0]) + xstrncpy(checklist->conn->rfc931, checklist->rfc931, USER_IDENT_SZ); + aclCheck(checklist); } #endif static void aclLookupDstIPDone(const ipcache_addrs * ia, void *data) @@ -2361,11 +2363,11 @@ } for (i = 0; i < ACL_ENUM_MAX; i++) checklist->state[i] = ACL_LOOKUP_NONE; #if USE_IDENT if (ident) - xstrncpy(checklist->ident, ident, USER_IDENT_SZ); + xstrncpy(checklist->rfc931, ident, USER_IDENT_SZ); #endif return checklist; } void Index: src/client_side.c =================================================================== RCS file: /cvsroot/squid/squid/src/client_side.c,v retrieving revision 1.1.1.3.4.1.2.26.2.5 diff -U5 -r1.1.1.3.4.1.2.26.2.5 client_side.c --- src/client_side.c 2000/11/07 11:28:22 1.1.1.3.4.1.2.26.2.5 +++ src/client_side.c 2000/11/09 08:32:56 @@ -133,25 +133,22 @@ #if USE_IDENT static void clientIdentDone(const char *ident, void *data) { ConnStateData *conn = data; - if (ident) - xstrncpy(conn->ident, ident, sizeof(conn->ident)); - else - xstrncpy(conn->ident, "-", sizeof(conn->ident)); + xstrncpy(conn->rfc931, ident ? ident : dash_str, USER_IDENT_SZ); } #endif static aclCheck_t * clientAclChecklistCreate(const acl_access * acl, const clientHttpRequest * http) { aclCheck_t *ch; ConnStateData *conn = http->conn; ch = aclChecklistCreate(acl, http->request, - conn->ident); + conn->rfc931); /* * hack for ident ACL. It needs to get full addresses, and a * place to store the ident result on persistent connections... */ @@ -300,12 +297,12 @@ httpHeaderAppend(&new_request->header, &old_request->header); new_request->client_addr = old_request->client_addr; new_request->my_addr = old_request->my_addr; new_request->my_port = old_request->my_port; new_request->flags.redirected = 1; - if (old_request->user_ident[0]) - xstrncpy(new_request->user_ident, old_request->user_ident, + if (old_request->authuser[0]) + xstrncpy(new_request->authuser, old_request->authuser, USER_IDENT_SZ); if (old_request->body_connection) { new_request->body_connection = old_request->body_connection; old_request->body_connection = NULL; } @@ -740,14 +737,14 @@ httpHeaderPackInto(&request->header, &p); http->al.http.method = request->method; http->al.http.version = request->http_ver; http->al.headers.request = xstrdup(mb.buf); http->al.hier = request->hier; - if (request->user_ident[0]) - http->al.cache.ident = request->user_ident; - else - http->al.cache.ident = conn->ident; + if (request->authuser[0]) + http->al.cache.authuser = request->authuser; + if (conn->rfc931[0]) + http->al.cache.rfc931 = conn->rfc931; packerClean(&p); memBufClean(&mb); } accessLogLog(&http->al); clientUpdateCounters(http); Index: src/redirect.c =================================================================== RCS file: /cvsroot/squid/squid/src/redirect.c,v retrieving revision 1.1.1.3.4.1.2.1 diff -U5 -r1.1.1.3.4.1.2.1 redirect.c --- src/redirect.c 2000/04/17 00:13:10 1.1.1.3.4.1.2.1 +++ src/redirect.c 2000/11/09 08:32:56 @@ -124,16 +124,16 @@ } r = xcalloc(1, sizeof(redirectStateData)); cbdataAdd(r, cbdataXfree, 0); r->orig_url = xstrdup(http->uri); r->client_addr = conn->log_addr; - if (http->request->user_ident[0]) - r->client_ident = http->request->user_ident; - else if (conn->ident == NULL || *conn->ident == '\0') { - r->client_ident = dash_str; + if (http->request->authuser[0]) + r->client_ident = http->request->authuser; + else if (conn->rfc931[0]) { + r->client_ident = conn->rfc931; } else { - r->client_ident = conn->ident; + r->client_ident = dash_str; } r->method_s = RequestMethodStr[http->request->method]; r->handler = handler; r->data = data; cbdataLock(r->data); Index: src/structs.h =================================================================== RCS file: /cvsroot/squid/squid/src/structs.h,v retrieving revision 1.1.1.3.4.1.2.22.2.9 diff -U5 -r1.1.1.3.4.1.2.22.2.9 structs.h --- src/structs.h 2000/11/08 10:12:56 1.1.1.3.4.1.2.22.2.9 +++ src/structs.h 2000/11/09 08:32:59 @@ -184,11 +184,11 @@ struct in_addr dst_addr; struct in_addr my_addr; unsigned short my_port; request_t *request; ConnStateData *conn; /* hack for ident and NTLM*/ - char ident[USER_IDENT_SZ]; + char rfc931[USER_IDENT_SZ]; acl_proxy_auth_user *auth_user; acl_lookup_state state[ACL_ENUM_MAX]; #if SQUID_SNMP char *snmp_community; #endif @@ -894,11 +894,12 @@ struct { struct in_addr caddr; size_t size; log_type code; int msec; - const char *ident; + const char *rfc931; + const char *authuser; } cache; struct { char *request; char *reply; } headers; @@ -968,11 +969,11 @@ acl_proxy_auth_user *auth_user; clientHttpRequest *chr; struct sockaddr_in peer; struct sockaddr_in me; struct in_addr log_addr; - char ident[USER_IDENT_SZ]; + char rfc931[USER_IDENT_SZ]; int nrequests; struct { int n; time_t until; } defer; @@ -1493,11 +1494,11 @@ struct _request_t { method_t method; protocol_t protocol; char login[MAX_LOGIN_SZ]; char host[SQUIDHOSTNAMELEN + 1]; - char user_ident[USER_IDENT_SZ]; /* from proxy auth or ident server */ + char authuser[USER_IDENT_SZ]; /* from proxy auth only */ u_short port; String urlpath; char *canonical; int link_count; /* free when zero */ request_flags flags;