summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-23 11:36:27 +1000
committerMichael Adam <obnox@samba.org>2008-08-26 14:39:42 +0200
commitf09e8ce2cecb5ed9afdf811024442ec9320f4b52 (patch)
treef66ec3129ee2bf6f8f46d6653436be435dbbdfa3
parent98c3324cc3d55c72dcad9b04b9c6e665250bf2e5 (diff)
downloadsamba-f09e8ce2cecb5ed9afdf811024442ec9320f4b52.tar.gz
samba-f09e8ce2cecb5ed9afdf811024442ec9320f4b52.tar.bz2
samba-f09e8ce2cecb5ed9afdf811024442ec9320f4b52.zip
fixed tsmsm_sendfile(). The logic was totally broken.
(This used to be commit 794e48b809036871287df8416a2c669b7e26f216)
-rw-r--r--source3/modules/vfs_tsmsm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c
index 4a732bca43..d56c5aa87f 100644
--- a/source3/modules/vfs_tsmsm.c
+++ b/source3/modules/vfs_tsmsm.c
@@ -279,10 +279,13 @@ static ssize_t tsmsm_aio_return(struct vfs_handle_struct *handle, struct files_s
static ssize_t tsmsm_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, const DATA_BLOB *hdr,
SMB_OFF_T offset, size_t n)
{
- bool file_online = tsmsm_aio_force(handle, fsp);
+ bool file_offline = tsmsm_aio_force(handle, fsp);
- if(!file_online)
- return ENOSYS;
+ if (file_offline) {
+ DEBUG(10,("tsmsm_sendfile on offline file - rejecting\n"));
+ errno = ENOSYS;
+ return -1;
+ }
return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, hdr, offset, n);
}
@@ -333,7 +336,7 @@ static int tsmsm_set_offline(struct vfs_handle_struct *handle,
if (tsmd->hsmscript == NULL) {
/* no script enabled */
- DEBUG(1, ("tsmsm_set_offline: No tsmsm:hsmscript configured\n"));
+ DEBUG(1, ("tsmsm_set_offline: No 'tsmsm:hsm script' configured\n"));
return 0;
}