From: Jeremy Allison Date: Mon, 28 Feb 2022 22:20:37 +0000 (-0800) Subject: s3: smbd: In recursive_rmdir(), Move one more use of OpenDir() -> OpenDir_nstatus() X-Git-Tag: tevent-0.12.0~591 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51b7475d394ab04f73bdc054382f0814a41aaa74;p=thirdparty%2Fsamba.git s3: smbd: In recursive_rmdir(), 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/smbd/close.c b/source3/smbd/close.c index 4ad8e42f319..8174e4aaeb8 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -848,16 +848,23 @@ bool recursive_rmdir(TALLOC_CTX *ctx, bool ret = True; long offset = 0; SMB_STRUCT_STAT st; - struct smb_Dir *dir_hnd; + struct smb_Dir *dir_hnd = NULL; struct files_struct *dirfsp = NULL; int retval; NTSTATUS status; SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname)); - dir_hnd = OpenDir(talloc_tos(), conn, smb_dname, NULL, 0); - if (dir_hnd == NULL) + status = OpenDir_ntstatus(talloc_tos(), + conn, + smb_dname, + NULL, + 0, + &dir_hnd); + if (!NT_STATUS_IS_OK(status)) { + errno = map_errno_from_nt_status(status); return False; + } dirfsp = dir_hnd_fetch_fsp(dir_hnd);