The branch, master has been updated
       via  4990080 krb5pac: make sure to correctly store the highest relative 
pointer offset.
       via  87157f0 s3-net: mention optional impersonation principal for PAC 
retrieval.
       via  3c31fe7 s4-torture: make sure to deal with the highest relative 
pointer offset correctly.
       via  732e8ab ndrdump: make sure to deal with the highest relative 
pointer offset correctly.
      from  009cf6e s3:auth: wbcAuthenticateEx gives unix times (bug #9625)

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


- Log -----------------------------------------------------------------
commit 499008021051e5b01e4c1c151403b18a9dcbcf24
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 1 17:41:00 2013 +0100

    krb5pac: make sure to correctly store the highest relative pointer offset.
    
    Guenther
    
    Signed-off-by: Günther Deschner <g...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>
    
    Autobuild-User(master): Günther Deschner <g...@samba.org>
    Autobuild-Date(master): Fri Feb  1 21:19:28 CET 2013 on sn-devel-104

commit 87157f04d1ffcee9f12a9529869a3338af82d99a
Author: Günther Deschner <g...@samba.org>
Date:   Thu Dec 13 12:31:54 2012 +0100

    s3-net: mention optional impersonation principal for PAC retrieval.
    
    Guenther
    
    Signed-off-by: Günther Deschner <g...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 3c31fe7600145662f8bdba98c8f13cbaac58685e
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 1 17:45:02 2013 +0100

    s4-torture: make sure to deal with the highest relative pointer offset 
correctly.
    
    Guenther
    
    Signed-off-by: Günther Deschner <g...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 732e8ab64d3c082dd142e4cbf07ebaec54549216
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 1 17:44:16 2013 +0100

    ndrdump: make sure to deal with the highest relative pointer offset 
correctly.
    
    Guenther
    
    Signed-off-by: Günther Deschner <g...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>

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

Summary of changes:
 librpc/ndr/ndr_krb5pac.c  |    3 +++
 librpc/tools/ndrdump.c    |   25 +++++++++++++++++++------
 source3/utils/net_ads.c   |    2 +-
 source4/torture/ndr/ndr.c |   32 ++++++++++++++++++++++++++------
 4 files changed, 49 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/ndr_krb5pac.c b/librpc/ndr/ndr_krb5pac.c
index 237c0b6..f7db791 100644
--- a/librpc/ndr/ndr_krb5pac.c
+++ b/librpc/ndr/ndr_krb5pac.c
@@ -115,6 +115,9 @@ enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, 
int ndr_flags, struc
                                        NDR_CHECK(ndr_pull_subcontext_end(ndr, 
_ndr_info, 0, r->_ndr_size));
                                }
                                NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+                               if (ndr->offset > ndr->relative_highest_offset) 
{
+                                       ndr->relative_highest_offset = 
ndr->offset;
+                               }
                                ndr->offset = _relative_save_offset;
                        }
                        ndr->flags = _flags_save_PAC_INFO;
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 91bf06f..4a102f5 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -214,6 +214,7 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char 
*function,
        };
        const struct ndr_interface_call_pipes *in_pipes = NULL;
        const struct ndr_interface_call_pipes *out_pipes = NULL;
+       uint32_t highest_ofs;
 
        ndr_table_init();
 
@@ -341,8 +342,14 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char 
*function,
 
                ndr_err = f->ndr_pull(ndr_pull, NDR_IN, st);
 
-               if (ndr_pull->offset != ndr_pull->data_size) {
-                       printf("WARNING! %d unread bytes while parsing context 
file\n", ndr_pull->data_size - ndr_pull->offset);
+               if (ndr_pull->offset > ndr_pull->relative_highest_offset) {
+                       highest_ofs = ndr_pull->offset;
+               } else {
+                       highest_ofs = ndr_pull->relative_highest_offset;
+               }
+
+               if (highest_ofs != ndr_pull->data_size) {
+                       printf("WARNING! %d unread bytes while parsing context 
file\n", ndr_pull->data_size - highest_ofs);
                }
 
                if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
@@ -392,10 +399,16 @@ static NTSTATUS ndrdump_pull_and_print_pipes(const char 
*function,
 
        printf("pull returned %s\n", nt_errstr(status));
 
-       if (ndr_pull->offset != ndr_pull->data_size) {
-               printf("WARNING! %d unread bytes\n", ndr_pull->data_size - 
ndr_pull->offset);
-               ndrdump_data(ndr_pull->data+ndr_pull->offset,
-                            ndr_pull->data_size - ndr_pull->offset,
+       if (ndr_pull->offset > ndr_pull->relative_highest_offset) {
+               highest_ofs = ndr_pull->offset;
+       } else {
+               highest_ofs = ndr_pull->relative_highest_offset;
+       }
+
+       if (highest_ofs != ndr_pull->data_size) {
+               printf("WARNING! %d unread bytes\n", ndr_pull->data_size - 
highest_ofs);
+               ndrdump_data(ndr_pull->data+highest_ofs,
+                            ndr_pull->data_size - highest_ofs,
                             dumpdata);
        }
 
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 80368ee..013884d 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -2596,7 +2596,7 @@ static int net_ads_kerberos_pac(struct net_context *c, 
int argc, const char **ar
 
        if (c->display_usage) {
                d_printf(  "%s\n"
-                          "net ads kerberos pac\n"
+                          "net ads kerberos pac [impersonation_principal]\n"
                           "    %s\n",
                         _("Usage:"),
                         _("Dump the Kerberos PAC"));
diff --git a/source4/torture/ndr/ndr.c b/source4/torture/ndr/ndr.c
index 30cd46a..9e63ff7 100644
--- a/source4/torture/ndr/ndr.c
+++ b/source4/torture/ndr/ndr.c
@@ -43,6 +43,7 @@ static bool wrap_ndr_pullpush_test(struct torture_context 
*tctx,
        struct ndr_pull *ndr = ndr_pull_init_blob(&(data->data), tctx);
        void *ds = talloc_zero_size(ndr, data->struct_size);
        bool ret;
+       uint32_t highest_ofs;
 
        ndr->flags |= data->flags;
 
@@ -51,9 +52,15 @@ static bool wrap_ndr_pullpush_test(struct torture_context 
*tctx,
        torture_assert_ndr_success(tctx, data->pull_fn(ndr, data->ndr_flags, 
ds),
                                   "pulling");
 
-       torture_assert(tctx, ndr->offset == ndr->data_size,
+       if (ndr->offset > ndr->relative_highest_offset) {
+               highest_ofs = ndr->offset;
+       } else {
+               highest_ofs = ndr->relative_highest_offset;
+       }
+
+       torture_assert(tctx, highest_ofs == ndr->data_size,
                                   talloc_asprintf(tctx,
-                                          "%d unread bytes", ndr->data_size - 
ndr->offset));
+                                          "%d unread bytes", ndr->data_size - 
highest_ofs));
 
        if (check_fn != NULL) {
                ret = check_fn(tctx, ds);
@@ -120,6 +127,7 @@ static bool wrap_ndr_inout_pull_test(struct torture_context 
*tctx,
        const struct ndr_pull_test_data *data = (const struct 
ndr_pull_test_data *)test->data;
        void *ds = talloc_zero_size(tctx, data->struct_size);
        struct ndr_pull *ndr;
+       uint32_t highest_ofs;
 
        /* handle NDR_IN context */
 
@@ -132,8 +140,14 @@ static bool wrap_ndr_inout_pull_test(struct 
torture_context *tctx,
                data->pull_fn(ndr, NDR_IN, ds),
                "ndr pull of context failed");
 
-       torture_assert(tctx, ndr->offset == ndr->data_size,
-               talloc_asprintf(tctx, "%d unread bytes", ndr->data_size - 
ndr->offset));
+       if (ndr->offset > ndr->relative_highest_offset) {
+               highest_ofs = ndr->offset;
+       } else {
+               highest_ofs = ndr->relative_highest_offset;
+       }
+
+       torture_assert(tctx, highest_ofs == ndr->data_size,
+               talloc_asprintf(tctx, "%d unread bytes", ndr->data_size - 
highest_ofs));
 
        talloc_free(ndr);
 
@@ -148,8 +162,14 @@ static bool wrap_ndr_inout_pull_test(struct 
torture_context *tctx,
                data->pull_fn(ndr, NDR_OUT, ds),
                "ndr pull failed");
 
-       torture_assert(tctx, ndr->offset == ndr->data_size,
-               talloc_asprintf(tctx, "%d unread bytes", ndr->data_size - 
ndr->offset));
+       if (ndr->offset > ndr->relative_highest_offset) {
+               highest_ofs = ndr->offset;
+       } else {
+               highest_ofs = ndr->relative_highest_offset;
+       }
+
+       torture_assert(tctx, highest_ofs == ndr->data_size,
+               talloc_asprintf(tctx, "%d unread bytes", ndr->data_size - 
highest_ofs));
 
        talloc_free(ndr);
 


-- 
Samba Shared Repository

Reply via email to