if (!lp_parm_bool(-1, "notify", "inotify", True)) {
return NT_STATUS_INVALID_SYSTEM_SERVICE;
}
- ret = inotify_watch(ctx, path, filter, subdir_filter,
+ /*
+ * "ctx->private_data" is not obvious as a talloc context
+ * here. Without modifying the VFS we don't have a mem_ctx
+ * available here, and ctx->private_data was used by
+ * inotify_watch before it got a real talloc parent.
+ */
+ ret = inotify_watch(ctx->private_data, ctx,
+ path, filter, subdir_filter,
callback, private_data, handle);
if (ret != 0) {
return map_nt_error_from_unix(ret);
add a watch. The watch is removed when the caller calls
talloc_free() on *handle
*/
-int inotify_watch(struct sys_notify_context *ctx,
+int inotify_watch(TALLOC_CTX *mem_ctx,
+ struct sys_notify_context *ctx,
const char *path,
uint32_t *filter,
uint32_t *subdir_filter,
watch descriptor for multiple watches on the same path */
mask |= (IN_MASK_ADD | IN_ONLYDIR);
- w = talloc(in, struct inotify_watch_context);
+ w = talloc(mem_ctx, struct inotify_watch_context);
if (w == NULL) {
*filter = orig_filter;
return ENOMEM;
/* The following definitions come from smbd/notify_inotify.c */
-int inotify_watch(struct sys_notify_context *ctx,
+int inotify_watch(TALLOC_CTX *mem_ctx,
+ struct sys_notify_context *ctx,
const char *path,
uint32_t *filter,
uint32_t *subdir_filter,