c = &changes[i];
- if (!convert_string_allocate(NULL, CH_UNIX, CH_UTF16LE,
+ if (!convert_string_talloc(talloc_tos(), CH_UNIX, CH_UTF16LE,
c->name, strlen(c->name)+1, &uni_name.buffer,
&namelen, True) || (uni_name.buffer == NULL)) {
goto fail;
*/
prs_set_offset(ps, prs_offset(ps)-2);
- SAFE_FREE(uni_name.buffer);
+ TALLOC_FREE(uni_name.buffer);
if (prs_offset(ps) > max_offset) {
/* Too much data for client. */
return True;
fail:
- SAFE_FREE(uni_name.buffer);
+ TALLOC_FREE(uni_name.buffer);
return False;
}
if (asprintf(&fullpath, "%s/%s", fsp->conn->connectpath,
fsp->fsp_name) == -1) {
DEBUG(0, ("asprintf failed\n"));
+ TALLOC_FREE(fsp->notify);
return NT_STATUS_NO_MEMORY;
}
const char *path)
{
char *fullpath;
+ char *parent;
+ const char *name;
if (path[0] == '.' && path[1] == '/') {
path += 2;
}
- if (asprintf(&fullpath, "%s/%s", conn->connectpath, path) == -1) {
+ if (parent_dirname(talloc_tos(), path, &parent, &name)) {
+ struct smb_filename *smb_fname_parent = NULL;
+ NTSTATUS status;
+
+ status = create_synthetic_smb_fname(talloc_tos(), parent, NULL,
+ NULL, &smb_fname_parent);
+ if (!NT_STATUS_IS_OK(status)) {
+ return;
+ }
+ if (SMB_VFS_STAT(conn, smb_fname_parent) != -1) {
+ notify_onelevel(conn->notify_ctx, action, filter,
+ SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent->st),
+ name);
+ }
+ TALLOC_FREE(smb_fname_parent);
+ }
+
+ fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath,
+ path);
+ if (fullpath == NULL) {
DEBUG(0, ("asprintf failed\n"));
return;
}
-
notify_trigger(conn->notify_ctx, action, filter, fullpath);
- SAFE_FREE(fullpath);
+ TALLOC_FREE(fullpath);
}
static void notify_fsp(files_struct *fsp, uint32 action, const char *name)