summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-12-11 13:21:11 +0100
committerStefan Metzmacher <metze@samba.org>2012-12-11 14:00:00 +0100
commit1a4adcfcb31a06fe3eae4e78a502cbfaa092587e (patch)
treef0ed3799a45430320ba55ce5e7ba1f49803294f8
parentce895609b04380bfc41e4f8fddc84bd2f9324340 (diff)
downloadsamba-1a4adcfcb31a06fe3eae4e78a502cbfaa092587e.tar.gz
samba-1a4adcfcb31a06fe3eae4e78a502cbfaa092587e.tar.bz2
samba-1a4adcfcb31a06fe3eae4e78a502cbfaa092587e.zip
s4:torture/samr: allow STATUS_PASSWORD_RESTRICTIONS from ChangePasswordUser
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/torture/rpc/samr.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index ba0f20bcc8..01f4c0fdc2 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1759,8 +1759,10 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
torture_comment(tctx, "(%s:%s) old_password[%s] new_password[%s] status[%s]\n",
__location__, __FUNCTION__,
oldpass, newpass, nt_errstr(r.out.result));
- torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
- "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM hash");
+ if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+ torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
+ "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM hash");
+ }
/* Unbreak the LM hash */
hash1.hash[0]--;
@@ -1784,8 +1786,10 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
torture_comment(tctx, "(%s:%s) old_password[%s] new_password[%s] status[%s]\n",
__location__, __FUNCTION__,
oldpass, newpass, nt_errstr(r.out.result));
- torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
- "expected NT_STATUS_WRONG_PASSWORD because we broke the NT hash");
+ if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
+ torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
+ "expected NT_STATUS_WRONG_PASSWORD because we broke the NT hash");
+ }
/* Unbreak the NT hash */
hash3.hash[0]--;
@@ -1809,8 +1813,10 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
torture_comment(tctx, "(%s:%s) old_password[%s] new_password[%s] status[%s]\n",
__location__, __FUNCTION__,
oldpass, newpass, nt_errstr(r.out.result));
- if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_WRONG_PASSWORD)) {
- torture_warning(tctx, "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM cross-hash, got %s\n", nt_errstr(r.out.result));
+ if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_WRONG_PASSWORD) &&
+ !NT_STATUS_EQUAL(r.out.result, NT_STATUS_PASSWORD_RESTRICTION))
+ {
+ torture_warning(tctx, "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD or NT_STATUS_PASSWORD_RESTRICTION because we broke the LM cross-hash, got %s\n", nt_errstr(r.out.result));
ret = false;
}
@@ -1836,8 +1842,10 @@ static bool test_ChangePasswordUser(struct dcerpc_binding_handle *b,
torture_comment(tctx, "(%s:%s) old_password[%s] new_password[%s] status[%s]\n",
__location__, __FUNCTION__,
oldpass, newpass, nt_errstr(r.out.result));
- if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_WRONG_PASSWORD)) {
- torture_warning(tctx, "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the NT cross-hash, got %s\n", nt_errstr(r.out.result));
+ if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_WRONG_PASSWORD) &&
+ !NT_STATUS_EQUAL(r.out.result, NT_STATUS_PASSWORD_RESTRICTION))
+ {
+ torture_warning(tctx, "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD or NT_STATUS_PASSWORD_RESTRICTION because we broke the NT cross-hash, got %s\n", nt_errstr(r.out.result));
ret = false;
}