From: Volker Lendecke Date: Thu, 23 Oct 2025 16:53:11 +0000 (+0200) Subject: vfs: Remove some code duplication X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16ab4778785cff757cde23d106f062101f3cde9b;p=thirdparty%2Fsamba.git vfs: Remove some code duplication We do the chdir in both cases Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 71f21b5d1fc..3b2463876da 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -210,13 +210,7 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle, handle->conn->sconn->remote_address, handle->conn->sconn->local_address, junction, &consumedcnt, &self_referral); - if (!NT_STATUS_IS_OK(status)) { - struct smb_filename connectpath_fname = { - .base_name = handle->conn->connectpath - }; - vfs_ChDir(handle->conn, &connectpath_fname); - return status; - } + { struct smb_filename connectpath_fname = { .base_name = handle->conn->connectpath @@ -224,6 +218,10 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle, vfs_ChDir(handle->conn, &connectpath_fname); } + if (!NT_STATUS_IS_OK(status)) { + return status; + } + if (!self_referral) { pathnamep[consumedcnt] = '\0';