]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Don't code when you are tired.. if persistent PAM Connections are enabled
authorhno <>
Thu, 6 Nov 2003 01:14:25 +0000 (01:14 +0000)
committerhno <>
Thu, 6 Nov 2003 01:14:25 +0000 (01:14 +0000)
then we want to keep the connection even if authenticaiton was unsuccessful.

helpers/basic_auth/PAM/pam_auth.c

index df7e67ae5ba741d4971fdaf95c55882a83568e2e..68963c9362486616cbef30ec83c5b1d246e48a51 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: pam_auth.c,v 1.14 2003/11/05 18:06:34 hno Exp $
+ * $Id: pam_auth.c,v 1.15 2003/11/05 18:14:25 hno Exp $
  *
  * PAM authenticator module for Squid.
  * Copyright (C) 1999,2002,2003 Henrik Nordstrom <hno@squid-cache.org>
@@ -249,17 +249,19 @@ error:
            fprintf(stdout, "ERR\n");
        }
        /* cleanup */
+       retval = PAM_SUCCESS;
+#ifdef PAM_AUTHTOK
+       if (ttl != 0) {
+           if (retval == PAM_SUCCESS)
+               retval = pam_set_item(pamh, PAM_AUTHTOK, NULL);
+       }
+#endif
        if (ttl == 0 || retval != PAM_SUCCESS) {
            retval = pam_end(pamh, retval);
            if (retval != PAM_SUCCESS) {
                fprintf(stderr, "WARNING: failed to release PAM authenticator\n");
            }
            pamh = NULL;
-#ifdef PAM_AUTHTOK
-       } else if (ttl != 0) {
-           if (retval == PAM_SUCCESS)
-               retval = pam_set_item(pamh, PAM_AUTHTOK, NULL);
-#endif
        }
     }