From: Jeremy Allison Date: Fri, 30 Aug 2019 21:00:12 +0000 (-0700) Subject: s3: VFS: vfs_syncops. Implement symlinkat(). X-Git-Tag: tevent-0.10.1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f5de7061eb53a5115223ca26279b320a15591c8;p=thirdparty%2Fsamba.git s3: VFS: vfs_syncops. Implement symlinkat(). Currently identical to symlink(). Signed-off-by: Jeremy Allison Reviewed-by: Ralph Böhme --- diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 04a0180a2fb..e8169bac1a9 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -185,6 +185,30 @@ static int syncops_symlink(vfs_handle_struct *handle, return ret; } +static int syncops_symlinkat(vfs_handle_struct *handle, + const char *link_contents, + struct files_struct *dirfsp, + const struct smb_filename *new_smb_fname) +{ + int ret; + struct syncops_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct syncops_config_data, + return -1); + + ret = SMB_VFS_NEXT_SYMLINKAT(handle, + link_contents, + dirfsp, + new_smb_fname); + + if (ret == 0 && config->onmeta && !config->disable) { + syncops_two_names(link_contents, + new_smb_fname->base_name); + } + return ret; +} + static int syncops_linkat(vfs_handle_struct *handle, files_struct *srcfsp, const struct smb_filename *old_smb_fname, @@ -318,6 +342,7 @@ static struct vfs_fn_pointers vfs_syncops_fns = { .renameat_fn = syncops_renameat, .unlink_fn = syncops_unlink, .symlink_fn = syncops_symlink, + .symlinkat_fn = syncops_symlinkat, .linkat_fn = syncops_linkat, .mknodat_fn = syncops_mknodat, .close_fn = syncops_close,