s4-smbtorture: add smbcli_rap_netoemchangepassword().
authorGünther Deschner <gd@samba.org>
Fri, 7 May 2010 20:10:51 +0000 (22:10 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 10 May 2010 19:30:27 +0000 (21:30 +0200)
Guenther

source4/torture/rap/rap.c

index 0e9900a11a6dd5db765291e4b474af86e68fabbc..c116dde49333a8a4cac3d423477974e59987f9d9 100644 (file)
@@ -1648,6 +1648,55 @@ NTSTATUS smbcli_rap_netuserpasswordset2(struct smbcli_tree *tree,
        return result;
 }
 
+NTSTATUS smbcli_rap_netoemchangepassword(struct smbcli_tree *tree,
+                                        struct smb_iconv_convenience *iconv_convenience,
+                                        TALLOC_CTX *mem_ctx,
+                                        struct rap_NetOEMChangePassword *r)
+{
+       struct rap_call *call;
+       NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
+
+       if (!(call = new_rap_cli_call(mem_ctx, iconv_convenience, RAP_SamOEMChgPasswordUser2_P))) {
+               return NT_STATUS_NO_MEMORY;
+       }
+
+       rap_cli_push_string(call, r->in.UserName);
+       rap_cli_push_sendbuf(call, 532);
+       ndr_push_bytes(call->ndr_push_param, r->in.crypt_password, 516);
+       ndr_push_bytes(call->ndr_push_param, r->in.password_hash, 16);
+
+       rap_cli_expect_format(call, "");
+       rap_cli_expect_extra_format(call, "B516B16");
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(rap_NetOEMChangePassword, r);
+       }
+
+       result = rap_cli_do_call(tree, iconv_convenience, call);
+
+       if (!NT_STATUS_IS_OK(result))
+               goto done;
+
+       result = NT_STATUS_INVALID_PARAMETER;
+
+       NDR_GOTO(ndr_pull_rap_status(call->ndr_pull_param, NDR_SCALARS, &r->out.status));
+       NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, &r->out.convert));
+
+       result = NT_STATUS_OK;
+
+       if (!NT_STATUS_IS_OK(result)) {
+               goto done;
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(rap_NetOEMChangePassword, r);
+       }
+
+ done:
+       talloc_free(call);
+       return result;
+}
+
 static bool test_netservergetinfo(struct torture_context *tctx, 
                                  struct smbcli_state *cli)
 {