From: Volker Lendecke Date: Mon, 15 Sep 2025 18:35:46 +0000 (-0700) Subject: smbd: Align [smb|smb2]_file_link_information code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=611788e2ac1deb4e77f9f5827edd45548231d1c0;p=thirdparty%2Fsamba.git smbd: Align [smb|smb2]_file_link_information code The next patch will merge them into one function. Make it obvious in a separate patch that they are the same except for parsing the input buffer. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index 1801bca00fd..1d0580c0283 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -4468,16 +4468,16 @@ static NTSTATUS smb2_file_link_information(connection_struct *conn, return NT_STATUS_INVALID_PARAMETER; } - /* SMB2 hardlink paths are never DFS. */ - req->flags2 &= ~FLAGS2_DFS_PATHNAMES; - ucf_flags &= ~UCF_DFS_PATHNAME; - status = check_path_syntax(newname, fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH); if (!NT_STATUS_IS_OK(status)) { return status; } + /* hardlink paths are never DFS. */ + req->flags2 &= ~FLAGS2_DFS_PATHNAMES; + ucf_flags &= ~UCF_DFS_PATHNAME; + DBG_DEBUG("got name |%s|\n", newname); status = filename_convert_dirfsp_rel(ctx, @@ -4573,14 +4573,16 @@ static NTSTATUS smb_file_link_information(connection_struct *conn, return status; } - DBG_DEBUG("got name |%s|\n", newname); - if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(newname, &dst_twrp); } + /* hardlink paths are never DFS. */ + req->flags2 &= ~FLAGS2_DFS_PATHNAMES; ucf_flags &= ~UCF_DFS_PATHNAME; + DBG_DEBUG("got name |%s|\n", newname); + status = filename_convert_dirfsp_rel(ctx, conn, conn->cwd_fsp,