From: Jeremy Allison Date: Mon, 28 Feb 2022 22:11:04 +0000 (-0800) Subject: s3: VFS: shadow_copy: Move one more use of OpenDir() -> OpenDir_nstatus(). X-Git-Tag: tevent-0.12.0~593 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a138d0f2d986a8d05ea2e4172871701bdb187770;p=thirdparty%2Fsamba.git s3: VFS: shadow_copy: Move one more use of OpenDir() -> OpenDir_nstatus(). Eventually we can replace OpenDir() with OpenDir_ntatatus(). Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/modules/vfs_shadow_copy.c b/source3/modules/vfs_shadow_copy.c index 37c4657e79b..739e3e9cb90 100644 --- a/source3/modules/vfs_shadow_copy.c +++ b/source3/modules/vfs_shadow_copy.c @@ -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; }