summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-11-09 19:24:51 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:45:02 +0100
commit529763a9aa192a6785ba878aceeb1683c2510913 (patch)
tree5fc843ffa644969ecd967d8b4133fc19333c33b5 /source4/torture/rpc
parentb2ddeeb79d2622b3fd216465716dfa6b8c3e0b86 (diff)
downloadsamba-529763a9aa192a6785ba878aceeb1683c2510913.tar.gz
samba-529763a9aa192a6785ba878aceeb1683c2510913.tar.bz2
samba-529763a9aa192a6785ba878aceeb1683c2510913.zip
r25920: ndr: change NTSTAUS into enum ndr_err_code (samba4 callers)
lib/messaging/ lib/registry/ lib/ldb-samba/ librpc/rpc/ auth/auth_winbind.c auth/gensec/ auth/kerberos/ dsdb/repl/ dsdb/samdb/ dsdb/schema/ torture/ cluster/ctdb/ kdc/ ntvfs/ipc/ torture/rap/ ntvfs/ utils/getntacl.c ntptr/ smb_server/ libcli/wrepl/ wrepl_server/ libcli/cldap/ libcli/dgram/ libcli/ldap/ libcli/raw/ libcli/nbt/ libnet/ winbind/ rpc_server/ metze (This used to be commit 6223c7fddc972687eb577e04fc1c8e0604c35435)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/eventlog.c4
-rw-r--r--source4/torture/rpc/samsync.c5
-rw-r--r--source4/torture/rpc/spoolss_notify.c12
-rw-r--r--source4/torture/rpc/winreg.c6
4 files changed, 15 insertions, 12 deletions
diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c
index c1d863454c..64b012fba6 100644
--- a/source4/torture/rpc/eventlog.c
+++ b/source4/torture/rpc/eventlog.c
@@ -105,6 +105,7 @@ static bool test_ReadEventLog(struct torture_context *tctx,
DATA_BLOB blob;
struct eventlog_Record rec;
struct ndr_pull *ndr;
+ enum ndr_err_code ndr_err;
/* Read first for number of bytes in record */
@@ -138,8 +139,9 @@ static bool test_ReadEventLog(struct torture_context *tctx,
ndr = ndr_pull_init_blob(&blob, tctx);
- status = ndr_pull_eventlog_Record(
+ ndr_err = ndr_pull_eventlog_Record(
ndr, NDR_SCALARS|NDR_BUFFERS, &rec);
+ status = ndr_map_error2ntstatus(ndr_err);
NDR_PRINT_DEBUG(eventlog_Record, &rec);
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 6f76e3b58b..a7cde8af4f 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -544,11 +544,12 @@ static bool samsync_handle_user(TALLOC_CTX *mem_ctx, struct samsync_state *samsy
if (user->user_private_info.SensitiveData) {
DATA_BLOB data;
struct netr_USER_KEYS keys;
+ enum ndr_err_code ndr_err;
data.data = user->user_private_info.SensitiveData;
data.length = user->user_private_info.DataLength;
creds_arcfour_crypt(samsync_state->creds, data.data, data.length);
- nt_status = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
- if (NT_STATUS_IS_OK(nt_status)) {
+ ndr_err = ndr_pull_struct_blob(&data, mem_ctx, &keys, (ndr_pull_flags_fn_t)ndr_pull_netr_USER_KEYS);
+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
if (keys.keys.keys2.lmpassword.length == 16) {
sam_rid_crypt(rid, keys.keys.keys2.lmpassword.pwd.hash, lm_hash.hash, 0);
lm_hash_p = &lm_hash;
diff --git a/source4/torture/rpc/spoolss_notify.c b/source4/torture/rpc/spoolss_notify.c
index e44c2a874b..bffbd1108c 100644
--- a/source4/torture/rpc/spoolss_notify.c
+++ b/source4/torture/rpc/spoolss_notify.c
@@ -44,7 +44,7 @@ static void spoolss__op_unbind(struct dcesrv_connection_context *context, const
static NTSTATUS spoolss__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_pull *pull, void **r)
{
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
uint16_t opnum = dce_call->pkt.u.request.opnum;
dce_call->fault_code = 0;
@@ -58,8 +58,8 @@ static NTSTATUS spoolss__op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_
NT_STATUS_HAVE_NO_MEMORY(*r);
/* unravel the NDR for the packet */
- status = ndr_table_spoolss.calls[opnum].ndr_pull(pull, NDR_IN, *r);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_table_spoolss.calls[opnum].ndr_pull(pull, NDR_IN, *r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
dcerpc_log_packet(&ndr_table_spoolss, opnum, NDR_IN,
&dce_call->pkt.u.request.stub_and_verifier);
dce_call->fault_code = DCERPC_FAULT_NDR;
@@ -117,11 +117,11 @@ static NTSTATUS spoolss__op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX
static NTSTATUS spoolss__op_ndr_push(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct ndr_push *push, const void *r)
{
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
uint16_t opnum = dce_call->pkt.u.request.opnum;
- status = ndr_table_spoolss.calls[opnum].ndr_push(push, NDR_OUT, r);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_table_spoolss.calls[opnum].ndr_push(push, NDR_OUT, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
dce_call->fault_code = DCERPC_FAULT_NDR;
return NT_STATUS_NET_WRITE_FAULT;
}
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 2ce1fa768c..45954f2c71 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -155,7 +155,7 @@ static bool test_CreateKey_sd(struct dcerpc_pipe *p,
SEC_ACE_FLAG_CONTAINER_INHERIT,
NULL);
- torture_assert_ntstatus_ok(tctx,
+ torture_assert_ndr_success(tctx,
ndr_push_struct_blob(&sdblob, tctx, sd,
(ndr_push_flags_fn_t)ndr_push_security_descriptor),
"Failed to push security_descriptor ?!\n");
@@ -220,7 +220,7 @@ static bool _test_GetKeySecurity(struct dcerpc_pipe *p,
sd = talloc_zero(tctx, struct security_descriptor);
- torture_assert_ntstatus_ok(tctx,
+ torture_assert_ndr_success(tctx,
ndr_pull_struct_blob(&sdblob, tctx, sd,
(ndr_pull_flags_fn_t)ndr_pull_security_descriptor),
"pull_security_descriptor failed");
@@ -264,7 +264,7 @@ static bool _test_SetKeySecurity(struct dcerpc_pipe *p,
NDR_PRINT_DEBUG(security_descriptor, sd);
}
- torture_assert_ntstatus_ok(tctx,
+ torture_assert_ndr_success(tctx,
ndr_push_struct_blob(&sdblob, tctx, sd,
(ndr_push_flags_fn_t)ndr_push_security_descriptor),
"push_security_descriptor failed");