summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-21 14:41:01 +0200
committerVolker Lendecke <vl@samba.org>2010-08-27 21:59:09 +0200
commit9322fa4077a9c15c9b5431ac2369b50bfffbb73d (patch)
tree918e4666b72cb39ffd50d4778c37fbeb7101a164 /source3/auth
parent26ee30585dbffd7e887c48ddf0900fe0afd90e47 (diff)
downloadsamba-9322fa4077a9c15c9b5431ac2369b50bfffbb73d.tar.gz
samba-9322fa4077a9c15c9b5431ac2369b50bfffbb73d.tar.bz2
samba-9322fa4077a9c15c9b5431ac2369b50bfffbb73d.zip
s3: Lift smbd_server_fd() from smb_pam_passcheck
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/pampass.c9
-rw-r--r--source3/auth/pass_check.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c
index 2f8c4cc416..7c09c1630a 100644
--- a/source3/auth/pampass.c
+++ b/source3/auth/pampass.c
@@ -806,13 +806,12 @@ NTSTATUS smb_pam_accountcheck(const char *user, const char *rhost)
* PAM Password Validation Suite
*/
-NTSTATUS smb_pam_passcheck(const char * user, const char * password)
+NTSTATUS smb_pam_passcheck(const char * user, const char * password,
+ const char * rhost)
{
pam_handle_t *pamh = NULL;
NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
struct pam_conv *pconv = NULL;
- const char *rhost;
- char addr[INET6_ADDRSTRLEN];
/*
* Note we can't ignore PAM here as this is the only
@@ -823,10 +822,6 @@ NTSTATUS smb_pam_passcheck(const char * user, const char * password)
if ((pconv = smb_setup_pam_conv(smb_pam_conv, user, password, NULL)) == NULL)
return NT_STATUS_LOGON_FAILURE;
- rhost = client_name(smbd_server_fd());
- if (strequal(rhost,"UNKNOWN"))
- rhost = client_addr(smbd_server_fd(), addr, sizeof(addr));
-
if (!smb_pam_start(&pamh, user, rhost, pconv))
return NT_STATUS_LOGON_FAILURE;
diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c
index 5943761277..a4bc6b509c 100644
--- a/source3/auth/pass_check.c
+++ b/source3/auth/pass_check.c
@@ -553,7 +553,14 @@ core of password checking routine
static NTSTATUS password_check(const char *password, void *private_data)
{
#ifdef WITH_PAM
- return smb_pam_passcheck(get_this_user(), password);
+ const char *rhost;
+ char addr[INET6_ADDRSTRLEN];
+
+ rhost = client_name(smbd_server_fd());
+ if (strequal(rhost,"UNKNOWN"))
+ rhost = client_addr(smbd_server_fd(), addr, sizeof(addr));
+
+ return smb_pam_passcheck(get_this_user(), rhost, password);
#else
bool ret;