mirror of
https://github.com/samba-team/samba.git
synced 2025-09-13 17:44:21 +03:00
s3: VFS: unityed_media: Fix um_readlinkat() to cope with real directory fsps.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
This commit is contained in:
@@ -1322,10 +1322,19 @@ static int um_readlinkat(vfs_handle_struct *handle,
|
|||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
struct smb_filename *client_fname = NULL;
|
struct smb_filename *client_fname = NULL;
|
||||||
|
struct smb_filename *full_fname = NULL;
|
||||||
|
|
||||||
DEBUG(10, ("Entering um_readlinkat\n"));
|
DEBUG(10, ("Entering um_readlinkat\n"));
|
||||||
|
|
||||||
if (!is_in_media_files(smb_fname->base_name)) {
|
full_fname = full_path_from_dirfsp_atname(talloc_tos(),
|
||||||
|
dirfsp,
|
||||||
|
smb_fname);
|
||||||
|
if (full_fname == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_in_media_files(full_fname->base_name)) {
|
||||||
|
TALLOC_FREE(full_fname);
|
||||||
return SMB_VFS_NEXT_READLINKAT(handle,
|
return SMB_VFS_NEXT_READLINKAT(handle,
|
||||||
dirfsp,
|
dirfsp,
|
||||||
smb_fname,
|
smb_fname,
|
||||||
@@ -1334,18 +1343,19 @@ static int um_readlinkat(vfs_handle_struct *handle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = alloc_get_client_smb_fname(handle, talloc_tos(),
|
status = alloc_get_client_smb_fname(handle, talloc_tos(),
|
||||||
smb_fname, &client_fname);
|
full_fname, &client_fname);
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = SMB_VFS_NEXT_READLINKAT(handle,
|
status = SMB_VFS_NEXT_READLINKAT(handle,
|
||||||
dirfsp,
|
handle->conn->cwd_fsp,
|
||||||
client_fname,
|
client_fname,
|
||||||
buf,
|
buf,
|
||||||
bufsiz);
|
bufsiz);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
TALLOC_FREE(full_fname);
|
||||||
TALLOC_FREE(client_fname);
|
TALLOC_FREE(client_fname);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user