Fix bug #7791 - gvfsd-smb (Gnome vfs) fails to copy files from a SMB share using...
authorJeremy Allison <jra@samba.org>
Thu, 11 Nov 2010 17:44:21 +0000 (09:44 -0800)
committerKarolin Seeger <kseeger@samba.org>
Sat, 5 Mar 2011 13:34:35 +0000 (14:34 +0100)
The underlying problem is that the old code invoked by cli_write() increments
cli->mid directly when issuing outstanding writes. This should now be done only
in libsmb/clientgen.c to make metze's new signing engine works correctly. Just
deleting this code fixes the problem.

Jeremy.
(cherry picked from commit 9a02a38d9783b0d7dc172cc5bdc2380bc5d107cf)

source3/libsmb/clireadwrite.c

index 6342de484c206ae1bd1ee0cfdf3bbaaeb1c4da61..1f5f9252d49f9f41b659b184d263d51260024445 100644 (file)
@@ -704,8 +704,7 @@ static bool cli_issue_write(struct cli_state *cli,
                                off_t offset,
                                uint16 mode,
                                const char *buf,
-                               size_t size,
-                               int i)
+                               size_t size)
 {
        char *p;
        bool large_writex = false;
@@ -779,8 +778,6 @@ static bool cli_issue_write(struct cli_state *cli,
                cli_setup_bcc(cli, p+size);
        }
 
-       SSVAL(cli->outbuf,smb_mid,cli->mid + i);
-
        show_msg(cli->outbuf);
        if (direct_writes) {
                /* For direct writes we now need to write the data
@@ -829,7 +826,7 @@ ssize_t cli_write(struct cli_state *cli,
                        if (!cli_issue_write(cli, fnum, offset + bsent,
                                        write_mode,
                                        buf + bsent,
-                                       size1, issued))
+                                       size1))
                                return -1;
                        issued++;
                }