Skip to content

Commit

Permalink
pam: use PAM_REINITIALIZE_CRED
Browse files Browse the repository at this point in the history
Both work fine, PAM_REINITIALIZE_CRED is the more correct
choice and is required on Solaris, see sudo bug #642;

https://bugzilla.sudo.ws/show_bug.cgi?id=642
  • Loading branch information
Duncaen committed Nov 14, 2020
1 parent b3e966b commit a1ab056
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pam.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ pamauth(const char *user, const char *myname, int interactive, int nopass, int p
warn("pam_set_item(?, PAM_USER, \"%s\"): %s", user,
pam_strerror(pamh, ret));

ret = pam_setcred(pamh, PAM_ESTABLISH_CRED);
ret = pam_setcred(pamh, PAM_REINITIALIZE_CRED);
if (ret != PAM_SUCCESS)
warn("pam_setcred(?, PAM_ESTABLISH_CRED): %s", pam_strerror(pamh, ret));
warn("pam_setcred(?, PAM_REINITIALIZE_CRED): %s", pam_strerror(pamh, ret));
else
cred = 1;

Expand Down

0 comments on commit a1ab056

Please sign in to comment.