The branch, v3-4-test has been updated
       via  52d26c3a3a8914a608d8b318e01fee636cc83042 (commit)
       via  7cd8dfc7bdbc6e0715bbd8eddf1ef11c622a8f72 (commit)
      from  e14d0a1b3b4875db08d967131efb4e300d22bc12 (commit)

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


- Log -----------------------------------------------------------------
commit 52d26c3a3a8914a608d8b318e01fee636cc83042
Author: Tim Prouty <[email protected]>
Date:   Mon May 18 18:31:46 2009 -0700

    s4 torture: Fix typo

commit 7cd8dfc7bdbc6e0715bbd8eddf1ef11c622a8f72
Author: Tim Prouty <[email protected]>
Date:   Mon May 18 18:20:18 2009 -0700

    s3 sendfile: Fix two bugs in sendfile
    
    These were found interally via code inspection.
    
    1) fake_sendfile was incorrectly writing zeros over real data on a
       short read.
    
    2) sendfile_short_send was doing 4 byte writes instead of 1024 byte
       writes due to an incorrect sizeof usage.
    
    Jermey, Vl please check

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

Summary of changes:
 source3/smbd/reply.c       |    7 ++++---
 source4/torture/rpc/samr.c |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 66caa86..6fe4f88 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2664,7 +2664,7 @@ static ssize_t fake_sendfile(files_struct *fsp, SMB_OFF_T 
startpos,
 
                /* If we had a short read, fill with zeros. */
                if (ret < cur_read) {
-                       memset(buf, '\0', cur_read - ret);
+                       memset(buf + ret, '\0', cur_read - ret);
                }
 
                if (write_data(smbd_server_fd(),buf,cur_read) != cur_read) {
@@ -2690,6 +2690,7 @@ static void sendfile_short_send(files_struct *fsp,
                                size_t headersize,
                                size_t smb_maxcnt)
 {
+#define SHORT_SEND_BUFSIZE 1024
        if (nread < headersize) {
                DEBUG(0,("sendfile_short_send: sendfile failed to send "
                        "header for file %s (%s). Terminating\n",
@@ -2700,7 +2701,7 @@ static void sendfile_short_send(files_struct *fsp,
        nread -= headersize;
 
        if (nread < smb_maxcnt) {
-               char *buf = SMB_CALLOC_ARRAY(char, 1024);
+               char *buf = SMB_CALLOC_ARRAY(char, SHORT_SEND_BUFSIZE);
                if (!buf) {
                        exit_server_cleanly("sendfile_short_send: "
                                "malloc failed");
@@ -2726,7 +2727,7 @@ static void sendfile_short_send(files_struct *fsp,
                         */
                        size_t to_write;
 
-                       to_write = MIN(sizeof(buf), smb_maxcnt - nread);
+                       to_write = MIN(SHORT_SEND_BUFSIZE, smb_maxcnt - nread);
                        if (write_data(smbd_server_fd(), buf, to_write) != 
to_write) {
                                exit_server_cleanly("sendfile_short_send: "
                                        "write_data failed");
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 4ee634b..39d38f7 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -6452,7 +6452,7 @@ static bool torture_rpc_samr_pwdlastset(struct 
torture_context *torture,
 
 struct torture_suite *torture_rpc_samr_passwords_pwdlastset(TALLOC_CTX 
*mem_ctx)
 {
-       struct torture_suite *suite = torture_suite_create(nmem_ctx, 
"SAMR-PASSWORDS-PWDLASTSET");
+       struct torture_suite *suite = torture_suite_create(mem_ctx, 
"SAMR-PASSWORDS-PWDLASTSET");
        struct torture_rpc_tcase *tcase;
 
        tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "samr",


-- 
Samba Shared Repository

Reply via email to