summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/messages_local.c16
-rw-r--r--source3/rpc_client/ndr.c13
-rw-r--r--source3/smbd/notify_internal.c32
-rw-r--r--source3/utils/net_rpc_registry.c9
4 files changed, 40 insertions, 30 deletions
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index db098f2744..5f7c46f61e 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -142,7 +142,7 @@ static NTSTATUS messaging_tdb_fetch(TDB_CONTEXT *msg_tdb,
struct messaging_array *result;
TDB_DATA data;
DATA_BLOB blob;
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
if (!(result = TALLOC_ZERO_P(mem_ctx, struct messaging_array))) {
return NT_STATUS_NO_MEMORY;
@@ -157,15 +157,15 @@ static NTSTATUS messaging_tdb_fetch(TDB_CONTEXT *msg_tdb,
blob = data_blob_const(data.dptr, data.dsize);
- status = ndr_pull_struct_blob(
+ ndr_err = ndr_pull_struct_blob(
&blob, result, result,
(ndr_pull_flags_fn_t)ndr_pull_messaging_array);
SAFE_FREE(data.dptr);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
TALLOC_FREE(result);
- return status;
+ return ndr_map_error2ntstatus(ndr_err);
}
if (DEBUGLEVEL >= 10) {
@@ -187,7 +187,7 @@ static NTSTATUS messaging_tdb_store(TDB_CONTEXT *msg_tdb,
{
TDB_DATA data;
DATA_BLOB blob;
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
TALLOC_CTX *mem_ctx;
int ret;
@@ -200,13 +200,13 @@ static NTSTATUS messaging_tdb_store(TDB_CONTEXT *msg_tdb,
return NT_STATUS_NO_MEMORY;
}
- status = ndr_push_struct_blob(
+ ndr_err = ndr_push_struct_blob(
&blob, mem_ctx, array,
(ndr_push_flags_fn_t)ndr_push_messaging_array);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(mem_ctx);
- return status;
+ return ndr_map_error2ntstatus(ndr_err);
}
if (DEBUGLEVEL >= 10) {
diff --git a/source3/rpc_client/ndr.c b/source3/rpc_client/ndr.c
index c7044aa7d9..a64ead809a 100644
--- a/source3/rpc_client/ndr.c
+++ b/source3/rpc_client/ndr.c
@@ -33,6 +33,7 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
DATA_BLOB blob;
struct ndr_push *push;
NTSTATUS status;
+ enum ndr_err_code ndr_err;
SMB_ASSERT(cli->pipe_idx == p_idx);
SMB_ASSERT(table->num_calls > opnum);
@@ -44,9 +45,9 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
return NT_STATUS_NO_MEMORY;
}
- status = call->ndr_push(push, NDR_IN, r);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ ndr_err = call->ndr_push(push, NDR_IN, r);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ndr_map_error2ntstatus(ndr_err);
}
blob = ndr_push_blob(push);
@@ -85,11 +86,11 @@ NTSTATUS cli_do_rpc_ndr(struct rpc_pipe_client *cli,
/* have the ndr parser alloc memory for us */
pull->flags |= LIBNDR_FLAG_REF_ALLOC;
- status = call->ndr_pull(pull, NDR_OUT, r);
+ ndr_err = call->ndr_pull(pull, NDR_OUT, r);
talloc_free(pull);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ndr_map_error2ntstatus(ndr_err);
}
return NT_STATUS_OK;
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index 2a2afe376b..84b8e1098e 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -165,8 +165,12 @@ static NTSTATUS notify_load(struct notify_context *notify, struct db_record *rec
status = NT_STATUS_OK;
if (blob.length > 0) {
- status = ndr_pull_struct_blob(&blob, notify->array, notify->array,
- (ndr_pull_flags_fn_t)ndr_pull_notify_array);
+ enum ndr_err_code ndr_err;
+ ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->array,
+ (ndr_pull_flags_fn_t)ndr_pull_notify_array);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ status = ndr_map_error2ntstatus(ndr_err);
+ }
}
if (DEBUGLEVEL >= 10) {
@@ -199,6 +203,7 @@ static NTSTATUS notify_save(struct notify_context *notify, struct db_record *rec
TDB_DATA dbuf;
DATA_BLOB blob;
NTSTATUS status;
+ enum ndr_err_code ndr_err;
TALLOC_CTX *tmp_ctx;
/* if possible, remove some depth arrays */
@@ -215,11 +220,11 @@ static NTSTATUS notify_save(struct notify_context *notify, struct db_record *rec
tmp_ctx = talloc_new(notify);
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
- status = ndr_push_struct_blob(&blob, tmp_ctx, notify->array,
+ ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, notify->array,
(ndr_push_flags_fn_t)ndr_push_notify_array);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
- return status;
+ return ndr_map_error2ntstatus(ndr_err);
}
if (DEBUGLEVEL >= 10) {
@@ -244,7 +249,7 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data
uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
{
struct notify_context *notify = talloc_get_type(private_data, struct notify_context);
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
struct notify_event ev;
TALLOC_CTX *tmp_ctx = talloc_new(notify);
struct notify_list *listel;
@@ -253,9 +258,9 @@ static void notify_handler(struct messaging_context *msg_ctx, void *private_data
return;
}
- status = ndr_pull_struct_blob(data, tmp_ctx, &ev,
- (ndr_pull_flags_fn_t)ndr_pull_notify_event);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_pull_struct_blob(data, tmp_ctx, &ev,
+ (ndr_pull_flags_fn_t)ndr_pull_notify_event);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
return;
}
@@ -547,6 +552,7 @@ static NTSTATUS notify_send(struct notify_context *notify, struct notify_entry *
struct notify_event ev;
DATA_BLOB data;
NTSTATUS status;
+ enum ndr_err_code ndr_err;
TALLOC_CTX *tmp_ctx;
ev.action = action;
@@ -555,11 +561,11 @@ static NTSTATUS notify_send(struct notify_context *notify, struct notify_entry *
tmp_ctx = talloc_new(notify);
- status = ndr_push_struct_blob(&data, tmp_ctx, &ev,
- (ndr_push_flags_fn_t)ndr_push_notify_event);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_push_struct_blob(&data, tmp_ctx, &ev,
+ (ndr_push_flags_fn_t)ndr_push_notify_event);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
- return status;
+ return ndr_map_error2ntstatus(ndr_err);
}
status = messaging_send(notify->messaging_ctx, e->server,
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index e1d65fb06b..c2b9aced69 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -986,6 +986,7 @@ static NTSTATUS rpc_registry_getsd_internal(const DOM_SID *domain_sid,
{
POLICY_HND pol_hive, pol_key;
NTSTATUS status;
+ enum ndr_err_code ndr_err;
struct KeySecurityData *sd = NULL;
uint32_t sec_info;
DATA_BLOB blob;
@@ -1033,11 +1034,13 @@ static NTSTATUS rpc_registry_getsd_internal(const DOM_SID *domain_sid,
blob.data = sd->data;
blob.length = sd->size;
- status = ndr_pull_struct_blob(&blob, mem_ctx, &sec_desc,
- (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &sec_desc,
+ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ status = ndr_map_error2ntstatus(ndr_err);
goto out;
}
+ status = NT_STATUS_OK;
display_sec_desc(&sec_desc);