Call pam_end with proper return value, to let the pam libraries
authoraland <aland>
Fri, 5 Dec 2003 15:38:14 +0000 (15:38 +0000)
committeraland <aland>
Fri, 5 Dec 2003 15:38:14 +0000 (15:38 +0000)
clean up after themselves..

Patch from max liccardo

src/modules/rlm_pam/rlm_pam.c

index e5ff6b9..12532d6 100644 (file)
@@ -204,7 +204,7 @@ static int pam_pass(const char *name, const char *passwd, const char *pamauth)
     if (retval != PAM_SUCCESS) {
       DEBUG("pam_pass: function pam_authenticate FAILED for <%s>. Reason: %s",
            name, pam_strerror(pamh, retval));
-      pam_end(pamh, 0);
+      pam_end(pamh, retval);
       return -1;
     }
 
@@ -217,13 +217,13 @@ static int pam_pass(const char *name, const char *passwd, const char *pamauth)
     if (retval != PAM_SUCCESS) {
       DEBUG("pam_pass: function pam_acct_mgmt FAILED for <%s>. Reason: %s",
            name, pam_strerror(pamh, retval));
-      pam_end(pamh, 0);
+      pam_end(pamh, retval);
       return -1;
     }
 #endif
 
     DEBUG("pam_pass: authentication succeeded for <%s>", name);
-    pam_end(pamh, 0);
+    pam_end(pamh, retval);
     return 0;
 }