diff options
author | Jeremy Allison <jra@samba.org> | 2019-08-22 14:24:49 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-08-23 18:49:36 +0000 |
commit | 44c955a81ada0f513230653f35f0d6a0dd6d7404 (patch) | |
tree | c77d659e9bf84cca58b40c4284c1e1dad75ad101 /source3/modules/vfs_media_harmony.c | |
parent | 4874730c3052668a1bc8b8939ee557a77387f1f0 (diff) | |
download | samba-44c955a81ada0f513230653f35f0d6a0dd6d7404.tar.gz |
s3: VFS: vfs_media_harmony. Implement readlinkat().
Currently identical to readlink().
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 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 1b1a6606056..55b62a470e4 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -1782,6 +1782,47 @@ out: } /* + * Success: return byte count + * Failure: set errno, return -1 + */ +static int mh_readlinkat(vfs_handle_struct *handle, + files_struct *dirfsp, + const struct smb_filename *smb_fname, + char *buf, + size_t bufsiz) +{ + int status; + struct smb_filename *clientFname = NULL; + + DEBUG(MH_INFO_DEBUG, ("Entering mh_readlinkat\n")); + if (!is_in_media_files(smb_fname->base_name)) { + status = SMB_VFS_NEXT_READLINKAT(handle, + dirfsp, + smb_fname, + buf, + bufsiz); + goto out; + } + + if ((status = alloc_get_client_smb_fname(handle, talloc_tos(), + smb_fname, + &clientFname))) { + goto err; + } + + status = SMB_VFS_NEXT_READLINKAT(handle, + dirfsp, + clientFname, + buf, + bufsiz); + +err: + TALLOC_FREE(clientFname); +out: + return status; +} + +/* * Success: return 0 * Failure: set errno, return -1 */ @@ -2323,6 +2364,7 @@ static struct vfs_fn_pointers vfs_mh_fns = { .ntimes_fn = mh_ntimes, .symlink_fn = mh_symlink, .readlink_fn = mh_readlink, + .readlinkat_fn = mh_readlinkat, .linkat_fn = mh_linkat, .mknodat_fn = mh_mknodat, .realpath_fn = mh_realpath, |