#include "lib/tdb/include/tdb.h"
#include "lib/util/util_tdb.h"
#include "messaging/messaging.h"
-#include "db_wrap.h"
+#include "tdb_wrap.h"
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_notify.h"
#include "lib/util/dlinklist.h"
#include "ntvfs/common/ntvfs_common.h"
#include "ntvfs/sysdep/sys_notify.h"
#include "cluster/cluster.h"
+#include "param/param.h"
struct notify_context {
struct tdb_wrap *w;
*/
struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
struct messaging_context *messaging_ctx,
+ struct loadparm_context *lp_ctx,
struct event_context *ev,
struct share_config *scfg)
{
return NULL;
}
- notify->w = cluster_tdb_tmp_open(notify, "notify.tdb", TDB_SEQNUM);
+ notify->w = cluster_tdb_tmp_open(notify, lp_ctx, "notify.tdb", TDB_SEQNUM);
if (notify->w == NULL) {
talloc_free(notify);
return NULL;
{
TDB_DATA dbuf;
DATA_BLOB blob;
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
int seqnum;
seqnum = tdb_get_seqnum(notify->w->tdb);
blob.data = dbuf.dptr;
blob.length = dbuf.dsize;
- status = ndr_pull_struct_blob(&blob, notify->array, notify->array,
- (ndr_pull_flags_fn_t)ndr_pull_notify_array);
+ ndr_err = ndr_pull_struct_blob(&blob, notify->array, lp_iconv_convenience(global_loadparm),
+ notify->array,
+ (ndr_pull_flags_fn_t)ndr_pull_notify_array);
free(dbuf.dptr);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ndr_map_error2ntstatus(ndr_err);
+ }
- return status;
+ return NT_STATUS_OK;
}
/*
{
TDB_DATA dbuf;
DATA_BLOB blob;
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
int ret;
TALLOC_CTX *tmp_ctx;
tmp_ctx = talloc_new(notify);
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
- status = ndr_push_struct_blob(&blob, tmp_ctx, notify->array,
- (ndr_push_flags_fn_t)ndr_push_notify_array);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, lp_iconv_convenience(global_loadparm), notify->array,
+ (ndr_push_flags_fn_t)ndr_push_notify_array);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
- return status;
+ return ndr_map_error2ntstatus(ndr_err);
}
dbuf.dptr = blob.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;
return;
}
- status = ndr_pull_struct_blob(data, tmp_ctx, &ev,
+ ndr_err = ndr_pull_struct_blob(data, tmp_ctx, lp_iconv_convenience(global_loadparm), &ev,
(ndr_pull_flags_fn_t)ndr_pull_notify_event);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
return;
}
struct notify_event ev;
DATA_BLOB data;
NTSTATUS status;
+ enum ndr_err_code ndr_err;
TALLOC_CTX *tmp_ctx;
ev.action = action;
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, lp_iconv_convenience(global_loadparm), &ev, (ndr_push_flags_fn_t)ndr_push_notify_event);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(tmp_ctx);
return;
}