s3: VFS: fruit: Move two more uses of OpenDir() -> OpenDir_nstatus().
authorJeremy Allison <jra@samba.org>
Mon, 28 Feb 2022 22:08:40 +0000 (14:08 -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_fruit.c

index e54e0903c40d63b2e486b7e704cae325714bd35b..3b95337034bf2d5f8c49e84dd8e61044de57f8ed 100644 (file)
@@ -5055,6 +5055,7 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle,
        char *talloced = NULL;
        long offset = 0;
        size_t nbands;
+       NTSTATUS status;
 
        path = talloc_asprintf(talloc_tos(),
                               "%s/%s/bands",
@@ -5075,9 +5076,15 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle,
                return false;
        }
 
-       dir_hnd = OpenDir(talloc_tos(), handle->conn, bands_dir, NULL, 0);
-       if (dir_hnd == NULL) {
+       status = OpenDir_ntstatus(talloc_tos(),
+                                 handle->conn,
+                                 bands_dir,
+                                 NULL,
+                                 0,
+                                 &dir_hnd);
+       if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(bands_dir);
+               errno = map_errno_from_nt_status(status);
                return false;
        }
 
@@ -5198,6 +5205,7 @@ static uint64_t fruit_disk_free(vfs_handle_struct *handle,
        uint64_t dfree;
        uint64_t dsize;
        bool ok;
+       NTSTATUS status;
 
        SMB_VFS_HANDLE_GET_DATA(handle, config,
                                struct fruit_config_data,
@@ -5213,8 +5221,14 @@ static uint64_t fruit_disk_free(vfs_handle_struct *handle,
                                              _dsize);
        }
 
-       dir_hnd = OpenDir(talloc_tos(), handle->conn, smb_fname, NULL, 0);
-       if (dir_hnd == NULL) {
+       status = OpenDir_ntstatus(talloc_tos(),
+                                 handle->conn,
+                                 smb_fname,
+                                 NULL,
+                                 0,
+                                 &dir_hnd);
+       if (!NT_STATUS_IS_OK(status)) {
+               errno = map_errno_from_nt_status(status);
                return UINT64_MAX;
        }