Merge branch 'master' of git://git.samba.org/samba into convenience
authorJelmer Vernooij <jelmer@samba.org>
Sun, 1 Mar 2009 16:29:04 +0000 (17:29 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 1 Mar 2009 16:29:04 +0000 (17:29 +0100)
librpc/gen_ndr/ndr_drsblobs.c
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm

index 72e182d3ff3092a31b7302a7d907698618815e5c..ee7c9933c21c529b84d1f7d5501b0658910be6c8 100644 (file)
@@ -1870,9 +1870,6 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n
                for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0]));
                }
-               for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) {
-                       NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0]));
-               }
                for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0]));
                }
@@ -1885,9 +1882,6 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n
                for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0]));
                }
-               for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) {
-                       NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0]));
-               }
                for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) {
                        NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0]));
                }
index 0e4a7e22894b6b12ef01dd4890e2fed723c45cf2..34aebc7f0fb112265df27386224f101ff13ec7b5 100644 (file)
@@ -586,9 +586,15 @@ sub ParseElementPushLevel
                my $length = ParseExpr($l->{LENGTH_IS}, $env, $e->{ORIGINAL});
                my $counter = "cntr_$e->{NAME}_$l->{LEVEL_INDEX}";
 
+               my $array_pointless = ($length eq "0");
+
+               if ($array_pointless) {
+                       warning($e->{ORIGINAL}, "pointless array `$e->{NAME}' will always have size 0");
+               }
+
                $var_name = get_array_element($var_name, $counter);
 
-               if (($primitives and not $l->{IS_DEFERRED}) or ($deferred and $l->{IS_DEFERRED})) {
+               if ((($primitives and not $l->{IS_DEFERRED}) or ($deferred and $l->{IS_DEFERRED})) and not $array_pointless) {
                        $self->pidl("for ($counter = 0; $counter < $length; $counter++) {");
                        $self->indent;
                        $self->ParseElementPushLevel($e, GetNextLevel($e, $l), $ndr, $var_name, $env, 1, 0);
@@ -596,7 +602,7 @@ sub ParseElementPushLevel
                        $self->pidl("}");
                }
 
-               if ($deferred and ContainsDeferred($e, $l)) {
+               if ($deferred and ContainsDeferred($e, $l) and not $array_pointless) {
                        $self->pidl("for ($counter = 0; $counter < $length; $counter++) {");
                        $self->indent;
                        $self->ParseElementPushLevel($e, GetNextLevel($e, $l), $ndr, $var_name, $env, 0, 1);