summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-02-29 01:27:52 +0100
committerGünther Deschner <gd@samba.org>2008-02-29 01:27:52 +0100
commit53d55794dfbce06fcb40e5bdd81ca8a6dc1c4655 (patch)
treea6e4e4a438623a005b71a2df36376e003f188c85 /source3/libnet
parent29222fa551591a6a845cf6619a664a8e3877fa3c (diff)
downloadsamba-53d55794dfbce06fcb40e5bdd81ca8a6dc1c4655.tar.gz
samba-53d55794dfbce06fcb40e5bdd81ca8a6dc1c4655.tar.bz2
samba-53d55794dfbce06fcb40e5bdd81ca8a6dc1c4655.zip
libnetjoin: add fallback to level 24 samr setinfo so that libnet can join NT4.
Guenther (This used to be commit bc2d3d51449831146a9faf6e809e7a91d174659c)
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_join.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index b8572f68b5..1a8486f5b5 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -883,6 +883,25 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
&user_pol,
25,
&user_info);
+
+ if (NT_STATUS_EQUAL(status, NT_STATUS(DCERPC_FAULT_INVALID_TAG))) {
+
+ uchar pwbuf2[516];
+
+ encode_pw_buffer(pwbuf2, r->in.machine_password, STR_UNICODE);
+
+ /* retry with level 24 */
+ init_samr_user_info24(&user_info.info24, pwbuf2, 24);
+
+ SamOEMhashBlob(user_info.info24.password.data, 516,
+ &cli->user_session_key);
+
+ status = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
+ &user_pol,
+ 24,
+ &user_info);
+ }
+
if (!NT_STATUS_IS_OK(status)) {
libnet_join_set_error_string(mem_ctx, r,
"Failed to set password for machine account (%s)\n",