summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-10-19 11:56:49 -0700
committerKarolin Seeger <kseeger@samba.org>2016-10-31 12:39:09 +0100
commitbfa537d5e2b4406e39d342a24719c8c772a56d1e (patch)
treef57b13ecd4c2f9e58aafc7da2e9b95a357465e34 /source3/modules
parent71d5a11ea3a4b7e75c852495f3b6676984bdc01d (diff)
downloadsamba-bfa537d5e2b4406e39d342a24719c8c772a56d1e.tar.gz
s3: vfs: Remove files/directories after the streams are deleted.
By the time we get to SMB_VFS_UNLINK/SMB_VFS_RMDIR the ACL checks have already been done. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12384 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> (cherry picked from commit b17c9fdc51c10313eed32d6e078ed7050a342d0f)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_streams_depot.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index 83c9d9743ae..d874514bf22 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -725,8 +725,12 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
return -1;
}
- ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
- if (ret == 0) {
+ /*
+ * We know the unlink should succeed as the ACL
+ * check is already done in the caller. Remove the
+ * file *after* the streams.
+ */
+ {
char *dirname = stream_dir(handle, smb_fname_base,
&smb_fname_base->st, false);
@@ -749,6 +753,7 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
TALLOC_FREE(dirname);
}
+ ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
TALLOC_FREE(smb_fname_base);
return ret;
}
@@ -787,8 +792,12 @@ static int streams_depot_rmdir(vfs_handle_struct *handle,
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname_base);
- if (ret == 0) {
+ /*
+ * We know the rmdir should succeed as the ACL
+ * check is already done in the caller. Remove the
+ * directory *after* the streams.
+ */
+ {
char *dirname = stream_dir(handle, smb_fname_base,
&smb_fname_base->st, false);
@@ -811,6 +820,7 @@ static int streams_depot_rmdir(vfs_handle_struct *handle,
TALLOC_FREE(dirname);
}
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname_base);
TALLOC_FREE(smb_fname_base);
return ret;
}