]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r2369: Fix from Richard Renard <rrenard@idealx.com> to fix usermgr and trust relation...
authorJeremy Allison <jra@samba.org>
Thu, 16 Sep 2004 22:08:26 +0000 (22:08 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:41 +0000 (10:52 -0500)
Jeremy.

source/rpc_server/srv_samr_nt.c

index 74f6030365d8ff628e94d68751ce0a98000c9256..34fad9b0ed384b562a3f00a7f2b9acd1de934578 100644 (file)
@@ -728,7 +728,17 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, UN
        for (i = 0; i < num_entries; i++) {
                pwd = &disp_user_info[i+start_idx];
                temp_name = pdb_get_username(pwd);
-               init_unistr2(&uni_temp_name, temp_name, UNI_STR_TERMINATE);
+
+               /*
+                * usrmgr expects a non-NULL terminated string with
+                * trust relationships
+                */
+               if (pdb_get_acct_ctrl(pwd) & ACB_DOMTRUST) {
+                       init_unistr2(&uni_temp_name, temp_name, UNI_FLAGS_NONE);
+               } else {
+                       init_unistr2(&uni_temp_name, temp_name, UNI_STR_TERMINATE);
+               }
+
                user_sid = pdb_get_user_sid(pwd);
 
                if (!sid_peek_check_rid(domain_sid, user_sid, &user_rid)) {