Thanks to Alex Rousskov for identifying the necessary environment setting.
#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)
{
* 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:
}
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) {
/* 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;
}
# 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}"
#
# 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:
--without-dns-cname \
--without-po2html \
"
+
+# Fix the distclean testing.
+export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
#
# 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:
#
#
OPTS=" \
- --enable-loadable-modules \
+ --disable-loadable-modules \
--enable-gnuregex \
--enable-optimizations \
--enable-inline \
--with-pthreads \
--with-valgrind-debug \
"
+
+# Fix the distclean testing.
+export DISTCHECK_CONFIGURE_FLAGS="${OPTS}"
+
+