mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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>
This commit is contained in:
parent
4e93ea2340
commit
b17c9fdc51
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user