summaryrefslogtreecommitdiff
path: root/libpam/pam_handlers.c
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2001-10-11 04:52:25 +0000
committerAndrew G. Morgan <morgan@kernel.org>2001-10-11 04:52:25 +0000
commit64ab317e86dc8e798b4f4ed603227206c0fc001b (patch)
tree724590bf0513412074404694ffcfb0f4c8432999 /libpam/pam_handlers.c
parent345044121bc4e8977a22d6235d31df4b2114a240 (diff)
Relevant BUGIDs: 468724
Purpose of commit: bugfix Commit summary: --------------- Legacy behavior for pam_close_session and pam_setcred was not sufficient. Basically, it appears to be common practice for some applications to call these functions without first calling pam_authenticate and pam_open_session which would have frozen the auth and session module stacks. The new behavior is to treat the returns of these secondary functions as authoritative when navigating the stack in the absence of a chain-freezing first set of calls. pam_chauthtok should not benefit from this behavior, and there does not appear to be a justification for using an event like this to freeze the stack outright - legacy behavior did not do that.
Diffstat (limited to 'libpam/pam_handlers.c')
-rw-r--r--libpam/pam_handlers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpam/pam_handlers.c b/libpam/pam_handlers.c
index 8e32f8e8..d007ed98 100644
--- a/libpam/pam_handlers.c
+++ b/libpam/pam_handlers.c
@@ -751,7 +751,7 @@ int _pam_add_handler(pam_handle_t *pamh
(*handler_p)->must_fail = must_fail; /* failure forced? */
(*handler_p)->func = func;
memcpy((*handler_p)->actions,actions,sizeof((*handler_p)->actions));
- (*handler_p)->cached_retval = -1; /* error */
+ (*handler_p)->cached_retval = _PAM_INVALID_RETVAL;
(*handler_p)->cached_retval_p = &((*handler_p)->cached_retval);
(*handler_p)->argc = argc;
(*handler_p)->argv = argv; /* not a copy */
@@ -772,7 +772,7 @@ int _pam_add_handler(pam_handle_t *pamh
(*handler_p2)->must_fail = must_fail; /* failure forced? */
(*handler_p2)->func = func2;
memcpy((*handler_p2)->actions,actions,sizeof((*handler_p2)->actions));
- (*handler_p2)->cached_retval = -1; /* ignored */
+ (*handler_p2)->cached_retval = _PAM_INVALID_RETVAL; /* ignored */
/* Note, this next entry points to the handler_p value! */
(*handler_p2)->cached_retval_p = &((*handler_p)->cached_retval);
(*handler_p2)->argc = argc;