summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-09-16 22:08:26 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:41 -0500
commit3ada1c1a992172b92f695343a8648675583f7719 (patch)
tree3327c34b41802317c01b162d7333d9fa4b145289 /source3
parentebc84c4efd2b97a16ee1a67a9811eb77fb85bb58 (diff)
downloadsamba-3ada1c1a992172b92f695343a8648675583f7719.tar.gz
samba-3ada1c1a992172b92f695343a8648675583f7719.tar.bz2
samba-3ada1c1a992172b92f695343a8648675583f7719.zip
r2369: Fix from Richard Renard <rrenard@idealx.com> to fix usermgr and trust relationships.
Jeremy. (This used to be commit b910e530027c19c4e505314a91ffcb72f20d8f09)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_samr_nt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 74f6030365..34fad9b0ed 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -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)) {