summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-21 14:57:16 +0200
committerVolker Lendecke <vl@samba.org>2010-08-28 11:12:13 +0200
commit92fd03c5f08055283af55f5a1dffaf84edb7e9ce (patch)
treeca64a5af98ea007eca9d7720d5d7e261672cd70c /source3/auth
parenta3995ef31cfbd798921bf5fd34721b4251e173be (diff)
downloadsamba-92fd03c5f08055283af55f5a1dffaf84edb7e9ce.tar.gz
samba-92fd03c5f08055283af55f5a1dffaf84edb7e9ce.tar.bz2
samba-92fd03c5f08055283af55f5a1dffaf84edb7e9ce.zip
s3: Lift smbd_server_fd() from pass_check()
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_unix.c7
-rw-r--r--source3/auth/pass_check.c8
2 files changed, 8 insertions, 7 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);
diff --git a/source3/auth/pass_check.c b/source3/auth/pass_check.c
index 80e7da91df..c61a10ba1b 100644
--- a/source3/auth/pass_check.c
+++ b/source3/auth/pass_check.c
@@ -660,6 +660,7 @@ return NT_STATUS_OK on correct match, appropriate error otherwise
NTSTATUS pass_check(const struct passwd *pass,
const char *user,
+ const char *rhost,
const char *password,
bool run_cracker)
{
@@ -668,13 +669,6 @@ NTSTATUS pass_check(const struct passwd *pass,
NTSTATUS nt_status;
- 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));
-
#ifdef DEBUG_PASSWORD
DEBUG(100, ("checking user=[%s] pass=[%s]\n", user, password));
#endif