summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2005-02-26 15:26:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:48 -0500
commit180fa12026caef8f22154e0e7c60f9043b5588e2 (patch)
tree0834235ab13715aacb6aa4fecad3cfc6178a2d93 /source3/utils
parentfb84318c34418d6f11344b5497efde3a37b5446a (diff)
downloadsamba-180fa12026caef8f22154e0e7c60f9043b5588e2.tar.gz
samba-180fa12026caef8f22154e0e7c60f9043b5588e2.tar.bz2
samba-180fa12026caef8f22154e0e7c60f9043b5588e2.zip
r5580: Fix "net rpc trustdom add". Much closer to what windows does. Also stop
referencing unknown_6 from sam, because it's just fixed at 1260, the max len of LOGON_HRS. Need to go in and mark it as "remove me" from passdb. (This used to be commit ffac752875938d510446ebbeba6fc983f65cda1e)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index b18d4b0ba5..13624f7544 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -4377,7 +4377,7 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid,
}
/* Create trusting domain's account */
- acb_info = ACB_DOMTRUST;
+ acb_info = ACB_NORMAL;
unknown = 0xe00500b0; /* No idea what this is - a permission mask?
mimir: yes, most probably it is */
@@ -4390,20 +4390,34 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid,
{
SAM_USERINFO_CTR ctr;
- SAM_USER_INFO_24 p24;
+ SAM_USER_INFO_23 p23;
+ NTTIME notime;
+ char nostr[] = "";
+ LOGON_HRS hrs;
uchar pwbuf[516];
encode_pw_buffer((char *)pwbuf, argv[1], STR_UNICODE);
ZERO_STRUCT(ctr);
- ZERO_STRUCT(p24);
-
- init_sam_user_info24(&p24, (char *)pwbuf, 24);
-
- ctr.switch_value = 24;
- ctr.info.id24 = &p24;
-
- result = cli_samr_set_userinfo(cli, mem_ctx, &user_pol, 24,
+ ZERO_STRUCT(p23);
+ ZERO_STRUCT(notime);
+ hrs.max_len = 1260;
+ hrs.offset = 0;
+ hrs.len = 21;
+ memset(hrs.hours, 0xFF, sizeof(hrs.hours));
+ acb_info = ACB_DOMTRUST;
+
+ init_sam_user_info23A(&p23, &notime, &notime, &notime,
+ &notime, &notime, &notime,
+ nostr, nostr, nostr, nostr, nostr,
+ nostr, nostr, nostr, nostr, nostr,
+ 0, 0, acb_info, ACCT_FLAGS, 168, &hrs,
+ 0, 0, (char *)pwbuf);
+ ctr.switch_value = 23;
+ ctr.info.id23 = &p23;
+ p23.passmustchange = 0;
+
+ result = cli_samr_set_userinfo(cli, mem_ctx, &user_pol, 23,
&cli->user_session_key, &ctr);
if (!NT_STATUS_IS_OK(result)) {