[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Tue Sep 24 02:05:03 CEST 2013


The branch, master has been updated
       via  167e2f2 pidl: Generate wireshark that conforms to the rules of Wireshark project
       via  00dc30a pidl: Generate NDR64/NDR32 aware code for the wireshark dissectors
       via  26c1c15 idl: fix frsrpc idl with NDR64 fields
       via  aa5b369 idl: remove duplicate flag
       via  fc11bab frstrans.idl: add flag(NDR_PAHEX) to frstrans_BytePipe
       via  51d8eba drsuapi.idl: change the range for attribute values to 26214400 bytes.
       via  c18c6c9 librpc/ndr: make use of ndr_dump_data() in ndr_print_array_uint8()
       via  3d3e8b5 librpc/ndr: make ndr_pull/push_DATA_BLOB NDR64 aware
      from  4f69b58 s4:torture:ldap: Fix misleading output

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 167e2f2b5543008e02613dcd56e36f7326912cdb
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Sep 22 22:23:51 2013 -0700

    pidl: Generate wireshark that conforms to the rules of Wireshark project
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Sep 24 02:04:05 CEST 2013 on sn-devel-104

commit 00dc30a9ffafbd2bbf8041e81b443e9eb73f9dcf
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Sep 22 22:10:10 2013 -0700

    pidl: Generate NDR64/NDR32 aware code for the wireshark dissectors
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 26c1c15da45ce3b024498c85fe8f5ebef0e6b9d2
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Sep 22 19:50:10 2013 -0700

    idl: fix frsrpc idl with NDR64 fields
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit aa5b3697346710138852b32d6fa479a75b371049
Author: Matthieu Patou <mat at matws.net>
Date:   Sun Sep 22 18:29:56 2013 -0700

    idl: remove duplicate flag
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit fc11bab20b8ba9548808d60c108fb81096aaffe3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 23 08:09:37 2013 +0200

    frstrans.idl: add flag(NDR_PAHEX) to frstrans_BytePipe
    
    That way we get hexdump -C style output for the content of the pipe chunks.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Matthieu Patou <mat at matws.net>

commit 51d8eba8417c58c2ade30d58a838441008209542
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 23 08:05:41 2013 +0200

    drsuapi.idl: change the range for attribute values to 26214400 bytes.
    
    This matches the IDL from [MS-DRSR].
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Matthieu Patou <mat at matws.net>

commit c18c6c9fb53a84e587f5ed951e47a1bb5f53a30e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 23 07:39:43 2013 +0200

    librpc/ndr: make use of ndr_dump_data() in ndr_print_array_uint8()
    
    It's much easier to look at hexdump -C style output than
    a few thousand lines with 1 byte each.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Matthieu Patou <mat at matws.net>

commit 3d3e8b53bf78c6ab442682b9fe22c902b9c45d73
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Sep 23 07:20:00 2013 +0200

    librpc/ndr: make ndr_pull/push_DATA_BLOB NDR64 aware
    
    Pair-Programmed-With: Matthieu Patou <mat at matws.net>
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Matthieu Patou <mat at matws.net>

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

Summary of changes:
 librpc/idl/drsuapi.idl               |    2 +-
 librpc/idl/frsrpc.idl                |    5 ++---
 librpc/idl/frstrans.idl              |    2 +-
 librpc/ndr/ndr_basic.c               |   21 +++++++++++++++------
 pidl/lib/Parse/Pidl/Wireshark/NDR.pm |   16 ++++++++++++----
 5 files changed, 31 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index ed85205..063d135 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -546,7 +546,7 @@ interface drsuapi
 
 	/* Generic DATA_BLOB values */
 	typedef struct {
-		[range(0,10485760),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
+		[range(0,26214400),value(ndr_size_DATA_BLOB(0,blob,0))] uint32 __ndr_size;
 		DATA_BLOB *blob;
 	} drsuapi_DsAttributeValue;
 
diff --git a/librpc/idl/frsrpc.idl b/librpc/idl/frsrpc.idl
index fcc3119..a235702 100644
--- a/librpc/idl/frsrpc.idl
+++ b/librpc/idl/frsrpc.idl
@@ -43,7 +43,6 @@ interface frsrpc
 		FRSRPC_CO_FLAG_MORPH_GEN_HEAD	= 0x00400000,
 		FRSRPC_CO_FLAG_JUST_OID_RESET	= 0x00800000,
 		FRSRPC_CO_FLAG_COMPRESSED_STAGE	= 0x01000000,
-		FRSRPC_CO_FLAG_COMPRESSED_STAGE	= 0x01000000,
 		FRSRPC_CO_FLAG_SKIP_VV_UPDATE	= 0x02000000
 	} frsrpc_CommPktCoCmdFlags;
 
@@ -344,8 +343,8 @@ interface frsrpc
 		[value(0)] uint32 upk_len;
 		[subcontext(4),subcontext_size(pkt_len)]
 			frsrpc_CommPktChunkCtr *ctr;
-		[value(0)] uint32 data_name;
-		[value(0)] uint32 data_handle;
+		[value(0)] uint3264 data_name;
+		[value(0)] uint3264 data_handle;
 	} frsrpc_FrsSendCommPktReq;
 
 	WERROR frsrpc_FrsSendCommPkt(
diff --git a/librpc/idl/frstrans.idl b/librpc/idl/frstrans.idl
index a60529b..caf6e42 100644
--- a/librpc/idl/frstrans.idl
+++ b/librpc/idl/frstrans.idl
@@ -277,7 +277,7 @@ interface frstrans
 
 	/*****************/
 	/* Function 0x0f */
-	typedef pipe uint8 frstrans_BytePipe;
+	typedef [flag(NDR_PAHEX)] pipe uint8 frstrans_BytePipe;
 
 	WERROR frstrans_RawGetFileDataAsync(
 		[in,ref] policy_handle *server_context,
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index 1887838..5c653c8 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -32,6 +32,8 @@
 #define NDR_SIVALS(ndr, ofs, v) do { if (NDR_BE(ndr))  { RSIVALS(ndr->data,ofs,v); } else SIVALS(ndr->data,ofs,v); } while (0)
 
 
+static void ndr_dump_data(struct ndr_print *ndr, const uint8_t *buf, int len);
+
 /*
   check for data leaks from the server by looking for non-zero pad bytes
   these could also indicate that real structure elements have been
@@ -1162,14 +1164,15 @@ _PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
 			   const uint8_t *data, uint32_t count)
 {
 	int i;
+#define _ONELINE_LIMIT 32
 
 	if (data == NULL) {
 		ndr->print(ndr, "%s: ARRAY(%d) : NULL", name, count);
 		return;
 	}
 
-	if (count <= 600 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) {
-		char s[1202];
+	if (count <= _ONELINE_LIMIT && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) {
+		char s[(_ONELINE_LIMIT + 1) * 2];
 		for (i=0;i<count;i++) {
 			snprintf(&s[i*2], 3, "%02x", data[i]);
 		}
@@ -1179,6 +1182,11 @@ _PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
 	}
 
 	ndr->print(ndr, "%s: ARRAY(%d)", name, count);
+	if (count > _ONELINE_LIMIT && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) {
+		ndr_dump_data(ndr, data, count);
+		return;
+	}
+
 	ndr->depth++;
 	for (i=0;i<count;i++) {
 		char *idx=NULL;
@@ -1188,6 +1196,7 @@ _PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
 		}
 	}
 	ndr->depth--;	
+#undef _ONELINE_LIMIT
 }
 
 static void ndr_print_asc(struct ndr_print *ndr, const uint8_t *buf, int len)
@@ -1253,7 +1262,7 @@ _PUBLIC_ void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_
  *    current ndr offset.
  * 2) When called with the LIBNDR_FLAG_REMAINING flag, push the byte array to
  *    the ndr buffer.
- * 3) Otherwise, push a uint32 length _and_ a corresponding byte array to the
+ * 3) Otherwise, push a uint3264 length _and_ a corresponding byte array to the
  *    ndr buffer.
  */
 _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob)
@@ -1271,7 +1280,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flag
 		NDR_PUSH_ALLOC_SIZE(ndr, blob.data, blob.length);
 		data_blob_clear(&blob);
 	} else {
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length));
+		NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, blob.length));
 	}
 	NDR_CHECK(ndr_push_bytes(ndr, blob.data, blob.length));
 	return NDR_ERR_SUCCESS;
@@ -1284,7 +1293,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flag
  *    current ndr offset.
  * 2) When called with the LIBNDR_FLAG_REMAINING flag, pull all remaining bytes
  *    from the ndr buffer.
- * 3) Otherwise, pull a uint32 length _and_ a corresponding byte array from the
+ * 3) Otherwise, pull a uint3264 length _and_ a corresponding byte array from the
  *    ndr buffer.
  */
 _PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob)
@@ -1305,7 +1314,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flag
 			length = ndr->data_size - ndr->offset;
 		}
 	} else {
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &length));
+		NDR_CHECK(ndr_pull_uint3264(ndr, NDR_SCALARS, &length));
 	}
 	NDR_PULL_NEED_BYTES(ndr, length);
 	*blob = data_blob_talloc(ndr->current_mem_ctx, ndr->data+ndr->offset, length);
diff --git a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
index 1aa44c3..9c49931 100644
--- a/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
+++ b/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
@@ -364,8 +364,9 @@ sub ElementLevel($$$$$$$$)
 		}
 		my $num_bits = ($l->{HEADER_SIZE}*8);
 		my $hf2 = $self->register_hf_field($hf."_", "Subcontext length", "$ifname.$pn.$_->{NAME}subcontext", "FT_UINT$num_bits", "BASE_HEX", "NULL", 0, "");
+		$num_bits = 3264 if ($num_bits == 32);
 		$self->{hf_used}->{$hf2} = 1;
-		$self->pidl_code("dcerpc_info *di = pinfo->private_data;");
+		$self->pidl_code("dcerpc_info *di = (dcerpc_info*)pinfo->private_data;");
 		$self->pidl_code("guint$num_bits size;");
 		$self->pidl_code("int conformant = di->conformant_run;");
 		$self->pidl_code("tvbuff_t *subtvb;");
@@ -374,7 +375,12 @@ sub ElementLevel($$$$$$$$)
 		# and conformant run skips the dissections of scalars ...
 		$self->pidl_code("if (!conformant) {");
 		$self->indent;
+		$self->pidl_code("guint32 saved_flags = di->call_data->flags;");
 		$self->pidl_code("offset = dissect_ndr_uint$num_bits(tvb, offset, pinfo, tree, drep, $hf2, &size);");
+		# This is a subcontext, there is normally no such thing as
+		# 64 bit NDR is subcontext so we clear the flag so that we can
+		# continue to dissect handmarshalled stuff with pidl
+		$self->pidl_code("di->call_data->flags &= ~DCERPC_IS_NDR64;");
 
 		$self->pidl_code("subtvb = tvb_new_subset(tvb, offset, size, -1);");
 		if ($param ne 0) {
@@ -383,6 +389,7 @@ sub ElementLevel($$$$$$$$)
 			$self->pidl_code("$myname\_(subtvb, 0, pinfo, tree, drep);");
 		}
 		$self->pidl_code("offset += size;");
+		$self->pidl_code("di->call_data->flags = saved_flags;");
 		$self->deindent;
 		$self->pidl_code("}");
 	} else {
@@ -634,7 +641,7 @@ sub Struct($$$$)
 	$self->pidl_code("proto_item *item = NULL;");
 	$self->pidl_code("proto_tree *tree = NULL;");
 	if ($e->{ALIGN} > 1) {
-		$self->pidl_code("dcerpc_info *di = pinfo->private_data;");
+		$self->pidl_code("dcerpc_info *di = (dcerpc_info *)pinfo->private_data;");
 	}
 	$self->pidl_code("int old_offset;");
 	$self->pidl_code("");
@@ -972,6 +979,7 @@ sub Initialize($$)
 		$self->register_type("int$bits", "offset = PIDL_dissect_uint$bits(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);", "FT_INT$bits", "BASE_DEC", 0, "NULL", $bytes);
 	}
 		
+	$self->register_type("uint3264", "offset = dissect_ndr_uint3264(tvb, offset, pinfo, tree, drep, \@HF\@, NULL);", "FT_UINT32", "BASE_DEC", 0, "NULL", 8);
 	$self->register_type("hyper", "offset = dissect_ndr_uint64(tvb, offset, pinfo, tree, drep, \@HF\@, NULL);", "FT_UINT64", "BASE_DEC", 0, "NULL", 8);
 	$self->register_type("udlong", "offset = dissect_ndr_duint32(tvb, offset, pinfo, tree, drep, \@HF\@, NULL);", "FT_UINT64", "BASE_DEC", 0, "NULL", 4);
 	$self->register_type("bool8", "offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, \@HF\@, \@PARAM\@);","FT_INT8", "BASE_DEC", 0, "NULL", 1);
@@ -1017,6 +1025,8 @@ sub Parse($$$$$)
 	It is maintained by the Samba team, not the Wireshark team.
 	Instructions on how to download and install Pidl can be 
 	found at http://wiki.wireshark.org/Pidl
+
+	\$Id\$
 */
 
 ";
@@ -1024,9 +1034,7 @@ sub Parse($$$$$)
 	$self->pidl_hdr($notice);
 
 	$self->{res}->{headers} = "\n";
-	$self->{res}->{headers} .= "#ifdef HAVE_CONFIG_H\n";
 	$self->{res}->{headers} .= "#include \"config.h\"\n";
-	$self->{res}->{headers} .= "#endif\n\n";
 
 	$self->{res}->{headers} .= "#ifdef _MSC_VER\n";
 	$self->{res}->{headers} .= "#pragma warning(disable:4005)\n";


-- 
Samba Shared Repository


More information about the samba-cvs mailing list