]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In recursive_rmdir(), Move one more use of OpenDir() -> OpenDir_nstatus()
authorJeremy Allison <jra@samba.org>
Mon, 28 Feb 2022 22:20:37 +0000 (14:20 -0800)
committerVolker Lendecke <vl@samba.org>
Wed, 2 Mar 2022 21:04:34 +0000 (21:04 +0000)
Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/close.c

index 4ad8e42f319daa5add35447054d00a921109e83d..8174e4aaeb878a04d87fec96263dbfcf9e17662c 100644 (file)
@@ -848,16 +848,23 @@ bool recursive_rmdir(TALLOC_CTX *ctx,
        bool ret = True;
        long offset = 0;
        SMB_STRUCT_STAT st;
-       struct smb_Dir *dir_hnd;
+       struct smb_Dir *dir_hnd = NULL;
        struct files_struct *dirfsp = NULL;
        int retval;
        NTSTATUS status;
 
        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
 
-       dir_hnd = OpenDir(talloc_tos(), conn, smb_dname, NULL, 0);
-       if (dir_hnd == NULL)
+       status = OpenDir_ntstatus(talloc_tos(),
+                                 conn,
+                                 smb_dname,
+                                 NULL,
+                                 0,
+                                 &dir_hnd);
+       if (!NT_STATUS_IS_OK(status)) {
+               errno = map_errno_from_nt_status(status);
                return False;
+       }
 
        dirfsp = dir_hnd_fetch_fsp(dir_hnd);