diff options
author | Volker Lendecke <vl@samba.org> | 2011-02-25 06:43:52 -0700 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-03-02 18:39:21 +0100 |
commit | cf7dac6fbccca6667e5ed20b199e80701b8a6bd4 (patch) | |
tree | 611f063cb14b4ba77be8a574dc2cd46101dfb150 /source3/modules | |
parent | c9d1e16c2c6ab5ffebbab4bd82a4cda0bb860046 (diff) | |
download | samba-cf7dac6fbccca6667e5ed20b199e80701b8a6bd4.tar.gz samba-cf7dac6fbccca6667e5ed20b199e80701b8a6bd4.tar.bz2 samba-cf7dac6fbccca6667e5ed20b199e80701b8a6bd4.zip |
s3: Pass smb_filename through the set_offline vfs op
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_default.c | 3 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 12 | ||||
-rw-r--r-- | source3/modules/vfs_onefs_shadow_copy.c | 3 | ||||
-rw-r--r-- | source3/modules/vfs_tsmsm.c | 11 |
4 files changed, 26 insertions, 3 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 6ad538149a..b7e70a608b 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1634,7 +1634,8 @@ static bool vfswrap_is_offline(struct vfs_handle_struct *handle, 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) diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index e5c375ad95..303ffae660 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -2215,6 +2215,17 @@ static bool smb_full_audit_is_offline(struct vfs_handle_struct *handle, 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 */ @@ -2333,6 +2344,7 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .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) diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c index a6681c0ab4..9011f6da77 100644 --- a/source3/modules/vfs_onefs_shadow_copy.c +++ b/source3/modules/vfs_onefs_shadow_copy.c @@ -645,8 +645,9 @@ onefs_shadow_copy_is_offline(struct vfs_handle_struct *handle, 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); diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c index 533fde2003..6383891913 100644 --- a/source3/modules/vfs_tsmsm.c +++ b/source3/modules/vfs_tsmsm.c @@ -349,10 +349,13 @@ static ssize_t tsmsm_pwrite(struct vfs_handle_struct *handle, struct files_struc } 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 */ @@ -360,6 +363,12 @@ static int tsmsm_set_offline(struct vfs_handle_struct *handle, 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) { |