summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils/net_rpc_join.c')
-rw-r--r--source3/utils/net_rpc_join.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index f63cb14b7e..5bc38f979f 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -148,7 +148,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
/* Password stuff */
char *clear_trust_password = NULL;
- uchar pwbuf[516];
+ struct samr_CryptPassword crypt_pwd;
uchar md4_trust_password[16];
union samr_UserInfo set_info;
@@ -337,14 +337,13 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
E_md4hash(clear_trust_password, md4_trust_password);
}
- encode_pw_buffer(pwbuf, clear_trust_password, STR_UNICODE);
-
/* Set password on machine account */
- init_samr_user_info24(&set_info.info24, pwbuf, 24);
+ init_samr_CryptPassword(clear_trust_password,
+ &cli->user_session_key,
+ &crypt_pwd);
- SamOEMhashBlob(set_info.info24.password.data, 516,
- &cli->user_session_key);
+ init_samr_user_info24(&set_info.info24, crypt_pwd.data, 24);
CHECK_RPC_ERR(rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
&user_pol,