From 2adc0e0fdcd639a46008edff18371f181da93ed1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 13 Sep 2019 12:29:41 -0700 Subject: [PATCH] s3: smbd: Change recursive_rmdir() to call SMB_VFS_UNLINKAT(). Use conn->cwd_fsp as current fsp. Rework to modern standards. No logic change for now. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/close.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index c441f4eb5bcc..713ecb6a9b7f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -853,6 +853,7 @@ bool recursive_rmdir(TALLOC_CTX *ctx, long offset = 0; SMB_STRUCT_STAT st; struct smb_Dir *dir_hnd; + int retval; SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname)); @@ -907,8 +908,14 @@ bool recursive_rmdir(TALLOC_CTX *ctx, if(SMB_VFS_RMDIR(conn, smb_dname_full) != 0) { goto err_break; } - } else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) { - goto err_break; + } else { + retval = SMB_VFS_UNLINKAT(conn, + conn->cwd_fsp, + smb_dname_full, + 0); + if (retval != 0) { + goto err_break; + } } /* Successful iteration. */ -- 2.34.1