1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

r14959: allow change notify to be disabled completely using

notify:enable=False
This commit is contained in:
Andrew Tridgell 2006-04-07 11:25:21 +00:00 committed by Gerald (Jerry) Carter
parent 0617aebbbc
commit 2a8f093105
2 changed files with 20 additions and 3 deletions

View File

@ -83,6 +83,10 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, uint32_t server,
char *path; char *path;
struct notify_context *notify; struct notify_context *notify;
if (lp_parm_bool(snum, "notify", "enable", True) != True) {
return NULL;
}
notify = talloc(mem_ctx, struct notify_context); notify = talloc(mem_ctx, struct notify_context);
if (notify == NULL) { if (notify == NULL) {
return NULL; return NULL;
@ -339,6 +343,11 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,
size_t len; size_t len;
int depth; int depth;
/* see if change notify is enabled at all */
if (notify == NULL) {
return NT_STATUS_NOT_IMPLEMENTED;
}
status = notify_lock(notify); status = notify_lock(notify);
NT_STATUS_NOT_OK_RETURN(status); NT_STATUS_NOT_OK_RETURN(status);
@ -410,6 +419,11 @@ NTSTATUS notify_remove(struct notify_context *notify, void *private)
int i, depth; int i, depth;
struct notify_depth *d; struct notify_depth *d;
/* see if change notify is enabled at all */
if (notify == NULL) {
return NT_STATUS_NOT_IMPLEMENTED;
}
for (listel=notify->list;listel;listel=listel->next) { for (listel=notify->list;listel;listel=listel->next) {
if (listel->private == private) { if (listel->private == private) {
DLIST_REMOVE(notify->list, listel); DLIST_REMOVE(notify->list, listel);
@ -552,6 +566,11 @@ void notify_trigger(struct notify_context *notify,
int depth; int depth;
const char *p, *next_p; const char *p, *next_p;
/* see if change notify is enabled at all */
if (notify == NULL) {
return;
}
status = notify_load(notify); status = notify_load(notify);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
return; return;

View File

@ -185,14 +185,12 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs,
return NT_STATUS_INTERNAL_DB_CORRUPTION; return NT_STATUS_INTERNAL_DB_CORRUPTION;
} }
/* allow this to be NULL - we just disable change notify */
pvfs->notify_context = notify_init(pvfs, pvfs->notify_context = notify_init(pvfs,
pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->server_id,
pvfs->ntvfs->ctx->msg_ctx, pvfs->ntvfs->ctx->msg_ctx,
event_context_find(pvfs), event_context_find(pvfs),
pvfs->ntvfs->ctx->config.snum); pvfs->ntvfs->ctx->config.snum);
if (pvfs->notify_context == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
pvfs->sidmap = sidmap_open(pvfs); pvfs->sidmap = sidmap_open(pvfs);
if (pvfs->sidmap == NULL) { if (pvfs->sidmap == NULL) {