]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: can_delete_directory_fsp() returns NTSTATUS
authorVolker Lendecke <vl@samba.org>
Mon, 21 Feb 2022 16:19:49 +0000 (17:19 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 22 Feb 2022 09:21:29 +0000 (09:21 +0000)
Don't go via errno

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

index 88c5d2758c83940d95c3c7507a6ddac48e1bb209..c9cc6b73e584b30d967ed1e6c7b0f1d9569830df 100644 (file)
@@ -1915,14 +1915,12 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
        char *talloced = NULL;
        SMB_STRUCT_STAT st;
        struct connection_struct *conn = fsp->conn;
-       struct smb_Dir *dir_hnd = OpenDir(talloc_tos(),
-                                       conn,
-                                       fsp->fsp_name,
-                                       NULL,
-                                       0);
+       struct smb_Dir *dir_hnd = NULL;
 
-       if (!dir_hnd) {
-               return map_nt_error_from_unix(errno);
+       status = OpenDir_ntstatus(
+               talloc_tos(), conn, fsp->fsp_name, NULL, 0, &dir_hnd);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
 
        while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced))) {