summaryrefslogtreecommitdiff
path: root/source3/smbd/notify_internal.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-03-25 14:52:24 +0100
committerStefan Metzmacher <metze@samba.org>2013-03-26 10:11:41 +0100
commitd4ebeeb78865c6a20a85437b82a1302921f3d1fe (patch)
treecbd07e747ad36f2459691490d43075beeb82e9e6 /source3/smbd/notify_internal.c
parentbbb4068c933ecc043025633a13c62bf04eaf6d49 (diff)
downloadsamba-d4ebeeb78865c6a20a85437b82a1302921f3d1fe.tar.gz
samba-d4ebeeb78865c6a20a85437b82a1302921f3d1fe.tar.bz2
samba-d4ebeeb78865c6a20a85437b82a1302921f3d1fe.zip
smbd: Avoid sending 0-sized keys to dbwrap
Start the notification one level below /. Sharing and notifying / for changes is broken at this moment anyway. When sharing / and someone wants to get notified for changes under /usr, we store "//usr" as the notify_index key. So this patch does not break anything that is not broken today, and it avoids a bogus call to dbwrap_parse_records. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/smbd/notify_internal.c')
-rw-r--r--source3/smbd/notify_internal.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index eaf51e7648..f5a8584b2e 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -608,11 +608,18 @@ void notify_trigger(struct notify_context *notify,
return;
}
+ if (path[0] != '/') {
+ /*
+ * The rest of this routine assumes an absolute path.
+ */
+ return;
+ }
+
idx_state.mem_ctx = talloc_tos();
idx_state.vnns = NULL;
idx_state.my_vnn = get_my_vnn();
- for (p = path; p != NULL; p = next_p) {
+ for (p = strchr(path+1, '/'); p != NULL; p = next_p) {
ptrdiff_t path_len = p - path;
bool recursive;