]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: walk_streams() 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/modules/vfs_streams_depot.c

index ae73ba965a55caa13d3e847e7f705ffad24fad0a..f1ec5b9748af0a5ddf27992baca33c7710a53d9c 100644 (file)
@@ -551,6 +551,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
        const char *dname = NULL;
        long offset = 0;
        char *talloced = NULL;
+       NTSTATUS status;
 
        dirname = stream_dir(handle, smb_fname_base, &smb_fname_base->st,
                             false);
@@ -594,13 +595,14 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle,
        orig_connectpath = handle->conn->connectpath;
        handle->conn->connectpath = rootdir;
 
-       dir_hnd = OpenDir(talloc_tos(), handle->conn, dir_smb_fname, NULL, 0);
-       if (dir_hnd == NULL) {
+       status = OpenDir_ntstatus(
+               talloc_tos(), handle->conn, dir_smb_fname, NULL, 0, &dir_hnd);
+       if (!NT_STATUS_IS_OK(status)) {
                handle->conn->connectpath = orig_connectpath;
                TALLOC_FREE(rootdir);
                TALLOC_FREE(dir_smb_fname);
                TALLOC_FREE(dirname);
-               return map_nt_error_from_unix(errno);
+               return status;
        }
 
         while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced))