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)
committerVolker Lendecke <vl@samba.org>
Wed, 14 Jan 2015 05:24:06 +0000 (06:24 +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>
source3/auth/auth_util.c
source3/auth/proto.h
source3/auth/server_info.c

index dbc7d24dc17eaccad68146b984fa8832c34ad998..585afd31386c8cfef0b8baa73cfcf99ac6e21fae 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 da3c0996a29101df5ee16551c443a8dd0b76378c..792e96d1facfd8973ab3136f59a422311f20a351 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,