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

Stefan Metzmacher metze at samba.org
Sun Dec 20 10:48:06 MST 2009


The branch, v3-5-test has been updated
       via  6fa974e... Fix release script to work with recent git versions (cherry picked from commit 7f956869ff7a8e481afb9db0c52a0d74d809867a)
       via  fdfe8da... talloc: Fix exports and increment talloc version (cherry picked from commit 6618a062a19660a718074f6e6155339451b7a5b6)
       via  c751ceb... talloc: Make abi checks in release script
       via  f4c910b... talloc: Move release script under /script too (cherry picked from commit 8e6df560b74d7e9b94dd47625de56bc1dc0bc6d7)
       via  fed2560... talloc: Change the way mksysms work
       via  636f199... Fix release script with newer versins of git (cherry picked from commit 4334092cbae28181ba0d1cf2ac026961f2192972)
       via  79be733... tdb tools: Mostly cosmetic adaptions
       via  57c5bd8... tdb: change version to 1.2.0 after adding TDB_*ALLOW_NESTING
       via  1383e23... tdb: add TDB_DISALLOW_NESTING and make TDB_ALLOW_NESTING the default behavior
       via  e6669e7... New attempt at TDB transaction nesting allow/disallow.
       via  2159f25... tdb: always set tdb->tracefd to -1 to be safe on goto fail
       via  d01b4d0... tdb: update README a bit
       via  c739d4c... tdb: add tests for double .close() in pytdb
       via  4df5dc8... tdb: reset tdb->fd to -1 in tdb_close()
       via  701c5e5... tdb: fix typo in python's Tdb.get() docstring
       via  4177155... tdb: kill last bits from swig
       via  ccd7828... tsocket: Fixed tsocket_guide.txt asciidoc syntax. (cherry picked from commit a5bdab8b32768282270315f880f980d99ebb9a2e)
       via  797accf... tsocket: Fixed documentation for tsocket_address_bsd_sockaddr(). (cherry picked from commit e33ae22b87597f31caefd5466bb8e8f240405972)
       via  d0c59bb... tsocket: Fixed typo in LGPL header. (cherry picked from commit ab04dd3be743806bf3c9cf9db4b5326ce0476bf5)
       via  d226fce... tsocket: add tsocket_address_bsd_sockaddr() and tsocket_address_bsd_from_sockaddr()
      from  5a4f0e5... tevent: prefix types and defined with tevent_ and TEVENT_

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


- Log -----------------------------------------------------------------
commit 6fa974ec35e7c83bbef05f21ee2a20100346ba57
Author: Simo Sorce <idra at samba.org>
Date:   Tue Dec 15 09:17:25 2009 -0500

    Fix release script to work with recent git versions
    (cherry picked from commit 7f956869ff7a8e481afb9db0c52a0d74d809867a)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit fdfe8da31be7f658c3a584eda20e3faeb2a19cac
Author: Simo Sorce <idra at samba.org>
Date:   Wed Oct 14 10:50:19 2009 -0400

    talloc: Fix exports and increment talloc version
    (cherry picked from commit 6618a062a19660a718074f6e6155339451b7a5b6)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c751ceb929c5f025648aa4f3a5e746287eeee726
Author: Simo Sorce <idra at samba.org>
Date:   Wed Oct 14 10:57:17 2009 -0400

    talloc: Make abi checks in release script
    
    Make always sure the exports and signature files are up to date before
    shipping a release.
    (cherry picked from commit 8fb483b2964f1222c013df42ba8be544269da612)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit f4c910b78d475e6b83feb612425ec6b64f596d86
Author: Simo Sorce <idra at samba.org>
Date:   Wed Oct 14 10:55:11 2009 -0400

    talloc: Move release script under /script too
    (cherry picked from commit 8e6df560b74d7e9b94dd47625de56bc1dc0bc6d7)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit fed2560341c6cbbeee512111f1cd7fb544c80c21
Author: Simo Sorce <idra at samba.org>
Date:   Wed Oct 14 10:20:28 2009 -0400

    talloc: Change the way mksysms work
    
    Make sure we always have a sorted (per file) export file.
    This way we can directly compare the real export and the check file w/o having
    to further sort things.
    
    Also return error code from abi_checks.sh if warnings were reported
    (cherry picked from commit 2d6d6bcb5de87ce0dbce13ff6bc775b953438b75)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 636f199b4fc75275c1bd175d1b939b95ad144289
Author: Simo Sorce <idra at samba.org>
Date:   Mon Dec 7 09:25:03 2009 -0500

    Fix release script with newer versins of git
    (cherry picked from commit 4334092cbae28181ba0d1cf2ac026961f2192972)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 79be7337bda044637940b084a4480bd9a71e41b0
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Fri Oct 16 19:02:02 2009 +0200

    tdb tools: Mostly cosmetic adaptions
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 9776cb03450d21da5d454e683bdba29793ba3f67)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 57c5bd874666234419a976d0b4d8a68fda5cf9c5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 19 09:49:03 2009 +0100

    tdb: change version to 1.2.0 after adding TDB_*ALLOW_NESTING
    
    metze
    (cherry picked from commit 5ca0a4bfd6fdbb515835682a12f715283b46cb3e)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 1383e232cc7d20e64a04eb912d7d8a8ae5a5b5a9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 19 09:34:05 2009 +0100

    tdb: add TDB_DISALLOW_NESTING and make TDB_ALLOW_NESTING the default behavior
    
    We need to keep TDB_ALLOW_NESTING as default behavior,
    so that existing code continues to work.
    
    However we may change the default together with a major version
    number change in future.
    
    metze
    (cherry picked from commit 3b9f19ed919fef2e88b2f92ae541e07bc7379cd1)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit e6669e7f563f7be27ecb9872ea3ef148236dea3c
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon May 25 17:04:42 2009 +1000

    New attempt at TDB transaction nesting allow/disallow.
    
    Make the default be that transaction is not allowed and any attempt to create a nested transaction will fail with TDB_ERR_NESTING.
    
    If an application can cope with transaction nesting and the implicit
    semantics of tdb_transaction_commit(), it can enable transaction nesting
    by using the TDB_ALLOW_NESTING flag.
    (cherry picked from ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 436b55db1ff238ec467b07a74b088f6fcfaf927c)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 2159f25dac59966cfa4cd627ddbb544e09d12a07
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 19 09:38:48 2009 +0100

    tdb: always set tdb->tracefd to -1 to be safe on goto fail
    
    metze
    (cherry picked from commit 85449b7bcc4bd7948bea38b5514a02357950a002)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit d01b4d0dc8e5715fb4c9f691a2dc7c8653566cad
Author: Kirill Smelkov <kirr at mns.spb.ru>
Date:   Wed Oct 21 21:18:58 2009 +0400

    tdb: update README a bit
    
    While studying tdb, I've noticed a couple of mismatches between readme
    and actual code:
    
    - tdb_open_ex changed it's log_fn argument to log_ctx
    - there is now no tdb_update(), which it seems was transformed into
      non-exported tdb_update_hash()
    
    There were other mismatches, but I don't remember them now, sorry.
    
    Signed-off-by: Kirill Smelkov <kirr at mns.spb.ru>
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    (cherry picked from commit 83de5c826313aa09c76131ae70550bd81b3521c5)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c739d4c1f56dd8e137123468d13c05f52eeab8b9
Author: Kirill Smelkov <kirr at mns.spb.ru>
Date:   Wed Oct 21 21:18:57 2009 +0400

    tdb: add tests for double .close() in pytdb
    
    The reason I do it is that when using older python-tdb as shipped in
    Debian Lenny, python interpreter crashes on this test:
    
        (gdb) bt
        #0  0xb7f8c424 in __kernel_vsyscall ()
        #1  0xb7df5640 in raise () from /lib/i686/cmov/libc.so.6
        #2  0xb7df7018 in abort () from /lib/i686/cmov/libc.so.6
        #3  0xb7e3234d in __libc_message () from /lib/i686/cmov/libc.so.6
        #4  0xb7e38624 in malloc_printerr () from /lib/i686/cmov/libc.so.6
        #5  0xb7e3a826 in free () from /lib/i686/cmov/libc.so.6
        #6  0xb7b39c84 in tdb_close () from /usr/lib/libtdb.so.1
        #7  0xb7b43e14 in ?? () from /var/lib/python-support/python2.5/_tdb.so
        #8  0x0a038d08 in ?? ()
        #9  0x00000000 in ?? ()
    
    master's pytdb does not (we have a check for self->closed in obj_close()),
    but still...
    
    Signed-off-by: Kirill Smelkov <kirr at mns.spb.ru>
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    (cherry picked from commit 71a21393dd1bb61bded82b1581ac6d5bd3b0153c)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 4df5dc8c5387707fa0cd628907d68026f0251fb9
Author: Kirill Smelkov <kirr at mns.spb.ru>
Date:   Wed Oct 21 21:18:56 2009 +0400

    tdb: reset tdb->fd to -1 in tdb_close()
    
    So that erroneous double tdb_close() calls do not try to close() same
    fd again. This is like SAFE_FREE() but for fd.
    
    Signed-off-by: Kirill Smelkov <kirr at mns.spb.ru>
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    (cherry picked from commit b4424f8234a78a79fb2d71d46ca208b4f12e0f9e)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 701c5e5a2c14c7c1914a1acf73579b5f7867dc9a
Author: Kirill Smelkov <kirr at mns.spb.ru>
Date:   Wed Oct 21 21:18:55 2009 +0400

    tdb: fix typo in python's Tdb.get() docstring
    
    It's Tdb.get(), not Tdb.fetch().
    
    Signed-off-by: Kirill Smelkov <kirr at mns.spb.ru>
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    (cherry picked from commit cfed5f946de0992a594c189ee3c19cf98e59d380)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 4177155348900c10de3fe2c5799ed4cdc11f282c
Author: Kirill Smelkov <kirr at mns.spb.ru>
Date:   Wed Oct 21 21:18:54 2009 +0400

    tdb: kill last bits from swig
    
    We no longer use swig for pytdb, so there is no need for swig make
    rules. Also pytdb.c header should be updated.
    
    Signed-off-by: Kirill Smelkov <kirr at mns.spb.ru>
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
    (cherry picked from commit ecbe5ebd8d1c44a478c613eb1cace0521142d0d3)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit ccd782844fc794ad1c1db4205aab1958bfa552a9
Author: Andreas Schneider <asn at redhat.com>
Date:   Tue Dec 15 12:58:18 2009 +0100

    tsocket: Fixed tsocket_guide.txt asciidoc syntax.
    (cherry picked from commit a5bdab8b32768282270315f880f980d99ebb9a2e)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 797accfd5fb0fdc4ddf69ed2dd71d7926b49cdca
Author: Andreas Schneider <asn at redhat.com>
Date:   Tue Dec 15 12:57:35 2009 +0100

    tsocket: Fixed documentation for tsocket_address_bsd_sockaddr().
    (cherry picked from commit e33ae22b87597f31caefd5466bb8e8f240405972)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit d0c59bbb135ebeec71a4b11d41b3b4e5096857af
Author: Andreas Schneider <asn at redhat.com>
Date:   Tue Dec 15 12:56:44 2009 +0100

    tsocket: Fixed typo in LGPL header.
    (cherry picked from commit ab04dd3be743806bf3c9cf9db4b5326ce0476bf5)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit d226fce23c122b515426659b8a9149a29b9e427c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Nov 4 19:03:41 2009 +0100

    tsocket: add tsocket_address_bsd_sockaddr() and tsocket_address_bsd_from_sockaddr()
    
    metze
    (cherry picked from commit edbf2caa6f8273227229cd8f1b293e95c6a6122d)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 lib/talloc/configure.ac                   |    2 +-
 lib/talloc/script/abi_checks.sh           |   27 +--
 lib/talloc/script/mksyms.awk              |   19 +--
 lib/talloc/script/mksyms.sh               |   19 ++-
 lib/talloc/{ => script}/release-script.sh |   12 +-
 lib/talloc/talloc.exports                 |   24 ++-
 lib/talloc/talloc.signatures              |   51 +++---
 lib/tdb/common/open.c                     |   28 ++-
 lib/tdb/common/tdb.c                      |   30 +++
 lib/tdb/common/transaction.c              |   19 ++
 lib/tdb/configure.ac                      |    2 +-
 lib/tdb/docs/README                       |   13 +-
 lib/tdb/include/tdb.h                     |    5 +-
 lib/tdb/pytdb.c                           |    4 +-
 lib/tdb/python/tests/simple.py            |    9 +
 lib/tdb/release-script.sh                 |    2 +-
 lib/tdb/rules.mk                          |    5 -
 lib/tdb/tools/tdbdump.c                   |    4 +-
 lib/tdb/tools/tdbtool.c                   |   13 +-
 lib/tsocket/tsocket.c                     |    2 +-
 lib/tsocket/tsocket.h                     |   17 ++-
 lib/tsocket/tsocket_bsd.c                 |   56 +++++-
 lib/tsocket/tsocket_guide.txt             |  317 ++++++++++++++++-------------
 lib/tsocket/tsocket_helpers.c             |    2 +-
 lib/tsocket/tsocket_internal.h            |    2 +-
 25 files changed, 428 insertions(+), 256 deletions(-)
 rename lib/talloc/{ => script}/release-script.sh (80%)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/configure.ac b/lib/talloc/configure.ac
index a169f79..c1b1d2e 100644
--- a/lib/talloc/configure.ac
+++ b/lib/talloc/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ(2.50)
-AC_INIT(talloc, 2.0.0)
+AC_INIT(talloc, 2.0.1)
 AC_CONFIG_SRCDIR([talloc.c])
 AC_SUBST(datarootdir)
 AC_CONFIG_HEADER(config.h)
diff --git a/lib/talloc/script/abi_checks.sh b/lib/talloc/script/abi_checks.sh
index ba60ed0..66c4e60 100755
--- a/lib/talloc/script/abi_checks.sh
+++ b/lib/talloc/script/abi_checks.sh
@@ -33,6 +33,7 @@ LANG=C; export LANG
 LC_ALL=C; export LC_ALL
 LC_COLLATE=C; export LC_COLLATE
 
+exit_status=0
 script=$0
 dir_name=$(dirname ${script})
 
@@ -58,34 +59,22 @@ signatures_file_check=${signatures_file}.check
 
 
 ${dir_name}/mksyms.sh awk ${exports_file_check} ${headers} 2>&1 > /dev/null
+cat ${headers} | ${dir_name}/mksigs.pl | sort| uniq > ${signatures_file_check} 2> /dev/null
 
-cat ${headers} | ${dir_name}/mksigs.pl > ${signatures_file_check} 2> /dev/null
-
-normalize_exports_file() {
-	filename=$1
-	cat ${filename} \
-	| sed -e 's/^[ \t]*//g' \
-	| sed -e 's/^$//g' \
-	| sed -e 's/^#.*$//g' \
-	| sort | uniq > ${filename}.sort
-}
-
-normalize_exports_file ${exports_file}
-normalize_exports_file ${exports_file_check}
-
-normalize_exports_file ${signatures_file}
-normalize_exports_file ${signatures_file_check}
-
-diff -u ${exports_file}.sort ${exports_file_check}.sort
+diff -u ${exports_file} ${exports_file_check}
 if test "x$?" != "x0" ; then
 	echo "WARNING: possible ABI change detected in exports!"
+	let exit_status++
 else
 	echo "exports check: OK"
 fi
 
-diff -u ${signatures_file}.sort ${signatures_file_check}.sort
+diff -u ${signatures_file} ${signatures_file_check}
 if test "x$?" != "x0" ; then
 	echo "WARNING: possible ABI change detected in signatures!"
+	let exit_status++
 else
 	echo "signatures check: OK"
 fi
+
+exit $exit_status
diff --git a/lib/talloc/script/mksyms.awk b/lib/talloc/script/mksyms.awk
index ca14da0..8775faf 100644
--- a/lib/talloc/script/mksyms.awk
+++ b/lib/talloc/script/mksyms.awk
@@ -8,25 +8,12 @@
 #
 BEGIN {
 	inheader=0;
-	current_file="";
-	print "#"
-	print "# This file is automatically generated with \"make symbols\". DO NOT EDIT "
-	print "#"
-	print "{"
-	print "\tglobal:"
 }
 
 END {
-	print""
-	print "\tlocal: *;"
-	print "};"
 }
 
 {
-	if (FILENAME!=current_file) {
-		print "\t\t# The following definitions come from",FILENAME
-		current_file=FILENAME
-	}
 	if (inheader) {
 		if (match($0,"[)][^()]*[;][ \t]*$")) {
 			inheader = 0;
@@ -42,7 +29,7 @@ END {
 /^extern[ \t]+[^()]+[;][ \t]*$/ {
 	gsub(/[^ \t]+[ \t]+/, "");
 	sub(/[;][ \t]*$/, "");
-	printf "\t\t%s;\n", $0;
+	printf "           %s;\n", $0;
 	next;
 }
 
@@ -61,7 +48,7 @@ END {
 	sub(/[(].*$/, "");
 	gsub(/[^ \t]+[ \t]+/, "");
 	gsub(/^[*]+/, "");
-	printf "\t\t%s;\n",$0;
+	printf "           %s;\n",$0;
 	next;
 }
 
@@ -70,7 +57,7 @@ END {
 	sub(/[(].*$/, "");
 	gsub(/[^ \t]+[ \t]+/, "");
 	gsub(/^[*]/, "");
-	printf "\t\t%s;\n",$0;
+	printf "           %s;\n",$0;
 	next;
 }
 
diff --git a/lib/talloc/script/mksyms.sh b/lib/talloc/script/mksyms.sh
index 714d55a..089344f 100755
--- a/lib/talloc/script/mksyms.sh
+++ b/lib/talloc/script/mksyms.sh
@@ -34,7 +34,24 @@ echo creating $symsfile
 
 mkdir -p `dirname $symsfile`
 
-${awk} -f `dirname $0`/mksyms.awk $proto_src > $symsfile_tmp
+#Write header
+cat > $symsfile_tmp << EOF
+# This file is autogenerated, please DO NOT EDIT
+{
+    global:
+EOF
+
+#loop on each header
+for i in $proto_src; do
+${awk} -f `dirname $0`/mksyms.awk $i | sort >> $symsfile_tmp
+done;
+
+#Write tail
+cat >> $symsfile_tmp << EOF
+
+    local: *;
+};
+EOF
 
 if cmp -s $symsfile $symsfile_tmp 2>/dev/null
 then
diff --git a/lib/talloc/release-script.sh b/lib/talloc/script/release-script.sh
similarity index 80%
rename from lib/talloc/release-script.sh
rename to lib/talloc/script/release-script.sh
index 6b6c0e7..fd5c1ef 100755
--- a/lib/talloc/release-script.sh
+++ b/lib/talloc/script/release-script.sh
@@ -10,10 +10,20 @@ if [ ! -d "lib/talloc" ]; then
     exit 1
 fi
 
+# Check exports and signatures are up to date
+pushd lib/talloc
+./script/abi_checks.sh talloc talloc.h
+abicheck=$?
+popd
+if [ ! "$abicheck" = "0" ]; then
+    echo "ERROR: ABI Checks produced warnings!"
+    exit 1
+fi
+
 git clean -f -x -d lib/talloc
 git clean -f -x -d lib/replace
 
-curbranch=`git-branch |grep "^*" | tr -d "* "`
+curbranch=`git branch |grep "^*" | tr -d "* "`
 
 version=$1
 strver=`echo ${version} | tr "." "-"`
diff --git a/lib/talloc/talloc.exports b/lib/talloc/talloc.exports
index 75134c0..1b8062f 100644
--- a/lib/talloc/talloc.exports
+++ b/lib/talloc/talloc.exports
@@ -1,7 +1,19 @@
+# This file is autogenerated, please DO NOT EDIT
 {
     global:
            _talloc;
            _talloc_array;
+           _talloc_free;
+           _talloc_get_type_abort;
+           _talloc_memdup;
+           _talloc_move;
+           _talloc_realloc;
+           _talloc_realloc_array;
+           _talloc_reference_loc;
+           _talloc_set_destructor;
+           _talloc_steal_loc;
+           _talloc_zero;
+           _talloc_zero_array;
            talloc_asprintf;
            talloc_asprintf_append;
            talloc_asprintf_append_buffer;
@@ -11,40 +23,32 @@
            talloc_enable_leak_report;
            talloc_enable_leak_report_full;
            talloc_enable_null_tracking;
+           talloc_enable_null_tracking_no_autofree;
            talloc_find_parent_byname;
-           _talloc_free;
            talloc_free_children;
            talloc_get_name;
            talloc_get_size;
-           _talloc_get_type_abort;
            talloc_increase_ref_count;
            talloc_init;
            talloc_is_parent;
-           _talloc_memdup;
-           _talloc_move;
            talloc_named;
            talloc_named_const;
            talloc_parent;
            talloc_parent_name;
            talloc_pool;
-           _talloc_realloc;
-           _talloc_realloc_array;
            talloc_realloc_fn;
            talloc_reference_count;
-           _talloc_reference_loc;
            talloc_reparent;
            talloc_report;
            talloc_report_depth_cb;
            talloc_report_depth_file;
            talloc_report_full;
            talloc_set_abort_fn;
-           _talloc_set_destructor;
            talloc_set_log_fn;
            talloc_set_log_stderr;
            talloc_set_name;
            talloc_set_name_const;
            talloc_show_parents;
-           _talloc_steal_loc;
            talloc_strdup;
            talloc_strdup_append;
            talloc_strdup_append_buffer;
@@ -59,8 +63,6 @@
            talloc_vasprintf_append_buffer;
            talloc_version_major;
            talloc_version_minor;
-           _talloc_zero;
-           _talloc_zero_array;
 
     local: *;
 };
diff --git a/lib/talloc/talloc.signatures b/lib/talloc/talloc.signatures
index 00fb4a3..f2868e8 100644
--- a/lib/talloc/talloc.signatures
+++ b/lib/talloc/talloc.signatures
@@ -1,15 +1,15 @@
-char *talloc_asprintf_append_buffer (char *, const char *, ...);
-char *talloc_asprintf_append (char *, const char *, ...);
 char *talloc_asprintf (const void *, const char *, ...);
-char *talloc_strdup_append_buffer (char *, const char *);
-char *talloc_strdup_append (char *, const char *);
+char *talloc_asprintf_append (char *, const char *, ...);
+char *talloc_asprintf_append_buffer (char *, const char *, ...);
 char *talloc_strdup (const void *, const char *);
-char *talloc_strndup_append_buffer (char *, const char *, size_t);
-char *talloc_strndup_append (char *, const char *, size_t);
+char *talloc_strdup_append (char *, const char *);
+char *talloc_strdup_append_buffer (char *, const char *);
 char *talloc_strndup (const void *, const char *, size_t);
-char *talloc_vasprintf_append_buffer (char *, const char *, va_list);
-char *talloc_vasprintf_append (char *, const char *, va_list);
+char *talloc_strndup_append (char *, const char *, size_t);
+char *talloc_strndup_append_buffer (char *, const char *, size_t);
 char *talloc_vasprintf (const void *, const char *, va_list);
+char *talloc_vasprintf_append (char *, const char *, va_list);
+char *talloc_vasprintf_append_buffer (char *, const char *, va_list);
 const char *talloc_get_name (const void *);
 const char *talloc_parent_name (const void *);
 const char *talloc_set_name (const void *, const char *, ...);
@@ -23,39 +23,40 @@ size_t talloc_get_size (const void *);
 size_t talloc_reference_count (const void *);
 size_t talloc_total_blocks (const void *);
 size_t talloc_total_size (const void *);
+void *_talloc (const void *, size_t);
 void *_talloc_array (const void *, size_t, unsigned int, const char *);
+void *_talloc_get_type_abort (const void *, const char *, const char *);
+void *_talloc_memdup (const void *, const void *, size_t, const char *);
+void *_talloc_move (const void *, const void *);
+void *_talloc_realloc (const void *, void *, size_t, const char *);
+void *_talloc_realloc_array (const void *, void *, size_t, unsigned int, const char *);
+void *_talloc_reference_loc (const void *, const void *, const char *);
+void *_talloc_steal_loc (const void *, const void *, const char *);
+void *_talloc_zero (const void *, size_t, const char *);
+void *_talloc_zero_array (const void *, size_t, unsigned int, const char *);
 void *talloc_autofree_context (void);
 void *talloc_check_name (const void *, const char *);
-void *_talloc (const void *, size_t);
-void talloc_disable_null_tracking (void);
-void talloc_enable_leak_report_full (void);
-void talloc_enable_leak_report (void);
-void talloc_enable_null_tracking (void);
 void *talloc_find_parent_byname (const void *, const char *);
-void talloc_free_children (void *);
-void *_talloc_get_type_abort (const void *, const char *, const char *);
 void *talloc_init (const char *, ...);
-void *_talloc_memdup (const void *, const void *, size_t, const char *);
-void *_talloc_move (const void *, const void *);
-void *talloc_named_const (const void *, size_t, const char *);
 void *talloc_named (const void *, size_t, const char *, ...);
+void *talloc_named_const (const void *, size_t, const char *);
 void *talloc_parent (const void *);
 void *talloc_pool (const void *, size_t);
-void *_talloc_realloc_array (const void *, void *, size_t, unsigned int, const char *);
-void *_talloc_realloc (const void *, void *, size_t, const char *);
 void *talloc_realloc_fn (const void *, void *, size_t);
-void *_talloc_reference_loc (const void *, const void *, const char *);
 void *talloc_reparent (const void *, const void *, const void *);
+void _talloc_set_destructor (const void *, int (*) (void *));
+void talloc_disable_null_tracking (void);
+void talloc_enable_leak_report (void);
+void talloc_enable_leak_report_full (void);
+void talloc_enable_null_tracking (void);
+void talloc_enable_null_tracking_no_autofree (void);
+void talloc_free_children (void *);
 void talloc_report (const void *, FILE *);
 void talloc_report_depth_cb (const void *, int, int, void (*) (const void *, int, int, int, void *), void *);
 void talloc_report_depth_file (const void *, int, int, FILE *);
 void talloc_report_full (const void *, FILE *);
 void talloc_set_abort_fn (void (*) (const char *));
-void _talloc_set_destructor (const void *, int (*) (void *));
 void talloc_set_log_fn (void (*) (const char *));
 void talloc_set_log_stderr (void);
 void talloc_set_name_const (const void *, const char *);
 void talloc_show_parents (const void *, FILE *);
-void *_talloc_steal_loc (const void *, const void *, const char *);
-void *_talloc_zero_array (const void *, size_t, unsigned int, const char *);
-void *_talloc_zero (const void *, size_t, const char *);
diff --git a/lib/tdb/common/open.c b/lib/tdb/common/open.c
index 1ba2e7b..4d4f95a 100644
--- a/lib/tdb/common/open.c
+++ b/lib/tdb/common/open.c
@@ -163,6 +163,9 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 	}
 	tdb_io_init(tdb);
 	tdb->fd = -1;
+#ifdef TDB_TRACE
+	tdb->tracefd = -1;
+#endif
 	tdb->name = NULL;
 	tdb->map_ptr = NULL;
 	tdb->flags = tdb_flags;
@@ -199,6 +202,23 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 		tdb->flags &= ~TDB_CLEAR_IF_FIRST;
 	}
 
+	if ((tdb->flags & TDB_ALLOW_NESTING) &&
+	    (tdb->flags & TDB_DISALLOW_NESTING)) {
+		tdb->ecode = TDB_ERR_NESTING;
+		TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: "
+			"allow_nesting and disallow_nesting are not allowed together!"));
+		errno = EINVAL;
+		goto fail;
+	}
+
+	/*
+	 * TDB_ALLOW_NESTING is the default behavior.
+	 * Note: this may change in future versions!
+	 */
+	if (!(tdb->flags & TDB_DISALLOW_NESTING)) {
+		tdb->flags |= TDB_ALLOW_NESTING;
+	}
+
 	/* internal databases don't mmap or lock, and start off cleared */
 	if (tdb->flags & TDB_INTERNAL) {
 		tdb->flags |= (TDB_NOLOCK | TDB_NOMMAP);
@@ -207,10 +227,6 @@ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 			TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: tdb_new_database failed!"));
 			goto fail;
 		}
-#ifdef TDB_TRACE
-		/* All tracing will fail.  That's ok. */
-		tdb->tracefd = -1;
-#endif
 		goto internal;
 	}
 
@@ -403,8 +419,10 @@ int tdb_close(struct tdb_context *tdb)
 			tdb_munmap(tdb);
 	}
 	SAFE_FREE(tdb->name);
-	if (tdb->fd != -1)
+	if (tdb->fd != -1) {
 		ret = close(tdb->fd);
+		tdb->fd = -1;
+	}
 	SAFE_FREE(tdb->lockrecs);
 
 	/* Remove from contexts list */
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c
index 564c5fe..d2688de 100644
--- a/lib/tdb/common/tdb.c
+++ b/lib/tdb/common/tdb.c
@@ -730,11 +730,41 @@ int tdb_get_flags(struct tdb_context *tdb)
 
 void tdb_add_flags(struct tdb_context *tdb, unsigned flags)
 {
+	if ((flags & TDB_ALLOW_NESTING) &&
+	    (flags & TDB_DISALLOW_NESTING)) {
+		tdb->ecode = TDB_ERR_NESTING;
+		TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_add_flags: "
+			"allow_nesting and disallow_nesting are not allowed together!"));
+		return;
+	}
+
+	if (flags & TDB_ALLOW_NESTING) {
+		tdb->flags &= ~TDB_DISALLOW_NESTING;
+	}
+	if (flags & TDB_DISALLOW_NESTING) {
+		tdb->flags &= ~TDB_ALLOW_NESTING;
+	}
+
 	tdb->flags |= flags;
 }
 
 void tdb_remove_flags(struct tdb_context *tdb, unsigned flags)
 {
+	if ((flags & TDB_ALLOW_NESTING) &&
+	    (flags & TDB_DISALLOW_NESTING)) {
+		tdb->ecode = TDB_ERR_NESTING;
+		TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_remove_flags: "
+			"allow_nesting and disallow_nesting are not allowed together!"));
+		return;
+	}
+
+	if (flags & TDB_ALLOW_NESTING) {
+		tdb->flags |= TDB_DISALLOW_NESTING;
+	}
+	if (flags & TDB_DISALLOW_NESTING) {
+		tdb->flags |= TDB_ALLOW_NESTING;
+	}
+
 	tdb->flags &= ~flags;
 }
 
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
index 035b4e1..20f2bfc 100644
--- a/lib/tdb/common/transaction.c
+++ b/lib/tdb/common/transaction.c
@@ -85,6 +85,21 @@
     still available, but no transaction recovery area is used and no
     fsync/msync calls are made.
 
+  - if TDB_ALLOW_NESTING is passed to flags in tdb open, or added using
+    tdb_add_flags() transaction nesting is enabled.
+    It resets the TDB_DISALLOW_NESTING flag, as both cannot be used together.
+    The default is that transaction nesting is allowed.
+    Note: this default may change in future versions of tdb.
+
+    Beware. when transactions are nested a transaction successfully
+    completed with tdb_transaction_commit() can be silently unrolled later.
+
+  - if TDB_DISALLOW_NESTING is passed to flags in tdb open, or added using
+    tdb_add_flags() transaction nesting is disabled.
+    It resets the TDB_ALLOW_NESTING flag, as both cannot be used together.
+    An attempt create a nested transaction will fail with TDB_ERR_NESTING.
+    The default is that transaction nesting is allowed.
+    Note: this default may change in future versions of tdb.
 */
 
 
@@ -427,6 +442,10 @@ int tdb_transaction_start(struct tdb_context *tdb)
 
 	/* cope with nested tdb_transaction_start() calls */
 	if (tdb->transaction != NULL) {
+		if (!(tdb->flags & TDB_ALLOW_NESTING)) {
+			tdb->ecode = TDB_ERR_NESTING;
+			return -1;
+		}
 		tdb->transaction->nesting++;
 		TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: nesting %d\n", 
 			 tdb->transaction->nesting));
diff --git a/lib/tdb/configure.ac b/lib/tdb/configure.ac
index 52ecff4..779f596 100644
--- a/lib/tdb/configure.ac
+++ b/lib/tdb/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ(2.50)
 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
 AC_DEFUN([SMB_ENABLE], [echo -n ""])
-AC_INIT(tdb, 1.1.7)
+AC_INIT(tdb, 1.2.0)
 AC_CONFIG_SRCDIR([common/tdb.c])
 AC_CONFIG_HEADER(include/config.h)
 AC_LIBREPLACE_ALL_CHECKS
diff --git a/lib/tdb/docs/README b/lib/tdb/docs/README


-- 
Samba Shared Repository


More information about the samba-cvs mailing list