diff --git a/source/smbd/open.c b/source/smbd/open.c index 064e17c..6f80e28 100644 --- a/source/smbd/open.c +++ b/source/smbd/open.c @@ -3282,6 +3282,24 @@ NTSTATUS create_file(connection_struct *conn, (unsigned int)root_dir_fid, ea_list, sd, fname)); + if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) { + char *resolved_fname; + + status = resolve_dfspath(talloc_tos(), conn, true, fname, + &resolved_fname); + + if (!NT_STATUS_IS_OK(status)) { + /* + * For PATH_NOT_COVERED we had + * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED, + * ERRSRV, ERRbadpath); + * Need to fix in callers + */ + goto fail; + } + fname = resolved_fname; + } + /* * Get the file name. */ @@ -3409,24 +3427,6 @@ NTSTATUS create_file(connection_struct *conn, } } - if ((req != NULL) && (req->flags2 & FLAGS2_DFS_PATHNAMES)) { - char *resolved_fname; - - status = resolve_dfspath(talloc_tos(), conn, true, fname, - &resolved_fname); - - if (!NT_STATUS_IS_OK(status)) { - /* - * For PATH_NOT_COVERED we had - * reply_botherror(req, NT_STATUS_PATH_NOT_COVERED, - * ERRSRV, ERRbadpath); - * Need to fix in callers - */ - goto fail; - } - fname = resolved_fname; - } - /* * Check if POSIX semantics are wanted. */