]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 113596
authorAndrew G. Morgan <morgan@kernel.org>
Tue, 5 Sep 2000 04:55:04 +0000 (04:55 +0000)
committerAndrew G. Morgan <morgan@kernel.org>
Tue, 5 Sep 2000 04:55:04 +0000 (04:55 +0000)
Purpose of commit: bugfix

Commit summary:
---------------
The "likeauth" module argument did not work for pam_pwdb and
pam_unix. This commit fixes it.

CHANGELOG
modules/pam_pwdb/pam_pwdb.c
modules/pam_unix/pam_unix_auth.c

index 6416142030ce9f0a26acc771b3c624cafef6ee4f..3139013bb6bcc233408385e9259d6fb5e81ecc3e 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -35,6 +35,7 @@ Where you should replace XXXXX with a bug-id.
 0.73: please submit patches for this section with actual code/doc
       patches!
 
+* "likeauth" fix for pam_unix and pam_pwdb which (Bug 113596 - agmorgan)
 * fix for pam_unix (support.c) to avoid segfault with NULL password
   (Bug 113238 - vorlon)
 * fix to pam_unix_passwd: try repeatedly to get a lock on the password
index 68ca68fd07f30590c82896add43b0c59ac2bc441..4d335572b5748a1deb6a1c142bba5187752f0b82 100644 (file)
@@ -83,7 +83,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags
 
     if ( on(UNIX_LIKE_AUTH, ctrl) ) {
        D(("recording return code for next time [%d]", retval));
-       pam_set_data(pamh, "pwdb_setcred_return", (void *) &retval, NULL);
+       pam_set_data(pamh, "pwdb_setcred_return", (void *) retval, NULL);
     }
 
     D(("done. [%s]", pam_strerror(pamh, retval)));
@@ -108,8 +108,7 @@ PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags
        int *pretval = &retval;
 
        D(("recovering return code from auth call"));
-       pam_get_data(pamh, "pwdb_setcred_return", (const void **) &pretval);
-       pam_set_data(pamh, "pwdb_setcred_return", NULL, NULL);
+       pam_get_data(pamh, "pwdb_setcred_return", (const void **) pretval);
        D(("recovered data indicates that old retval was %d", retval));
     }
 
index a16118d683c2845c044bd6a16ed2b4f5fb584bdc..7c639d886bc72a2a521a4b6543b3c9e4d009d688 100644 (file)
@@ -88,9 +88,8 @@
        if (on(UNIX_LIKE_AUTH, ctrl) && ret_data) {             \
                D(("recording return code for next time [%d]",  \
                                        retval));               \
-               *ret_data = retval;                             \
                pam_set_data(pamh, "unix_setcred_return",       \
-                               (void *) ret_data, NULL);       \
+                               (void *) retval, NULL);         \
        }                                                       \
        D(("done. [%s]", pam_strerror(pamh, retval)));          \
        return retval;                                          \
@@ -205,8 +204,7 @@ PAM_EXTERN int pam_sm_setcred(pam_handle_t * pamh, int flags
                int *pretval = NULL;
 
                D(("recovering return code from auth call"));
-               pam_get_data(pamh, "unix_setcred_return", (const void **) &pretval);
-               pam_set_data(pamh, "unix_setcred_return", NULL, NULL);
+               pam_get_data(pamh, "unix_setcred_return", (const void **) pretval);
                if(pretval) {
                        retval = *pretval;
                        free(pretval);