* two users _can_ be merged without invalidating all the request
* scheme data. The scheme is also responsible for merging any user
* related scheme data itself.
+ * The caller is responsible for altering all refcount pointers to
+ * the 'from' object. They are invalid once this method is complete.
*/
void
Auth::User::absorb(Auth::User::Pointer from)
{
-
- /* RefCount children CANNOT be merged like this. The external Auth::User::Pointer's cannot be changed. */
-
- /* check that we only have the two references:
- * 1) our function scope
- * 2) the parsing function scope)
- */
- assert(from->RefCountCount() == 2);
-
/*
* XXX Incomplete: it should merge in hash references too and ask the module to merge in scheme data
* dlink_list proxy_auth_list;
safe_free(negotiate_request->server_blob);
negotiate_request->server_blob = xstrdup(blob);
negotiate_request->releaseAuthServer();
- auth_user_request->user()->credentials(Auth::Ok);
- debugs(29, 4, HERE << "Successfully validated user via Negotiate. Username '" << blob << "'");
/* connection is authenticated */
debugs(29, 4, HERE << "authenticated user " << auth_user_request->user()->username());
* Just free the temporary auth_user after merging as
* much of it new state into the existing one as possible */
usernamehash->user()->absorb(local_auth_user);
- local_auth_user = usernamehash->user();
/* from here on we are working with the original cached credentials. */
- negotiate_request->_auth_user = local_auth_user;
+ local_auth_user = usernamehash->user();
+ auth_user_request->user(local_auth_user);
} else {
/* store user in hash's */
local_auth_user->addToNameCache();
/* set these to now because this is either a new login from an
* existing user or a new user */
local_auth_user->expiretime = current_time.tv_sec;
- negotiate_request->releaseAuthServer();
- negotiate_request->user()->credentials(Auth::Ok);
+ auth_user_request->user()->credentials(Auth::Ok);
+ debugs(29, 4, HERE << "Successfully validated user via Negotiate. Username '" << blob << "'");
} else if (strncasecmp(reply, "NA ", 3) == 0 && arg != NULL) {
/* authentication failure (wrong password, etc.) */
if (usernamehash) {
/* we can't seamlessly recheck the username due to the
* challenge-response nature of the protocol.
- * Just free the temporary auth_user */
+ * Just free the temporary auth_user after merging as
+ * much of it new state into the existing one as possible */
usernamehash->user()->absorb(local_auth_user);
local_auth_user = usernamehash->user();
- ntlm_request->_auth_user = local_auth_user;
+ auth_user_request->user(local_auth_user);
} else {
/* store user in hash's */
local_auth_user->addToNameCache();