From: Volker Lendecke Date: Mon, 21 Feb 2022 16:19:49 +0000 (+0100) Subject: vfs: walk_streams() returns NTSTATUS X-Git-Tag: tevent-0.12.0~669 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e3c51ee431f5070f87f3596b11da1b7a1c19e9a;p=thirdparty%2Fsamba.git vfs: walk_streams() returns NTSTATUS Don't go via errno Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index ae73ba965a5..f1ec5b9748a 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -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))