The branch, v3-2-test has been updated
       via  1361caecb355047001f8a351ec2e6f10d7f0e741 (commit)
       via  3ce3f7f58402b98ce386bab1c40988e5ccd40d15 (commit)
      from  2381ec3b3f6a4798c15f4d3f3aee8caea8f48941 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 1361caecb355047001f8a351ec2e6f10d7f0e741
Author: Andrew Tridgell <[EMAIL PROTECTED]>
Date:   Sun Aug 24 13:53:19 2008 +1000

    fixed an errno handling bug that could lead to an infinite loop
    (cherry picked from commit 5ccdc58ce91ee40ca7171dd040191291aeb7fe02)

commit 3ce3f7f58402b98ce386bab1c40988e5ccd40d15
Author: Andrew Tridgell <[EMAIL PROTECTED]>
Date:   Sat Aug 23 11:36:27 2008 +1000

    fixed tsmsm_sendfile(). The logic was totally broken.
    (cherry picked from commit 794e48b809036871287df8416a2c669b7e26f216)

-----------------------------------------------------------------------

Summary of changes:
 source/modules/vfs_tsmsm.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/modules/vfs_tsmsm.c b/source/modules/vfs_tsmsm.c
index 4a732bc..ee958b1 100644
--- a/source/modules/vfs_tsmsm.c
+++ b/source/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;
        }
 


-- 
Samba Shared Repository

Reply via email to