summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2015-01-13 13:45:16 -0800
committerVolker Lendecke <vl@samba.org>2015-01-14 06:24:06 +0100
commit60895e62fe21e41cf4a09ec8a92239b8f015b450 (patch)
treedce0f83a75ae0b4d0c958f2cf4687f09d5d61248 /source3/auth
parentd20b2d397205c1ab85a43f54bc95360a732265f3 (diff)
downloadsamba-60895e62fe21e41cf4a09ec8a92239b8f015b450.tar.gz
s3: auth: Plumb in the SamInfo3_handle_sids() utility function into passwd_to_SamInfo3().
Core fix for: https://bugzilla.samba.org/show_bug.cgi?id=11044 Based on code from Michael Zeis <mzeis.quantum@gmail.com> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_util.c3
-rw-r--r--source3/auth/proto.h3
-rw-r--r--source3/auth/server_info.c16
3 files changed, 17 insertions, 5 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index dbc7d24dc17..585afd31386 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -671,7 +671,8 @@ NTSTATUS make_server_info_pw(TALLOC_CTX *mem_ctx,
status = passwd_to_SamInfo3(result,
unix_username,
pwd,
- &result->info3);
+ &result->info3,
+ &result->extra);
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
index da3c0996a29..792e96d1fac 100644
--- a/source3/auth/proto.h
+++ b/source3/auth/proto.h
@@ -305,7 +305,8 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx,
const char *unix_username,
const struct passwd *pwd,
- struct netr_SamInfo3 **pinfo3);
+ struct netr_SamInfo3 **pinfo3,
+ struct extra_auth_info *extra);
struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx,
const struct netr_SamInfo3 *orig);
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index 9f992ffa103..7b1cdd574b4 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -539,7 +539,8 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx,
const char *unix_username,
const struct passwd *pwd,
- struct netr_SamInfo3 **pinfo3)
+ struct netr_SamInfo3 **pinfo3,
+ struct extra_auth_info *extra)
{
struct netr_SamInfo3 *info3;
NTSTATUS status;
@@ -635,8 +636,17 @@ NTSTATUS passwd_to_SamInfo3(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(domain_sid);
- sid_copy(&domain_sid, &user_sid);
- sid_split_rid(&domain_sid, &info3->base.rid);
+ status = SamInfo3_handle_sids(unix_username,
+ &user_sid,
+ &group_sid,
+ info3,
+ &domain_sid,
+ extra);
+
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
+
info3->base.domain_sid = dom_sid_dup(info3, &domain_sid);
ok = sid_peek_check_rid(&domain_sid, &group_sid,