summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_onefs_shadow_copy.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-02 09:27:44 -0700
committerTim Prouty <tprouty@samba.org>2009-07-06 15:38:36 -0700
commit258952aa85f2a68e2d2362522f6114c6a439f1e3 (patch)
tree696d8f4425cb6d82c95c0923ba1b0405d39a1f5e /source3/modules/vfs_onefs_shadow_copy.c
parent133e915a81510f543f6458f377857d4f1b680970 (diff)
downloadsamba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.gz
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.bz2
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.zip
s3: Plumb smb_filename through SMB_VFS_UNLINK
Diffstat (limited to 'source3/modules/vfs_onefs_shadow_copy.c')
-rw-r--r--source3/modules/vfs_onefs_shadow_copy.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c
index 04460d6056..1a43e0671a 100644
--- a/source3/modules/vfs_onefs_shadow_copy.c
+++ b/source3/modules/vfs_onefs_shadow_copy.c
@@ -143,9 +143,6 @@ onefs_shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
return ret; \
} while (0) \
-/*
- * XXX: Convert osc_canonicalize_path to use talloc instead of malloc.
- */
#define SHADOW_NEXT_SMB_FNAME(op, args, rtype) do { \
char *smb_base_name_tmp = NULL; \
char *cpath = NULL; \
@@ -165,6 +162,35 @@ onefs_shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
} while (0) \
+/*
+ * XXX: Convert osc_canonicalize_path to use talloc instead of malloc.
+ */
+#define SHADOW_NEXT_SMB_FNAME_CONST(op, args, rtype) do { \
+ struct smb_filename *smb_fname_tmp = NULL; \
+ char *cpath = NULL; \
+ char *snap_component = NULL; \
+ rtype ret; \
+ if (shadow_copy_match_name(smb_fname->base_name, \
+ &snap_component)) { \
+ cpath = osc_canonicalize_path(smb_fname->base_name, \
+ snap_component); \
+ smb_fname->base_name = cpath; \
+ } \
+ status = create_synthetic_smb_fname(talloc_tos(), \
+ cpath ?: smb_fname->base_name, \
+ smb_fname->stream_name, &smb_fname->st, \
+ &smb_fname_tmp); \
+ if (!NT_STATUS_IS_OK(status)) { \
+ errno = map_errno_from_nt_status(status); \
+ return ret; \
+ } \
+ ret = SMB_VFS_NEXT_ ## op args; \
+ TALLOC_FREE(smb_fname_tmp) \
+ SAFE_FREE(cpath); \
+ return ret; \
+ } while (0) \
+
+
static uint64_t
onefs_shadow_copy_disk_free(vfs_handle_struct *handle, const char *path,
@@ -324,11 +350,12 @@ onefs_shadow_copy_lstat(vfs_handle_struct *handle,
}
static int
-onefs_shadow_copy_unlink(vfs_handle_struct *handle, const char *path)
+onefs_shadow_copy_unlink(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- SHADOW_NEXT(UNLINK,
- (handle, cpath ?: path),
- int);
+ SHADOW_NEXT_SMB_FNAME_CONST(UNLINK,
+ (handle, smb_fname_tmp),
+ int);
}
static int