summaryrefslogtreecommitdiffstats
path: root/source3/modules
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-25 06:37:34 -0700
committerVolker Lendecke <vlendec@samba.org>2011-03-02 18:39:21 +0100
commitc9d1e16c2c6ab5ffebbab4bd82a4cda0bb860046 (patch)
tree3ffb79da3653f0ba9273afd637f9e25e4aedd6cb /source3/modules
parent48f6b4d6fc08fa0621734c1c677ef7ef92891754 (diff)
downloadsamba-c9d1e16c2c6ab5ffebbab4bd82a4cda0bb860046.tar.gz
samba-c9d1e16c2c6ab5ffebbab4bd82a4cda0bb860046.tar.xz
samba-c9d1e16c2c6ab5ffebbab4bd82a4cda0bb860046.zip
s3: Pass smb_filename through the is_offline vfs op
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c15
-rw-r--r--source3/modules/vfs_full_audit.c13
-rw-r--r--source3/modules/vfs_onefs_shadow_copy.c4
-rw-r--r--source3/modules/vfs_tsmsm.c13
4 files changed, 40 insertions, 5 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 5448db8ee01..6ad538149a8 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1607,9 +1607,14 @@ static bool vfswrap_aio_force(struct vfs_handle_struct *handle, struct files_str
return false;
}
-static bool vfswrap_is_offline(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf)
+static bool vfswrap_is_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf)
{
- if (ISDOT(path) || ISDOTDOT(path)) {
+ NTSTATUS status;
+ char *path;
+
+ if (ISDOT(fname->base_name) || ISDOTDOT(fname->base_name)) {
return false;
}
@@ -1620,6 +1625,12 @@ static bool vfswrap_is_offline(struct vfs_handle_struct *handle, const char *pat
return false;
}
+ status = get_full_smb_filename(talloc_tos(), fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
+
return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
}
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index a9a4a0664e0..e5c375ad95b 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -2203,6 +2203,18 @@ static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle,
return result;
}
+static bool smb_full_audit_is_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *sbuf)
+{
+ bool result;
+
+ result = SMB_VFS_NEXT_IS_OFFLINE(handle, fname, sbuf);
+ do_log(SMB_VFS_OP_IS_OFFLINE, result, handle, "%s",
+ smb_fname_str_do_log(fname));
+ return result;
+}
+
static struct vfs_fn_pointers vfs_full_audit_fns = {
/* Disk operations */
@@ -2320,6 +2332,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
.aio_fsync = smb_full_audit_aio_fsync,
.aio_suspend = smb_full_audit_aio_suspend,
.aio_force = smb_full_audit_aio_force,
+ .is_offline = smb_full_audit_is_offline,
};
NTSTATUS vfs_full_audit_init(void)
diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c
index bcc40f0d9fa..a6681c0ab4f 100644
--- a/source3/modules/vfs_onefs_shadow_copy.c
+++ b/source3/modules/vfs_onefs_shadow_copy.c
@@ -634,8 +634,10 @@ onefs_shadow_copy_lsetxattr(vfs_handle_struct *handle, const char *path,
static bool
onefs_shadow_copy_is_offline(struct vfs_handle_struct *handle,
- const char *path, SMB_STRUCT_STAT *sbuf)
+ const struct smb_fname *fname,
+ SMB_STRUCT_STAT *sbuf)
{
+#error Isilon, please convert "char *path" to "struct smb_fname *fname"
SHADOW_NEXT(IS_OFFLINE,
(handle, cpath ?: path, sbuf),
bool);
diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c
index 95c83de08d2..533fde20030 100644
--- a/source3/modules/vfs_tsmsm.c
+++ b/source3/modules/vfs_tsmsm.c
@@ -146,8 +146,9 @@ static int tsmsm_connect(struct vfs_handle_struct *handle,
}
static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
- const char *path,
- SMB_STRUCT_STAT *stbuf) {
+ const struct smb_filename *fname,
+ SMB_STRUCT_STAT *stbuf)
+{
struct tsmsm_struct *tsmd = (struct tsmsm_struct *) handle->data;
const dm_sessid_t *dmsession_id;
void *dmhandle = NULL;
@@ -158,6 +159,14 @@ static bool tsmsm_is_offline(struct vfs_handle_struct *handle,
bool offline;
char *buf = NULL;
size_t buflen;
+ NTSTATUS status;
+ char *path;
+
+ status = get_full_smb_filename(talloc_tos(), fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
/* if the file has more than FILE_IS_ONLINE_RATIO of blocks available,
then assume it is not offline (it may not be 100%, as it could be sparse) */