mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s3: VFS: vfs_media_harmony. Implement linkat().
Currently identical to link(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
This commit is contained in:
parent
d75177454c
commit
6e96b98f64
@ -1821,6 +1821,58 @@ out:
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Success: return 0
|
||||
* Failure: set errno, return -1
|
||||
*/
|
||||
static int mh_linkat(vfs_handle_struct *handle,
|
||||
files_struct *srcfsp,
|
||||
const struct smb_filename *old_smb_fname,
|
||||
files_struct *dstfsp,
|
||||
const struct smb_filename *new_smb_fname,
|
||||
int flags)
|
||||
{
|
||||
int status;
|
||||
struct smb_filename *oldclientFname = NULL;
|
||||
struct smb_filename *newclientFname = NULL;
|
||||
|
||||
DEBUG(MH_INFO_DEBUG, ("Entering mh_linkat\n"));
|
||||
if (!is_in_media_files(old_smb_fname->base_name) &&
|
||||
!is_in_media_files(new_smb_fname->base_name)) {
|
||||
status = SMB_VFS_NEXT_LINKAT(handle,
|
||||
srcfsp,
|
||||
old_smb_fname,
|
||||
dstfsp,
|
||||
new_smb_fname,
|
||||
flags);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((status = alloc_get_client_smb_fname(handle, talloc_tos(),
|
||||
old_smb_fname,
|
||||
&oldclientFname))) {
|
||||
goto err;
|
||||
}
|
||||
if ((status = alloc_get_client_smb_fname(handle, talloc_tos(),
|
||||
new_smb_fname,
|
||||
&newclientFname))) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
status = SMB_VFS_NEXT_LINKAT(handle,
|
||||
srcfsp,
|
||||
oldclientFname,
|
||||
dstfsp,
|
||||
newclientFname,
|
||||
flags);
|
||||
|
||||
err:
|
||||
TALLOC_FREE(newclientFname);
|
||||
TALLOC_FREE(oldclientFname);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Success: return 0
|
||||
* Failure: set errno, return -1
|
||||
@ -2302,6 +2354,7 @@ static struct vfs_fn_pointers vfs_mh_fns = {
|
||||
.symlink_fn = mh_symlink,
|
||||
.readlink_fn = mh_readlink,
|
||||
.link_fn = mh_link,
|
||||
.linkat_fn = mh_linkat,
|
||||
.mknod_fn = mh_mknod,
|
||||
.realpath_fn = mh_realpath,
|
||||
.chflags_fn = mh_chflags,
|
||||
|
Loading…
Reference in New Issue
Block a user