The branch, v4-5-test has been updated
       via  1a73c19 s3:librpc: remove bigendian argument from 
dcerpc_pull_ncacn_packet()
      from  ed83c31 ctdb-build: Install CTDB tests correctly from toplevel

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit 1a73c1902c5a1ad64082a76086c41f24346b335f
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Oct 28 12:16:05 2015 +0100

    s3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()
    
    We should get this from the packet itself.
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    Reviewed-by: G√ľnther Deschner <g...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    (cherry picked from commit 1bfba2c5161c0e27f8c27301f258360aedf1b018)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12581
    smbclient fails on bad endianess when listing shares from Solaris kernel SMB
    server on SPARC
    
    Autobuild-User(v4-5-test): Karolin Seeger <ksee...@samba.org>
    Autobuild-Date(v4-5-test): Thu Feb 16 13:37:57 CET 2017 on sn-devel-144

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

Summary of changes:
 source3/librpc/rpc/dcerpc.h         | 3 +--
 source3/librpc/rpc/dcerpc_helpers.c | 9 ++++-----
 source3/rpc_client/cli_pipe.c       | 3 +--
 3 files changed, 6 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/librpc/rpc/dcerpc.h b/source3/librpc/rpc/dcerpc.h
index 1838012..f58ef4c 100644
--- a/source3/librpc/rpc/dcerpc.h
+++ b/source3/librpc/rpc/dcerpc.h
@@ -61,8 +61,7 @@ NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
                                  DATA_BLOB *blob);
 NTSTATUS dcerpc_pull_ncacn_packet(TALLOC_CTX *mem_ctx,
                                  const DATA_BLOB *blob,
-                                 struct ncacn_packet *r,
-                                 bool bigendian);
+                                 struct ncacn_packet *r);
 NTSTATUS dcerpc_push_dcerpc_auth(TALLOC_CTX *mem_ctx,
                                 enum dcerpc_AuthType auth_type,
                                 enum dcerpc_AuthLevel auth_level,
diff --git a/source3/librpc/rpc/dcerpc_helpers.c 
b/source3/librpc/rpc/dcerpc_helpers.c
index aab43a1..11b445f 100644
--- a/source3/librpc/rpc/dcerpc_helpers.c
+++ b/source3/librpc/rpc/dcerpc_helpers.c
@@ -88,14 +88,12 @@ NTSTATUS dcerpc_push_ncacn_packet(TALLOC_CTX *mem_ctx,
 *                      elements
 * @param blob          The blob of data to decode
 * @param r             An empty ncacn_packet, must not be NULL
-* @param bigendian     Whether the packet is bignedian encoded
 *
 * @return a NTSTATUS error code
 */
 NTSTATUS dcerpc_pull_ncacn_packet(TALLOC_CTX *mem_ctx,
                                  const DATA_BLOB *blob,
-                                 struct ncacn_packet *r,
-                                 bool bigendian)
+                                 struct ncacn_packet *r)
 {
        enum ndr_err_code ndr_err;
        struct ndr_pull *ndr;
@@ -104,11 +102,12 @@ NTSTATUS dcerpc_pull_ncacn_packet(TALLOC_CTX *mem_ctx,
        if (!ndr) {
                return NT_STATUS_NO_MEMORY;
        }
-       if (bigendian) {
+
+       if (!(CVAL(ndr->data, DCERPC_DREP_OFFSET) & DCERPC_DREP_LE)) {
                ndr->flags |= LIBNDR_FLAG_BIGENDIAN;
        }
 
-       if (CVAL(blob->data, DCERPC_PFC_OFFSET) & DCERPC_PFC_FLAG_OBJECT_UUID) {
+       if (CVAL(ndr->data, DCERPC_PFC_OFFSET) & DCERPC_PFC_FLAG_OBJECT_UUID) {
                ndr->flags |= LIBNDR_FLAG_OBJECT_PRESENT;
        }
 
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 47e2854..84d1121 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -948,8 +948,7 @@ static void rpc_api_pipe_got_pdu(struct tevent_req *subreq)
 
        status = dcerpc_pull_ncacn_packet(state->pkt,
                                          &state->incoming_frag,
-                                         state->pkt,
-                                         !state->endianess);
+                                         state->pkt);
        if (!NT_STATUS_IS_OK(status)) {
                /*
                 * TODO: do a real async disconnect ...


-- 
Samba Shared Repository

Reply via email to