summaryrefslogtreecommitdiffstats
path: root/source3/auth/auth.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-08 18:55:37 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:28:02 +1000
commit7e46a84bb769c2e781e2650b4227b05ee3cb9635 (patch)
tree43e3d5397c37d018d116dec3a96146a2788eb903 /source3/auth/auth.c
parent45f70db01070cfb0cdfb6ae0e8ee64da2bf42fc0 (diff)
downloadsamba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.tar.gz
samba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.tar.xz
samba-7e46a84bb769c2e781e2650b4227b05ee3cb9635.zip
s3-auth: Pass the remote_address down to user_info.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/auth/auth.c')
-rw-r--r--source3/auth/auth.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index dbe337faa83..0f661a953f1 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -19,7 +19,7 @@
#include "includes.h"
#include "auth.h"
-#include "smbd/globals.h"
+#include "../lib/tsocket/tsocket.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
@@ -284,11 +284,19 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
if (NT_STATUS_IS_OK(nt_status)) {
unix_username = (*server_info)->unix_name;
if (!(*server_info)->guest) {
+ char *rhost;
+ int rc;
+
+ rhost = tsocket_address_inet_addr_string(user_info->remote_host,
+ talloc_tos());
+ if (rhost == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
/* We might not be root if we are an RPC call */
become_root();
- nt_status = smb_pam_accountcheck(
- unix_username,
- smbd_server_conn->client_id.name);
+ nt_status = smb_pam_accountcheck(unix_username,
+ rhost);
unbecome_root();
if (NT_STATUS_IS_OK(nt_status)) {