]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
TestBed: Truely make distcheck work for all configure levels
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jul 2009 11:30:50 +0000 (23:30 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jul 2009 11:30:50 +0000 (23:30 +1200)
Thanks to Alex Rousskov for identifying the necessary environment setting.

src/auth/Acl.cc
src/auth/UserRequest.cc
test-suite/buildtests/layer-00-default.opts
test-suite/buildtests/layer-01-minimal.opts
test-suite/buildtests/layer-02-maximus.opts

index dddea7d0d4868363a03acef56623206bc58a7dd6..affaffafae82a97474bf075b7e40f9eced84bae9 100644 (file)
@@ -6,9 +6,11 @@
 #include "auth/AclProxyAuth.h"
 #include "HttpRequest.h"
 
-/** retval -1 user not authenticated (authentication error?)
-    retval  0 user not authorized OR user authentication is in pgrogress
-    retval +1 user authenticated and authorized */
+/**
+ * \retval -1 user not authenticated (authentication error?)
+ * \retval  0 user not authorized OR user authentication is in progress
+ * \retval +1 user authenticated and authorized
+ */
 int
 AuthenticateAcl(ACLChecklist *ch)
 {
@@ -38,19 +40,16 @@ AuthenticateAcl(ACLChecklist *ch)
      * unlock auth_user_request on our behalf, but it was too
      * ugly and hard to follow.  Now we do our own locking here.
      *
-     * I'm not sure what tryToAuthenticateAndSetAuthUser does when
-     * auth_user_request is set before calling.  I'm tempted to
-     * unlock and set it to NULL, but it seems safer to save the
-     * pointer before calling and unlock it afterwards.  If the
-     * pointer doesn't change then its a no-op.
+     * AYJ 2009-07-15:
+     * tryToAuthenticateAndSetAuthUser now only produces the auth_user_request object
+     * for use here. Will try to authenticate if missing. And fix-up request pointer if unset.
      */
-    AuthUserRequest *old_auth_user_request = checklist->auth_user_request;
     const auth_acl_t result = AuthUserRequest::tryToAuthenticateAndSetAuthUser(
                                   &checklist->auth_user_request, headertype, request,
                                   checklist->conn(), checklist->src_addr);
     if (checklist->auth_user_request)
         AUTHUSERREQUESTLOCK(checklist->auth_user_request, "ACLAuth::authenticated");
-    AUTHUSERREQUESTUNLOCK(old_auth_user_request, "old ACLAuth");
+
     switch (result) {
 
     case AUTH_ACL_CANNOT_AUTHENTICATE:
index 285e19c70677b6be02800319b4a806f43a3a40fe..6aa57f2e0165c82841915cef769a085a87c49783 100644 (file)
@@ -502,11 +502,10 @@ AuthUserRequest::authenticate(AuthUserRequest ** auth_user_request, http_hdr_typ
 }
 
 auth_acl_t
-
 AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_request, http_hdr_type headertype, HttpRequest * request, ConnStateData * conn, IpAddress &src_addr)
 {
     /* If we have already been called, return the cached value */
-    AuthUserRequest *t = authTryGetUser (auth_user_request, conn, request);
+    AuthUserRequest *t = authTryGetUser(auth_user_request, conn, request);
 
     if (t && t->lastReply != AUTH_ACL_CANNOT_AUTHENTICATE
             && t->lastReply != AUTH_ACL_HELPER) {
@@ -523,11 +522,14 @@ AuthUserRequest::tryToAuthenticateAndSetAuthUser(AuthUserRequest ** auth_user_re
     /* ok, call the actual authenticator routine. */
     auth_acl_t result = authenticate(auth_user_request, headertype, request, conn, src_addr);
 
-    t = authTryGetUser (auth_user_request, conn, request);
+    t = authTryGetUser(auth_user_request, conn, request);
 
     if (t && result != AUTH_ACL_CANNOT_AUTHENTICATE &&
-            result != AUTH_ACL_HELPER)
+            result != AUTH_ACL_HELPER) {
         t->lastReply = result;
+        if (!*auth_user_request)
+            *auth_user_request = t;
+    }
 
     return result;
 }
index 74779fcfc795e705cbeaec57d5f222339fe54709..fa83cf001a428b78f930114b027d996b9af31db9 100644 (file)
@@ -6,4 +6,7 @@ MAKETEST="distcheck"
 # Default configuration options.
 #  - Nothing special configured. Just whatever is found by "./configure"
 #
-OPTS=""
+OPTS="--disable-loadable-modules"
+
+# Fix the distclean testing.
+export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
index 10756db62b7bca97e5cf8531861b2e3491853dfd..07ab7b0b1c95590aac6054331ff6a26770974111 100644 (file)
@@ -6,7 +6,7 @@
 #
 # Check - everything MUST work at this level
 # distcheck is not possible here since it drops our configure options...
-MAKETEST="check"
+MAKETEST="distcheck"
 #
 #
 # The options for this level can be easily generated semi-automatically from configure.in by:
@@ -97,3 +97,6 @@ OPTS=" \
        --without-dns-cname \
        --without-po2html \
        "
+
+# Fix the distclean testing.
+export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
index ba8a9b580f279722b524eef1d01452e5131e43e6..e85113e0bd0750ec8a055a31f3e12dd4a8f81292 100644 (file)
@@ -6,7 +6,7 @@
 #
 # Complete Check - everything is supposed to work at this level
 # distcheck is not possible since it drops our configure options...
-MAKETEST="check"
+MAKETEST="distcheck"
 #
 #
 # The options for this level can be easily generated semi-automatically from configure.in by:
@@ -41,7 +41,7 @@ MAKETEST="check"
 #
 #
 OPTS=" \
-       --enable-loadable-modules \
+       --disable-loadable-modules \
        --enable-gnuregex \
        --enable-optimizations \
        --enable-inline \
@@ -108,3 +108,8 @@ OPTS=" \
        --with-pthreads \
        --with-valgrind-debug \
        "
+
+# Fix the distclean testing.
+export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+
+