bool recursive)
{
char *fullpath;
+ size_t len;
struct notify_entry e;
NTSTATUS status;
return NT_STATUS_NO_MEMORY;
}
+ /*
+ * Avoid /. at the end of the path name. notify can't deal with it.
+ */
+ len = strlen(fullpath);
+ if (len > 1 && fullpath[len-1] == '.' && fullpath[len-2] == '/') {
+ fullpath[len-2] = '\0';
+ }
+
ZERO_STRUCT(e);
e.path = fullpath;
e.dir_fd = fsp->fh->fd;
{
struct notify_entry e = *e0;
NTSTATUS status;
- char *tmp_path = NULL;
struct notify_list *listel;
- size_t len;
int depth;
/* see if change notify is enabled at all */
return NT_STATUS_NOT_IMPLEMENTED;
}
- /* cope with /. on the end of the path */
- len = strlen(e.path);
- if (len > 1 && e.path[len-1] == '.' && e.path[len-2] == '/') {
- tmp_path = talloc_strndup(notify, e.path, len-2);
- if (tmp_path == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto done;
- }
- e.path = tmp_path;
- }
-
depth = count_chars(e.path, '/');
listel = talloc_zero(notify, struct notify_list);
}
status = NT_STATUS_OK;
done:
- talloc_free(tmp_path);
-
return status;
}