diff options
author | Steve Langasek <vorlon@debian.org> | 2008-07-28 20:51:56 +0000 |
---|---|---|
committer | Steve Langasek <vorlon@debian.org> | 2008-07-28 20:51:56 +0000 |
commit | b4a78564bec722ef5b17dbba4b2830b2c8d2085b (patch) | |
tree | cf22a65dbb995f5dc623154723fde97a1fdc1f8c /modules/pam_unix/passverify.c | |
parent | d8f48f659521b4f2b6403f9b9dc2a8eed1f8d399 (diff) | |
download | pam-b4a78564bec722ef5b17dbba4b2830b2c8d2085b.tar.gz pam-b4a78564bec722ef5b17dbba4b2830b2c8d2085b.tar.bz2 pam-b4a78564bec722ef5b17dbba4b2830b2c8d2085b.zip |
Relevant BUGIDs:
Purpose of commit: bugfix (thread safety)
Commit summary:
---------------
2008-07-28 Steve Langasek <vorlon@debian.org>
* modules/pam_unix/passverify.c: make save_old_password()
thread-safe by using pam_modutil_getpwnam() instead of getpwnam()
* modules/pam_unix/passverify.c, modules/pam_unix/passverify.h,
modules/pam_unix/pam_unix_passwd.c: add pamh argument to
save_old_password()
Diffstat (limited to 'modules/pam_unix/passverify.c')
-rw-r--r-- | modules/pam_unix/passverify.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/pam_unix/passverify.c b/modules/pam_unix/passverify.c index ce5bc450..0f58b019 100644 --- a/modules/pam_unix/passverify.c +++ b/modules/pam_unix/passverify.c @@ -535,9 +535,15 @@ unlock_pwdf(void) } #endif +#ifdef HELPER_COMPILE int save_old_password(const char *forwho, const char *oldpass, int howmany) +#else +int +save_old_password(pam_handle_t *pamh, const char *forwho, const char *oldpass, + int howmany) +#endif { static char buf[16384]; static char nbuf[16384]; @@ -653,7 +659,7 @@ save_old_password(const char *forwho, const char *oldpass, fclose(opwfile); if (!found) { - pwd = getpwnam(forwho); + pwd = pam_modutil_getpwnam(pamh, forwho); if (pwd == NULL) { err = 1; } else { |