mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
s3: VFS: vfs_unityed_media. Implement symlinkat().
Currently identical to symlink(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
parent
f6d63ff644
commit
8c851da40f
@ -1365,6 +1365,47 @@ err:
|
||||
return status;
|
||||
}
|
||||
|
||||
static int um_symlinkat(vfs_handle_struct *handle,
|
||||
const char *link_contents,
|
||||
struct files_struct *dirfsp,
|
||||
const struct smb_filename *new_smb_fname)
|
||||
{
|
||||
int status;
|
||||
char *client_link_contents = NULL;
|
||||
struct smb_filename *new_client_fname = NULL;
|
||||
|
||||
DEBUG(10, ("Entering um_symlinkat\n"));
|
||||
|
||||
if (!is_in_media_files(link_contents) &&
|
||||
!is_in_media_files(new_smb_fname->base_name)) {
|
||||
return SMB_VFS_NEXT_SYMLINKAT(handle,
|
||||
link_contents,
|
||||
dirfsp,
|
||||
new_smb_fname);
|
||||
}
|
||||
|
||||
status = alloc_get_client_path(handle, talloc_tos(),
|
||||
link_contents, &client_link_contents);
|
||||
if (status != 0) {
|
||||
goto err;
|
||||
}
|
||||
status = alloc_get_client_smb_fname(handle, talloc_tos(),
|
||||
new_smb_fname, &new_client_fname);
|
||||
if (status != 0) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
status = SMB_VFS_NEXT_SYMLINKAT(handle,
|
||||
client_link_contents,
|
||||
dirfsp,
|
||||
new_client_fname);
|
||||
|
||||
err:
|
||||
TALLOC_FREE(client_link_contents);
|
||||
TALLOC_FREE(new_client_fname);
|
||||
return status;
|
||||
}
|
||||
|
||||
static int um_readlinkat(vfs_handle_struct *handle,
|
||||
files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1932,6 +1973,7 @@ static struct vfs_fn_pointers vfs_um_fns = {
|
||||
.chdir_fn = um_chdir,
|
||||
.ntimes_fn = um_ntimes,
|
||||
.symlink_fn = um_symlink,
|
||||
.symlinkat_fn = um_symlinkat,
|
||||
.readlinkat_fn = um_readlinkat,
|
||||
.linkat_fn = um_linkat,
|
||||
.mknodat_fn = um_mknodat,
|
||||
|
Loading…
x
Reference in New Issue
Block a user