[SCM] Samba Shared Repository - branch master updated

Rusty Russell rusty at samba.org
Mon May 9 21:22:02 MDT 2011


The branch, master has been updated
       via  0d93eb8 tdb_wrap.h: not a public header.
       via  7deeaca gencache: don't use CLEAR_IF_FIRST as fallback.
       via  3ccfe7c Add -fno-common where supported (WAF only)
      from  14f9916 build: Remove --disable-s3build so we can rely on these subsystems

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


- Log -----------------------------------------------------------------
commit 0d93eb8f5501c348451a7d78e83516873d71cda0
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue May 10 11:46:53 2011 +0930

    tdb_wrap.h: not a public header.
    
    It is a private library, and OpenChange has their own which they use, so
    it's not for them either.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    
    Autobuild-User: Rusty Russell <rusty at rustcorp.com.au>
    Autobuild-Date: Tue May 10 05:21:19 CEST 2011 on sn-devel-104

commit 7deeacae2bab03d5e2ea2642f028a4011ce3bec3
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Apr 19 12:06:05 2011 +0930

    gencache: don't use CLEAR_IF_FIRST as fallback.
    
    CLEAR_IF_FIRST only works if *all* openers use that flag.
    
    So just truncate the file: it's racy, but that's what we're doing anyway.
    
    We'd really need a TDB_OPENCHECK_OR_CLEAR flag to do this properly (or in
    TDB2, a open hook at the right point).
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 3ccfe7cb7be80cc6fa5b8fc437af72168515b892
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue May 10 11:37:30 2011 +0930

    Add -fno-common where supported (WAF only)
    
    Normally under UNIX, uninitialized non-static global variables get
    placed in the "common" section, where they are merged at link time.
    This means if two C files define "int debug", they will end up
    referring to the same variable.  Or if one does "float level" and the
    other does "int level" you'll get an accidental union.
    
    Such bugs can be hard to track down; fortunately GCC offers
    -fno-common to disable this feature.  It didn't reveal any places
    which need fixing, however).
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

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

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py |    2 +-
 lib/util/wscript_build                |    1 -
 source3/lib/gencache.c                |   10 +++-------
 source3/libsmb/samlogon_cache.c       |   13 +++----------
 4 files changed, 7 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 174ca14..207d732 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -597,7 +597,7 @@ def SAMBA_CONFIG_H(conf, path=None):
 
     if Options.options.developer:
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
-        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes',
+        conf.ADD_CFLAGS('-Wall -g -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -Wformat=2 -Wno-format-y2k -Wmissing-prototypes -fno-common',
                         testflags=True)
         if os.getenv('TOPLEVEL_BUILD'):
             conf.ADD_CFLAGS('-Wcast-qual', testflags=True)
diff --git a/lib/util/wscript_build b/lib/util/wscript_build
index fc5f4b5..740e68b 100755
--- a/lib/util/wscript_build
+++ b/lib/util/wscript_build
@@ -113,7 +113,6 @@ bld.SAMBA_SUBSYSTEM('UTIL_PW',
 bld.SAMBA_LIBRARY('tdb-wrap',
                   source='tdb_wrap.c',
                   deps='tdb talloc samba-util',
-                  public_headers='tdb_wrap.h',
                   private_library=True,
                   local_include=False
                   )
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 7a86063..8d4861a 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -81,14 +81,10 @@ again:
 				return false;
 			}
 			first_try = false;
-			DEBUG(0, ("gencache_init: tdb_check(%s) failed - retry after CLEAR_IF_FIRST\n",
+			DEBUG(0, ("gencache_init: tdb_check(%s) failed - retry after truncate\n",
 				  cache_fname));
-			cache = tdb_open_log(cache_fname, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, open_flags, 0644);
-			if (cache) {
-				tdb_close(cache);
-				cache = NULL;
-				goto again;
-			}
+			truncate(cache_fname, 0);
+			goto again;
 		}
 	}
 
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index 590c950..01a5282 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -71,16 +71,9 @@ clear:
 	}
 	first_try = false;
 
-	DEBUG(0,("retry after CLEAR_IF_FIRST for '%s'\n", path));
-	tdb = tdb_open_log(path, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
-			   O_RDWR | O_CREAT, 0600);
-	if (tdb) {
-		tdb_close(tdb);
-		goto again;
-	}
-	DEBUG(0,("tdb_open_log(%s) with CLEAR_IF_FIRST - failed\n", path));
-
-	return false;
+	DEBUG(0,("retry after truncate for '%s'\n", path));
+	truncate(path, 0);
+	goto again;
 }
 
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list