]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Tighten non_wide_link_open() for absolute root share open
authorVolker Lendecke <vl@samba.org>
Sat, 19 Oct 2024 15:29:01 +0000 (17:29 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 18:07:33 +0000 (18:07 +0000)
Make it clear that non_widelink_open being called for absolute paths
is not done during regular operations, i.e. when we have passed our
pathnames through filename_convert_dirfsp and we work on a real
dirfsp.

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

index 540cf1acc8c70813de9981b14507a7707137a961..be728d88c588e5620cec57c4d8283ad3cbf825f4 100644 (file)
@@ -654,6 +654,7 @@ again:
        if (smb_fname->base_name[0] == '/') {
                int cmp = strcmp(connpath, smb_fname->base_name);
                if (cmp == 0) {
+                       SMB_ASSERT(dirfsp == conn->cwd_fsp);
                        smb_fname->base_name = talloc_strdup(smb_fname, "");
                        if (smb_fname->base_name == NULL) {
                                status = NT_STATUS_NO_MEMORY;