From: Volker Lendecke Date: Wed, 9 Oct 2024 11:36:00 +0000 (+0200) Subject: smbd: Use OpenDir_from_pathref() in can_delete_directory_fsp() X-Git-Tag: tdb-1.4.13~525 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10512eebec60346c302b86eb77231372b8ad617a;p=thirdparty%2Fsamba.git smbd: Use OpenDir_from_pathref() in can_delete_directory_fsp() This avoids a full path traversal if /proc/self/fd is available. Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 7ac7df78faf..451e21b62af 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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; }