/*
- * $Id: ExternalACLEntry.cc,v 1.3 2003/06/27 22:32:31 hno Exp $
+ * $Id: ExternalACLEntry.cc,v 1.4 2003/07/09 14:14:57 hno Exp $
*
* DEBUG: section 82 External ACL
* AUTHOR: Henrik Nordstrom, MARA Systems AB
password = someData.password;
message = someData.message;
tag = someData.tag;
+ log = someData.log;
}
/*
- * $Id: ExternalACLEntry.h,v 1.3 2003/06/27 22:32:31 hno Exp $
+ * $Id: ExternalACLEntry.h,v 1.4 2003/07/09 14:14:57 hno Exp $
*
* DEBUG: section 82 External ACL
* AUTHOR: Henrik Nordstrom, MARA Systems AB
String password;
String message;
String tag;
+ String log;
};
String password;
String message;
String tag;
+ String log;
external_acl *def;
private:
/*
- * $Id: HttpRequest.cc,v 1.37 2003/06/27 22:32:31 hno Exp $
+ * $Id: HttpRequest.cc,v 1.38 2003/07/09 14:14:57 hno Exp $
*
* DEBUG: section 73 HTTP Request
* AUTHOR: Duane Wessels
req->extacl_passwd.clean();
+ req->extacl_log.clean();
+
memFree(req, MEM_REQUEST_T);
}
/*
- * $Id: access_log.cc,v 1.85 2003/07/09 13:57:43 hno Exp $
+ * $Id: access_log.cc,v 1.86 2003/07/09 14:14:58 hno Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
LFT_USER_IDENT,
/*LFT_USER_REALM, */
/*LFT_USER_SCHEME, */
+ LFT_USER_EXTERNAL,
LFT_HTTP_CODE,
/*LFT_HTTP_STATUS, */
/*LFT_REPLY_SIZE_BODY, */
/*LFT_REPLY_SIZE_BODY_NO_TE, */
+ LFT_TAG,
+ LFT_EXT_LOG,
+
LFT_PERCENT /* special string cases for escaped chars */
} logformat_bcode_t;
/*{ "<sb", LFT_REPLY_SIZE_BODY }, */
/*{ "<sB", LFT_REPLY_SIZE_BODY_NO_TE }, */
+ {"et", LFT_TAG},
+ {"ea", LFT_EXT_LOG},
+
{"%", LFT_PERCENT},
{NULL, LFT_NONE} /* this must be last */
break;
case LFT_USER_NAME:
- out = accessLogFormatName(al->cache.authuser ?
- al->cache.authuser : al->cache.rfc931);
+ out = accessLogFormatName(al->cache.authuser);
+
+ if (!out)
+ out = accessLogFormatName(al->cache.extuser);
+
+#if USE_SSL
+
+ if (!out)
+ out = accessLogFormatName(al->cache.ssluser);
+
+#endif
+
+ if (!out)
+ out = accessLogFormatName(al->cache.rfc931);
dofree = 1;
break;
+ case LFT_USER_EXTERNAL:
+ out = accessLogFormatName(al->cache.extuser);
+
+ dofree = 1;
+
+ break;
+
/* case LFT_USER_REALM: */
/* case LFT_USER_SCHEME: */
/*case LFT_REPLY_SIZE_BODY: */
/*case LFT_REPLY_SIZE_BODY_NO_TE: */
+ case LFT_TAG:
+ if (al->request)
+ out = al->request->tag.buf();
+
+ quote = 1;
+
+ break;
+
+ case LFT_EXT_LOG:
+ if (al->request)
+ out = al->request->extacl_log.buf();
+
+ quote = 1;
+
+ break;
+
case LFT_PERCENT:
out = "%";
#
-# $Id: cf.data.pre,v 1.330 2003/07/07 21:55:04 hno Exp $
+# $Id: cf.data.pre,v 1.331 2003/07/09 14:14:58 hno Exp $
#
#
# SQUID Web Proxy Cache http://www.squid-cache.org/
un User name
ul User login
ui User ident
+ ue User from external acl
Hs HTTP status code
Ss Squid request status (TCP_MISS etc)
Sh Squid hierarchy status (DEFAULT_PARENT etc)
rm Request method (GET/POST etc)
ru Request URL
rv Request protocol version
+ et Tag returned by external acl
+ ea Log string returned by external acl
<st Reply size including HTTP headers
% a literal % character
user= The users name (login)
password= The users password (for login= cache_peer option)
- message= Message describing the reason
+ message= Message describing the reason. Available as %o
+ in error pages
tag= Apply a tag to a request (for both ERR and OK results)
Only sets a tag, does not alter existing tags.
+ log= String to be logged in access.log. Available as
+ %ea in logformat specifications
Keyword values need to be enclosed in quotes if they may
contain whitespace, or the whitespace escaped using \. Any
/*
- * $Id: errorpage.cc,v 1.188 2003/03/10 04:56:38 robertc Exp $
+ * $Id: errorpage.cc,v 1.189 2003/07/09 14:14:58 hno Exp $
*
* DEBUG: section 4 Error Generation
* AUTHOR: Duane Wessels
break;
+ case 'o':
+ p = external_acl_message ? external_acl_message : "[not available]";
+
+ break;
+
case 'p':
if (r) {
memBufPrintf(&mb, "%d", (int) r->port);
/*
- * $Id: external_acl.cc,v 1.47 2003/07/06 21:43:36 hno Exp $
+ * $Id: external_acl.cc,v 1.48 2003/07/09 14:14:58 hno Exp $
*
* DEBUG: section 82 External ACL
* AUTHOR: Henrik Nordstrom, MARA Systems AB
}
}
+ external_acl_message = "MISSING REQUIRED INFORMATION";
+
if (!entry) {
if (acl->def->require_auth) {
int ti;
} else {
if (!entry) {
debug(82, 1) ("aclMatchExternal: '%s' queue overload. Request rejected '%s'.\n", acl->def->name, key);
+ external_acl_message = "SYSTEM TOO BUSY, TRY AGAIN LATER";
return -1;
} else {
debug(82, 1) ("aclMatchExternal: '%s' queue overload. Using stale result. '%s'.\n", acl->def->name, key);
external_acl_cache_touch(acl->def, entry);
result = entry->result;
+ external_acl_message = entry->message.buf();
+
debug(82, 2) ("aclMatchExternal: %s = %d\n", acl->def->name, result);
if (ch->request) {
if (!ch->request->tag.size())
ch->request->tag = entry->tag;
+
+ if (entry->log.size())
+ ch->request->extacl_log = entry->log;
}
return result;
*
* Keywords:
*
- * user= The users name (login)
- * message= Message describing the reason
- * tag= A string tag to be applied to the request that triggered the acl match.
- * applies to both OK and ERR responses.
- * Won't override existing request tags.
+ * user= The users name (login)
+ * message= Message describing the reason
+ * tag= A string tag to be applied to the request that triggered the acl match.
+ * applies to both OK and ERR responses.
+ * Won't override existing request tags.
+ * log= A string to be used in access logging
*
* Other keywords may be added to the protocol later
*
entryData.message = value;
else if (strcmp(token, "tag") == 0)
entryData.tag = value;
+ else if (strcmp(token, "log") == 0)
+ entryData.log = value;
else if (strcmp(token, "password") == 0)
entryData.password = value;
else if (strcmp(token, "passwd") == 0)
/*
- * $Id: globals.h,v 1.124 2003/04/24 06:35:09 hno Exp $
+ * $Id: globals.h,v 1.125 2003/07/09 14:14:58 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern int ssl_ctx_ex_index_dont_verify_domain; /* -1 */
extern int opt_no_daemon; /* 0 */
+extern const char *external_acl_message; /* NULL */
#endif /* SQUID_GLOBALS_H */
/*
- * $Id: structs.h,v 1.469 2003/07/06 21:50:56 hno Exp $
+ * $Id: structs.h,v 1.470 2003/07/09 14:14:58 hno Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
String tag; /* Internal tag for this request */
String extacl_user; /* User name returned by extacl lookup */
String extacl_passwd; /* Password returned by extacl lookup */
+ String extacl_log; /* String to be used for access.log purposes */
};
#endif