diff --git a/source/smbd/notify.c b/source/smbd/notify.c index 6e24466..b65aeb1 100644 --- a/source/smbd/notify.c +++ b/source/smbd/notify.c @@ -211,6 +211,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, BOOL recursive) { char *fullpath; + const char *fspname; struct notify_entry e; NTSTATUS status; @@ -221,8 +222,13 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, return NT_STATUS_NO_MEMORY; } + fspname = fsp->fsp_name; + if (fspname[0] == '.' && fspname[1] == '/') { + fspname += 2; + } + if (asprintf(&fullpath, "%s/%s", fsp->conn->connectpath, - fsp->fsp_name) == -1) { + fspname) == -1) { DEBUG(0, ("asprintf failed\n")); return NT_STATUS_NO_MEMORY; } @@ -349,6 +355,9 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter, { char *fullpath; + if (path[0] == '.' && path[1] == '/') { + path += 2; + } if (asprintf(&fullpath, "%s/%s", conn->connectpath, path) == -1) { DEBUG(0, ("asprintf failed\n")); return;