]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Enable fd_openat(cwd_fsp, "/absolute/share/path")
authorVolker Lendecke <vl@samba.org>
Sat, 19 Oct 2024 15:30:09 +0000 (17:30 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 18:07:33 +0000 (18:07 +0000)
So far fd_openat needed to be called with cwd_fsp and "." if you
wanted to open the share root, this enables using the absolute share
path. The next patch will remove sending the "." with cwd_fsp as a
simplification. Enable that with this little change.

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

index be728d88c588e5620cec57c4d8283ad3cbf825f4..3290c71f69ee76291b7980bee69e6ed6b52e219b 100644 (file)
@@ -655,7 +655,7 @@ again:
                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, "");
+                       smb_fname->base_name = talloc_strdup(smb_fname, ".");
                        if (smb_fname->base_name == NULL) {
                                status = NT_STATUS_NO_MEMORY;
                                goto out;