summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-14 04:47:15 +0000
committerVolker Lendecke <vlendec@samba.org>2007-02-14 04:47:15 +0000
commit9d217f0db3b18a24858e20fa4abed5a07331a0d1 (patch)
tree1cad190d74026562e69915896d980dacdfcfe1b6
parente2101ed77f746bc03c1aa6890068fd1f81cca4b5 (diff)
downloadsamba-9d217f0db3b18a24858e20fa4abed5a07331a0d1.tar.gz
samba-9d217f0db3b18a24858e20fa4abed5a07331a0d1.tar.xz
samba-9d217f0db3b18a24858e20fa4abed5a07331a0d1.zip
r21327: Jim, thanks for the review! :-)
Now to test this... Volker
-rw-r--r--source/modules/vfs_default.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index 3c8ff580edc..90fd30c604b 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -850,6 +850,33 @@ static char *vfswrap_realpath(vfs_handle_struct *handle, const char *path, char
return result;
}
+static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_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)
+{
+ /*
+ * So far inotify is the only supported default notify mechanism. If
+ * another platform like the the BSD's or a proprietary Unix comes
+ * along and wants another default, we can play the same trick we
+ * played with Posix ACLs.
+ *
+ * Until that is the case, hard-code inotify here.
+ */
+#ifdef HAVE_INOTIFY
+ if (lp_kernel_change_notify(ctx->conn->params)) {
+ return inotify_watch(ctx, e, callback, private_data, handle);
+ }
+#endif
+ /*
+ * Do nothing, leave everything to notify_internal.c
+ */
+ return NT_STATUS_OK;
+}
+
static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc)
{
size_t result;
@@ -1231,6 +1258,8 @@ static vfs_op_tuple vfs_default_ops[] = {
SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(vfswrap_realpath), SMB_VFS_OP_REALPATH,
SMB_VFS_LAYER_OPAQUE},
+ {SMB_VFS_OP(vfswrap_notify_watch), SMB_VFS_OP_NOTIFY_WATCH,
+ SMB_VFS_LAYER_OPAQUE},
/* NT ACL operations. */