summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-09-13 12:29:41 -0700
committerRalph Boehme <slow@samba.org>2019-09-26 17:20:48 +0000
commit2adc0e0fdcd639a46008edff18371f181da93ed1 (patch)
tree7416e938e0807adc6fd48fccea41bb76aa38dd4d /source3/smbd
parentf8cff71e5f9edb97a3817bc259c0aeec6fbdba7f (diff)
downloadsamba-2adc0e0fdcd639a46008edff18371f181da93ed1.tar.gz
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 <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index c441f4eb5bc..713ecb6a9b7 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. */