summaryrefslogtreecommitdiffstats
path: root/source/smbd/session.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-30 21:05:58 +0000
committerJeremy Allison <jra@samba.org>2001-04-30 21:05:58 +0000
commit1648ac64a75de74d1a1575eb49cccc4f75488bfa (patch)
treefcc176107476d9dfdbc8b21406fbaa858136653c /source/smbd/session.c
parent783728fa8c6527e1dfc4434a587d5753886ad8ec (diff)
downloadsamba-1648ac64a75de74d1a1575eb49cccc4f75488bfa.tar.gz
samba-1648ac64a75de74d1a1575eb49cccc4f75488bfa.tar.xz
samba-1648ac64a75de74d1a1575eb49cccc4f75488bfa.zip
Based on an original PAM patch by Andrew Bartlett, re-written by me to
remove global static PAM variables, and to tidy up the PAM internals code. Now looks like the rest of Samba. Still needs testing. Jeremy.
Diffstat (limited to 'source/smbd/session.c')
-rw-r--r--source/smbd/session.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source/smbd/session.c b/source/smbd/session.c
index 3131fb9f542..40654c0f43c 100644
--- a/source/smbd/session.c
+++ b/source/smbd/session.c
@@ -99,6 +99,13 @@ BOOL session_claim(uint16 vuid)
sessionid.id_num = i;
sessionid.pid = pid;
+ if (!smb_pam_claim_session(sessionid.username, sessionid.id_str, sessionid.hostname)) {
+ DEBUG(1,("pam_session rejected the session for %s [%s]\n",
+ sessionid.username, sessionid.id_str));
+ tdb_delete(tdb, key);
+ return False;
+ }
+
dlen = tdb_pack(dbuf, sizeof(dbuf), "fffdd",
sessionid.username, sessionid.hostname, sessionid.id_str,
sessionid.id_num, sessionid.pid);
@@ -110,15 +117,6 @@ BOOL session_claim(uint16 vuid)
return False;
}
-#if WITH_PAM
- if (!smb_pam_session(True, sessionid.username, sessionid.id_str, sessionid.hostname)) {
- DEBUG(1,("smb_pam_session rejected the session for %s [%s]\n",
- sessionid.username, sessionid.id_str));
- tdb_delete(tdb, key);
- return False;
- }
-#endif
-
#if WITH_UTMP
if (lp_utmp()) {
sys_utmp_claim(sessionid.username, sessionid.hostname,
@@ -169,9 +167,7 @@ void session_yield(uint16 vuid)
}
#endif
-#if WITH_PAM
- smb_pam_session(False, sessionid.username, sessionid.id_str, sessionid.hostname);
-#endif
+ smb_pam_close_session(sessionid.username, sessionid.id_str, sessionid.hostname);
tdb_delete(tdb, key);
}