From: Volker Lendecke Date: Mon, 11 Nov 2024 15:19:17 +0000 (+0100) Subject: vfs: Use the getwd-cache only if we have a valid tcon X-Git-Tag: tdb-1.4.13~534 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=142a78eb24a7fb62ca52ca76d878fd19f5caeed9;p=thirdparty%2Fsamba.git vfs: Use the getwd-cache only if we have a valid tcon A valid tcon will have changed fsp_get_pathref_fd() to AT_FDCWD, -100 on Linux. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index ab1fa97993f..462f57f854e 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1022,6 +1022,9 @@ struct smb_filename *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn) if (!lp_getwd_cache()) { goto nocache; } + if (fsp_get_pathref_fd(conn->cwd_fsp) == -1) { + goto nocache; + } smb_fname_dot = synthetic_smb_fname(ctx, ".",