[SCM] Samba Shared Repository - branch v3-6-test updated

Jeremy Allison jra at samba.org
Fri Sep 17 10:35:54 MDT 2010


The branch, v3-6-test has been updated
       via  8628371 Fix array size of  a memmber of struct cli_ulogoff_state
       via  aa26978 Merge branch 'v3-6-test' of ssh://git.samba.org/data/git/samba into v3-6-test
       via  3aa9d0b Merge branch 'v3-6-test' of ssh://git.samba.org/data/git/samba into v3-6-test
       via  9f2d183 pidl: prevent ndr_print_*() dying on NULL pointers
       via  eadcd31 wbclient: gr_mem can be NULL
       via  08b923e wbclient: paranoid check for double free
       via  acd0f9d tdb: added TDB_NO_FSYNC env variable
      from  cd4945d s3: fix order of arguments in nsec_time_diff call

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit 86283712b95f166dd1e6d2b4cbde070c8f4a017e
Author: Sumit Bose <sbose at redhat.com>
Date:   Fri Sep 17 10:33:08 2010 +0200

    Fix array size of  a memmber of struct cli_ulogoff_state
    
    The too small array makes UID-REGRESSION-FIX fail on 32bit
    architectures.
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit e2d6b64219b883363b4d1d92db27bf180c887d07)

commit aa26978206e7a9bd902b4de0af28de8bbec89fac
Merge: 3aa9d0beca8cee24731d864ecfafbc55c554179a cd4945d3f0f17a28a9f1a1835dd19d3847f45d31
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 17 09:34:20 2010 -0700

    Merge branch 'v3-6-test' of ssh://git.samba.org/data/git/samba into v3-6-test

commit 3aa9d0beca8cee24731d864ecfafbc55c554179a
Merge: 9f2d1836b12724abed0ced02a5a3e793fdc62c66 318f727cb9d87617e86eaafa76005a08578eaf41
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 16 16:20:24 2010 -0700

    Merge branch 'v3-6-test' of ssh://git.samba.org/data/git/samba into v3-6-test

commit 9f2d1836b12724abed0ced02a5a3e793fdc62c66
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Sep 16 16:57:21 2010 +1000

    pidl: prevent ndr_print_*() dying on NULL pointers
    
    when using ndrdump you can get uninitialised structures containing
    pointers. Don't segfault when trying to print them
    (cherry picked from commit 83a24ff2efd48b0e192024798695f6cfec9000b5)

commit eadcd31929024f99c2f8bc734165361e45de1d50
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Sep 16 20:12:20 2010 +1000

    wbclient: gr_mem can be NULL
    
    if the structure was partly created and an error occurred, then don't
    crash
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit b04b8b5610f23cd50c9a7a00eeca81229acd36d5)

commit 08b923eb86b97844660a8fdf8454aed4f610e117
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Sep 16 20:11:47 2010 +1000

    wbclient: paranoid check for double free
    
    added while tracking down a crash in the wbinfo blackbox test
    
    Pair-Programmed-With: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit a16328449171c1138bce3a9f32b7c1fa211e58d2)

commit acd0f9dab5240aa29d887606f3e1b782bb6c4047
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Sep 16 20:06:44 2010 +1000

    tdb: added TDB_NO_FSYNC env variable
    
    this might help reduce test times and load on test machines
    (cherry picked from commit ff515ff4772a555facce75eead91ceff271713f5)

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

Summary of changes:
 lib/tdb/common/open.c                    |    4 ++++
 librpc/ndr/libndr.h                      |    1 +
 librpc/ndr/ndr_basic.c                   |   10 ++++++++++
 nsswitch/libwbclient/wbc_pwd.c           |    5 +++++
 nsswitch/libwbclient/wbclient.c          |    5 +++++
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm |    2 ++
 source3/libsmb/cliconnect.c              |    2 +-
 7 files changed, 28 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 401fa74..d195c1c 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -228,6 +228,10 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 		goto fail;
 	}
 
+	if (getenv("TDB_NO_FSYNC")) {
+		tdb->flags |= TDB_NOSYNC;
+	}
+
 	/*
 	 * TDB_ALLOW_NESTING is the default behavior.
 	 * Note: this may change in future versions!
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index d5091a6..9e94d19 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -519,6 +519,7 @@ enum ndr_err_code ndr_push_unique_ptr(struct ndr_push *ndr, const void *p);
 enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p);
 enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr);
 void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type);
+void ndr_print_null(struct ndr_print *ndr);
 void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, const char *val, uint32_t value);
 void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
 void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index d0d58b0..233d50e 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -848,6 +848,11 @@ _PUBLIC_ void ndr_print_struct(struct ndr_print *ndr, const char *name, const ch
 	ndr->print(ndr, "%s: struct %s", name, type);
 }
 
+_PUBLIC_ void ndr_print_null(struct ndr_print *ndr)
+{
+	ndr->print(ndr, "UNEXPECTED NULL POINTER");
+}
+
 _PUBLIC_ void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type, 
 		    const char *val, uint32_t value)
 {
@@ -999,6 +1004,11 @@ _PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
 {
 	int i;
 
+	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];
 		for (i=0;i<count;i++) {
diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c
index c7bfdb8..1527808 100644
--- a/nsswitch/libwbclient/wbc_pwd.c
+++ b/nsswitch/libwbclient/wbc_pwd.c
@@ -100,6 +100,11 @@ static void wbcGroupDestructor(void *ptr)
 	free(gr->gr_name);
 	free(gr->gr_passwd);
 
+	/* if the array was partly created this can be NULL */
+	if (gr->gr_mem == NULL) {
+		return;
+	}
+
 	for (i=0; gr->gr_mem[i] != NULL; i++) {
 		free(gr->gr_mem[i]);
 	}
diff --git a/nsswitch/libwbclient/wbclient.c b/nsswitch/libwbclient/wbclient.c
index 15be255..19bb3e9 100644
--- a/nsswitch/libwbclient/wbclient.c
+++ b/nsswitch/libwbclient/wbclient.c
@@ -148,6 +148,7 @@ const char *wbcErrorString(wbcErr error)
 }
 
 #define WBC_MAGIC (0x7a2b0e1e)
+#define WBC_MAGIC_FREE (0x875634fe)
 
 struct wbcMemPrefix {
 	uint32_t magic;
@@ -197,6 +198,10 @@ void wbcFreeMemory(void *p)
 	if (wbcMem->magic != WBC_MAGIC) {
 		return;
 	}
+
+	/* paranoid check to ensure we don't double free */
+	wbcMem->magic = WBC_MAGIC_FREE;
+
 	if (wbcMem->destructor != NULL) {
 		wbcMem->destructor(p);
 	}
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 83bca28..b389cfb 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -1466,6 +1466,7 @@ sub ParseStructPrint($$$$$)
 	$self->DeclareArrayVariables($_) foreach (@{$struct->{ELEMENTS}});
 
 	$self->pidl("ndr_print_struct($ndr, name, \"$name\");");
+	$self->pidl("if (r == NULL) { ndr_print_null($ndr); return; }");
 
 	$self->start_flags($struct, $ndr);
 
@@ -2039,6 +2040,7 @@ sub ParseFunctionPrint($$)
 	}
 
 	$self->pidl("ndr_print_struct($ndr, name, \"$fn->{NAME}\");");
+	$self->pidl("if (r == NULL) { ndr_print_null($ndr); return; }");
 	$self->pidl("$ndr->depth++;");
 
 	$self->pidl("if (flags & NDR_SET_VALUES) {");
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 23f7b35..1c104c9 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1497,7 +1497,7 @@ NTSTATUS cli_session_setup(struct cli_state *cli,
 
 struct cli_ulogoff_state {
 	struct cli_state *cli;
-	uint16_t vwv[2];
+	uint16_t vwv[3];
 };
 
 static void cli_ulogoff_done(struct tevent_req *subreq);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list