summaryrefslogtreecommitdiff
path: root/source3/auth/auth_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/auth/auth_unix.c')
-rw-r--r--source3/auth/auth_unix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c
index c50ac78ee4..87cfdb9dd5 100644
--- a/source3/auth/auth_unix.c
+++ b/source3/auth/auth_unix.c
@@ -37,16 +37,23 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
{
NTSTATUS nt_status;
struct passwd *pass = NULL;
+ const char *rhost;
+ char addr[INET6_ADDRSTRLEN];
DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
become_root();
pass = Get_Pwnam_alloc(talloc_tos(), user_info->mapped.account_name);
+ rhost = client_name(smbd_server_fd());
+ if (strequal(rhost,"UNKNOWN"))
+ rhost = client_addr(smbd_server_fd(), addr, sizeof(addr));
+
/** @todo This call assumes a ASCII password, no charset transformation is
done. We may need to revisit this **/
nt_status = pass_check(pass,
pass ? pass->pw_name : user_info->mapped.account_name,
+ rhost,
user_info->password.plaintext,
true);