summaryrefslogtreecommitdiff
path: root/libpam/pam_dispatch.c
diff options
context:
space:
mode:
authorTomas Mraz <tm@t8m.info>2005-01-07 15:31:26 +0000
committerTomas Mraz <tm@t8m.info>2005-01-07 15:31:26 +0000
commit8371672714bbe3a7c171143a657083271cad7c71 (patch)
tree926b7b38b7c0ce98dcfe15c58296cf7fe15f774c /libpam/pam_dispatch.c
parentc75c3ff9f2c3d221aabe89b8d0779f041e71e30c (diff)
Relevant BUGIDs: 629251, Red Hat bz 143750
Purpose of commit: bugfix Commit summary: --------------- libpam: don't return PAM_IGNORE if the impression is positive and using cached chain pam_nologin: don't overwrite return value with return from pam_get_item
Diffstat (limited to 'libpam/pam_dispatch.c')
-rw-r--r--libpam/pam_dispatch.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libpam/pam_dispatch.c b/libpam/pam_dispatch.c
index c6fcd5f8..1daf0c9f 100644
--- a/libpam/pam_dispatch.c
+++ b/libpam/pam_dispatch.c
@@ -184,8 +184,12 @@ static int _pam_dispatch_aux(pam_handle_t *pamh, int flags, struct handler *h,
if ( impression == _PAM_UNDEF
|| (impression == _PAM_POSITIVE && status == PAM_SUCCESS) ) {
- impression = _PAM_POSITIVE;
- status = retval;
+ /* in case of using cached chain
+ we could get here with PAM_IGNORE - don't return it */
+ if ( retval != PAM_IGNORE || cached_retval == retval ) {
+ impression = _PAM_POSITIVE;
+ status = retval;
+ }
}
if ( impression == _PAM_POSITIVE && action == _PAM_ACTION_DONE ) {
goto decision_made;
@@ -227,8 +231,10 @@ static int _pam_dispatch_aux(pam_handle_t *pamh, int flags, struct handler *h,
if (impression == _PAM_UNDEF
|| (impression == _PAM_POSITIVE
&& status == PAM_SUCCESS) ) {
- impression = _PAM_POSITIVE;
- status = retval;
+ if ( retval != PAM_IGNORE || cached_retval == retval ) {
+ impression = _PAM_POSITIVE;
+ status = retval;
+ }
}
}