summaryrefslogtreecommitdiff
path: root/source3/auth/auth.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-07-12 12:23:08 +0200
committerAndreas Schneider <asn@samba.org>2011-07-13 14:09:35 +0200
commitf97bdebbbe29c896524e7a0a68296f2d4709364a (patch)
tree8e087c7748e2ac52c5fefbcee5bbfe3c60bd9ac2 /source3/auth/auth.c
parent15e017deb02de40af1226316614386cfadb205eb (diff)
downloadsamba-f97bdebbbe29c896524e7a0a68296f2d4709364a.tar.gz
samba-f97bdebbbe29c896524e7a0a68296f2d4709364a.tar.bz2
samba-f97bdebbbe29c896524e7a0a68296f2d4709364a.zip
s3-auth: Fix account check over ncalrpc.
Diffstat (limited to 'source3/auth/auth.c')
-rw-r--r--source3/auth/auth.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index 0bdce9d1f4..a7fe1c624c 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -284,12 +284,16 @@ 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;
+ const char *rhost;
- rhost = tsocket_address_inet_addr_string(user_info->remote_host,
- talloc_tos());
- if (rhost == NULL) {
- return NT_STATUS_NO_MEMORY;
+ if (tsocket_address_is_inet(user_info->remote_host, "ip")) {
+ rhost = tsocket_address_inet_addr_string(user_info->remote_host,
+ talloc_tos());
+ if (rhost == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ } else {
+ rhost = "127.0.0.1";
}
/* We might not be root if we are an RPC call */