summaryrefslogtreecommitdiff
path: root/source4/ntvfs/common
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-03-30 05:45:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:21 -0500
commitaec7f3ae721bff48e63cc3abcee07b18fa13417a (patch)
treeebc084e45129b6a124a142473d8cb19680241705 /source4/ntvfs/common
parent4a1055dfda8af208e7b11b8d5d2283501bd852a4 (diff)
downloadsamba-aec7f3ae721bff48e63cc3abcee07b18fa13417a.tar.gz
samba-aec7f3ae721bff48e63cc3abcee07b18fa13417a.tar.bz2
samba-aec7f3ae721bff48e63cc3abcee07b18fa13417a.zip
r14803: copy with the root directory, which has /. on the end of the path
(This used to be commit 16742cd28621d205f21c855e5635be1dfc3f2b69)
Diffstat (limited to 'source4/ntvfs/common')
-rw-r--r--source4/ntvfs/common/notify.c17
1 files changed, 17 insertions, 0 deletions
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);