diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-05-25 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-05-25 08:00:00 +0000 |
commit | 6eaaa1b1207c17ce06e97167373e5f9c063b5cae (patch) | |
tree | 223bb6cce8dacb919e5cf3196c5c2a0c8c7ff98b /modules/pam_debug | |
parent | 4098939fb3f523a94a14ee2b9bc48ea43b29a45e (diff) | |
download | pam-6eaaa1b1207c17ce06e97167373e5f9c063b5cae.tar.gz pam-6eaaa1b1207c17ce06e97167373e5f9c063b5cae.tar.bz2 pam-6eaaa1b1207c17ce06e97167373e5f9c063b5cae.zip |
pam_debug: do not invoke pam_get_user and do not set PAM_USER
pam_debug used to invoke pam_get_user and set PAM_USER to "nobody" when
pam_get_user returns an empty string as the user name. When either of
these functions returned an error value, it used to return that error
value. This hasn't been documented, and I couldn't find any rationale
for this behaviour.
* modules/pam_debug/pam_debug.c (pam_sm_authenticate): Do not invoke
pam_get_user and pam_set_item.
Diffstat (limited to 'modules/pam_debug')
-rw-r--r-- | modules/pam_debug/pam_debug.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/modules/pam_debug/pam_debug.c b/modules/pam_debug/pam_debug.c index 61b39d75..414806b2 100644 --- a/modules/pam_debug/pam_debug.c +++ b/modules/pam_debug/pam_debug.c @@ -62,28 +62,7 @@ static int parse_args(int retval, const char *event, int pam_sm_authenticate(pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { - int retval; - const char *user=NULL; - - /* - * authentication requires we know who the user wants to be - */ - retval = pam_get_user(pamh, &user, NULL); - if (retval != PAM_SUCCESS) { - D(("get user returned error: %s", pam_strerror(pamh,retval))); - return retval; - } - if (*user == '\0') { - D(("username not known")); - retval = pam_set_item(pamh, PAM_USER, (const void *) DEFAULT_USER); - if (retval != PAM_SUCCESS) - return retval; - } - user = NULL; /* clean up */ - - retval = parse_args(PAM_SUCCESS, "auth", pamh, argc, argv); - - return retval; + return parse_args(PAM_SUCCESS, "auth", pamh, argc, argv); } int pam_sm_setcred(pam_handle_t *pamh, int flags UNUSED, |