Fix Red Hat bugzilla bug : https://bugzilla.redhat.com/show_bug.cgi?id=516165
authorJeremy Allison <jra@samba.org>
Wed, 19 Aug 2009 22:33:08 +0000 (15:33 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 19 Aug 2009 22:33:08 +0000 (15:33 -0700)
nautilus fails to copy files from an SMB share. This is a show-stopper
for 3.4.1 (I'll open a Samba.org bug). Although gnome-vfs is doing
*incredibly* stupid things by asking for a read size of 65535 - this
translates on the wire to a 65534 byte read followed by a 1 byte
read. Please send this back to the gnome developers that they
will ge horrid on the wire performance for this.
Jeremy.

source3/libsmb/clireadwrite.c

index d38de1950800d4f4d25ac6b4ef9558b056f9de07..0d1f9e515ef778f5dd9670ffc3a5ee5f3b8ddfa5 100644 (file)
@@ -200,7 +200,7 @@ static void cli_read_andx_done(struct tevent_req *subreq)
        state->buf = (uint8_t *)smb_base(inbuf) + SVAL(vwv+6, 0);
 
        if (trans_oob(smb_len(inbuf), SVAL(vwv+6, 0), state->received)
-           || (state->buf < bytes)) {
+           || (state->received && (state->buf < bytes))) {
                DEBUG(5, ("server returned invalid read&x data offset\n"));
                tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
                return;