]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4351: compile errors when authentication modules disabled
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Oct 2015 14:28:52 +0000 (07:28 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Oct 2015 14:28:52 +0000 (07:28 -0700)
Authentication modules can be selectively disabled. This means the module
header files need to be wrapped with disable macros, and also code that
depends on module internal definitions.

17 files changed:
src/auth/Gadgets.cc
src/auth/basic/Config.h
src/auth/basic/Scheme.h
src/auth/basic/User.h
src/auth/basic/UserRequest.h
src/auth/digest/Config.h
src/auth/digest/Scheme.h
src/auth/digest/User.h
src/auth/digest/UserRequest.h
src/auth/negotiate/Config.h
src/auth/negotiate/Scheme.h
src/auth/negotiate/User.h
src/auth/negotiate/UserRequest.h
src/auth/ntlm/Config.h
src/auth/ntlm/Scheme.h
src/auth/ntlm/User.h
src/auth/ntlm/UserRequest.h

index 4c23e1602931126fd7f821e31821558fb6013210..cf9151e372c843b04ccb73f2483c7eb62da7793d 100644 (file)
@@ -112,22 +112,34 @@ authenticateCachedUsersList()
         return lhs->userKey() < rhs->userKey();
     };
     std::vector<Auth::User::Pointer> v1, v2, rv, u1, u2;
+#if HAVE_AUTH_MODULE_BASIC
     if (Auth::Config::Find("basic") != nullptr)
         u1 = Auth::Basic::User::Cache()->sortedUsersList();
+#endif
+#if HAVE_AUTH_MODULE_DIGEST
     if (Auth::Config::Find("digest") != nullptr)
         u2 = Auth::Digest::User::Cache()->sortedUsersList();
-    v1.reserve(u1.size()+u2.size());
-    std::merge(u1.begin(), u1.end(),u2.begin(), u2.end(),
-               std::back_inserter(v1), aucp_compare);
-    u1.clear();
-    u2.clear();
+#endif
+    if (u1.size() > 0 || u2.size() > 0) {
+        v1.reserve(u1.size()+u2.size());
+        std::merge(u1.begin(), u1.end(),u2.begin(), u2.end(),
+                   std::back_inserter(v1), aucp_compare);
+        u1.clear();
+        u2.clear();
+    }
+#if HAVE_AUTH_MODULE_NEGOTIATE
     if (Auth::Config::Find("negotiate") != nullptr)
         u1 = Auth::Negotiate::User::Cache()->sortedUsersList();
+#endif
+#if HAVE_AUTH_MODULE_NTLM
     if (Auth::Config::Find("ntlm") != nullptr)
         u2 = Auth::Ntlm::User::Cache()->sortedUsersList();
-    v2.reserve(u1.size()+u2.size());
-    std::merge(u1.begin(), u1.end(),u2.begin(), u2.end(),
-               std::back_inserter(v2), aucp_compare);
+#endif
+    if (u1.size() > 0 || u2.size() > 0) {
+        v2.reserve(u1.size()+u2.size());
+        std::merge(u1.begin(), u1.end(),u2.begin(), u2.end(),
+                   std::back_inserter(v2), aucp_compare);
+    }
     rv.reserve(v1.size()+v2.size());
     std::merge(v1.begin(), v1.end(),v2.begin(), v2.end(),
                std::back_inserter(rv), aucp_compare);
index 3d82ae394b3fa55ae556237fb84b85dfa156fe32..babec9fab6bda20a117fd3ebe7c658cd385aff5a 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __AUTH_BASIC_H__
 #define __AUTH_BASIC_H__
 
+#if HAVE_AUTH_MODULE_BASIC
+
 #include "auth/Config.h"
 #include "auth/Gadgets.h"
 #include "auth/UserRequest.h"
@@ -51,5 +53,6 @@ private:
 
 extern helper *basicauthenticators;
 
+#endif /* HAVE_AUTH_MODULE_BASIC */
 #endif /* __AUTH_BASIC_H__ */
 
index 8846ab2fbad888c3b74cc2da85350ff4c079ddad..3b5a406a110160bd7efb539ae6e974d4793e455d 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_AUTH_BASIC_SCHEME_H
 #define SQUID_AUTH_BASIC_SCHEME_H
 
+#if HAVE_AUTH_MODULE_BASIC
+
 #include "auth/Scheme.h"
 
 namespace Auth
@@ -41,5 +43,6 @@ private:
 } // namespace Basic
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_BASIC */
 #endif /* SQUID_AUTH_BASIC_SCHEME_H */
 
index 8d449d461772d2a1d9e8eb7e7287269239e13019..473f1d9b5acfccb91c3c2f97c77473877ee51799 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_AUTH_BASIC_USER_H
 #define _SQUID_AUTH_BASIC_USER_H
 
+#if HAVE_AUTH_MODULE_BASIC
+
 #include "auth/User.h"
 #include "auth/UserRequest.h"
 
@@ -51,5 +53,6 @@ private:
 } // namespace Basic
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_BASIC */
 #endif /* _SQUID_AUTH_BASIC_USER_H */
 
index c3b0d18f8db918defaa9d6365a2ecb9049d69414..731af71e06c64318753537605891d7e24b57f8c4 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_SRC_AUTH_BASIC_USERREQUEST_H
 #define _SQUID_SRC_AUTH_BASIC_USERREQUEST_H
 
+#if HAVE_AUTH_MODULE_BASIC
+
 #include "auth/UserRequest.h"
 
 class ConnStateData;
@@ -43,5 +45,6 @@ private:
 } // namespace Basic
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_BASIC */
 #endif /* _SQUID_SRC_AUTH_BASIC_USERREQUEST_H */
 
index f460cb434461453deb4bac72b9ec3e466c9989ce..10da5745e3e81dc1c1f4b68abeac434d5b8f2122 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __AUTH_DIGEST_H__
 #define __AUTH_DIGEST_H__
 
+#if HAVE_AUTH_MODULE_DIGEST
+
 #include "auth/Config.h"
 #include "auth/Gadgets.h"
 #include "auth/UserRequest.h"
@@ -103,5 +105,6 @@ public:
 
 extern helper *digestauthenticators;
 
+#endif /* HAVE_AUTH_MODULE_DIGEST */
 #endif
 
index 713236a3ed88eaba7681a2132cdfd1b12701577f..2753a4b5efd47ad13e6db9767726bcd2bc0226ec 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_AUTH_DIGEST_SCHEME_H
 #define SQUID_AUTH_DIGEST_SCHEME_H
 
+#if HAVE_AUTH_MODULE_DIGEST
+
 #include "auth/Scheme.h"
 
 namespace Auth
@@ -43,5 +45,6 @@ private:
 } // namespace Digest
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_DIGEST */
 #endif /* SQUID_AUTH_DIGEST_SCHEME_H */
 
index 902a8b2206bab242950833673f71f43a66edd4b7..bbe3059b83cd3e7ea7c7979dc5c2d4ca7783c773 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_AUTH_DIGEST_USER_H
 #define _SQUID_AUTH_DIGEST_USER_H
 
+#if HAVE_AUTH_MODULE_DIGEST
+
 #include "auth/digest/Config.h"
 #include "auth/User.h"
 #include "rfc2617.h"
@@ -45,5 +47,6 @@ public:
 } // namespace Digest
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_DIGEST */
 #endif /* _SQUID_AUTH_DIGEST_USER_H */
 
index 4273bbf940b0392082352c47f5d377daf07950d7..015abe85df1014320471bb3d55cbc34f45324e68 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_SRC_AUTH_DIGEST_USERREQUEST_H
 #define _SQUID_SRC_AUTH_DIGEST_USERREQUEST_H
 
+#if HAVE_AUTH_MODULE_DIGEST
+
 #include "auth/UserRequest.h"
 
 class ConnStateData;
@@ -67,5 +69,6 @@ private:
 } // namespace Digest
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_DIGEST */
 #endif /* _SQUID_SRC_AUTH_DIGEST_USERREQUEST_H */
 
index 84413f8cd8282463e35c2b208a0adba6eb7b7c95..e99d7f996111d5aacb0a58c89964c77ba1319bdd 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __AUTH_NEGOTIATE_H__
 #define __AUTH_NEGOTIATE_H__
 
+#if HAVE_AUTH_MODULE_NEGOTIATE
+
 #include "auth/Config.h"
 #include "auth/Gadgets.h"
 #include "auth/UserRequest.h"
@@ -45,5 +47,6 @@ public:
 
 extern statefulhelper *negotiateauthenticators;
 
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE */
 #endif
 
index 4364e778040a72e9a2a6be1bf8f44620d34a1ec3..8d2fd6f6a6cf64f4d2c5243714fdfa242b1147b8 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_AUTH_NEGOTIATE_SCHEME_H
 #define SQUID_AUTH_NEGOTIATE_SCHEME_H
 
+#if HAVE_AUTH_MODULE_NEGOTIATE
+
 #include "auth/Scheme.h"
 
 namespace Auth
@@ -42,5 +44,6 @@ private:
 } // namespace Negotiate
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE */
 #endif /* SQUID_AUTH_NEGOTIATE_SCHEME_H */
 
index 5c5ecfeaf6e312c163ac2acfcc8386f0cac17d4d..f75e64872d88d1c9ef549d820265b5ab69c92163 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_AUTH_NEGOTIATE_USER_H
 #define _SQUID_AUTH_NEGOTIATE_USER_H
 
+#if HAVE_AUTH_MODULE_NEGOTIATE
+
 #include "auth/User.h"
 
 namespace Auth
@@ -39,5 +41,6 @@ public:
 } // namespace Negotiate
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE */
 #endif /* _SQUID_AUTH_NEGOTIATE_USER_H */
 
index 8d3e267a9f7915962488de51a7bf727fdb3bfe13..18d7a42e07844070e89665bc1d7e60f7ff3298ff 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H
 #define _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H
 
+#if HAVE_AUTH_MODULE_NEGOTIATE
+
 #include "auth/UserRequest.h"
 #include "helper/forward.h"
 
@@ -62,5 +64,6 @@ private:
 } // namespace Negotiate
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NEGOTIATE */
 #endif /* _SQUID_SRC_AUTH_NEGOTIATE_USERREQUEST_H */
 
index 98065cc06ed98031e3991e523f7fe6ce1e7275dc..0c904b092721aa25df10ce5c5a0edca02990bdf0 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef __AUTH_NTLM_H__
 #define __AUTH_NTLM_H__
 
+#if HAVE_AUTH_MODULE_NTLM
+
 #include "auth/Config.h"
 #include "auth/Gadgets.h"
 #include "auth/UserRequest.h"
@@ -48,5 +50,6 @@ public:
 
 extern statefulhelper *ntlmauthenticators;
 
+#endif /* HAVE_AUTH_MODULE_NTLM */
 #endif
 
index ef22499633a949489964abafac55c281103088dd..4cb022814deffb41d9bb4cdc1e83a8968fa8f422 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef SQUID_AUTH_NTLM_SCHEME_H
 #define SQUID_AUTH_NTLM_SCHEME_H
 
+#if HAVE_AUTH_MODULE_NTLM
+
 #include "auth/Scheme.h"
 
 namespace Auth
@@ -46,5 +48,6 @@ private:
 } // namespace Ntlm
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NTLM */
 #endif /* SQUID_AUTH_NTLM_SCHEME_H */
 
index 9c6fdbaa1d2f1c0d9078fca4f29db9f92d0984fc..a4bac5d5bf770b11c491a9201f9f0d4834f59171 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_AUTH_NTLM_USER_H
 #define _SQUID_AUTH_NTLM_USER_H
 
+#if HAVE_AUTH_MODULE_NTLM
+
 #include "auth/User.h"
 
 namespace Auth
@@ -39,5 +41,6 @@ public:
 } // namespace Ntlm
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NTLM */
 #endif /* _SQUID_AUTH_NTLM_USER_H */
 
index e9252f3083d463067240a48f398d37b4c56873ff..4f5899a2cc8ed6431926dbf6b4483ccd60a97ec0 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _SQUID_SRC_AUTH_NTLM_USERREQUEST_H
 #define _SQUID_SRC_AUTH_NTLM_USERREQUEST_H
 
+#if HAVE_AUTH_MODULE_NTLM
+
 #include "auth/UserRequest.h"
 #include "helper/forward.h"
 
@@ -59,5 +61,6 @@ private:
 } // namespace Ntlm
 } // namespace Auth
 
+#endif /* HAVE_AUTH_MODULE_NTLM */
 #endif /* _SQUID_SRC_AUTH_NTLM_USERREQUEST_H */