summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-09-13 12:34:31 -0700
committerRalph Boehme <slow@samba.org>2019-09-26 17:20:48 +0000
commit3bf8181f159c142a45287e996167d11980508dd6 (patch)
tree2f6224e9da42db185ed6df862653a20c337d8c3f /source3/smbd
parent2adc0e0fdcd639a46008edff18371f181da93ed1 (diff)
downloadsamba-3bf8181f159c142a45287e996167d11980508dd6.tar.gz
s3: smbd: Change rmdir_internals() to call SMB_VFS_UNLINKAT() in 2 places.
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.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 713ecb6a9b7..567315b712e 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -959,7 +959,10 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
if (!(S_ISDIR(smb_dname->st.st_ex_mode))) {
return NT_STATUS_NOT_A_DIRECTORY;
}
- ret = SMB_VFS_UNLINK(conn, smb_dname);
+ ret = SMB_VFS_UNLINKAT(conn,
+ conn->cwd_fsp,
+ smb_dname,
+ 0);
} else {
ret = SMB_VFS_RMDIR(conn, smb_dname);
}
@@ -1069,8 +1072,14 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, files_struct *fsp)
smb_dname_full) != 0) {
goto err_break;
}
- } else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) {
- goto err_break;
+ } else {
+ int retval = SMB_VFS_UNLINKAT(conn,
+ conn->cwd_fsp,
+ smb_dname_full,
+ 0);
+ if(retval != 0) {
+ goto err_break;
+ }
}
/* Successful iteration. */