s3: VFS: shadow_copy: Move one more use of OpenDir() -> OpenDir_nstatus().
authorJeremy Allison <jra@samba.org>
Mon, 28 Feb 2022 22:11:04 +0000 (14:11 -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/modules/vfs_shadow_copy.c

index 37c4657e79b575ac6e812b9b1c6f07c5e4817c48..739e3e9cb90f8559065fa4cc229368d1ec28f6c7 100644 (file)
@@ -179,6 +179,7 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
        const char *dname = NULL;
        char *talloced = NULL;
        long offset = 0;
+       NTSTATUS status;
        struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(),
                                                fsp->conn->connectpath,
                                                NULL,
@@ -190,10 +191,16 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
                return -1;
        }
 
-       dir_hnd = OpenDir(talloc_tos(), handle->conn, smb_fname, NULL, 0);
+       status = OpenDir_ntstatus(talloc_tos(),
+                                 handle->conn,
+                                 smb_fname,
+                                 NULL,
+                                 0,
+                                 &dir_hnd);
        TALLOC_FREE(smb_fname);
-       if (dir_hnd == NULL) {
+       if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("OpenDir() failed for [%s]\n", fsp->conn->connectpath);
+               errno = map_errno_from_nt_status(status);
                return -1;
        }