summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-03-30 03:51:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:20 -0500
commited3fc628713e1f9552b523c9aec9bd8993e0b771 (patch)
tree47aeb7113ad1f89e3b1432ecb3acdb915c744991 /source4/ntvfs/common
parent8260854a18fe784be01fa88be1678bf0e267720c (diff)
downloadsamba-ed3fc628713e1f9552b523c9aec9bd8993e0b771.tar.gz
samba-ed3fc628713e1f9552b523c9aec9bd8993e0b771.tar.bz2
samba-ed3fc628713e1f9552b523c9aec9bd8993e0b771.zip
r14797: added checking of the filter in notify requests
(This used to be commit 1db0a5a7f4c1ff915d91bc15d8e40cc90a78961d)
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r--source4/ntvfs/common/notify.c14
1 files changed, 9 insertions, 5 deletions
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;i<notify->array->num_entries;i++) {
- if (notify_match(notify, &notify->array->entries[i], path, action)) {
+ if (notify_match(notify, &notify->array->entries[i], path, filter)) {
notify_send(notify, &notify->array->entries[i],
path + strlen(notify->array->entries[i].path) + 1,
action);