aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2024-01-15 20:05:28 +0100
committerDmitry V. Levin <ldv@strace.io>2024-01-15 20:01:23 +0000
commite3309f060a67805e679fee55b1101b91991ea824 (patch)
tree45513599de4e02e3b34db460fa7c2f000df727ef /modules
parent94386184f67fd0870fa56eef2a2d473943c03eb1 (diff)
downloadpam-e3309f060a67805e679fee55b1101b91991ea824.tar.gz
pam-e3309f060a67805e679fee55b1101b91991ea824.tar.bz2
pam-e3309f060a67805e679fee55b1101b91991ea824.zip
pam_unix: fix regressions
The returned value stored in pwd from _unix_getpwnam is inserted into pam handler through pam_set_data. Do not manually free the value. Also check getline return value for != -1 instead of == -1. Fixes 8f2ca5919b26843ef774ef0aeb9bf261dec943a0 and 73d009e9ea8edafc18c7fe3650b25dd6bdce88c1. No release affected. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_unix/pam_unix_passwd.c1
-rw-r--r--modules/pam_unix/passverify.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c
index 7c141c3b..fe3f566a 100644
--- a/modules/pam_unix/pam_unix_passwd.c
+++ b/modules/pam_unix/pam_unix_passwd.c
@@ -660,7 +660,6 @@ pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv)
user);
return PAM_USER_UNKNOWN;
}
- _pam_drop(pwd);
/*
* This is not an AUTH module!
diff --git a/modules/pam_unix/passverify.c b/modules/pam_unix/passverify.c
index 045ea785..60d9ceca 100644
--- a/modules/pam_unix/passverify.c
+++ b/modules/pam_unix/passverify.c
@@ -729,7 +729,7 @@ save_old_password(pam_handle_t *pamh, const char *forwho, const char *oldpass,
goto done;
}
- while (getline(&buf, &bufsize, opwfile) == -1) {
+ while (getline(&buf, &bufsize, opwfile) != -1) {
if (!strncmp(buf, forwho, len) && strchr(":,\n", buf[len]) != NULL) {
char *ep, *sptr = NULL;
long value;