From abf27643616a0ad2c0477869c2146d852ee57026 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 25 May 2010 11:21:46 +0200 Subject: s4:torture/rpc/samr.c: Fix the "ValidatePassword" test It was failing randomly due to an uninitialised "status" variable. --- source4/torture/rpc/samr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index c44c4eff8d..b87cac5ac9 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -7916,12 +7916,15 @@ static bool test_samr_ValidatePassword(struct dcerpc_pipe *p, for (i=0; passwords[i]; i++) { req.req3.password.string = passwords[i]; - torture_assert_ntstatus_ok(tctx, dcerpc_samr_ValidatePassword_r(b, tctx, &r), - "ValidatePassword failed"); + + status = dcerpc_samr_ValidatePassword_r(b, tctx, &r); if (NT_STATUS_EQUAL(status, NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE)) { torture_skip(tctx, "ValidatePassword not supported by server\n"); } - torture_assert_ntstatus_ok(tctx, r.out.result, "samr_ValidatePassword"); + torture_assert_ntstatus_ok(tctx, status, + "samr_ValidatePassword failed"); + torture_assert_ntstatus_ok(tctx, r.out.result, + "samr_ValidatePassword failed"); torture_comment(tctx, "Server %s password '%s' with code %i\n", repp->ctr3.status==SAMR_VALIDATION_STATUS_SUCCESS?"allowed":"refused", req.req3.password.string, repp->ctr3.status); -- cgit