diff options
author | Simo Sorce <idra@samba.org> | 2008-08-26 18:56:49 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-08-26 18:56:49 -0400 |
commit | a1de4e988d7780f687bb7ed2288faf3dfbb9da71 (patch) | |
tree | abc569f52f33efdf48135faf7f0c790601eef229 /source3/modules/vfs_tsmsm.c | |
parent | 5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4 (diff) | |
parent | 95cc5ee395ab9d7f6f79d341ad20bc486c292a8d (diff) | |
download | samba-a1de4e988d7780f687bb7ed2288faf3dfbb9da71.tar.gz samba-a1de4e988d7780f687bb7ed2288faf3dfbb9da71.tar.xz samba-a1de4e988d7780f687bb7ed2288faf3dfbb9da71.zip |
Merge branch 'v3-devel' of ssh://git.samba.org/data/git/samba into v3-devel
(This used to be commit e038f1cf9fb305fc1e7a4189208e451d30aaa1f0)
Diffstat (limited to 'source3/modules/vfs_tsmsm.c')
-rw-r--r-- | source3/modules/vfs_tsmsm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/modules/vfs_tsmsm.c b/source3/modules/vfs_tsmsm.c index 4a732bca43..ee958b1be5 100644 --- a/source3/modules/vfs_tsmsm.c +++ b/source3/modules/vfs_tsmsm.c @@ -200,9 +200,9 @@ static bool tsmsm_is_offline(struct vfs_handle_struct *handle, goto done; } - lerrno = 0; - do { + lerrno = 0; + ret = dm_get_dmattr(*dmsession_id, dmhandle, dmhandle_len, DM_NO_TOKEN, &dmname, buflen, buf, &rlen); if (ret == -1 && errno == EINVAL) { @@ -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; } |