diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-11-09 14:39:45 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-09 21:23:16 +0100 |
commit | f9578af966c1c1b5b5df4acac9977472d2896bea (patch) | |
tree | 6c46e463bf302012d29680f4067007d974baa0e0 /source3/smbd | |
parent | 5290ea864e6871651c2cd4eb565641b79c124a48 (diff) | |
download | samba-f9578af966c1c1b5b5df4acac9977472d2896bea.tar.gz samba-f9578af966c1c1b5b5df4acac9977472d2896bea.tar.bz2 samba-f9578af966c1c1b5b5df4acac9977472d2896bea.zip |
ndr: change NTSTAUS into enum ndr_err_code (samba3 callers)
lib/messages_local.c
rpc_client/ndr.c
smbd/notify_internal.c
utils/net_rpc_registry.c
metze
(This used to be commit c2645d2164c05976a98bafed980b6029baf89977)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/notify_internal.c | 32 |
1 files changed, 19 insertions, 13 deletions
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, |