]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: check for absolute paths in full_path_from_dirfsp_atname()
authorRalph Boehme <slow@samba.org>
Mon, 14 Dec 2020 14:53:11 +0000 (15:53 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
If the "atname" is an absolute path we can ignore the dirfsp and just return a
copy of the atname.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/filename.c

index 748d1effc165c4eb14067fc13b9f369ac74e213d..184a293f2055d7f180e7598bddb6bb6441672e9c 100644 (file)
@@ -2068,7 +2068,8 @@ struct smb_filename *full_path_from_dirfsp_atname(
        char *path = NULL;
 
        if (dirfsp == dirfsp->conn->cwd_fsp ||
-           ISDOT(dirfsp->fsp_name->base_name))
+           ISDOT(dirfsp->fsp_name->base_name) ||
+           atname->base_name[0] == '/')
        {
                path = talloc_strdup(mem_ctx, atname->base_name);
        } else {