access.log.
/*
- * $Id: acl.cc,v 1.168 1998/07/14 21:29:54 wessels Exp $
+ * $Id: acl.cc,v 1.169 1998/07/14 22:28:08 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
static int
aclMatchProxyAuth(acl_proxy_auth * p, aclCheck_t * checklist)
{
- LOCAL_ARRAY(char, sent_user, ICP_IDENT_SZ);
+ LOCAL_ARRAY(char, sent_user, USER_IDENT_SZ);
const char *s;
char *cleartext;
char *sent_auth;
cleartext = uudecode(sent_auth);
xfree(sent_auth);
debug(28, 3) ("aclMatchProxyAuth: cleartext = '%s'\n", cleartext);
- xstrncpy(sent_user, cleartext, ICP_IDENT_SZ);
+ xstrncpy(sent_user, cleartext, USER_IDENT_SZ);
xfree(cleartext);
if ((passwd = strchr(sent_user, ':')) != NULL)
*passwd++ = '\0';
return 0;
}
debug(28, 5) ("aclMatchProxyAuth: checking user %s\n", sent_user);
+ /* copy username to checklist for logging on client-side */
+ xstrncpy(checklist->request->user_ident, sent_user, USER_IDENT_SZ);
/* reread password file if necessary */
aclReadProxyAuth(p);
u = hash_lookup(p->hash, sent_user);
if (user_agent)
xstrncpy(checklist->browser, user_agent, BROWSERNAMELEN);
if (ident)
- xstrncpy(checklist->ident, ident, ICP_IDENT_SZ);
+ xstrncpy(checklist->ident, ident, USER_IDENT_SZ);
return checklist;
}
/*
- * $Id: client_side.cc,v 1.348 1998/07/14 22:18:20 wessels Exp $
+ * $Id: client_side.cc,v 1.349 1998/07/14 22:28:10 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
clientHttpRequest *http = data;
int page_id = -1;
ErrorState *err = NULL;
- HttpReply *rep;
debug(33, 5) ("clientAccessCheckDone: '%s' answer=%d\n", http->uri, answer);
http->acl_checklist = NULL;
if (answer == ACCESS_ALLOWED) {
http->redirect_state = REDIRECT_PENDING;
redirectStart(http, clientRedirectDone, http);
} else if (answer == ACCESS_REQ_PROXY_AUTH) {
- http->al.http.code = HTTP_PROXY_AUTHENTICATION_REQUIRED;
http->log_type = LOG_TCP_DENIED;
http->entry = clientCreateStoreEntry(http, http->request->method, 0);
- /* create appropreate response */
- rep = clientConstructProxyAuthReply(http);
- httpReplySwapOut(rep, http->entry);
- /* do not need it anymore */
- httpReplyDestroy(rep);
+ /* create appropriate response */
+ http->entry->mem_obj->reply = clientConstructProxyAuthReply(http);
+ httpReplySwapOut(http->entry->mem_obj->reply, http->entry);
storeComplete(http->entry);
} else {
debug(33, 5) ("Access Denied: %s\n", http->uri);
http->al.cache.size = http->out.size;
http->al.cache.code = http->log_type;
http->al.cache.msec = tvSubMsec(http->start, current_time);
- http->al.cache.ident = conn->ident.ident;
+ if (request->user_ident[0])
+ http->al.cache.ident = request->user_ident;
+ else
+ http->al.cache.ident = conn->ident.ident;
if (request) {
Packer p;
MemBuf mb;
#define ANONYMIZER_STANDARD 1
#define ANONYMIZER_PARANOID 2
-#define ICP_IDENT_SZ 64
+#define USER_IDENT_SZ 64
#define IDENT_NONE 0
#define IDENT_PENDING 1
#define IDENT_DONE 2
/*
- * $Id: ident.cc,v 1.41 1998/05/30 19:43:11 rousskov Exp $
+ * $Id: ident.cc,v 1.42 1998/07/14 22:28:12 wessels Exp $
*
* DEBUG: section 30 Ident (RFC 931)
* AUTHOR: Duane Wessels
if (strstr(buf, "USERID")) {
if ((t = strrchr(buf, ':'))) {
while (isspace(*++t));
- xstrncpy(connState->ident.ident, t, ICP_IDENT_SZ);
+ xstrncpy(connState->ident.ident, t, USER_IDENT_SZ);
}
}
}
struct in_addr src_addr;
struct in_addr dst_addr;
request_t *request;
- char ident[ICP_IDENT_SZ];
+ char ident[USER_IDENT_SZ];
char browser[BROWSERNAMELEN];
acl_lookup_state state[ACL_ENUM_MAX];
PF *callback;
struct in_addr log_addr;
struct {
int fd;
- char ident[ICP_IDENT_SZ];
+ char ident[USER_IDENT_SZ];
IDCB *callback;
int state;
void *callback_data;
protocol_t protocol;
char login[MAX_LOGIN_SZ];
char host[SQUIDHOSTNAMELEN + 1];
+ char user_ident[USER_IDENT_SZ]; /* from proxy auth or ident server */
u_short port;
String urlpath;
int link_count; /* free when zero */