summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-06-05 03:22:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:30 -0500
commit5b04ca8080708573207eb58f2c2b207780a6ea28 (patch)
tree42d7677298d96020cfa6ecdbe81211c582511bd3 /source4/torture/rpc
parentae067cdaf70c7725237ec58b5e23bc6f525594c2 (diff)
downloadsamba-5b04ca8080708573207eb58f2c2b207780a6ea28.tar.gz
samba-5b04ca8080708573207eb58f2c2b207780a6ea28.tar.bz2
samba-5b04ca8080708573207eb58f2c2b207780a6ea28.zip
r1025: Rename (across the samr and netlogon pipes, so far)
pwd -> password passwd -> password username -> account_name Also work on consistant structure feild names between these two pipes, and fix up some callers to use samr_Password for the netlogon credential code. Andrew Bartlett (This used to be commit 4e35418c2776f7b79be5b358ffd077754685d1ac)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/netlogon.c42
-rw-r--r--source4/torture/rpc/samr.c54
2 files changed, 48 insertions, 48 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 902910d179..3ee7afa575 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -103,7 +103,7 @@ static BOOL join_domain_bdc(TALLOC_CTX *mem_ctx)
again:
name.name = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
r.in.handle = &domain_handle;
- r.in.username = &name;
+ r.in.account_name = &name;
r.in.acct_flags = ACB_SVRTRUST;
r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
r.out.acct_handle = &join.acct_handle;
@@ -126,7 +126,7 @@ again:
status = dcerpc_samr_GetUserPwInfo(join.p, mem_ctx, &pwp);
if (NT_STATUS_IS_OK(status)) {
- policy_min_pw_len = pwp.out.info.min_pwd_len;
+ policy_min_pw_len = pwp.out.info.min_password_len;
}
join.machine_password = generate_random_str(mem_ctx, MAX(8, policy_min_pw_len));
@@ -198,7 +198,7 @@ static BOOL test_LogonUasLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
struct netr_LogonUasLogon r;
r.in.server_name = NULL;
- r.in.username = lp_parm_string(-1, "torture", "username");
+ r.in.account_name = lp_parm_string(-1, "torture", "username");
r.in.workstation = TEST_MACHINE_NAME;
printf("Testing LogonUasLogon\n");
@@ -219,7 +219,7 @@ static BOOL test_LogonUasLogoff(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
struct netr_LogonUasLogoff r;
r.in.server_name = NULL;
- r.in.username = lp_parm_string(-1, "torture", "username");
+ r.in.account_name = lp_parm_string(-1, "torture", "username");
r.in.workstation = TEST_MACHINE_NAME;
printf("Testing LogonUasLogoff\n");
@@ -242,7 +242,7 @@ static BOOL test_SetupCredentials(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct netr_ServerAuthenticate a;
struct netr_Credential credentials1, credentials2, credentials3;
const char *plain_pass;
- uint8_t mach_pwd[16];
+ struct samr_Password mach_password;
printf("Testing ServerReqChallenge\n");
@@ -265,16 +265,16 @@ static BOOL test_SetupCredentials(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
- E_md4hash(plain_pass, mach_pwd);
+ E_md4hash(plain_pass, mach_password.hash);
a.in.server_name = NULL;
- a.in.username = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
+ a.in.account_name = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
a.in.secure_channel_type = SEC_CHAN_BDC;
a.in.computer_name = TEST_MACHINE_NAME;
a.in.credentials = &credentials3;
a.out.credentials = &credentials3;
- creds_client_init(creds, &credentials1, &credentials2, mach_pwd, &credentials3,
+ creds_client_init(creds, &credentials1, &credentials2, &mach_password, &credentials3,
NETLOGON_NEG_AUTH2_FLAGS);
printf("Testing ServerAuthenticate\n");
@@ -302,7 +302,7 @@ static BOOL test_SetupCredentials2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct netr_ServerAuthenticate2 a;
struct netr_Credential credentials1, credentials2, credentials3;
const char *plain_pass;
- uint8_t mach_pwd[16];
+ struct samr_Password mach_password;
printf("Testing ServerReqChallenge\n");
@@ -325,10 +325,10 @@ static BOOL test_SetupCredentials2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
- E_md4hash(plain_pass, mach_pwd);
+ E_md4hash(plain_pass, mach_password.hash);
a.in.server_name = NULL;
- a.in.username = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
+ a.in.account_name = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
a.in.secure_channel_type = SEC_CHAN_BDC;
a.in.computer_name = TEST_MACHINE_NAME;
a.in.negotiate_flags = &negotiate_flags;
@@ -336,7 +336,7 @@ static BOOL test_SetupCredentials2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
a.in.credentials = &credentials3;
a.out.credentials = &credentials3;
- creds_client_init(creds, &credentials1, &credentials2, mach_pwd, &credentials3,
+ creds_client_init(creds, &credentials1, &credentials2, &mach_password, &credentials3,
negotiate_flags);
printf("Testing ServerAuthenticate2\n");
@@ -367,7 +367,7 @@ static BOOL test_SetupCredentials3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct netr_ServerAuthenticate3 a;
struct netr_Credential credentials1, credentials2, credentials3;
const char *plain_pass;
- uint8_t mach_pwd[16];
+ struct samr_Password mach_password;
uint32 rid;
printf("Testing ServerReqChallenge\n");
@@ -391,10 +391,10 @@ static BOOL test_SetupCredentials3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
- E_md4hash(plain_pass, mach_pwd);
+ E_md4hash(plain_pass, mach_password.hash);
a.in.server_name = NULL;
- a.in.username = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
+ a.in.account_name = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
a.in.secure_channel_type = SEC_CHAN_BDC;
a.in.computer_name = TEST_MACHINE_NAME;
a.in.negotiate_flags = &negotiate_flags;
@@ -403,7 +403,7 @@ static BOOL test_SetupCredentials3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
a.out.negotiate_flags = &negotiate_flags;
a.out.rid = &rid;
- creds_client_init(creds, &credentials1, &credentials2, mach_pwd, &credentials3,
+ creds_client_init(creds, &credentials1, &credentials2, &mach_password, &credentials3,
negotiate_flags);
printf("Testing ServerAuthenticate3\n");
@@ -434,7 +434,7 @@ enum ntlm_break {
struct samlogon_state {
TALLOC_CTX *mem_ctx;
- const char *username;
+ const char *account_name;
const char *password;
struct dcerpc_pipe *p;
struct netr_LogonSamLogon r;
@@ -473,7 +473,7 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
ninfo.logon_info.parameter_control = 0;
ninfo.logon_info.logon_id_low = 0;
ninfo.logon_info.logon_id_high = 0;
- ninfo.logon_info.username.string = samlogon_state->username;
+ ninfo.logon_info.account_name.string = samlogon_state->account_name;
ninfo.logon_info.workstation.string = TEST_MACHINE_NAME;
memcpy(ninfo.challenge, chall->data, 8);
@@ -827,7 +827,7 @@ static BOOL test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state, enum
ZERO_STRUCT(user_session_key);
/* TODO - test with various domain cases, and without domain */
- if (!SMBNTLMv2encrypt(samlogon_state->username, lp_workgroup(),
+ if (!SMBNTLMv2encrypt(samlogon_state->account_name, lp_workgroup(),
samlogon_state->password, &samlogon_state->chall,
&names_blob,
&lmv2_response, &ntlmv2_response,
@@ -1051,7 +1051,7 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
struct samlogon_state samlogon_state;
samlogon_state.mem_ctx = mem_ctx;
- samlogon_state.username = lp_parm_string(-1, "torture", "username");
+ samlogon_state.account_name = lp_parm_string(-1, "torture", "username");
samlogon_state.password = lp_parm_string(-1, "torture", "password");
samlogon_state.p = p;
@@ -1114,7 +1114,7 @@ static BOOL test_SetPassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
}
r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
- r.in.username = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
+ r.in.account_name = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
r.in.secure_channel_type = SEC_CHAN_BDC;
r.in.computer_name = TEST_MACHINE_NAME;
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 311ed23dbe..fea03e8617 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -22,7 +22,7 @@
#include "includes.h"
-#define TEST_USERNAME "samrtorturetest"
+#define TEST_ACCOUNT_NAME "samrtorturetest"
#define TEST_ALIASNAME "samrtorturetestalias"
#define TEST_GROUPNAME "samrtorturetestgroup"
#define TEST_MACHINENAME "samrtorturetestmach$"
@@ -281,11 +281,11 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
TEST_USERINFO_NAME(21, logon_script, 21, logon_script, "xx21-21 logon_script",
SAMR_FIELD_LOGON_SCRIPT);
- TEST_USERINFO_NAME(12, profile, 3, profile, "xx12-3 profile", 0);
- TEST_USERINFO_NAME(12, profile, 5, profile, "xx12-5 profile", 0);
- TEST_USERINFO_NAME(12, profile, 21, profile, "xx12-21 profile", 0);
- TEST_USERINFO_NAME(21, profile, 21, profile, "xx21-21 profile",
- SAMR_FIELD_PROFILE);
+ TEST_USERINFO_NAME(12, profile_path, 3, profile_path, "xx12-3 profile_path", 0);
+ TEST_USERINFO_NAME(12, profile_path, 5, profile_path, "xx12-5 profile_path", 0);
+ TEST_USERINFO_NAME(12, profile_path, 21, profile_path, "xx12-21 profile_path", 0);
+ TEST_USERINFO_NAME(21, profile_path, 21, profile_path, "xx21-21 profile_path",
+ SAMR_FIELD_PROFILE_PATH);
TEST_USERINFO_NAME(13, description, 1, description, "xx13-1 description", 0);
TEST_USERINFO_NAME(13, description, 5, description, "xx13-5 description", 0);
@@ -741,7 +741,7 @@ static BOOL test_ChangePasswordUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
uint8_t old_nt_hash[16], new_nt_hash[16];
uint8_t old_lm_hash[16], new_lm_hash[16];
- status = test_OpenUser_byname(p, mem_ctx, handle, TEST_USERNAME, &user_handle);
+ status = test_OpenUser_byname(p, mem_ctx, handle, TEST_ACCOUNT_NAME, &user_handle);
if (!NT_STATUS_IS_OK(status)) {
return False;
}
@@ -804,7 +804,7 @@ static BOOL test_OemChangePasswordUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_c
printf("Testing OemChangePasswordUser2\n");
server.name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
- account.name = TEST_USERNAME;
+ account.name = TEST_ACCOUNT_NAME;
E_deshash(oldpass, old_lm_hash);
E_deshash(newpass, new_lm_hash);
@@ -847,7 +847,7 @@ static BOOL test_ChangePasswordUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
printf("Testing ChangePasswordUser2\n");
server.name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
- init_samr_Name(&account, TEST_USERNAME);
+ init_samr_Name(&account, TEST_ACCOUNT_NAME);
E_md4hash(oldpass, old_nt_hash);
E_md4hash(newpass, new_nt_hash);
@@ -900,7 +900,7 @@ static BOOL test_ChangePasswordUser3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
printf("Testing ChangePasswordUser3\n");
server.name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
- init_samr_Name(&account, TEST_USERNAME);
+ init_samr_Name(&account, TEST_ACCOUNT_NAME);
E_md4hash(oldpass, old_nt_hash);
E_md4hash(newpass, new_nt_hash);
@@ -1354,26 +1354,26 @@ static BOOL test_CreateUser(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct samr_Name name;
BOOL ret = True;
- init_samr_Name(&name, TEST_USERNAME);
+ init_samr_Name(&name, TEST_ACCOUNT_NAME);
r.in.handle = domain_handle;
- r.in.username = &name;
+ r.in.account_name = &name;
r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
r.out.acct_handle = user_handle;
r.out.rid = &rid;
- printf("Testing CreateUser(%s)\n", r.in.username->name);
+ printf("Testing CreateUser(%s)\n", r.in.account_name->name);
status = dcerpc_samr_CreateUser(p, mem_ctx, &r);
if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
- printf("Server refused create of '%s'\n", r.in.username->name);
+ printf("Server refused create of '%s'\n", r.in.account_name->name);
ZERO_STRUCTP(user_handle);
return True;
}
if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
- if (!test_DeleteUser_byname(p, mem_ctx, domain_handle, r.in.username->name)) {
+ if (!test_DeleteUser_byname(p, mem_ctx, domain_handle, r.in.account_name->name)) {
return False;
}
status = dcerpc_samr_CreateUser(p, mem_ctx, &r);
@@ -1474,9 +1474,9 @@ static BOOL test_CreateUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
const char *account_name;
NTSTATUS nt_status;
} account_types[] = {
- { ACB_NORMAL, TEST_USERNAME, NT_STATUS_OK },
- { ACB_NORMAL | ACB_DISABLED, TEST_USERNAME, NT_STATUS_INVALID_PARAMETER },
- { ACB_NORMAL | ACB_PWNOEXP, TEST_USERNAME, NT_STATUS_INVALID_PARAMETER },
+ { ACB_NORMAL, TEST_ACCOUNT_NAME, NT_STATUS_OK },
+ { ACB_NORMAL | ACB_DISABLED, TEST_ACCOUNT_NAME, NT_STATUS_INVALID_PARAMETER },
+ { ACB_NORMAL | ACB_PWNOEXP, TEST_ACCOUNT_NAME, NT_STATUS_INVALID_PARAMETER },
{ ACB_WSTRUST, TEST_MACHINENAME, NT_STATUS_OK },
{ ACB_WSTRUST | ACB_DISABLED, TEST_MACHINENAME, NT_STATUS_INVALID_PARAMETER },
{ ACB_WSTRUST | ACB_PWNOEXP, TEST_MACHINENAME, NT_STATUS_INVALID_PARAMETER },
@@ -1486,8 +1486,8 @@ static BOOL test_CreateUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{ ACB_DOMTRUST, TEST_DOMAINNAME, NT_STATUS_OK },
{ ACB_DOMTRUST | ACB_DISABLED, TEST_DOMAINNAME, NT_STATUS_INVALID_PARAMETER },
{ ACB_DOMTRUST | ACB_PWNOEXP, TEST_DOMAINNAME, NT_STATUS_INVALID_PARAMETER },
- { 0, TEST_USERNAME, NT_STATUS_INVALID_PARAMETER },
- { ACB_DISABLED, TEST_USERNAME, NT_STATUS_INVALID_PARAMETER },
+ { 0, TEST_ACCOUNT_NAME, NT_STATUS_INVALID_PARAMETER },
+ { ACB_DISABLED, TEST_ACCOUNT_NAME, NT_STATUS_INVALID_PARAMETER },
{ 0, NULL, NT_STATUS_INVALID_PARAMETER }
};
@@ -1498,23 +1498,23 @@ static BOOL test_CreateUser2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
init_samr_Name(&name, account_types[i].account_name);
r.in.handle = handle;
- r.in.username = &name;
+ r.in.account_name = &name;
r.in.acct_flags = acct_flags;
r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
r.out.acct_handle = &acct_handle;
r.out.access_granted = &access_granted;
r.out.rid = &rid;
- printf("Testing CreateUser2(%s)\n", r.in.username->name);
+ printf("Testing CreateUser2(%s)\n", r.in.account_name->name);
status = dcerpc_samr_CreateUser2(p, mem_ctx, &r);
if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
- printf("Server refused create of '%s'\n", r.in.username->name);
+ printf("Server refused create of '%s'\n", r.in.account_name->name);
continue;
} else if (NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
- if (!test_DeleteUser_byname(p, mem_ctx, handle, r.in.username->name)) {
+ if (!test_DeleteUser_byname(p, mem_ctx, handle, r.in.account_name->name)) {
return False;
}
status = dcerpc_samr_CreateUser2(p, mem_ctx, &r);
@@ -2008,7 +2008,7 @@ static BOOL test_GetDisplayEnumerationIndex(struct dcerpc_pipe *p, TALLOC_CTX *m
r.in.handle = handle;
r.in.level = levels[i];
- init_samr_Name(&r.in.name, TEST_USERNAME);
+ init_samr_Name(&r.in.name, TEST_ACCOUNT_NAME);
status = dcerpc_samr_GetDisplayEnumerationIndex(p, mem_ctx, &r);
@@ -2049,7 +2049,7 @@ static BOOL test_GetDisplayEnumerationIndex2(struct dcerpc_pipe *p, TALLOC_CTX *
r.in.handle = handle;
r.in.level = levels[i];
- init_samr_Name(&r.in.name, TEST_USERNAME);
+ init_samr_Name(&r.in.name, TEST_ACCOUNT_NAME);
status = dcerpc_samr_GetDisplayEnumerationIndex2(p, mem_ctx, &r);
if (ok_lvl[i] &&
@@ -2469,7 +2469,7 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
BOOL ret = True;
uint32_t rid;
- status = test_LookupName(p, mem_ctx, domain_handle, TEST_USERNAME, &rid);
+ status = test_LookupName(p, mem_ctx, domain_handle, TEST_ACCOUNT_NAME, &rid);
if (!NT_STATUS_IS_OK(status)) {
return False;
}