bool (*is_offline)(struct vfs_handle_struct *handle,
const struct smb_filename *fname,
SMB_STRUCT_STAT *sbuf);
- int (*set_offline)(struct vfs_handle_struct *handle, const char *path);
+ int (*set_offline)(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname);
};
/*
const struct smb_filename *fname,
SMB_STRUCT_STAT *sbuf);
int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
- const char *path);
+ const struct smb_filename *fname);
#endif /* _VFS_H */
#define SMB_VFS_NEXT_IS_OFFLINE(handle,fname,sbuf) \
smb_vfs_call_is_offline((handle)->next,(fname),(sbuf))
-#define SMB_VFS_SET_OFFLINE(conn,path) \
- smb_vfs_call_set_offline((conn)->vfs_handles,(path))
-#define SMB_VFS_NEXT_SET_OFFLINE(handle,path) \
- smb_vfs_call_set_offline((handle)->next, (path))
+#define SMB_VFS_SET_OFFLINE(conn,fname) \
+ smb_vfs_call_set_offline((conn)->vfs_handles,(fname))
+#define SMB_VFS_NEXT_SET_OFFLINE(handle,fname) \
+ smb_vfs_call_set_offline((handle)->next, (fname))
#endif /* _VFS_MACROS_H */
return (dmapi_file_flags(path) & FILE_ATTRIBUTE_OFFLINE) != 0;
}
-static int vfswrap_set_offline(struct vfs_handle_struct *handle, const char *path)
+static int vfswrap_set_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname)
{
/* We don't know how to set offline bit by default, needs to be overriden in the vfs modules */
#if defined(ENOTSUP)
return result;
}
+static int smb_full_audit_set_offline(struct vfs_handle_struct *handle,
+ const struct smb_filename *fname)
+{
+ int result;
+
+ result = SMB_VFS_NEXT_SET_OFFLINE(handle, fname);
+ do_log(SMB_VFS_OP_SET_OFFLINE, result >= 0, handle, "%s",
+ smb_fname_str_do_log(fname));
+ return result;
+}
+
static struct vfs_fn_pointers vfs_full_audit_fns = {
/* Disk operations */
.aio_suspend = smb_full_audit_aio_suspend,
.aio_force = smb_full_audit_aio_force,
.is_offline = smb_full_audit_is_offline,
+ .set_offline = smb_full_audit_set_offline,
};
NTSTATUS vfs_full_audit_init(void)
static int
onefs_shadow_copy_set_offline(struct vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *fname)
{
+#error Isilon, please convert "char *path" to "struct smb_fname *fname"
SHADOW_NEXT(SET_OFFLINE,
(handle, cpath ?: path),
int);
}
static int tsmsm_set_offline(struct vfs_handle_struct *handle,
- const char *path) {
+ const struct smb_filename *fname)
+{
struct tsmsm_struct *tsmd = (struct tsmsm_struct *) handle->data;
int result = 0;
char *command;
+ NTSTATUS status;
+ char *path;
if (tsmd->hsmscript == NULL) {
/* no script enabled */
return 0;
}
+ status = get_full_smb_filename(talloc_tos(), fname, &path);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
+
/* Now, call the script */
command = talloc_asprintf(tsmd, "%s offline \"%s\"", tsmd->hsmscript, path);
if(!command) {
if (dosmode & FILE_ATTRIBUTE_OFFLINE) {
if (!(old_mode & FILE_ATTRIBUTE_OFFLINE)) {
- lret = SMB_VFS_SET_OFFLINE(conn, smb_fname->base_name);
+ lret = SMB_VFS_SET_OFFLINE(conn, smb_fname);
if (lret == -1) {
DEBUG(0, ("set_dos_mode: client has asked to "
"set FILE_ATTRIBUTE_OFFLINE to "
}
int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *fname)
{
VFS_FIND(set_offline);
- return handle->fns->set_offline(handle, path);
+ return handle->fns->set_offline(handle, fname);
}