From aec7f3ae721bff48e63cc3abcee07b18fa13417a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 30 Mar 2006 05:45:43 +0000 Subject: r14803: copy with the root directory, which has /. on the end of the path (This used to be commit 16742cd28621d205f21c855e5635be1dfc3f2b69) --- source4/ntvfs/common/notify.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4') diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index b71c2906ae..52abc08d74 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -227,6 +227,8 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e, { NTSTATUS status; struct notify_list *listel; + char *path = NULL; + size_t len; status = notify_load(notify); NT_STATUS_NOT_OK_RETURN(status); @@ -239,14 +241,29 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e, return NT_STATUS_NO_MEMORY; } + /* cope with /. on the end of the path */ + len = strlen(e->path); + if (len > 1 && e->path[len-1] == '.' && e->path[len-2] == '/') { + path = talloc_strndup(notify, e->path, len-2); + } + notify->array->entries[notify->array->num_entries] = *e; notify->array->entries[notify->array->num_entries].private = private; notify->array->entries[notify->array->num_entries].server = notify->server; + + if (path) { + notify->array->entries[notify->array->num_entries].path = path; + } + notify->array->num_entries++; status = notify_save(notify); NT_STATUS_NOT_OK_RETURN(status); + if (path) { + talloc_free(path); + } + listel = talloc(notify, struct notify_list); NT_STATUS_HAVE_NO_MEMORY(listel); -- cgit