s3:rpc_client: Return NTSTATUS for init_samr_CryptPassword()
[samba.git] / source3 / libnet / libnet_join.c
index b876d7ea89fb9a9165e100739a91daf9e7227565..4670617d74f1f8f29083f8dae581244faea7d9d8 100644 (file)
@@ -1539,9 +1539,12 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 
                /* retry with level 24 */
 
-               init_samr_CryptPassword(r->in.machine_password,
-                                       &session_key,
-                                       &crypt_pwd);
+               status = init_samr_CryptPassword(r->in.machine_password,
+                                                &session_key,
+                                                &crypt_pwd);
+               if (!NT_STATUS_IS_OK(status)) {
+                       goto error;
+               }
 
                user_info.info24.password = crypt_pwd;
                user_info.info24.password_expired = PASS_DONT_CHANGE_AT_NEXT_LOGON;
@@ -1553,6 +1556,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
                                                  &result);
        }
 
+error:
        old_timeout = rpccli_set_timeout(pipe_hnd, old_timeout);
 
        if (!NT_STATUS_IS_OK(status)) {