[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha7-1554-g0dc1b23
Günther Deschner
gd at samba.org
Mon May 11 22:28:20 GMT 2009
The branch, master has been updated
via 0dc1b239eb48ac81797720a8ff23c810321ad5c3 (commit)
via 4beb4395eb032a290bf0d29e0d50e4d823e5f20c (commit)
via 54d925a30469f9318717b8e6da7b433efd4efd70 (commit)
via 59cb8fd58d03953ea53eed70da35dd94fe10d9c4 (commit)
via 1fb9b65921b617962dd72bf64c62fd95bfdcf326 (commit)
via ff7ebdf317979f54fba257afb1dbfb589b33885f (commit)
via 0f88b3cc94edd716894ce86c0e7125298b5b6338 (commit)
from de6ddda45ea06e562cdd372a51ab60b40a435ffc (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 0dc1b239eb48ac81797720a8ff23c810321ad5c3
Author: Günther Deschner <gd at samba.org>
Date: Fri May 8 11:25:56 2009 +0200
s3-samr: implement _samr_RidToSid().
Guenther
commit 4beb4395eb032a290bf0d29e0d50e4d823e5f20c
Author: Günther Deschner <gd at samba.org>
Date: Mon May 11 23:47:37 2009 +0200
s3-samr: Let _samr_TestPrivateFunctionsDomain() return NT_STATUS_NOT_SUPPORTED to make RPC-SAMR happy.
Guenther
commit 54d925a30469f9318717b8e6da7b433efd4efd70
Author: Günther Deschner <gd at samba.org>
Date: Tue May 12 00:19:56 2009 +0200
s4-smbtorture: skip SetMemberAttributesOfGroup in RPC-SAMR for s3 as well.
Guenther
commit 59cb8fd58d03953ea53eed70da35dd94fe10d9c4
Author: Günther Deschner <gd at samba.org>
Date: Mon May 11 23:46:45 2009 +0200
s4-smbtorture: Skip secdesc set calls for non-user objects in RPC-SAMR for Samba3.
Note that they are skipped for all objects while testing Samba4.
Guenther
commit 1fb9b65921b617962dd72bf64c62fd95bfdcf326
Author: Günther Deschner <gd at samba.org>
Date: Mon May 11 23:46:11 2009 +0200
s4-smbtorture: Fix order of assert args in test_TestPrivateFunctionsDomain() in RPC-SAMR.
Guenther
commit ff7ebdf317979f54fba257afb1dbfb589b33885f
Author: Günther Deschner <gd at samba.org>
Date: Mon May 11 23:13:26 2009 +0200
s4-smbtorture: switch to use torture_context in RPC-SAMR.
Guenther
commit 0f88b3cc94edd716894ce86c0e7125298b5b6338
Author: Günther Deschner <gd at samba.org>
Date: Mon May 11 22:44:58 2009 +0200
s4-smbtorture: remove trailing whitespace in RPC-SAMR.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/srv_samr_nt.c | 41 ++-
source4/torture/rpc/samr.c | 717 ++++++++++++++++++++------------------
2 files changed, 408 insertions(+), 350 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index b2503dc..e0c785d 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -6299,6 +6299,36 @@ NTSTATUS _samr_GetDisplayEnumerationIndex2(pipes_struct *p,
}
/****************************************************************
+ _samr_RidToSid
+****************************************************************/
+
+NTSTATUS _samr_RidToSid(pipes_struct *p,
+ struct samr_RidToSid *r)
+{
+ struct samr_domain_info *dinfo;
+ NTSTATUS status;
+ struct dom_sid sid;
+
+ dinfo = policy_handle_find(p, r->in.domain_handle,
+ 0, NULL,
+ struct samr_domain_info, &status);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ if (!sid_compose(&sid, &dinfo->sid, r->in.rid)) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ *r->out.sid = sid_dup_talloc(p->mem_ctx, &sid);
+ if (!*r->out.sid) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ return NT_STATUS_OK;
+}
+
+/****************************************************************
****************************************************************/
NTSTATUS _samr_Shutdown(pipes_struct *p,
@@ -6324,7 +6354,6 @@ NTSTATUS _samr_SetMemberAttributesOfGroup(pipes_struct *p,
NTSTATUS _samr_TestPrivateFunctionsDomain(pipes_struct *p,
struct samr_TestPrivateFunctionsDomain *r)
{
- p->rng_fault_state = true;
return NT_STATUS_NOT_IMPLEMENTED;
}
@@ -6380,16 +6409,6 @@ NTSTATUS _samr_GetBootKeyInformation(pipes_struct *p,
/****************************************************************
****************************************************************/
-NTSTATUS _samr_RidToSid(pipes_struct *p,
- struct samr_RidToSid *r)
-{
- p->rng_fault_state = true;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
NTSTATUS _samr_SetDsrmPassword(pipes_struct *p,
struct samr_SetDsrmPassword *r)
{
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 6327985..c153557 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1,20 +1,20 @@
-/*
+/*
Unix SMB/CIFS implementation.
test suite for samr rpc operations
Copyright (C) Andrew Tridgell 2003
Copyright (C) Andrew Bartlett <abartlet at samba.org> 2003
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -48,17 +48,21 @@ enum torture_samr_choice {
TORTURE_SAMR_OTHER
};
-static bool test_QueryUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_QueryUserInfo(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
struct policy_handle *handle);
-static bool test_QueryUserInfo2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_QueryUserInfo2(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
struct policy_handle *handle);
-static bool test_QueryAliasInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- struct policy_handle *handle);
+static bool test_QueryAliasInfo(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
+ struct policy_handle *handle);
-static bool test_ChangePassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
- const char *acct_name,
+static bool test_ChangePassword(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
+ const char *acct_name,
struct policy_handle *domain_handle, char **password);
static void init_lsa_String(struct lsa_String *string, const char *s)
@@ -138,8 +142,8 @@ static bool test_SetDsrmPassword(struct dcerpc_pipe *p, struct torture_context *
}
-static bool test_QuerySecurity(struct dcerpc_pipe *p,
- struct torture_context *tctx,
+static bool test_QuerySecurity(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
struct policy_handle *handle)
{
NTSTATUS status;
@@ -174,7 +178,7 @@ static bool test_QuerySecurity(struct dcerpc_pipe *p,
}
-static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx,
+static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx,
struct policy_handle *handle, uint32_t base_acct_flags,
const char *base_account_name)
{
@@ -345,7 +349,7 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
test_account_name = talloc_asprintf(tctx, "%sxx7-21", base_account_name);
TEST_USERINFO_STRING(7, account_name, 21, account_name, base_account_name, 0);
test_account_name = base_account_name;
- TEST_USERINFO_STRING(21, account_name, 21, account_name, base_account_name,
+ TEST_USERINFO_STRING(21, account_name, 21, account_name, base_account_name,
SAMR_FIELD_ACCOUNT_NAME);
TEST_USERINFO_STRING(6, full_name, 1, full_name, "xx6-1 full_name", 0);
@@ -355,7 +359,7 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
TEST_USERINFO_STRING(6, full_name, 8, full_name, "xx6-8 full_name", 0);
TEST_USERINFO_STRING(6, full_name, 21, full_name, "xx6-21 full_name", 0);
TEST_USERINFO_STRING(8, full_name, 21, full_name, "xx8-21 full_name", 0);
- TEST_USERINFO_STRING(21, full_name, 21, full_name, "xx21-21 full_name",
+ TEST_USERINFO_STRING(21, full_name, 21, full_name, "xx21-21 full_name",
SAMR_FIELD_FULL_NAME);
TEST_USERINFO_STRING(6, full_name, 1, full_name, "", 0);
@@ -365,19 +369,19 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
TEST_USERINFO_STRING(6, full_name, 8, full_name, "", 0);
TEST_USERINFO_STRING(6, full_name, 21, full_name, "", 0);
TEST_USERINFO_STRING(8, full_name, 21, full_name, "", 0);
- TEST_USERINFO_STRING(21, full_name, 21, full_name, "",
+ TEST_USERINFO_STRING(21, full_name, 21, full_name, "",
SAMR_FIELD_FULL_NAME);
TEST_USERINFO_STRING(11, logon_script, 3, logon_script, "xx11-3 logon_script", 0);
TEST_USERINFO_STRING(11, logon_script, 5, logon_script, "xx11-5 logon_script", 0);
TEST_USERINFO_STRING(11, logon_script, 21, logon_script, "xx11-21 logon_script", 0);
- TEST_USERINFO_STRING(21, logon_script, 21, logon_script, "xx21-21 logon_script",
+ TEST_USERINFO_STRING(21, logon_script, 21, logon_script, "xx21-21 logon_script",
SAMR_FIELD_LOGON_SCRIPT);
TEST_USERINFO_STRING(12, profile_path, 3, profile_path, "xx12-3 profile_path", 0);
TEST_USERINFO_STRING(12, profile_path, 5, profile_path, "xx12-5 profile_path", 0);
TEST_USERINFO_STRING(12, profile_path, 21, profile_path, "xx12-21 profile_path", 0);
- TEST_USERINFO_STRING(21, profile_path, 21, profile_path, "xx21-21 profile_path",
+ TEST_USERINFO_STRING(21, profile_path, 21, profile_path, "xx21-21 profile_path",
SAMR_FIELD_PROFILE_PATH);
TEST_USERINFO_STRING(10, home_directory, 3, home_directory, "xx10-3 home_directory", 0);
@@ -395,23 +399,23 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
SAMR_FIELD_HOME_DRIVE);
TEST_USERINFO_STRING(21, home_drive, 10, home_drive, "xx21-10 home_drive",
SAMR_FIELD_HOME_DRIVE);
-
+
TEST_USERINFO_STRING(13, description, 1, description, "xx13-1 description", 0);
TEST_USERINFO_STRING(13, description, 5, description, "xx13-5 description", 0);
TEST_USERINFO_STRING(13, description, 21, description, "xx13-21 description", 0);
- TEST_USERINFO_STRING(21, description, 21, description, "xx21-21 description",
+ TEST_USERINFO_STRING(21, description, 21, description, "xx21-21 description",
SAMR_FIELD_DESCRIPTION);
TEST_USERINFO_STRING(14, workstations, 3, workstations, "14workstation3", 0);
TEST_USERINFO_STRING(14, workstations, 5, workstations, "14workstation4", 0);
TEST_USERINFO_STRING(14, workstations, 21, workstations, "14workstation21", 0);
- TEST_USERINFO_STRING(21, workstations, 21, workstations, "21workstation21",
+ TEST_USERINFO_STRING(21, workstations, 21, workstations, "21workstation21",
SAMR_FIELD_WORKSTATIONS);
- TEST_USERINFO_STRING(21, workstations, 3, workstations, "21workstation3",
+ TEST_USERINFO_STRING(21, workstations, 3, workstations, "21workstation3",
SAMR_FIELD_WORKSTATIONS);
- TEST_USERINFO_STRING(21, workstations, 5, workstations, "21workstation5",
+ TEST_USERINFO_STRING(21, workstations, 5, workstations, "21workstation5",
SAMR_FIELD_WORKSTATIONS);
- TEST_USERINFO_STRING(21, workstations, 14, workstations, "21workstation14",
+ TEST_USERINFO_STRING(21, workstations, 14, workstations, "21workstation14",
SAMR_FIELD_WORKSTATIONS);
TEST_USERINFO_BINARYSTRING(20, parameters, 21, parameters, "xx20-21 parameters", 0);
@@ -469,68 +473,68 @@ static bool test_SetUserInfo(struct dcerpc_pipe *p, struct torture_context *tctx
TEST_USERINFO_INT(4, logon_hours.bits[3], 3, logon_hours.bits[3], 1, 0);
TEST_USERINFO_INT(4, logon_hours.bits[3], 5, logon_hours.bits[3], 2, 0);
TEST_USERINFO_INT(4, logon_hours.bits[3], 21, logon_hours.bits[3], 3, 0);
- TEST_USERINFO_INT(21, logon_hours.bits[3], 21, logon_hours.bits[3], 4,
+ TEST_USERINFO_INT(21, logon_hours.bits[3], 21, logon_hours.bits[3], 4,
SAMR_FIELD_LOGON_HOURS);
- TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ),
- (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ),
+ (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags),
0);
- TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
- (base_acct_flags | ACB_DISABLED),
- (base_acct_flags | ACB_DISABLED | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
+ (base_acct_flags | ACB_DISABLED),
+ (base_acct_flags | ACB_DISABLED | user_extra_flags),
0);
-
+
/* Setting PWNOEXP clears the magic ACB_PW_EXPIRED flag */
- TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP),
- (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 5, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP),
+ (base_acct_flags | ACB_DISABLED | ACB_PWNOEXP),
0);
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ),
- (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ),
+ (base_acct_flags | ACB_DISABLED | ACB_HOMDIRREQ | user_extra_flags),
0);
/* The 'autolock' flag doesn't stick - check this */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_AUTOLOCK),
- (base_acct_flags | ACB_DISABLED | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_AUTOLOCK),
+ (base_acct_flags | ACB_DISABLED | user_extra_flags),
0);
#if 0
/* Removing the 'disabled' flag doesn't stick - check this */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags),
- (base_acct_flags | ACB_DISABLED | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags),
+ (base_acct_flags | ACB_DISABLED | user_extra_flags),
0);
#endif
/* Samba3 cannot store these atm */
if (!torture_setting_bool(tctx, "samba3", false)) {
/* The 'store plaintext' flag does stick */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED),
- (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED),
+ (base_acct_flags | ACB_DISABLED | ACB_ENC_TXT_PWD_ALLOWED | user_extra_flags),
0);
/* The 'use DES' flag does stick */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY),
- (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY),
+ (base_acct_flags | ACB_DISABLED | ACB_USE_DES_KEY_ONLY | user_extra_flags),
0);
/* The 'don't require kerberos pre-authentication flag does stick */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH),
- (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH),
+ (base_acct_flags | ACB_DISABLED | ACB_DONT_REQUIRE_PREAUTH | user_extra_flags),
0);
/* The 'no kerberos PAC required' flag sticks */
- TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD),
- (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD | user_extra_flags),
+ TEST_USERINFO_INT_EXP(16, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD),
+ (base_acct_flags | ACB_DISABLED | ACB_NO_AUTH_DATA_REQD | user_extra_flags),
0);
}
- TEST_USERINFO_INT_EXP(21, acct_flags, 21, acct_flags,
- (base_acct_flags | ACB_DISABLED),
- (base_acct_flags | ACB_DISABLED | user_extra_flags),
+ TEST_USERINFO_INT_EXP(21, acct_flags, 21, acct_flags,
+ (base_acct_flags | ACB_DISABLED),
+ (base_acct_flags | ACB_DISABLED | user_extra_flags),
SAMR_FIELD_ACCT_FLAGS);
#if 0
@@ -722,7 +726,7 @@ static bool test_SetUserPass_23(struct dcerpc_pipe *p, struct torture_context *t
static bool test_SetUserPassEx(struct dcerpc_pipe *p, struct torture_context *tctx,
- struct policy_handle *handle, bool makeshort,
+ struct policy_handle *handle, bool makeshort,
char **password)
{
NTSTATUS status;
@@ -1445,7 +1449,7 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
n.in.num_names = 2;
status = dcerpc_samr_LookupNames(p, tctx, &n);
if (!NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) {
- printf("LookupNames[2] failed - %s\n", nt_errstr(status));
+ printf("LookupNames[2] failed - %s\n", nt_errstr(status));
if (NT_STATUS_IS_OK(status)) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -1455,7 +1459,7 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
n.in.num_names = 0;
status = dcerpc_samr_LookupNames(p, tctx, &n);
if (!NT_STATUS_IS_OK(status)) {
- printf("LookupNames[0] failed - %s\n", nt_errstr(status));
+ printf("LookupNames[0] failed - %s\n", nt_errstr(status));
return status;
}
@@ -1463,7 +1467,7 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
n.in.num_names = 1;
status = dcerpc_samr_LookupNames(p, tctx, &n);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
- printf("LookupNames[1 bad name] failed - %s\n", nt_errstr(status));
+ printf("LookupNames[1 bad name] failed - %s\n", nt_errstr(status));
if (NT_STATUS_IS_OK(status)) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -1475,7 +1479,7 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
n.in.num_names = 2;
status = dcerpc_samr_LookupNames(p, tctx, &n);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
- printf("LookupNames[2 bad names] failed - %s\n", nt_errstr(status));
+ printf("LookupNames[2 bad names] failed - %s\n", nt_errstr(status));
if (NT_STATUS_IS_OK(status)) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -1485,7 +1489,8 @@ static NTSTATUS test_LookupName(struct dcerpc_pipe *p, struct torture_context *t
return NT_STATUS_OK;
}
-static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
struct policy_handle *domain_handle,
const char *name, struct policy_handle *user_handle)
{
@@ -1493,7 +1498,7 @@ static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct samr_OpenUser r;
uint32_t rid;
- status = test_LookupName(p, mem_ctx, domain_handle, name, &rid);
+ status = test_LookupName(p, tctx, domain_handle, name, &rid);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -1502,7 +1507,7 @@ static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
r.in.rid = rid;
r.out.user_handle = user_handle;
- status = dcerpc_samr_OpenUser(p, mem_ctx, &r);
+ status = dcerpc_samr_OpenUser(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("OpenUser_byname(%s -> %d) failed - %s\n", name, rid, nt_errstr(status));
}
@@ -1511,7 +1516,8 @@ static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
}
#if 0
-static bool test_ChangePasswordNT3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+static bool test_ChangePasswordNT3(struct dcerpc_pipe *p,
+ struct torture_context *tctx,
struct policy_handle *handle)
{
NTSTATUS status;
@@ -1524,7 +1530,7 @@ static bool test_ChangePasswordNT3(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, "testuser", &user_handle);
+ status = test_OpenUser_byname(p, tctx, handle, "testuser", &user_handle);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
@@ -1558,13 +1564,13 @@ static bool test_ChangePasswordNT3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
r.in.cross2_present = 1;
r.in.lm_cross = &hash6;
- status = dcerpc_samr_ChangePasswordUser(p, mem_ctx, &r);
+ status = dcerpc_samr_ChangePasswordUser(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
printf("ChangePasswordUser failed - %s\n", nt_errstr(status));
ret = false;
}
- if (!test_samr_handle_Close(p, mem_ctx, &user_handle)) {
+ if (!test_samr_handle_Close(p, tctx, &user_handle)) {
ret = false;
}
@@ -1573,7 +1579,7 @@ static bool test_ChangePasswordNT3(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
#endif
static bool test_ChangePasswordUser(struct dcerpc_pipe *p, struct torture_context *tctx,
- const char *acct_name,
+ const char *acct_name,
struct policy_handle *handle, char **password)
{
NTSTATUS status;
@@ -1606,7 +1612,7 @@ static bool test_ChangePasswordUser(struct dcerpc_pipe *p, struct torture_contex
torture_comment(tctx, "Testing ChangePasswordUser\n");
- torture_assert(tctx, *password != NULL,
+ torture_assert(tctx, *password != NULL,
"Failing ChangePasswordUser as old password was NULL. Previous test failed?");
oldpass = *password;
@@ -1659,7 +1665,7 @@ static bool test_ChangePasswordUser(struct dcerpc_pipe *p, struct torture_contex
r.in.lm_cross = &hash6;
status = dcerpc_samr_ChangePasswordUser(p, tctx, &r);
- torture_assert_ntstatus_equal(tctx, status, NT_STATUS_WRONG_PASSWORD,
+ torture_assert_ntstatus_equal(tctx, status, NT_STATUS_WRONG_PASSWORD,
"expected NT_STATUS_WRONG_PASSWORD because we broke the NT hash");
/* Unbreak the NT hash */
@@ -1841,7 +1847,7 @@ static bool test_ChangePasswordUser(struct dcerpc_pipe *p, struct torture_contex
}
}
-
+
if (!test_samr_handle_Close(p, tctx, &user_handle)) {
ret = false;
}
@@ -1876,7 +1882,7 @@ static bool test_OemChangePasswordUser2(struct dcerpc_pipe *p, struct torture_co
torture_comment(tctx, "Testing OemChangePasswordUser2\n");
- torture_assert(tctx, *password != NULL,
+ torture_assert(tctx, *password != NULL,
"Failing OemChangePasswordUser2 as old password was NULL. Previous test failed?");
oldpass = *password;
@@ -2046,7 +2052,7 @@ static bool test_ChangePasswordUser2(struct dcerpc_pipe *p, struct torture_conte
torture_comment(tctx, "Testing ChangePasswordUser2 on %s\n", acct_name);
- torture_assert(tctx, *password != NULL,
+ torture_assert(tctx, *password != NULL,
"Failing ChangePasswordUser2 as old password was NULL. Previous test failed?");
oldpass = *password;
@@ -2058,7 +2064,7 @@ static bool test_ChangePasswordUser2(struct dcerpc_pipe *p, struct torture_conte
}
newpass = samr_rand_pass(tctx, policy_min_pw_len);
- }
+ }
server.string = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
init_lsa_String(&account, acct_name);
@@ -2099,7 +2105,7 @@ static bool test_ChangePasswordUser2(struct dcerpc_pipe *p, struct torture_conte
}
-bool test_ChangePasswordUser3(struct dcerpc_pipe *p, struct torture_context *tctx,
+bool test_ChangePasswordUser3(struct dcerpc_pipe *p, struct torture_context *tctx,
const char *account_string,
int policy_min_pw_len,
char **password,
@@ -2134,7 +2140,7 @@ bool test_ChangePasswordUser3(struct dcerpc_pipe *p, struct torture_context *tct
torture_comment(tctx, "Using password '%s'\n", newpass);
--
Samba Shared Repository
More information about the samba-cvs
mailing list