summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/samr.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-10-04 01:02:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:21 -0500
commitc8bec9dd3afac052cf78de281067ff57e256017d (patch)
tree9a4ac9629aeecc40d5a65ee385db83b332c28ad4 /source4/torture/rpc/samr.c
parent582595c215d25d5057f89bb67626c2938bb003ac (diff)
downloadsamba-c8bec9dd3afac052cf78de281067ff57e256017d.tar.gz
samba-c8bec9dd3afac052cf78de281067ff57e256017d.tar.bz2
samba-c8bec9dd3afac052cf78de281067ff57e256017d.zip
r10703: Add a new user account, change the password and test it in the SAMLOGON test.
The semantics for the user account are very odd, the old password is still valid, but the session keys appear to be blanked out. Andrew Bartlett (This used to be commit bbfaf4821d81116efa91313655acb75d6f577953)
Diffstat (limited to 'source4/torture/rpc/samr.c')
-rw-r--r--source4/torture/rpc/samr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 7b06c854b0..3344699c2b 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1082,10 +1082,10 @@ static BOOL test_ChangePasswordUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
-static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle,
- int policy_min_pw_len,
- char **password)
+BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ const char *account_string,
+ int policy_min_pw_len,
+ char **password)
{
NTSTATUS status;
struct samr_ChangePasswordUser3 r;
@@ -1101,7 +1101,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
printf("Testing ChangePasswordUser3\n");
server.string = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
- init_lsa_String(&account, TEST_ACCOUNT_NAME);
+ init_lsa_String(&account, account_string);
E_md4hash(oldpass, old_nt_hash);
E_md4hash(newpass, new_nt_hash);
@@ -1133,7 +1133,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
policy_min_pw_len = r.out.dominfo->min_password_length;
}
if (policy_min_pw_len) /* try again with the right min password length */ {
- ret = test_ChangePasswordUser3(p, mem_ctx, handle, policy_min_pw_len, password);
+ ret = test_ChangePasswordUser3(p, mem_ctx, account_string, policy_min_pw_len, password);
} else {
printf("ChangePasswordUser3 failed - %s\n", nt_errstr(status));
ret = False;
@@ -1546,11 +1546,11 @@ static BOOL test_ChangePassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
/* we change passwords twice - this has the effect of verifying
they were changed correctly for the final call */
- if (!test_ChangePasswordUser3(p, mem_ctx, domain_handle, 0, password)) {
+ if (!test_ChangePasswordUser3(p, mem_ctx, TEST_ACCOUNT_NAME, 0, password)) {
ret = False;
}
- if (!test_ChangePasswordUser3(p, mem_ctx, domain_handle, 0, password)) {
+ if (!test_ChangePasswordUser3(p, mem_ctx, TEST_ACCOUNT_NAME, 0, password)) {
ret = False;
}
@@ -1645,7 +1645,7 @@ static BOOL test_CreateUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
/* check it was set right */
- if (!test_ChangePasswordUser3(p, user_ctx, domain_handle, 0, &password)) {
+ if (!test_ChangePasswordUser3(p, user_ctx, TEST_ACCOUNT_NAME, 0, &password)) {
ret = False;
}
}
@@ -1656,7 +1656,7 @@ static BOOL test_CreateUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
/* check it was set right */
- if (!test_ChangePasswordUser3(p, user_ctx, domain_handle, 0, &password)) {
+ if (!test_ChangePasswordUser3(p, user_ctx, TEST_ACCOUNT_NAME, 0, &password)) {
ret = False;
}
}