]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Use the getwd-cache only if we have a valid tcon
authorVolker Lendecke <vl@samba.org>
Mon, 11 Nov 2024 15:19:17 +0000 (16:19 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 13:44:32 +0000 (13:44 +0000)
A valid tcon will have changed fsp_get_pathref_fd() to AT_FDCWD, -100
on Linux.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/vfs.c

index ab1fa97993fee94b412239ac02f1c35cbb263047..462f57f854eb19c071ece0553b91c68cbb09d6c0 100644 (file)
@@ -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,
                                            ".",