basicauthenticators = NULL;
/* XXX Reinstate auth shutdown for dynamic schemes? */
- debugs(29, 2, "authBasicDone: Basic authentication Shutdown.");
+ debugs(29, DBG_CRITICAL, HERE << "Basic authentication Shutdown.");
}
bool
{
if ((authenticate != NULL) && (authenticateChildren != 0) &&
(basicAuthRealm != NULL)) {
- debugs(29, 9, "authBasicConfigured: returning configured");
+ debugs(29, 9, HERE << "returning configured");
return true;
}
- debugs(29, 9, "authBasicConfigured: returning unconfigured");
+ debugs(29, 9, HERE << "returning unconfigured");
return false;
}
AuthBasicConfig::fixHeader(AuthUserRequest *auth_user_request, HttpReply *rep, http_hdr_type type, HttpRequest * request)
{
if (authenticate) {
- debugs(29, 9, "authenticateFixErrorHeader: Sending type:" << type << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
+ debugs(29, 9, HERE << "Sending type:" << type << " header: 'Basic realm=\"" << basicAuthRealm << "\"'");
httpHeaderPutStrf(&rep->header, type, "Basic realm=\"%s\"", basicAuthRealm);
}
}
BasicUser::~BasicUser()
{
- if (passwd)
- xfree(passwd);
-
- safe_free (cleartext);
+ safe_free(passwd);
+ safe_free(cleartext);
}
static void
BasicAuthQueueNode *tmpnode;
char *t = NULL;
void *cbdata;
- debugs(29, 9, "authenticateBasicHandleReply: {" << (reply ? reply : "<NULL>") << "}");
+ debugs(29, 9, HERE << "{" << (reply ? reply : "<NULL>") << "}");
if (reply) {
if ((t = strchr(reply, ' ')))
storeAppendPrintf(entry, "%s basic concurrency %d\n", name, authenticateConcurrency);
storeAppendPrintf(entry, "%s basic credentialsttl %d seconds\n", name, (int) credentialsTTL);
storeAppendPrintf(entry, "%s basic casesensitive %s\n", name, casesensitive ? "on" : "off");
-
}
AuthBasicConfig::AuthBasicConfig()
} else if (strcasecmp(param_str, "casesensitive") == 0) {
parse_onoff(&casesensitive);
} else {
- debugs(29, 0, "unrecognised basic auth scheme parameter '" << param_str << "'");
+ debugs(29, DBG_CRITICAL, HERE << "unrecognised basic auth scheme parameter '" << param_str << "'");
}
}
* Don't allow NL or CR in the credentials.
* Oezguer Kesim <oec@codeblau.de>
*/
- debugs(29, 9, "BasicUser::decodeCleartext: '" << cleartext << "'");
+ debugs(29, 9, HERE << "'" << cleartext << "'");
if (strcspn(cleartext, "\r\n") != strlen(cleartext)) {
- debugs(29, 1, "BasicUser::decodeCleartext: bad characters in authorization header '" << httpAuthHeader << "'");
+ debugs(29, 1, HERE << "bad characters in authorization header '" << httpAuthHeader << "'");
safe_free(cleartext);
return false;
}
passwd = strchr(cleartext, ':');
if (passwd == NULL) {
- debugs(29, 4, "authenticateBasicDecodeAuth: no password in proxy authorization header '" << httpAuthHeader << "'");
+ debugs(29, 4, HERE << "no password in proxy authorization header '" << httpAuthHeader << "'");
passwd = NULL;
- currentRequest->setDenyMessage ("no password was present in the HTTP [proxy-]authorization header. This is most likely a browser bug");
+ currentRequest->setDenyMessage("no password was present in the HTTP [proxy-]authorization header. This is most likely a browser bug");
} else {
++passwd;
if (*passwd == '\0') {
- debugs(29, 4, "authenticateBasicDecodeAuth: Disallowing empty password,user is '" << username() << "'");
+ debugs(29, 4, HERE << "Disallowing empty password,user is '" << username() << "'");
passwd = NULL;
- currentRequest->setDenyMessage ("Request denied because you provided an empty password. Users MUST have a password.");
+ currentRequest->setDenyMessage("Request denied because you provided an empty password. Users MUST have a password.");
} else {
passwd = xstrndup(passwd, USER_IDENT_SZ);
}
{
if (username()) {
/* log the username */
- debugs(29, 9, "authBasicDecodeAuth: Creating new user for logging '" << username() << "'");
+ debugs(29, 9, HERE << "Creating new user for logging '" << username() << "'");
/* new scheme data */
BasicUser *basic_auth = new BasicUser(& basicConfig);
auth_user_request->user(basic_auth);
BasicUser::makeCachedFrom()
{
/* the user doesn't exist in the username cache yet */
- debugs(29, 9, "authBasicDecodeAuth: Creating new user '" << username() << "'");
+ debugs(29, 9, HERE << "Creating new user '" << username() << "'");
BasicUser *basic_user = new BasicUser(&basicConfig);
/* save the credentials */
basic_user->username(username());
void
BasicUser::updateCached(BasicUser *from)
{
- debugs(29, 9, "authBasicDecodeAuth: Found user '" << from->username() << "' in the user cache as '" << this << "'");
+ debugs(29, 9, HERE << "Found user '" << from->username() << "' in the user cache as '" << this << "'");
if (strcmp(from->passwd, passwd)) {
- debugs(29, 4, "authBasicDecodeAuth: new password found. Updating in user master record and resetting auth state to unchecked");
+ debugs(29, 4, HERE << "new password found. Updating in user master record and resetting auth state to unchecked");
flags.credentials_ok = 0;
xfree(passwd);
passwd = from->passwd;
}
if (flags.credentials_ok == 3) {
- debugs(29, 4, "authBasicDecodeAuth: last attempt to authenticate this user failed, resetting auth state to unchecked");
+ debugs(29, 4, HERE << "last attempt to authenticate this user failed, resetting auth state to unchecked");
flags.credentials_ok = 0;
}
}
-/*
+/**
* Decode a Basic [Proxy-]Auth string, linking the passed
* auth_user_request structure to any existing user structure or creating one
* if needed. Note that just returning will be treated as
return auth_user_request;
}
-/* Initialize helpers and the like for this auth scheme. Called AFTER parsing the
+/** Initialize helpers and the like for this auth scheme. Called AFTER parsing the
* config file */
void
AuthBasicConfig::init(AuthConfig * scheme)
assert(user()->auth_type == AUTH_BASIC);
basic_auth = dynamic_cast<basic_data *>(user());
assert(basic_auth != NULL);
- debugs(29, 9, "AuthBasicUserRequest::start: '" << basic_auth->username() << ":" << basic_auth->passwd << "'");
+ debugs(29, 9, HERE << "'" << basic_auth->username() << ":" << basic_auth->passwd << "'");
if (basicConfig.authenticate == NULL) {
handler(data, NULL);
}
void
-BasicUser::submitRequest (AuthUserRequest * auth_user_request, RH * handler, void *data)
+BasicUser::submitRequest(AuthUserRequest * auth_user_request, RH * handler, void *data)
{
/* mark the user as haveing verification in progress */
flags.credentials_ok = 2;
{
return &basicConfig;
}
-