add an entry to the notify array
*/
static NTSTATUS notify_add_array(struct notify_context *notify, struct notify_entry *e,
- const char *path, void *private)
+ void *private)
{
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++;
return notify_save(notify);
{
struct notify_entry e = *e0;
NTSTATUS status;
+ char *tmp_path = NULL;
struct notify_list *listel;
- char *path = NULL;
size_t len;
status = notify_lock(notify);
/* cope with /. on the end of the path */
len = strlen(e.path);
if (len > 1 && e.path[len-1] == '.' && e.path[len-2] == '/') {
- e.path = talloc_strndup(notify, e.path, len-2);
- if (e.path == NULL) {
+ tmp_path = talloc_strndup(notify, e.path, len-2);
+ if (tmp_path == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
}
+ e.path = tmp_path;
}
listel = talloc_zero(notify, struct notify_list);
then we need to install it in the array used for the
intra-samba notify handling */
if (e.filter != 0 || e.subdir_filter != 0) {
- status = notify_add_array(notify, &e, path, private);
+ status = notify_add_array(notify, &e, private);
}
done:
notify_unlock(notify);
- if (e.path != e0->path) {
- talloc_free(e.path);
- }
+ talloc_free(tmp_path);
return status;
}