]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Auth::User::userKey now returns SBuf
authorFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 4 Sep 2015 13:26:59 +0000 (15:26 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Fri, 4 Sep 2015 13:26:59 +0000 (15:26 +0200)
src/auth/Gadgets.cc
src/auth/User.h
src/auth/UserNameCache.cc
src/auth/basic/Config.cc
src/auth/negotiate/UserRequest.cc
src/auth/ntlm/UserRequest.cc

index 402aae7fffdd3f23f57c666b6d26956cf741b96d..8a91934af872753df4119086a7852bc9c3610bf1 100644 (file)
@@ -109,7 +109,7 @@ std::vector<Auth::User::Pointer>
 authenticateCachedUsersList()
 {
     auto aucp_compare = [=](const Auth::User::Pointer lhs, const Auth::User::Pointer rhs) {
-        return lhs->SBufUserKey() < rhs->SBufUserKey();
+        return lhs->userKey() < rhs->userKey();
     };
     std::vector<Auth::User::Pointer> v1, v2, rv, u1, u2;
     if (Auth::Config::Find("basic") != nullptr)
index 579048a42c55b820d4330449570cf8aa0109a323..8ff1af048c16c40120b456000f962f8575e4231f 100644 (file)
@@ -65,9 +65,7 @@ public:
     void username(char const *); ///< set stored username and userKey
 
     // NP: key is set at the same time as username_. Until then both are empty/NULL.
-    const char *userKey() {return !userKey_.isEmpty() ? userKey_.c_str() : NULL;}
-    // user key as a SBuf
-    const SBuf SBufUserKey() const {return userKey_;}
+    const SBuf userKey() const {return userKey_;}
 
     /**
      * How long these credentials are still valid for.
index 6ae6f05d3eb95ed00fea80d812ad5029d2ed0b03..870be26da6453f638731b07f2e98d7a1a76143d6 100644 (file)
@@ -69,8 +69,8 @@ UserNameCache::Cleanup(void *data)
 void
 UserNameCache::insert(Auth::User::Pointer anAuth_user)
 {
-    debugs(29, 6, "adding " << anAuth_user->SBufUserKey());
-    store_[anAuth_user->SBufUserKey()] = anAuth_user;
+    debugs(29, 6, "adding " << anAuth_user->userKey());
+    store_[anAuth_user->userKey()] = anAuth_user;
 }
 
 // generates the list of cached usernames in a format that is convenient
index 41876a2593303d03f22ef8ec8333ae3a720ee263..321e69907ecd4f5a6840683c8fd193a86a7d1d72 100644 (file)
@@ -247,7 +247,7 @@ Auth::Basic::Config::decode(char const *proxy_auth, const char *aRequestRealm)
     /* now lookup and see if we have a matching auth_user structure in memory. */
     Auth::User::Pointer auth_user;
 
-    if (!(auth_user = Auth::Basic::User::Cache()->lookup(lb->SBufUserKey()))) {
+    if (!(auth_user = Auth::Basic::User::Cache()->lookup(lb->userKey()))) {
         /* the user doesn't exist in the username cache yet */
         /* save the credentials */
         debugs(29, 9, HERE << "Creating new user '" << lb->username() << "'");
index eb9b736b308de73f8ed524ce1bad7b9abf5a07e8..b5d418a445d26aebb831f02ec2cd7de808276b56 100644 (file)
@@ -334,7 +334,7 @@ Auth::Negotiate::UserRequest::HandleReply(void *data, const Helper::Reply &reply
         /* connection is authenticated */
         debugs(29, 4, HERE << "authenticated user " << auth_user_request->user()->username());
         auto local_auth_user = lm_request->user();
-        auto cached_user = Auth::Negotiate::User::Cache()->lookup(auth_user_request->user()->SBufUserKey());
+        auto cached_user = Auth::Negotiate::User::Cache()->lookup(auth_user_request->user()->userKey());
         if (!cached_user) {
             local_auth_user->addToNameCache();
         } else {
index 9d9f3804350dc092b7b739a83641509bcca452c1..cc3b79eb4ecdda812f264df4ac7ec0d2c84da552 100644 (file)
@@ -329,7 +329,7 @@ Auth::Ntlm::UserRequest::HandleReply(void *data, const Helper::Reply &reply)
         debugs(29, 4, HERE << "authenticated user " << auth_user_request->user()->username());
         /* see if this is an existing user */
         auto local_auth_user = lm_request->user();
-        auto cached_user = Auth::Ntlm::User::Cache()->lookup(auth_user_request->user()->SBufUserKey());
+        auto cached_user = Auth::Ntlm::User::Cache()->lookup(auth_user_request->user()->userKey());
         if (!cached_user) {
             local_auth_user->addToNameCache();
         } else {