diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d2b03c430b0..64d40c39c37 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4128,12 +4128,14 @@ static NTSTATUS mkdir_internal(connection_struct *conn, } } - /* Go back to the previous $cwd. */ - safe_pathname_end(&safe_filename_state); - /* Ensure returned stat is up to date. */ smb_dname->st = smb_dname_rel->st; + smb_dname_rel = NULL; + + /* Go back to the previous $cwd. */ + safe_pathname_end(&safe_filename_state); + notify_fname(conn, NOTIFY_ACTION_ADDED, FILE_NOTIFY_CHANGE_DIR_NAME, smb_dname->base_name);