From: hno <> Date: Thu, 6 Nov 2003 01:14:25 +0000 (+0000) Subject: Don't code when you are tired.. if persistent PAM Connections are enabled X-Git-Tag: SQUID_3_0_PRE4~1168 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ebcec867be3574353179252760b83eaad14b049;p=thirdparty%2Fsquid.git Don't code when you are tired.. if persistent PAM Connections are enabled then we want to keep the connection even if authenticaiton was unsuccessful. --- diff --git a/helpers/basic_auth/PAM/pam_auth.c b/helpers/basic_auth/PAM/pam_auth.c index df7e67ae5b..68963c9362 100644 --- a/helpers/basic_auth/PAM/pam_auth.c +++ b/helpers/basic_auth/PAM/pam_auth.c @@ -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 @@ -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 } }