From ed3fc628713e1f9552b523c9aec9bd8993e0b771 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Mar 2006 03:51:49 +0000 Subject: r14797: added checking of the filter in notify requests (This used to be commit 1db0a5a7f4c1ff915d91bc15d8e40cc90a78961d) --- source4/ntvfs/common/notify.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source4/ntvfs/common') diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index bc04c830f1..c5acf9decb 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -322,11 +322,15 @@ static NTSTATUS notify_remove_all(struct notify_context *notify) see if a notify event matches */ static BOOL notify_match(struct notify_context *notify, struct notify_entry *e, - const char *path, uint32_t action) + const char *path, uint32_t filter) { - size_t len = strlen(e->path); + size_t len; - /* TODO: check action */ + if (!(filter & e->filter)) { + return False; + } + + len = strlen(e->path); if (strncmp(path, e->path, len) != 0) { return False; @@ -379,7 +383,7 @@ static void notify_send(struct notify_context *notify, struct notify_entry *e, trigger a notify message for anyone waiting on a matching event */ void notify_trigger(struct notify_context *notify, - uint32_t action, const char *path) + uint32_t action, uint32_t filter, const char *path) { NTSTATUS status; int i; @@ -391,7 +395,7 @@ void notify_trigger(struct notify_context *notify, /* this needs to be changed to a log(n) search */ for (i=0;iarray->num_entries;i++) { - if (notify_match(notify, ¬ify->array->entries[i], path, action)) { + if (notify_match(notify, ¬ify->array->entries[i], path, filter)) { notify_send(notify, ¬ify->array->entries[i], path + strlen(notify->array->entries[i].path) + 1, action); -- cgit