Fix bug #8324 - smbclient cannot list directories from a big-endian machine.
authorJeremy Allison <jra@samba.org>
Tue, 26 Jul 2011 22:16:29 +0000 (15:16 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Jul 2011 19:09:54 +0000 (21:09 +0200)
Two uses of the setup array are not being correctly byte-swapped to little
endian.

source3/libsmb/clilist.c

index d74d3d80db528d266eb4671edaf0c9c2a619f5df..59d01b7fc19e82c4ac9d37af354e47c63eee7264 100644 (file)
@@ -573,7 +573,7 @@ static struct tevent_req *cli_list_trans_send(TALLOC_CTX *mem_ctx,
 
        state->max_matches = 1366; /* Match W2k */
 
-       state->setup[0] = TRANSACT2_FINDFIRST;
+       SSVAL(&state->setup[0], 0, TRANSACT2_FINDFIRST);
 
        nlen = 2*(strlen(mask)+1);
        state->param = TALLOC_ARRAY(state, uint8_t, 12+nlen+2);
@@ -735,7 +735,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
                return;
        }
 
-       state->setup[0] = TRANSACT2_FINDNEXT;
+       SSVAL(&state->setup[0], 0, TRANSACT2_FINDNEXT);
 
        nlen = 2*(strlen(state->mask) + 1);