diff options
author | Günther Deschner <gd@samba.org> | 2008-02-01 14:21:54 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-01 16:29:20 +0100 |
commit | ddbe4ea6b79b511927d4d130cb345b873b12cc0e (patch) | |
tree | 7f8eab64473c0c26706bd5537d0367a124d4b1f9 /source3/utils/net_domain.c | |
parent | f0438acfda7ae28a68d20be3cd05cdaeff9ac82b (diff) | |
download | samba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.tar.gz samba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.tar.bz2 samba-ddbe4ea6b79b511927d4d130cb345b873b12cc0e.zip |
Use rpccli_samr_CreateUser2() all over the place.
Guenther
(This used to be commit 701af69118c9634c7dc0d5c10152ce776787694d)
Diffstat (limited to 'source3/utils/net_domain.c')
-rw-r--r-- | source3/utils/net_domain.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source3/utils/net_domain.c b/source3/utils/net_domain.c index 93b9d0bc25..74b35d0d66 100644 --- a/source3/utils/net_domain.c +++ b/source3/utils/net_domain.c @@ -37,6 +37,11 @@ goto done; \ } +static void init_lsa_String(struct lsa_String *name, const char *s) +{ + name->string = s; +} + /******************************************************************* Leave an AD domain. Windows XP disables the machine account. We'll try the same. The old code would do an LDAP delete. @@ -210,6 +215,7 @@ NTSTATUS netdom_join_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli, NTSTATUS status = NT_STATUS_UNSUCCESSFUL; char *acct_name; const char *const_acct_name; + struct lsa_String lsa_acct_name; uint32 user_rid; uint32 num_rids, *name_types, *user_rids; uint32 flags = 0x3e8; @@ -224,6 +230,7 @@ NTSTATUS netdom_join_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli, uchar md5buffer[16]; DATA_BLOB digested_session_key; uchar md4_trust_password[16]; + uint32_t access_granted = 0; /* Open the domain */ @@ -253,6 +260,8 @@ NTSTATUS netdom_join_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli, strlower_m(acct_name); const_acct_name = acct_name; + init_lsa_String(&lsa_acct_name, acct_name); + /* Don't try to set any acb_info flags other than ACB_WSTRUST */ acct_flags = SEC_GENERIC_READ | SEC_GENERIC_WRITE | SEC_GENERIC_EXECUTE | SEC_STD_WRITE_DAC | SEC_STD_DELETE | @@ -262,8 +271,14 @@ NTSTATUS netdom_join_domain( TALLOC_CTX *mem_ctx, struct cli_state *cli, DEBUG(10, ("Creating account with flags: %d\n",acct_flags)); - status = rpccli_samr_create_dom_user(pipe_hnd, mem_ctx, &domain_pol, - acct_name, acb_info, acct_flags, &user_pol, &user_rid); + status = rpccli_samr_CreateUser2(pipe_hnd, mem_ctx, + &domain_pol, + &lsa_acct_name, + acb_info, + acct_flags, + &user_pol, + &access_granted, + &user_rid); if ( !NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) |