change_notify_create seems to want to ignore the status from SMB_VFS_NOTIFY_WATCH but it can leak through

Richard Sharpe realrichardsharpe at gmail.com
Thu Dec 5 10:27:03 MST 2013


Hi folks,

In source3/smbd/notify.c:change_notify_create we see this:

        if (fsp->conn->sconn->sys_notify_ctx != NULL) {
                void *sys_notify_handle = NULL;

                status = SMB_VFS_NOTIFY_WATCH(
                        fsp->conn, fsp->conn->sconn->sys_notify_ctx,
                        fullpath, &filter, &subdir_filter,
                        sys_notify_callback, fsp, &sys_notify_handle);

                if (NT_STATUS_IS_OK(status)) {
                        talloc_steal(fsp->notify, sys_notify_handle);
                }
        }

        if ((filter != 0) || (subdir_filter != 0)) {
                status = notify_add(fsp->conn->sconn->notify_ctx,
                                    fullpath, filter, subdir_filter,
                                    notify_callback, fsp);
        }
        TALLOC_FREE(fullpath);
        return status;

In earlier versions there was an explicit comment about ignoring the
return from SMB_VFS_NOTIFY_WATCH (or sys_notify_watch), however, if
filter == 0 and subdir_filter == 0 the status from
SMB_VFS_NOTIFY_WATCH can leak through.

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list