Author: jra Date: 2004-09-16 22:08:21 +0000 (Thu, 16 Sep 2004) New Revision: 2368
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source/rpc_server&rev=2368&nolog=1 Log: Fix from Richard Renard <[EMAIL PROTECTED]> to fix usermgr and trust relationships. Jeremy. Modified: trunk/source/rpc_server/srv_samr_nt.c Changeset: Modified: trunk/source/rpc_server/srv_samr_nt.c =================================================================== --- trunk/source/rpc_server/srv_samr_nt.c 2004-09-16 12:49:02 UTC (rev 2367) +++ trunk/source/rpc_server/srv_samr_nt.c 2004-09-16 22:08:21 UTC (rev 2368) @@ -750,7 +750,17 @@ 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)) {