[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Mon Jan 19 08:18:01 MST 2015


The branch, master has been updated
       via  6f5ed44 tdb_wrap: don't let tdb_wrap_open() segfault with name==NULL
       via  c5cb1fb selftest: use env.SELFTEST_PREFIX to define subunit_cache
      from  8536022 README.Coding: Add hint for if-statments

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


- Log -----------------------------------------------------------------
commit 6f5ed443226b890d7dc76f525cbd1263a2bed8fd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 19 12:37:13 2015 +0100

    tdb_wrap: don't let tdb_wrap_open() segfault with name==NULL
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11032
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Mon Jan 19 16:17:28 CET 2015 on sn-devel-104

commit c5cb1fb6215ed2f7e783b15efaad45b1ec48ad64
Author: Stefan Metzmacher <metze at samba.org>
Date:   Sat Jan 10 09:51:45 2015 +0100

    selftest: use env.SELFTEST_PREFIX to define subunit_cache
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 lib/tdb_wrap/tdb_wrap.c | 8 +++++++-
 selftest/wscript        | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c
index e762b33..62dce06 100644
--- a/lib/tdb_wrap/tdb_wrap.c
+++ b/lib/tdb_wrap/tdb_wrap.c
@@ -130,10 +130,16 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
 	struct tdb_wrap *result;
 	struct tdb_wrap_private *w;
 
+	if (name == NULL) {
+		errno = EINVAL;
+		return NULL;
+	}
+
 	/* If they specify a .ntdb extension, but the code hasn't been
 	 * converted, we want to complain. */
-	if (name && strends(name, ".ntdb")) {
+	if (strends(name, ".ntdb")) {
 		DEBUG(2, ("tdb(%s): This code does not yet understand ntdb.  Please report.\n", name));
+		errno = EINVAL;
 		return NULL;
 	}
 
diff --git a/selftest/wscript b/selftest/wscript
index 820752f..df4a8c7 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -232,7 +232,7 @@ def cmd_testonly(opt):
         cmd = '(${CORE_COMMAND} && touch ${SELFTEST_PREFIX}/st_done) | ${FILTER_OPTIONS}'
         if (os.environ.get('RUN_FROM_BUILD_FARM') is None and
             not Options.options.FILTERED_SUBUNIT):
-            subunit_cache = os.path.join(Options.options.SELFTEST_PREFIX, "subunit")
+            subunit_cache = os.path.join(env.SELFTEST_PREFIX, "subunit")
             cmd += ' | tee %s | ${FORMAT_TEST_OUTPUT}' % subunit_cache
         else:
             cmd += ' | ${FILTER_OPTIONS}'


-- 
Samba Shared Repository


More information about the samba-cvs mailing list