From 4319076ccaf3e6264207a88b88dea0fa63b31879 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 19 Mar 2012 21:57:50 +0100 Subject: s3: Pass "path" through vfs_notify_watch --- source3/smbd/notify.c | 5 +++-- source3/smbd/notify_inotify.c | 5 +++-- source3/smbd/notify_internal.c | 2 +- source3/smbd/proto.h | 2 ++ source3/smbd/vfs.c | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 534ed8477b..5a78a726b7 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -548,12 +548,13 @@ struct sys_notify_context *sys_notify_context_create(connection_struct *conn, NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, + const char *path, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), void *private_data, void *handle) { - return SMB_VFS_NOTIFY_WATCH(ctx->conn, ctx, e, callback, private_data, - handle); + return SMB_VFS_NOTIFY_WATCH(ctx->conn, ctx, e, path, callback, + private_data, handle); } diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c index bccd093be4..a074d019d9 100644 --- a/source3/smbd/notify_inotify.c +++ b/source3/smbd/notify_inotify.c @@ -372,6 +372,7 @@ static int watch_destructor(struct inotify_watch_context *w) */ NTSTATUS inotify_watch(struct sys_notify_context *ctx, struct notify_entry *e, + const char *path, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), @@ -405,7 +406,7 @@ NTSTATUS inotify_watch(struct sys_notify_context *ctx, mask |= (IN_MASK_ADD | IN_ONLYDIR); /* get a new watch descriptor for this path */ - wd = inotify_add_watch(in->fd, e->path, mask); + wd = inotify_add_watch(in->fd, path, mask); if (wd == -1) { e->filter = filter; DEBUG(1, ("inotify_add_watch returned %s\n", strerror(errno))); @@ -428,7 +429,7 @@ NTSTATUS inotify_watch(struct sys_notify_context *ctx, w->private_data = private_data; w->mask = mask; w->filter = filter; - w->path = talloc_strdup(w, e->path); + w->path = talloc_strdup(w, path); if (w->path == NULL) { inotify_rm_watch(in->fd, wd); e->filter = filter; diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index 906f7674de..b12459c9d3 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -538,7 +538,7 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0, this call will modify e.filter and e.subdir_filter to remove bits handled by the backend */ - status = sys_notify_watch(notify->sys_notify_ctx, &e, + status = sys_notify_watch(notify->sys_notify_ctx, &e, e.path, sys_notify_callback, listel, &listel->sys_notify_handle); if (NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 0fbf9a0fcb..69655e7df6 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -524,6 +524,7 @@ struct sys_notify_context *sys_notify_context_create(connection_struct *conn, struct event_context *ev); NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, struct notify_entry *e, + const char *path, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), @@ -533,6 +534,7 @@ NTSTATUS sys_notify_watch(struct sys_notify_context *ctx, NTSTATUS inotify_watch(struct sys_notify_context *ctx, struct notify_entry *e, + const char *path, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 7da3881828..6b7b8691aa 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1834,13 +1834,14 @@ char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path) NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle, struct sys_notify_context *ctx, struct notify_entry *e, + const char *path, void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev), void *private_data, void *handle_p) { VFS_FIND(notify_watch); - return handle->fns->notify_watch_fn(handle, ctx, e, callback, + return handle->fns->notify_watch_fn(handle, ctx, e, path, callback, private_data, handle_p); } -- cgit