summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-04-07 11:25:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:00:46 -0500
commitcd794e79f999b3b7b639c4fe89ea1af23ed362f6 (patch)
tree4d6794e2446cffbc1e28cbf031dc6a2e6bbcab1b /source4/ntvfs/common
parenta40ce7f9f64ac8f45dc4f1d8d38ed63b3db0eb03 (diff)
downloadsamba-cd794e79f999b3b7b639c4fe89ea1af23ed362f6.tar.gz
samba-cd794e79f999b3b7b639c4fe89ea1af23ed362f6.tar.bz2
samba-cd794e79f999b3b7b639c4fe89ea1af23ed362f6.zip
r14959: allow change notify to be disabled completely using
notify:enable=False (This used to be commit 2a8f093105f3047a3697f29aadcc9c48c6ac88e1)
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r--source4/ntvfs/common/notify.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c
index 0c264de88f..452b8188f0 100644
--- a/source4/ntvfs/common/notify.c
+++ b/source4/ntvfs/common/notify.c
@@ -83,6 +83,10 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, uint32_t server,
char *path;
struct notify_context *notify;
+ if (lp_parm_bool(snum, "notify", "enable", True) != True) {
+ return NULL;
+ }
+
notify = talloc(mem_ctx, struct notify_context);
if (notify == NULL) {
return NULL;
@@ -339,6 +343,11 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0,
size_t len;
int depth;
+ /* see if change notify is enabled at all */
+ if (notify == NULL) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+
status = notify_lock(notify);
NT_STATUS_NOT_OK_RETURN(status);
@@ -410,6 +419,11 @@ NTSTATUS notify_remove(struct notify_context *notify, void *private)
int i, depth;
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) {
if (listel->private == private) {
DLIST_REMOVE(notify->list, listel);
@@ -552,6 +566,11 @@ void notify_trigger(struct notify_context *notify,
int depth;
const char *p, *next_p;
+ /* see if change notify is enabled at all */
+ if (notify == NULL) {
+ return;
+ }
+
status = notify_load(notify);
if (!NT_STATUS_IS_OK(status)) {
return;