diff options
author | Jeremy Allison <jra@samba.org> | 2019-08-30 13:51:50 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-03 21:15:42 +0000 |
commit | 2d50dfa52c8bac7f97eb95fef0a266e1fe9b1460 (patch) | |
tree | 2894094c648a3a75bcca9f70fb6757dad5ef2e6c /source3/modules/vfs_media_harmony.c | |
parent | ff3af0fccc8013862d75220bd60aa08ffe913d2a (diff) | |
download | samba-2d50dfa52c8bac7f97eb95fef0a266e1fe9b1460.tar.gz |
s3: VFS: vfs_media_harmony. Implement symlinkat().
Currently identical to symlink().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/modules/vfs_media_harmony.c')
-rw-r--r-- | source3/modules/vfs_media_harmony.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 56e2e4d8380..8e64d80f43a 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -1751,6 +1751,52 @@ out: } /* + * Success: return 0 + * Failure: set errno, return -1 + */ + +static int mh_symlinkat(vfs_handle_struct *handle, + const char *link_contents, + struct files_struct *dirfsp, + const struct smb_filename *new_smb_fname) +{ + int status = -1; + char *client_link_contents = NULL; + struct smb_filename *newclientFname = NULL; + + DEBUG(MH_INFO_DEBUG, ("Entering mh_symlinkat\n")); + if (!is_in_media_files(link_contents) && + !is_in_media_files(new_smb_fname->base_name)) { + status = SMB_VFS_NEXT_SYMLINKAT(handle, + link_contents, + dirfsp, + new_smb_fname); + goto out; + } + + if ((status = alloc_get_client_path(handle, talloc_tos(), + link_contents, + &client_link_contents))) { + goto err; + } + if ((status = alloc_get_client_smb_fname(handle, talloc_tos(), + new_smb_fname, + &newclientFname))) { + goto err; + } + + status = SMB_VFS_NEXT_SYMLINKAT(handle, + client_link_contents, + dirfsp, + newclientFname); +err: + TALLOC_FREE(client_link_contents); + TALLOC_FREE(newclientFname); +out: + return status; +} + +/* * Success: return byte count * Failure: set errno, return -1 */ @@ -2332,6 +2378,7 @@ static struct vfs_fn_pointers vfs_mh_fns = { .chdir_fn = mh_chdir, .ntimes_fn = mh_ntimes, .symlink_fn = mh_symlink, + .symlinkat_fn = mh_symlinkat, .readlinkat_fn = mh_readlinkat, .linkat_fn = mh_linkat, .mknodat_fn = mh_mknodat, |