- 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);
- }
+ oldwd = vfs_GetWd(parent, conn);
+ if (oldwd == NULL) {
+ DEBUG(1, ("vfs_GetWd failed!\n"));
+ goto done;
+ }
+ if (vfs_ChDir(conn, conn->connectpath) == -1) {
+ DEBUG(1, ("Could not chdir to connect path!\n"));
+ goto done;
+ }
+
+ if (SMB_VFS_STAT(conn, &smb_fname_parent) == -1) {
+ goto chdir_done;
+ }
+
+ notify_onelevel(conn->notify_ctx, action, filter,
+ SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
+ name);
+chdir_done:
+ vfs_ChDir(conn, oldwd);
+done:
+ TALLOC_FREE(parent);
+}
+
+void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
+ const char *path)
+{
+ char *fullpath = NULL;
+
+ if (path[0] == '.' && path[1] == '/') {
+ path += 2;