]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use OpenDir_from_pathref() in can_delete_directory_fsp()
authorVolker Lendecke <vl@samba.org>
Wed, 9 Oct 2024 11:36:00 +0000 (13:36 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 18:07:33 +0000 (18:07 +0000)
This avoids a full path traversal if /proc/self/fd is available.

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

index 7ac7df78faf4a0e3c21235c63878608b2648b53d..451e21b62af38dca5b1cb5e85ab497f82a608e74 100644 (file)
@@ -1550,8 +1550,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
        struct connection_struct *conn = fsp->conn;
        struct smb_Dir *dir_hnd = NULL;
 
-       status = OpenDir(
-               talloc_tos(), conn, fsp->fsp_name, NULL, 0, &dir_hnd);
+       status = OpenDir_from_pathref(talloc_tos(), fsp, NULL, 0, &dir_hnd);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }