]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
This commit disables chain caching.
authordes <des@FreeBSD.org>
Thu, 24 Jan 2002 15:30:03 +0000 (15:30 +0000)
committerdes <des@FreeBSD.org>
Thu, 24 Jan 2002 15:30:03 +0000 (15:30 +0000)
commit8926dc8e129a56900b40e30f5255bb5eb293f556
tree76e70ca2bfa4da76aa868ee1fd2ea3c96fc99735
parent9145fb545645d9c40f4b5b3b5977138afd82e066
This commit disables chain caching.

Chain caching is a feature of Linux-PAM, where pam_authenticate() and
pam_open_session() "freeze" the chain so that their companion
primitive (pam_setcred() and pam_close_session() respectively) will
call the exact same modules, skipping those that failed in the
previous call.

There are several reasons not to do this, the most prominent of which
is that it makes it impossible to call pam_setcred() without first
calling pam_authenticate() - which is perfectly valid according to
DCE/RFC 86.0 and XSSO, and is necessary to make 'login -f' work.

Instead of chain caching, implement something similar to the way
Solaris' libpam behaves: pam_setcred treats "sufficient" modules as if
they were "required", i.e. does not break the chain when they succeed.

PAM modules whose pam_sm_setcred() should not be called unless their
pam_sm_authenticate() succeeded can simply set a state variable using
pam_set_data() in pam_sm_authenticate(), and use pam_get_data() to
check it in pam_sm_setcred().

Sponsored by: DARPA, NAI Labs
contrib/libpam/libpam/pam_dispatch.c