summaryrefslogtreecommitdiff
path: root/source3/auth/auth_unix.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-06-15 11:32:12 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-07-04 18:28:04 +1000
commit66badc1740619eccac26bda720284bab6475f0b5 (patch)
treea04f9cbaf24b4609be805dbc40bb0e747af81754 /source3/auth/auth_unix.c
parent7e46a84bb769c2e781e2650b4227b05ee3cb9635 (diff)
downloadsamba-66badc1740619eccac26bda720284bab6475f0b5.tar.gz
samba-66badc1740619eccac26bda720284bab6475f0b5.tar.bz2
samba-66badc1740619eccac26bda720284bab6475f0b5.zip
s3-auth: Remove global smbd_server_conn from auth_unix.c.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/auth/auth_unix.c')
-rw-r--r--source3/auth/auth_unix.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c
index 36956986c5..f0a5215dd7 100644
--- a/source3/auth/auth_unix.c
+++ b/source3/auth/auth_unix.c
@@ -20,7 +20,7 @@
#include "includes.h"
#include "auth.h"
#include "system/passwd.h"
-#include "smbd/globals.h"
+#include "../lib/tsocket/tsocket.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
@@ -39,9 +39,17 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
{
NTSTATUS nt_status;
struct passwd *pass = NULL;
+ char *rhost;
+ int rc;
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
+ rhost = tsocket_address_inet_addr_string(user_info->remote_host,
+ talloc_tos());
+ if (rhost == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
become_root();
pass = Get_Pwnam_alloc(talloc_tos(), user_info->mapped.account_name);
@@ -49,7 +57,7 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
done. We may need to revisit this **/
nt_status = pass_check(pass,
pass ? pass->pw_name : user_info->mapped.account_name,
- smbd_server_conn->client_id.name,
+ rhost,
user_info->password.plaintext,
true);