s3:librpc: remove bigendian argument from dcerpc_pull_ncacn_packet()
authorStefan Metzmacher <metze@samba.org>
Wed, 28 Oct 2015 11:16:05 +0000 (12:16 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 26 Oct 2016 09:20:13 +0000 (11:20 +0200)
We should get this from the packet itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: G√ľnther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/librpc/rpc/dcerpc.h
source3/librpc/rpc/dcerpc_helpers.c
source3/rpc_client/cli_pipe.c

index 183801228f5f6d54fc328c8fb39b51957686ddb9..f58ef4c3bef3bb987798858c7e736d58f6beca7d 100644 (file)
@@ -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,
index aab43a1abd4c5505f5eb8c9155ac9e392c761e95..11b445f0fa14354bca2f0b1d7fd183c5375deb12 100644 (file)
@@ -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;
        }
 
index 47e2854d862d17cbc5a880705b5ec31c62093935..84d11216d0dd2bfe6c53576d6c2395dd3873982a 100644 (file)
@@ -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 ...