The branch, master has been updated via e7cc45c... error_codes: fix NT_STATUS_RPC_UNKNOWN_IF typo. via dd4e2eb... s4-smbtorture: use torture_context in policy function in RPC-LSA-LOOKUP test. from 421a926... s3:libsmb/nterr.c: fix/add NT_STATUS_RPC_* codes
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit e7cc45cb140e1df5731619ae09af6c10b8f9fffa Author: Günther Deschner <g...@samba.org> Date: Fri Mar 19 09:30:36 2010 +0100 error_codes: fix NT_STATUS_RPC_UNKNOWN_IF typo. Metze, please check. Guenther commit dd4e2ebda5c3febe89025781921f7f6875b57e07 Author: Günther Deschner <g...@samba.org> Date: Thu Mar 18 23:54:14 2010 +0100 s4-smbtorture: use torture_context in policy function in RPC-LSA-LOOKUP test. Guenther ----------------------------------------------------------------------- Summary of changes: libcli/util/ntstatus.h | 2 +- source3/libsmb/nterr.c | 2 +- source4/libcli/util/nterr.c | 2 +- source4/torture/rpc/lsa_lookup.c | 32 +++++++++++++++++--------------- 4 files changed, 20 insertions(+), 18 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/util/ntstatus.h b/libcli/util/ntstatus.h index dca1490..31f9d28 100644 --- a/libcli/util/ntstatus.h +++ b/libcli/util/ntstatus.h @@ -604,7 +604,7 @@ typedef uint32_t NTSTATUS; #define NT_STATUS_NO_SUCH_JOB NT_STATUS(0xC0000000 | 0xEDE) /* scheduler */ #define NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED NT_STATUS(0xC0000000 | 0x20004) #define NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX NT_STATUS(0xC0000000 | 0x20026) -#define NT_STAUTS_RPC_UNKNOWN_IF NT_STATUS(0xC0000000 | 0x20012) +#define NT_STATUS_RPC_UNKNOWN_IF NT_STATUS(0xC0000000 | 0x20012) #define NT_STATUS_RPC_CALL_FAILED NT_STATUS(0xC0000000 | 0x2001B) #define NT_STATUS_RPC_PROTOCOL_ERROR NT_STATUS(0xC0000000 | 0x2001D) #define NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE NT_STATUS(0xC0000000 | 0x2002E) diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c index 7efd32e..817bb56 100644 --- a/source3/libsmb/nterr.c +++ b/source3/libsmb/nterr.c @@ -545,7 +545,7 @@ static const nt_err_code_struct nt_errs[] = { "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES }, { "NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED", NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED }, { "NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX", NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX }, - { "NT_STAUTS_RPC_UNKNOWN_IF", NT_STAUTS_RPC_UNKNOWN_IF }, + { "NT_STATUS_RPC_UNKNOWN_IF", NT_STATUS_RPC_UNKNOWN_IF }, { "NT_STATUS_RPC_CALL_FAILED", NT_STATUS_RPC_CALL_FAILED }, { "NT_STATUS_RPC_PROTOCOL_ERROR", NT_STATUS_RPC_PROTOCOL_ERROR }, { "NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE", NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE }, diff --git a/source4/libcli/util/nterr.c b/source4/libcli/util/nterr.c index c70c331..3a850a0 100644 --- a/source4/libcli/util/nterr.c +++ b/source4/libcli/util/nterr.c @@ -546,7 +546,7 @@ static const nt_err_code_struct nt_errs[] = { "NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES }, { "NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED", NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED }, { "NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX", NT_STATUS_RPC_UNSUPPORTED_NAME_SYNTAX }, - { "NT_STAUTS_RPC_UNKNOWN_IF", NT_STAUTS_RPC_UNKNOWN_IF }, + { "NT_STATUS_RPC_UNKNOWN_IF", NT_STATUS_RPC_UNKNOWN_IF }, { "NT_STATUS_RPC_CALL_FAILED", NT_STATUS_RPC_CALL_FAILED }, { "NT_STATUS_RPC_PROTOCOL_ERROR", NT_STATUS_RPC_PROTOCOL_ERROR }, { "NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE", NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE }, diff --git a/source4/torture/rpc/lsa_lookup.c b/source4/torture/rpc/lsa_lookup.c index 0ca086c..3765fae 100644 --- a/source4/torture/rpc/lsa_lookup.c +++ b/source4/torture/rpc/lsa_lookup.c @@ -23,15 +23,15 @@ #include "librpc/gen_ndr/ndr_lsa_c.h" #include "libcli/security/security.h" -static bool open_policy(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b, +static bool open_policy(struct torture_context *tctx, + struct dcerpc_binding_handle *b, struct policy_handle **handle) { struct lsa_ObjectAttribute attr; struct lsa_QosInfo qos; struct lsa_OpenPolicy2 r; - NTSTATUS status; - *handle = talloc(mem_ctx, struct policy_handle); + *handle = talloc(tctx, struct policy_handle); if (!*handle) { return false; } @@ -53,31 +53,32 @@ static bool open_policy(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b, r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; r.out.handle = *handle; - status = dcerpc_lsa_OpenPolicy2_r(b, mem_ctx, &r); + torture_assert_ntstatus_ok(tctx, dcerpc_lsa_OpenPolicy2_r(b, tctx, &r), "OpenPolicy2 failed"); - return NT_STATUS_IS_OK(status); + return NT_STATUS_IS_OK(r.out.result); } -static bool get_domainsid(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b, +static bool get_domainsid(struct torture_context *tctx, + struct dcerpc_binding_handle *b, struct policy_handle *handle, struct dom_sid **sid) { struct lsa_QueryInfoPolicy r; union lsa_PolicyInformation *info = NULL; - NTSTATUS status; r.in.level = LSA_POLICY_INFO_DOMAIN; r.in.handle = handle; r.out.info = &info; - status = dcerpc_lsa_QueryInfoPolicy_r(b, mem_ctx, &r); - if (!NT_STATUS_IS_OK(status)) return false; + torture_assert_ntstatus_ok(tctx, dcerpc_lsa_QueryInfoPolicy_r(b, tctx, &r), + "QueryInfoPolicy failed"); *sid = info->domain.sid; return true; } -static NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, uint16_t level, +static NTSTATUS lookup_sids(struct torture_context *tctx, + uint16_t level, struct dcerpc_binding_handle *b, struct policy_handle *handle, struct dom_sid **sids, uint32_t num_sids, @@ -93,7 +94,7 @@ static NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, uint16_t level, names->names = NULL; sidarray.num_sids = num_sids; - sidarray.sids = talloc_array(mem_ctx, struct lsa_SidPtr, num_sids); + sidarray.sids = talloc_array(tctx, struct lsa_SidPtr, num_sids); for (i=0; i<num_sids; i++) { sidarray.sids[i].sid = sids[i]; @@ -108,7 +109,7 @@ static NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, uint16_t level, r.out.count = &count; r.out.domains = &domains; - return dcerpc_lsa_LookupSids_r(b, mem_ctx, &r); + return dcerpc_lsa_LookupSids_r(b, tctx, &r); } static const char *sid_type_lookup(enum lsa_SidType r) @@ -128,7 +129,8 @@ static const char *sid_type_lookup(enum lsa_SidType r) return "Invalid sid type\n"; } -static bool test_lookupsids(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b, +static bool test_lookupsids(struct torture_context *tctx, + struct dcerpc_binding_handle *b, struct policy_handle *handle, struct dom_sid **sids, uint32_t num_sids, int level, NTSTATUS expected_result, @@ -139,7 +141,7 @@ static bool test_lookupsids(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b uint32_t i; bool ret = true; - status = lookup_sids(mem_ctx, level, b, handle, sids, num_sids, + status = lookup_sids(tctx, level, b, handle, sids, num_sids, &names); if (!NT_STATUS_EQUAL(status, expected_result)) { printf("For level %d expected %s, got %s\n", @@ -157,7 +159,7 @@ static bool test_lookupsids(TALLOC_CTX *mem_ctx, struct dcerpc_binding_handle *b if (names.names[i].sid_type != types[i]) { printf("In level %d, for sid %s expected %s, " "got %s\n", level, - dom_sid_string(mem_ctx, sids[i]), + dom_sid_string(tctx, sids[i]), sid_type_lookup(types[i]), sid_type_lookup(names.names[i].sid_type)); ret = false; -- Samba Shared Repository