summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_shadow_copy2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-06-02 14:21:54 -0700
committerJeremy Allison <jra@samba.org>2017-06-18 02:49:25 +0200
commitfc92d451cf3162807e2493c62fa7617863adf2ba (patch)
treefe8a0bd156eb1fc5f5337212fd6ff6b7df1af0e6 /source3/modules/vfs_shadow_copy2.c
parent0da76414fdc6a0aacea6282a76b384a702615408 (diff)
downloadsamba-fc92d451cf3162807e2493c62fa7617863adf2ba.tar.gz
s3: VFS: Change SMB_VFS_LINK to use const struct smb_filename * instead of const char *.
We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Diffstat (limited to 'source3/modules/vfs_shadow_copy2.c')
-rw-r--r--source3/modules/vfs_shadow_copy2.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index faacc459146..5481eda0e25 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -1180,19 +1180,28 @@ static int shadow_copy2_symlink(vfs_handle_struct *handle,
}
static int shadow_copy2_link(vfs_handle_struct *handle,
- const char *oldname, const char *newname)
+ const struct smb_filename *old_smb_fname,
+ const struct smb_filename *new_smb_fname)
{
time_t timestamp_old = 0;
time_t timestamp_new = 0;
char *snappath_old = NULL;
char *snappath_new = NULL;
- if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), handle, oldname,
- &timestamp_old, NULL, &snappath_old)) {
+ if (!shadow_copy2_strip_snapshot_internal(talloc_tos(),
+ handle,
+ old_smb_fname->base_name,
+ &timestamp_old,
+ NULL,
+ &snappath_old)) {
return -1;
}
- if (!shadow_copy2_strip_snapshot_internal(talloc_tos(), handle, newname,
- &timestamp_new, NULL, &snappath_new)) {
+ if (!shadow_copy2_strip_snapshot_internal(talloc_tos(),
+ handle,
+ new_smb_fname->base_name,
+ &timestamp_new,
+ NULL,
+ &snappath_new)) {
return -1;
}
if ((timestamp_old != 0) || (timestamp_new != 0)) {
@@ -1206,7 +1215,7 @@ static int shadow_copy2_link(vfs_handle_struct *handle,
errno = EROFS;
return -1;
}
- return SMB_VFS_NEXT_LINK(handle, oldname, newname);
+ return SMB_VFS_NEXT_LINK(handle, old_smb_fname, new_smb_fname);
}
static int shadow_copy2_stat(vfs_handle_struct *handle,