return SMB_VFS_NEXT_REALPATH(handle, path);
}
-static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx, struct notify_entry *e,
- void (*callback)(struct sys_notify_context *ctx, void *private_data, struct notify_event *ev),
- void *private_data, void *handle_p)
-{
- return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
+static NTSTATUS skel_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)
+{
+ return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
private_data, handle_p);
}
NTSTATUS (*notify_watch_fn)(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),
NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,
struct sys_notify_context *ctx,
struct notify_entry *e,
+ const char *name,
void (*callback)(struct sys_notify_context *ctx,
void *private_data,
struct notify_event *ev),
#define SMB_VFS_NEXT_REALPATH(handle, path) \
smb_vfs_call_realpath((handle)->next, (path))
-#define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (callback), (private_data), (handle_p))
-#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->next, (ctx), (e), (callback), (private_data), (handle_p))
+#define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, path, callback, private_data, handle_p) \
+ smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (e), (path), (callback), (private_data), (handle_p))
+#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, path, callback, private_data, handle_p) \
+ smb_vfs_call_notify_watch((conn)->next, (ctx), (e), (path), (callback), (private_data), (handle_p))
#define SMB_VFS_CHFLAGS(conn, path, flags) \
smb_vfs_call_chflags((conn)->vfs_handles, (path), (flags))
static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_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),
*/
#ifdef HAVE_INOTIFY
if (lp_kernel_change_notify(ctx->conn->params)) {
- return inotify_watch(ctx, e, callback, private_data, handle);
+ return inotify_watch(ctx, e, path, callback, private_data,
+ handle);
}
#endif
/*
static NTSTATUS smb_full_audit_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),
{
NTSTATUS result;
- result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback, private_data, handle_p);
+ result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
+ private_data, handle_p);
do_log(SMB_VFS_OP_NOTIFY_WATCH, NT_STATUS_IS_OK(result), handle, "");
static NTSTATUS fam_watch(vfs_handle_struct *vfs_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),
watch->private_data = private_data;
watch->sys_ctx = ctx;
- if (!(watch->path = talloc_strdup(watch, e->path))) {
+ watch->path = talloc_strdup(watch, path);
+ if (watch->path == NULL) {
DEBUG(0, ("talloc_asprintf failed\n"));
TALLOC_FREE(watch);
return NT_STATUS_NO_MEMORY;
static NTSTATUS smb_time_audit_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),
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback,
+ result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, path, callback,
private_data, handle_p);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
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);
}
*/
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),
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)));
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;
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)) {
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),
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),
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);
}