]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: auth: Plumb in the SamInfo3_handle_sids() utility function into passwd_to_SamInfo3().
authorJeremy Allison <jra@samba.org>
Tue, 13 Jan 2015 21:45:16 +0000 (13:45 -0800)
committerStefan Metzmacher <metze@samba.org>
Fri, 23 Jan 2015 07:44:10 +0000 (08:44 +0100)
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>
(cherry picked from commit 60895e62fe21e41cf4a09ec8a92239b8f015b450)

source3/auth/auth_util.c
source3/auth/proto.h
source3/auth/server_info.c

index 2986fb4372f34235ea1cbd254f15bdd48a709d02..1c2cf80ed8b81c6ef8d29923ae50af89e627f734 100644 (file)
@@ -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;
        }
index 1da0c445e7877fcde40a124a601cb158432f5dd8..6a5508b2a1435fb2c68ebbddb814a277bec7b03d 100644 (file)
@@ -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);
 
index 9f992ffa103b2b962ceb415e69afa737dae5346e..7b1cdd574b449ff9ce6c8a36666fdd11596d26c3 100644 (file)
@@ -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,