]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2330: AuthUser objects are never unlocked
authorFrank Schmirler <squid@schmirler.de>
Mon, 28 Mar 2011 11:31:28 +0000 (05:31 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 28 Mar 2011 11:31:28 +0000 (05:31 -0600)
This is a partial port of the Buug 2305 auth fixes.
These changes involve combining the auth operation state links to
credentials data such that the shared code can lock/unlock them properly.

src/auth/basic/auth_basic.cc
src/auth/basic/auth_basic.h
src/auth/digest/auth_digest.cc
src/auth/digest/auth_digest.h
src/auth/negotiate/auth_negotiate.cc
src/auth/negotiate/auth_negotiate.h
src/auth/ntlm/auth_ntlm.cc
src/auth/ntlm/auth_ntlm.h

index bc67847427cb48f481a57f0b9e58d53be34e5382..3c64eeff26fb69733c4e0ca56095c2628db9d4cc 100644 (file)
@@ -122,7 +122,7 @@ AuthBasicConfig::type() const
     return basicScheme::GetInstance().type();
 }
 
-AuthBasicUserRequest::AuthBasicUserRequest() : _theUser(NULL)
+AuthBasicUserRequest::AuthBasicUserRequest()
 {}
 
 AuthBasicUserRequest::~AuthBasicUserRequest()
index 26001b57a66d95f5c124497e05966a6c1bcc6c3f..ceea91d1db099634697130fe10633c8d45d4f59f 100644 (file)
@@ -95,14 +95,6 @@ public:
     virtual void authenticate(HttpRequest * request, ConnStateData *conn, http_hdr_type type);
     virtual int module_direction();
     virtual void module_start(RH *, void *);
-    virtual AuthUser *user() {return _theUser;}
-
-    virtual const AuthUser *user() const {return _theUser;}
-
-    virtual void user (AuthUser *aUser) {_theUser=dynamic_cast<BasicUser *>(aUser);}
-
-private:
-    BasicUser *_theUser;
 };
 
 MEMPROXY_CLASS_INLINE(AuthBasicUserRequest);
index 16a3fec297b3718adaff6a9f57ba3134f6f59778..f619160ddc5d49f5db283dff8962a855f58861c5 100644 (file)
@@ -1446,7 +1446,7 @@ AuthDigestUserRequest::credentials(CredentialsState newCreds)
 AuthDigestUserRequest::AuthDigestUserRequest() : nonceb64(NULL) ,cnonce(NULL) ,realm(NULL),
         pszPass(NULL) ,algorithm(NULL) ,pszMethod(NULL),
         qop(NULL) ,uri(NULL) ,response(NULL),
-        nonce(NULL), _theUser (NULL) ,
+        nonce(NULL),
         credentials_ok (Unchecked)
 {}
 
index 1002e5b7b32b82c50035ef9a73485e442c4cc520..897bf0501555dab6107813d367a899a999cd6d54 100644 (file)
@@ -70,11 +70,6 @@ public:
 #endif
 
     virtual void module_start(RH *, void *);
-    virtual AuthUser *user() {return _theUser;}
-
-    virtual const AuthUser *user() const {return _theUser;}
-
-    virtual void user(AuthUser *aUser) {_theUser=dynamic_cast<DigestUser *>(aUser);}
 
     CredentialsState credentials() const;
     void credentials(CredentialsState);
@@ -100,7 +95,6 @@ public:
     digest_nonce_h *nonce;
 
 private:
-    DigestUser *_theUser;
     CredentialsState credentials_ok;
 };
 
index c9a71cec58a6a961576cc48f66ee53e81d525bf1..de0ff19a95dbc8f9bfd1a82951d0a9a7d13a5cec 100644 (file)
@@ -758,8 +758,7 @@ AuthNegotiateUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * c
 }
 
 AuthNegotiateUserRequest::AuthNegotiateUserRequest() :
-        /*conn(NULL),*/ auth_state(AUTHENTICATE_STATE_NONE),
-        _theUser(NULL)
+        /*conn(NULL),*/ auth_state(AUTHENTICATE_STATE_NONE)
 {
     waiting=0;
     client_blob=0;
index e28f518e521af314c1c29ad81df90dcf9b0e162f..b08b79f45db5e5e1c2914de27f92141a5962971e 100644 (file)
@@ -72,14 +72,9 @@ public:
     virtual int module_direction();
     virtual void onConnectionClose(ConnStateData *);
     virtual void module_start(RH *, void *);
-    virtual AuthUser *user() {return _theUser;}
-
-    virtual const AuthUser *user() const {return _theUser;}
 
     virtual void addHeader(HttpReply * rep, int accel);
 
-    virtual void user (AuthUser *aUser) {_theUser=dynamic_cast<NegotiateUser *>(aUser);}
-
     virtual const char * connLastHeader();
 
     /*we need to store the helper server between requests */
@@ -102,10 +97,6 @@ public:
 
     /* need access to the request flags to mess around on pconn failure */
     HttpRequest *request;
-
-private:
-    /* the user */
-    NegotiateUser * _theUser;
 };
 
 MEMPROXY_CLASS_INLINE(AuthNegotiateUserRequest);
index 42b16d019b257d656aa95dcfeeb5d50a0ba6e058..4afd447faab4431c4fa2d1d4d5818628b4b28b69 100644 (file)
@@ -676,8 +676,7 @@ AuthNTLMUserRequest::authenticate(HttpRequest * aRequest, ConnStateData * conn,
 }
 
 AuthNTLMUserRequest::AuthNTLMUserRequest() :
-        /*conn(NULL),*/ auth_state(AUTHENTICATE_STATE_NONE),
-        _theUser(NULL)
+        /*conn(NULL),*/ auth_state(AUTHENTICATE_STATE_NONE)
 {
     waiting=0;
     client_blob=0;
index e26cba601809b872cf205a8f912173fb3cc87f78..0b2426a06f1bf7567087eb8b6076e2bda3bb46e2 100644 (file)
@@ -60,11 +60,6 @@ public:
     virtual int module_direction();
     virtual void onConnectionClose(ConnStateData *);
     virtual void module_start(RH *, void *);
-    virtual AuthUser *user() {return _theUser;}
-
-    virtual const AuthUser *user() const {return _theUser;}
-
-    virtual void user (AuthUser *aUser) {_theUser=dynamic_cast<NTLMUser *>(aUser);}
 
     virtual const char * connLastHeader();
 
@@ -88,10 +83,6 @@ public:
 
     /* need access to the request flags to mess around on pconn failure */
     HttpRequest *request;
-
-private:
-    /* the user */
-    NTLMUser * _theUser;
 };
 
 MEMPROXY_CLASS_INLINE(AuthNTLMUserRequest);