diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2022-04-25 11:33:27 -0700 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2022-04-25 11:33:27 -0700 |
commit | ed8beed9a35b961f2fe31d47b3730e29b5e22466 (patch) | |
tree | ee479bd56a4aa29f78196b3183a05ae650a52fb6 /patches-applied/026_pam_unix_passwd_unknown_user | |
download | pam-ed8beed9a35b961f2fe31d47b3730e29b5e22466.tar.gz pam-ed8beed9a35b961f2fe31d47b3730e29b5e22466.tar.bz2 pam-ed8beed9a35b961f2fe31d47b3730e29b5e22466.zip |
Import pam_1.4.0-12.debian.tar.xz
[dgit import tarball pam 1.4.0-12 pam_1.4.0-12.debian.tar.xz]
Diffstat (limited to 'patches-applied/026_pam_unix_passwd_unknown_user')
-rw-r--r-- | patches-applied/026_pam_unix_passwd_unknown_user | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/patches-applied/026_pam_unix_passwd_unknown_user b/patches-applied/026_pam_unix_passwd_unknown_user new file mode 100644 index 00000000..99ac3f62 --- /dev/null +++ b/patches-applied/026_pam_unix_passwd_unknown_user @@ -0,0 +1,33 @@ +Description: distinguish between password manipulation failure and missing user. +Author: Martin Schwenke <martin@meltin.net> + +Index: pam/modules/pam_unix/passverify.c +=================================================================== +--- pam.orig/modules/pam_unix/passverify.c ++++ pam/modules/pam_unix/passverify.c +@@ -749,7 +749,7 @@ + struct passwd *tmpent = NULL; + struct stat st; + FILE *pwfile, *opwfile; +- int err = 1; ++ int err = 1, found = 0; + int oldmask; + #ifdef WITH_SELINUX + security_context_t prev_context=NULL; +@@ -820,6 +820,7 @@ + + tmpent->pw_passwd = assigned_passwd.charp; + err = 0; ++ found = 1; + } + if (putpwent(tmpent, pwfile)) { + D(("error writing entry to password file: %m")); +@@ -862,7 +863,7 @@ + return PAM_SUCCESS; + } else { + unlink(PW_TMPFILE); +- return PAM_AUTHTOK_ERR; ++ return found ? PAM_AUTHTOK_ERR : PAM_USER_UNKNOWN; + } + } + |