summaryrefslogtreecommitdiffstats
path: root/source/passdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-23 20:43:20 +0000
committerJeremy Allison <jra@samba.org>2001-04-23 20:43:20 +0000
commit59aa99f3901d098b7afbe675021bda53b62ee496 (patch)
treef429d51582687467c3249bcddad3c390141874cc /source/passdb
parent4db22afeed659a871a4a1f719d5fa1f2df07e24d (diff)
downloadsamba-59aa99f3901d098b7afbe675021bda53b62ee496.tar.gz
samba-59aa99f3901d098b7afbe675021bda53b62ee496.tar.xz
samba-59aa99f3901d098b7afbe675021bda53b62ee496.zip
Added "obey pam restrictions" parameter - default to "off".
Only set this to "on" if you know you have your PAM set up correctly..... NB. Doesn't apply to plaintext password authentication, which must use pam when compiled in. Jeremy.
Diffstat (limited to 'source/passdb')
-rw-r--r--source/passdb/pampass.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/passdb/pampass.c b/source/passdb/pampass.c
index f91f472603c..9f4a8f57b91 100644
--- a/source/passdb/pampass.c
+++ b/source/passdb/pampass.c
@@ -350,11 +350,17 @@ static BOOL smb_internal_pam_session(pam_handle_t *pamh, char *user, char *tty,
/*
* PAM Externally accessible Session handler
*/
+
BOOL smb_pam_session(BOOL flag, const char *in_user, char *tty, char *rhost)
{
pam_handle_t *pamh = NULL;
char * user;
+ /* Ignore PAM if told to. */
+
+ if (!lp_obey_pam_restrictions())
+ return True;
+
user = strdup(in_user);
if ( user == NULL ) {
DEBUG(0, ("PAM: PAM_session Malloc Failed!\n"));
@@ -382,6 +388,11 @@ BOOL smb_pam_accountcheck(char * user)
PAM_username = user;
PAM_password = NULL;
+ /* Ignore PAM if told to. */
+
+ if (!lp_obey_pam_restrictions())
+ return True;
+
if( smb_pam_start(&pamh, user, NULL)) {
if ( smb_pam_account(pamh, user, NULL, False)) {
return( smb_pam_end(pamh));
@@ -401,6 +412,12 @@ BOOL smb_pam_passcheck(char * user, char * password)
PAM_username = user;
PAM_password = password;
+ /*
+ * Note we can't ignore PAM here as this is the only
+ * way of doing auths on plaintext passwords when
+ * compiled --with-pam.
+ */
+
if( smb_pam_start(&pamh, user, NULL)) {
if ( smb_pam_auth(pamh, user, password)) {
if ( smb_pam_account(pamh, user, password, True)) {