From: Ralph Boehme Date: Thu, 21 Jan 2021 15:07:03 +0000 (+0100) Subject: vfs_streams_depot: support real dirfsps in streams_depot_rmdir_internal() X-Git-Tag: tevent-0.11.0~1931 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=070778011e733cc712f83bd74c8c23e72df9256e;p=thirdparty%2Fsamba.git vfs_streams_depot: support real dirfsps in streams_depot_rmdir_internal() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index e1f17afff74..4cf0bb47954 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -787,21 +787,30 @@ static int streams_depot_rmdir_internal(vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname) { + struct smb_filename *full_fname = NULL; struct smb_filename *smb_fname_base = NULL; int ret = -1; - DBG_DEBUG("called for %s\n", smb_fname->base_name); + full_fname = full_path_from_dirfsp_atname(talloc_tos(), + dirfsp, + smb_fname); + if (full_fname == NULL) { + return -1; + } + + DBG_DEBUG("called for %s\n", full_fname->base_name); /* * We potentially need to delete the per-inode streams directory */ smb_fname_base = synthetic_smb_fname(talloc_tos(), - smb_fname->base_name, + full_fname->base_name, NULL, NULL, - smb_fname->twrp, - smb_fname->flags); + full_fname->twrp, + full_fname->flags); + TALLOC_FREE(full_fname); if (smb_fname_base == NULL) { errno = ENOMEM; return -1; @@ -842,7 +851,7 @@ static int streams_depot_rmdir_internal(vfs_handle_struct *handle, return -1; } SMB_VFS_NEXT_UNLINKAT(handle, - dirfsp, + dirfsp->conn->cwd_fsp, smb_fname_dir, AT_REMOVEDIR); TALLOC_FREE(smb_fname_dir); @@ -852,7 +861,7 @@ static int streams_depot_rmdir_internal(vfs_handle_struct *handle, ret = SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, - smb_fname_base, + smb_fname, AT_REMOVEDIR); TALLOC_FREE(smb_fname_base); return ret;