[SCM] Samba Shared Repository - branch v4-2-test updated
Karolin Seeger
kseeger at samba.org
Sat Jun 20 15:14:09 MDT 2015
The branch, v4-2-test has been updated
via cb3eb21 tdb: version 1.3.6
via 5f96713 lib/replace: remove unused HAVE_DECL_PTHREAD_{MUTEXATTR_SETROBUST,MUTEX_CONSISTENT}_NP checks
via 862f50f lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11
via 4bb5bea wafsamba: let CHECK_DECLS() find enum values
via 669ed89 s3:wscript: remove signal related configure checks
via 46fec0b lib/util: remove signal related configure checks
via 8480d36 lib/replace: add signal related configure checks
via ec6b122 tdb: version 1.3.5
via 35181ac tdb: introduce tdb_chainlock_read_nonblock(), a nonblock variant of tdb_chainlock_read()
via 9ec7d7e Add set date to tdb manpages.
via 346ef80 tdb: Do not build test binaries if it's not a standalone build
via 7f07079 tdb: Fix CID 1034842 Resource leak
via 49fb6e7 tdb: Fix CID 1034841 Resource leak
via a7cfaa8 smbd/trans2: add a useful diagnostic for files with bad encoding
via 1ac2ee0 lib/util/charset: fix conversion failure logging
via 3d1df8d vfs_fruit: add option veto_appledouble
via 3209575 ctdb-locking: move all auto_mark logic into process_callbacks()
via 0a6b40b ctdb-locking: make process_callbacks() more robust
via 9579ef9 ctdb-locking: Add a comment to explain auto_mark usage
via faf635a ctdb-locking: Avoid resetting talloc destructor
via 5e91991 ctdb-locking: Avoid memory leak in the failure case
via 4216f06 ctdb-locking: Set destructor when lock_context is created
via f52066b ctdb-locking: Set the lock_ctx->request to NULL when request is freed
via 4e65889 ctdb-locking: Avoid memory corruption in ctdb_lock_context_destructor
via a1d7c1b tevent: version 0.9.25
via 2a6c505 pytevent: add a TeventTimer_Object_ref helper structure to make the code clearer
via bccf0d6 pytevent: remove const warnings using discard_const_p()
via cdcf907 pytevent: remove dead code TEVENT_DEPRECATED is never defined
via c11701f tevent.h: propose tstream_ versions of read_packet_send/recv and writev_send/recv
via 722bd35 tevent/testsuite: make sure we cleanup tevent_fd structures in the correct order
via 742bfc5 pytevent: Port to Python 3
via 7ee5cb7 pytalloc: Improve timer wrapper, and test it
via a8bf805 pytevent: Define missing TeventFd_Type object
via 622581d pytevent: Better error and reference handling
via e7ad0a7 tevent: fix access after free in tevent_common_check_signal()
via 9a65763 tevent: add a note to tevent_add_fd()
via 282802f lib: tevent: Fix compile error in Solaris ports backend.
via 92f7b8e tevent: Fix CID 1035381 Unchecked return value
from c786ea6 smbd: Fix a use-after-free
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test
- Log -----------------------------------------------------------------
commit cb3eb212575d639634b9a68f37f36cf56efd429f
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 12 09:10:39 2015 +0200
tdb: version 1.3.6
* Fix runtime detection for robust mutexes in the standalone build.
bug #11326
* Possible fix for the build with robust mutexes on solaris 11
bug #11319
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
Autobuild-Date(master): Fri Jun 12 19:55:34 CEST 2015 on sn-devel-104
(cherry picked from commit 4ddf78a282c85e84b6201a79b707fad9487f3ccd)
The last 13 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11331
Backport tdb-1.3.6.
Autobuild-User(v4-2-test): Karolin Seeger <kseeger at samba.org>
Autobuild-Date(v4-2-test): Sat Jun 20 23:13:17 CEST 2015 on sn-devel-104
commit 5f967133e2202a9a393c20ffa68fb5783d7f15b2
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 12 11:01:21 2015 +0200
lib/replace: remove unused HAVE_DECL_PTHREAD_{MUTEXATTR_SETROBUST,MUTEX_CONSISTENT}_NP checks
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit 89dcfbf3f45f448e515a1da82e09002a0aafb7b4)
commit 862f50f64e67d9d3582794af5aa638584a282e76
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 12 11:01:21 2015 +0200
lib/replace: fix PTHREAD_MUTEX_ROBUST fallback to PTHREAD_MUTEX_ROBUST_NP on solaris 11
Without this we got the following defines in config.h:
#define HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST_NP 1
#define HAVE_DECL_PTHREAD_MUTEX_CONSISTENT_NP 1
#define HAVE_PTHREAD_MUTEXATTR_SETROBUST 1
#define HAVE_PTHREAD_MUTEX_CONSISTENT 1
#define HAVE_ROBUST_MUTEXES 1
#define USE_TDB_MUTEX_LOCKING 1
And the build failed with PTHREAD_MUTEX_ROBUST being unknown.
Note that PTHREAD_MUTEX_ROBUST and PTHREAD_MUTEX_ROBUST_NP are enum values
while they're defines on solaris 11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11319
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit 34cf1d213ec0261af41ef6a16f5b37e5015c614b)
commit 4bb5beab8022701dd4d7121d1642af5b6f149994
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 12 12:13:23 2015 +0200
wafsamba: let CHECK_DECLS() find enum values
In the current state this still generates the same config.h
at least on ubuntu 14.04 amd64.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit ff072a633660780cf72d204f4620c664957a6072)
commit 669ed89c68840f0f80af2dbb80b438e46dbf6422
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 10 14:33:35 2015 +0200
s3:wscript: remove signal related configure checks
These are done in lib/replace now.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11326
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Wed Jun 10 17:50:41 CEST 2015 on sn-devel-104
(cherry picked from commit a5fd4ca0dbe4f7cbf0d3ead4214af283aabe4790)
commit 46fec0b1a2c0dc9ceb625223069072017b1c98ab
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 10 14:33:35 2015 +0200
lib/util: remove signal related configure checks
These are done in lib/replace now.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11326
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 322f4b76e5cae9f2513ef68d7d86ad19d4a88244)
commit 8480d36d52b95055d518f8bdb15034528b39798a
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Jun 10 14:33:35 2015 +0200
lib/replace: add signal related configure checks
These should be in a central place available for
all lib/replace users instead of having each caller
do its own checks.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11326
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a82acb076e78eb513fb1228595b220f61377e23c)
commit ec6b1221e09fe9ff6ea88d38a4efdeb007526dd8
Author: Alexander Drozdov <al.drozdov at gmail.com>
Date: Tue Apr 28 10:31:43 2015 +0300
tdb: version 1.3.5
ABI change: tdb_chainlock_read_nonblock() has been added.
Signed-off-by: Alexander Drozdov <al.drozdov at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Apr 29 00:05:29 CEST 2015 on sn-devel-104
(cherry picked from commit 3f35c1d52ee77f7cabd52dd503565cec360f1de2)
commit 35181ac5514a28729814101df95a67c44c05257e
Author: Alexander Drozdov <al.drozdov at gmail.com>
Date: Tue Apr 28 07:42:43 2015 +0300
tdb: introduce tdb_chainlock_read_nonblock(), a nonblock variant of tdb_chainlock_read()
Signed-off-by: Alexander Drozdov <al.drozdov at gmail.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit e4fe0aff5252b37536eec4a130d4e40a05a56ddb)
commit 9ec7d7e140e5355d863b83cdffde5e3948759ef9
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Sun Apr 26 10:13:05 2015 +0000
Add set date to tdb manpages.
This makes builds reproducible.
Signed-Off-By: Jelmer Vernooij <jelmer at samba.org>
Reveiewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 38553a305fe4021e2bd034bed11eaef18863aa0a)
commit 346ef80c64903b066468f260d6ae4f3266fe25e9
Author: Amitay Isaacs <amitay at gmail.com>
Date: Fri Aug 15 11:36:40 2014 +1000
tdb: Do not build test binaries if it's not a standalone build
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Mar 31 01:56:02 CEST 2015 on sn-devel-104
(cherry picked from commit 48e90ba062ecde71d03c3cf4bc9a809f805fabe4)
commit 7f070790e50b6ae2c3a326b3058be9de6a789307
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 8 19:21:23 2015 +0000
tdb: Fix CID 1034842 Resource leak
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ira Cooper <ira at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Wed Mar 11 00:23:20 CET 2015 on sn-devel-104
(cherry picked from commit 006328b81b2dd3416c20b0f19b438c614c1932cc)
commit 49fb6e7ac58db9c579e0c387e86a0b598434f042
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 8 19:18:21 2015 +0000
tdb: Fix CID 1034841 Resource leak
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Ira Cooper <ira at samba.org>
(cherry picked from commit 1b8c07ac7d51eb2a1957d79ea05b170106a9c0e8)
commit a7cfaa8a01099219666fe656f45c86a472689c0d
Author: Ralph Boehme <slow at samba.org>
Date: Wed Jun 3 17:07:46 2015 +0200
smbd/trans2: add a useful diagnostic for files with bad encoding
Catch conversion error and log the path of the offending file.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11323
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jun 9 21:00:02 CEST 2015 on sn-devel-104
(cherry picked from commit 0615b72a6b62d590831f1c24c5678dd29b9a2338)
commit 1ac2ee09078e7158ec155adae7ab13d9b2c6ec85
Author: Ralph Boehme <slow at samba.org>
Date: Wed Jun 3 16:58:22 2015 +0200
lib/util/charset: fix conversion failure logging
Move catch-all debug statement with loglevel 0 from behind the switch
clause into the switch clause as default case. Fixes an issue that
resulted in the log being flooded with level 0 messages in case someone
put a file with an illegal UTF8 encoding (eg '\xA0test') on the server.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11323
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 1c60dc5c3252685d51324481063461f60cf968fe)
commit 3d1df8d54c2c1142a499f5d80aa88393b4804052
Author: Ralph Boehme <slow at samba.org>
Date: Sat May 9 08:31:24 2015 +0200
vfs_fruit: add option veto_appledouble
vfs_fruit adds a wildcard path "._*" to the vetolist in order to prevent
client access to ._ AppleDouble files created internally by vfs_fruit
for storing the Mac resource fork stream.
Unfortunately there are legitimite use cases where an OS X client may
want to use such filenames, extracting ZIP archives (where the archive
contains ._ files) being one of them.
A possible simple solution to this problem would be to not veto ._ files
in the first place, even though that exposes internally created ._ files
which the client shouldn't be able to access.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11305
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Ralph Böhme <slow at samba.org>
Autobuild-Date(master): Tue Jun 9 14:48:14 CEST 2015 on sn-devel-104
(cherry picked from commit b26a1449a0e6d01d5ddca89547df739732c8a230)
commit 3209575c7f031299cc622d1ca5a5a6de4f5c34c1
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 2 12:43:17 2015 +0200
ctdb-locking: move all auto_mark logic into process_callbacks()
The caller should not dereference lock_ctx after invoking
process_callbacks(), it might be destroyed already.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
Autobuild-Date(master): Fri Jun 12 15:28:57 CEST 2015 on sn-devel-104
(cherry picked from commit b3a18d66c00dba73a3f56a6f95781b4d34db1fe2)
commit 0a6b40bc14646e8a9e8e00fd7e98902e8fe60ed6
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 2 12:39:17 2015 +0200
ctdb-locking: make process_callbacks() more robust
We should not dereference lock_ctx after invoking the callback
in the auto_mark == false case. The callback could have destroyed it.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit a2690bc3f4e28a2ed50ccb47cb404fc8570fde6d)
commit 9579ef91ccad878a1195ca919da2ce5aecb30153
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 2 13:15:37 2015 +1000
ctdb-locking: Add a comment to explain auto_mark usage
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 89849c4d31c0bb0c47864e11abc89efe7d812d87)
commit faf635a5cf06be9995185e2311b14edc53f49481
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 2 11:25:44 2015 +1000
ctdb-locking: Avoid resetting talloc destructor
Let ctdb_lock_request_destructor() take care of the proper cleanup.
If the request if freed from the callback function, then the lock context
should not be freed. Setting request->lctx to NULL takes care of that
in the destructor.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit bc747030d435447e62262541cf2e74be4c4229d8)
commit 5e91991ee0afe7c9d52f761d270b3fb3e6e7d114
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 2 11:15:11 2015 +1000
ctdb-locking: Avoid memory leak in the failure case
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 2b352ff20597b9e34b3777d35deca1bf56209f8a)
commit 4216f06a5bf4b4b3445b56c101b24317c410acb5
Author: Amitay Isaacs <amitay at gmail.com>
Date: Tue Jun 2 00:22:07 2015 +1000
ctdb-locking: Set destructor when lock_context is created
There is already code in the destructor to correctly remove it from the
pending or the active queue. This also ensures that when lock context
is in pending queue and if the lock request gets freed, the lock context
is correctly removed from the pending queue.
Thanks to Stefan Metzmacher for noticing this and suggesting the fix.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
(cherry picked from commit 5ae6a8f2fff5b5f4d46f496fd83f555be4b3d448)
commit f52066b3ee5ffa6099bd761faa9cbe2d88c7242e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 2 00:15:11 2015 +1000
ctdb-locking: Set the lock_ctx->request to NULL when request is freed
The code was added to ctdb_lock_context_destructor() to ensure that
the if a lock_ctx gets freed first, the lock_request does not have a
dangling pointer. However, the reverse is also true. When a lock_request
is freed, then lock_ctx should not have a dangling pointer.
In commit 374cbc7b0ff68e04ee4e395935509c7df817b3c0, the code for second
condition was dropped causing a regression.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit 752ec31bcbbfe9f5b3b1c5dde4179d69f41cb53c)
commit 4e658892a454bc88ddce9c4444ca849a7ce07a32
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue May 26 16:45:34 2015 +0200
ctdb-locking: Avoid memory corruption in ctdb_lock_context_destructor
If the lock request is freed from within the callback, then setting
lock_ctx->request to NULL in ctdb_lock_context_destructor will end up
corrupting memory. In this case, lock_ctx->request could be reallocated
and pointing to something else. This may cause unexpected abort trying
to dereference a NULL pointer.
So, set lock_ctx->request to NULL before processing callbacks.
This avoids the following valgrind problem.
==3636== Invalid write of size 8
==3636== at 0x151F3D: ctdb_lock_context_destructor (ctdb_lock.c:276)
==3636== by 0x58B3618: _talloc_free_internal (talloc.c:993)
==3636== by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free (talloc.c:1594)
==3636== by 0x15292E: ctdb_lock_handler (ctdb_lock.c:471)
==3636== by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636== by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636== by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636== by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636== by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636== by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636== by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636== by 0x118557: main (ctdbd.c:321)
==3636== Address 0x9c5b660 is 96 bytes inside a block of size 120 free'd
==3636== at 0x4C29D17: free (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3636== by 0x58B32D3: _talloc_free_internal (talloc.c:1063)
==3636== by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58B3232: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58B3232: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free_children_internal (talloc.c:1472)
==3636== by 0x58AD692: _talloc_free_internal (talloc.c:1019)
==3636== by 0x58AD692: _talloc_free (talloc.c:1594)
==3636== by 0x11EC30: daemon_incoming_packet (ctdb_daemon.c:844)
==3636== by 0x136F4A: lock_fetch_callback (ctdb_ltdb_server.c:268)
==3636== by 0x152489: process_callbacks (ctdb_lock.c:353)
==3636== by 0x152489: ctdb_lock_handler (ctdb_lock.c:468)
==3636== by 0x56A535A: epoll_event_loop (tevent_epoll.c:728)
==3636== by 0x56A535A: epoll_event_loop_once (tevent_epoll.c:926)
==3636== by 0x56A3826: std_event_loop_once (tevent_standard.c:114)
==3636== by 0x569FFFC: _tevent_loop_once (tevent.c:533)
==3636== by 0x56A019A: tevent_common_loop_wait (tevent.c:637)
==3636== by 0x56A37C6: std_event_loop_wait (tevent_standard.c:140)
==3636== by 0x11E03A: ctdb_start_daemon (ctdb_daemon.c:1320)
==3636== by 0x118557: main (ctdbd.c:321)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11293
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
(cherry picked from commit ee02e40e869fd46f113d016122dd5384b7887228)
commit a1d7c1bc319c55f7a771e5445d6efc7aa60ef80a
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri Jun 12 08:58:26 2015 +0200
tevent: version 0.9.25
* Fix compile error in Solaris ports backend.
* Fix access after free in tevent_common_check_signal(). bug #11308
* Improve pytevent bindings.
* Testsuite fixes.
* Improve the documentation of the tevent_add_fd()
assumtions. It must be talloc_free'ed before closing the fd!
See bug #11141 and bug #11316.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit d7bdb30cc1731dc84831e323332a85be2bccf6a7)
The last 14 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11330
Backport tevent-0.9.25.
commit 2a6c5059681ac30f843276d8908ab8d200a8cc0d
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 11 09:51:19 2015 +0200
pytevent: add a TeventTimer_Object_ref helper structure to make the code clearer
This gives talloc_set_destructor to verify the type,
which removes a compiler warning.
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit 93ee074f912da02d4c1f1584df9b107364b639be)
commit bccf0d651e3f6fb95a332221a180edd01ec90f94
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 11 09:50:35 2015 +0200
pytevent: remove const warnings using discard_const_p()
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit fb04f0f4190005ff21817b79d02897af23ddc7ee)
commit cdcf907e3352825a4034f2cbf0dcc7571b1e7aa8
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu Jun 11 09:49:18 2015 +0200
pytevent: remove dead code TEVENT_DEPRECATED is never defined
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit 1a8a5ba0d51f9c2c9e84a3400e05327e7059156b)
commit c11701f4759c3bf8aa2275c0235401131650f4b0
Author: Stefan Metzmacher <metze at samba.org>
Date: Thu May 28 09:32:26 2015 +0200
tevent.h: propose tstream_ versions of read_packet_send/recv and writev_send/recv
The functions operating on the raw file descriptor are for advanced callers,
which take extra care and avoid the problems of
https://bugzilla.samba.org/show_bug.cgi?id=11141.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 44584f810720602201a9afaaa087eeb83579eff5)
commit 722bd3546098889f0a18ce48cf3a2f2df8f6a53f
Author: Stefan Metzmacher <metze at samba.org>
Date: Sat May 30 01:42:08 2015 +0200
tevent/testsuite: make sure we cleanup tevent_fd structures in the correct order
First we need to remove the tevent_fd structures without
tevent_fd_set_auto_close(). Closing the fd needs to be the last
thing...
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 88971d4870a197f656ef912911ca1e4ff5b56749)
commit 742bfc520c97b93de685d50223993ccf907a9f37
Author: Petr Viktorin <pviktori at redhat.com>
Date: Fri May 22 11:47:56 2015 +0200
pytevent: Port to Python 3
- Use PyStr (String on py2, Unicode on py3) for text strings
- Use PyLong instead of PyInt on Python 3
- Use new module initialization
Signed-off-by: Petr Viktorin <pviktori at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
(cherry picked from commit 8dbdd27526c4d5358bc2614e90f9aca36f41ed1a)
commit 7ee5cb7e7ae55e599e325b24c9ae0f58e4feb06c
Author: Petr Viktorin <pviktori at redhat.com>
Date: Tue May 26 13:25:12 2015 +0200
pytalloc: Improve timer wrapper, and test it
Using Context.add_timer resulted in crashes due to missing type object
and bad reference handling.
Add a TeventTimer_Type struct, and introduce a clear ownership/lifetime model.
Add a "add_timer_offset" to allow adding timers from Python. (add_timer
requires passing struct timeval as a Python integer, which can't really
be done portably).
Add tests.
Signed-off-by: Petr Viktorin <pviktori at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
(similar to commit 560576217f11b132f9c32de6e41c623dbc152137)
(We don't run the tests in the backport)
commit a8bf8050f32d39d9f89ea2e1f81bfd26b115e5bd
Author: Petr Viktorin <pviktori at redhat.com>
Date: Fri May 22 13:29:11 2015 +0200
pytevent: Define missing TeventFd_Type object
The type objects for Fd was declared but never defined,
resulting in segfaults when it was used.
Define it.
Signed-off-by: Petr Viktorin <pviktori at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
(cherry picked from commit 4399dc582fa06b04e1cec1d3aa59cd332e4b5ba2)
commit 622581d9604a8aac0e9b1e786e517aa06352528d
Author: Petr Viktorin <pviktori at redhat.com>
Date: Thu Dec 4 12:44:56 2014 +0100
pytevent: Better error and reference handling
py_backend_list:
- Handle cases of PyString_FromString or PyList_Append failing.
- Properly decrease the reference count of the returned strings.
py_register_backend:
- Decref "name" after use
Signed-off-by: Petr Viktorin <pviktori at redhat.com>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Reviewed-by: Jelmer Vernooij <jelmer at samba.org>
(cherry picked from commit f5838df58ea36e64cd0295b595df9cbd10d8c757)
commit e7ad0a76ba7abef74afe2215735c29fa5fdb9709
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Jun 2 12:18:22 2015 +0200
tevent: fix access after free in tevent_common_check_signal()
This was reported by Pavel Březina <pbrezina at redhat.com>:
We found a crash in SSSD when a tevent signal is freed in its handler, tevent
than crashes when it access siginfo.
sig_info is freed in signal destructor:
> #ifdef SA_SIGINFO
> if (se->sa_flags & SA_SIGINFO) {
> if (sig_state->sig_info[se->signum]) {
> talloc_free(sig_state->sig_info[se->signum]);
> sig_state->sig_info[se->signum] = NULL;
> }
> }
> #endif
(gdb) bt
#0 0x00007f5d4d86cc74 in tevent_signal_destructor (se=0x7f5d5370f920) at
../tevent_signal.c:213
#1 0x00007f5d4d65f233 in _talloc_free_internal () from /lib64/libtalloc.so.2
#2 0x00007f5d4d6593a3 in _talloc_free () from /lib64/libtalloc.so.2
#3 0x00007f5d4342f3d4 in proxy_child_init_done (subreq=0x7f5d5370f600) at
src/providers/proxy/proxy_auth.c:436
#4 0x00007f5d4d86b0c2 in _tevent_req_error (req=req at entry=0x7f5d5370f600,
error=error at entry=5, location=location at entry=0x7f5d43433010
"src/providers/proxy/proxy_auth.c:356")
at ../tevent_req.c:167
#5 0x00007f5d4342ef5e in pc_init_sig_handler (ev=<optimized out>,
sige=<optimized out>, signum=<optimized out>, count=<optimized out>,
__siginfo=<optimized out>, pvt=<optimized out>)
at src/providers/proxy/proxy_auth.c:356
#6 0x00007f5d4d86d48c in tevent_common_check_signal (ev=0x7f5d536de670) at
../tevent_signal.c:428
#7 0x00007f5d4d86f28c in epoll_event_loop (tvalp=0x7fff7b568490,
epoll_ev=0x7f5d536de8b0) at ../tevent_epoll.c:647
#8 epoll_event_loop_once (ev=<optimized out>, location=<optimized out>) at
../tevent_epoll.c:926
#9 0x00007f5d4d86d7d7 in std_event_loop_once (ev=0x7f5d536de670,
location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent_standard.c:114
#10 0x00007f5d4d869fbd in _tevent_loop_once (ev=ev at entry=0x7f5d536de670,
location=location at entry=0x7f5d50faedc3 "src/util/server.c:668") at
../tevent.c:530
#11 0x00007f5d4d86a15b in tevent_common_loop_wait (ev=0x7f5d536de670,
location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent.c:634
#12 0x00007f5d4d86d777 in std_event_loop_wait (ev=0x7f5d536de670,
location=0x7f5d50faedc3 "src/util/server.c:668") at ../tevent_standard.c:140
#13 0x00007f5d50f96863 in server_loop (main_ctx=0x7f5d536dfac0) at
src/util/server.c:668
#14 0x00007f5d5180aa42 in main (argc=8, argv=<optimized out>) at
src/providers/data_provider_be.c:2909
But then it is accessed again in tevent_common_check_signal:
> #ifdef SA_SIGINFO
> if (clear_processed_siginfo) {
> uint32_t j;
> for (j=0;j<count;j++) {
> uint32_t ofs = (counter.seen + j)
> % TEVENT_SA_INFO_QUEUE_COUNT;
> memset((void*)&sig_state->sig_info[i][ofs],
> '\0',
> sizeof(siginfo_t));
> }
> }
> #endif
(gdb) bt
#0 0x00007fd7ba400505 in memset (__len=<optimized out>, __ch=<optimized out>,
__dest=<optimized out>) at /usr/include/bits/string3.h:84
#1 tevent_common_check_signal (ev=0x7fd7bfddf670) at ../tevent_signal.c:459
#2 0x00007fd7ba40228c in epoll_event_loop (tvalp=0x7fff85536430,
epoll_ev=0x7fd7bfddf8b0) at ../tevent_epoll.c:647
#3 epoll_event_loop_once (ev=<optimized out>, location=<optimized out>) at
../tevent_epoll.c:926
#4 0x00007fd7ba4007d7 in std_event_loop_once (ev=0x7fd7bfddf670,
location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent_standard.c:114
#5 0x00007fd7ba3fcfbd in _tevent_loop_once (ev=ev at entry=0x7fd7bfddf670,
location=location at entry=0x7fd7bdb417c3 "src/util/server.c:668") at
../tevent.c:530
#6 0x00007fd7ba3fd15b in tevent_common_loop_wait (ev=0x7fd7bfddf670,
location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent.c:634
#7 0x00007fd7ba400777 in std_event_loop_wait (ev=0x7fd7bfddf670,
location=0x7fd7bdb417c3 "src/util/server.c:668") at ../tevent_standard.c:140
#8 0x00007fd7bdb29343 in server_loop (main_ctx=0x7fd7bfde0ac0) at
src/util/server.c:668
#9 0x00007fd7be39ca42 in main (argc=8, argv=<optimized out>) at
src/providers/data_provider_be.c:2909
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11308
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jun 2 21:02:11 CEST 2015 on sn-devel-104
(cherry picked from commit 9d797ffb27bf4be100c900b0373f62b029679de3)
commit 9a65763db77f96793be43e4a0a92a8a821831f08
Author: Stefan Metzmacher <metze at samba.org>
Date: Mon May 18 13:25:33 2015 +0200
tevent: add a note to tevent_add_fd()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11141
Signed-off-by: Stefan Metzmacher <metze at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
(cherry picked from commit 33ca0179ac091c8bb1c2b3fa7999cc5047d09a80)
commit 282802f2f0aea30eaab05e4ca2f6841f394c08e1
Author: Gordon Ross <gordon.w.ross at gmail.com>
Date: Wed Apr 29 11:34:10 2015 -0700
lib: tevent: Fix compile error in Solaris ports backend.
Signed-off-by: Gordon Ross <gordon.w.ross at gmail.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit a7d41e94603d789bb461b84380a8fba3f837bc4f)
commit 92f7b8e37e3551bcaf096a6535107abdfb5ed187
Author: Volker Lendecke <vl at samba.org>
Date: Tue Mar 31 21:15:53 2015 +0200
tevent: Fix CID 1035381 Unchecked return value
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
(cherry picked from commit 6bcc037b5b636e88a914f1d39a95eb6eb72937e0)
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_autoconf.py | 13 +-
ctdb/server/ctdb_lock.c | 49 +--
docs-xml/manpages/vfs_fruit.8.xml | 17 +
lib/replace/system/threads.h | 9 +-
lib/replace/wscript | 15 +-
lib/tdb/ABI/{tdb-1.3.1.sigs => tdb-1.3.5.sigs} | 1 +
lib/tdb/ABI/{tdb-1.3.1.sigs => tdb-1.3.6.sigs} | 1 +
lib/tdb/common/lock.c | 7 +
lib/tdb/include/tdb.h | 1 +
lib/tdb/man/tdbbackup.8.xml | 1 +
lib/tdb/man/tdbdump.8.xml | 1 +
lib/tdb/man/tdbrestore.8.xml | 1 +
lib/tdb/man/tdbtool.8.xml | 1 +
lib/tdb/test/run-incompatible.c | 8 +-
lib/tdb/test/run-open-during-transaction.c | 1 +
lib/tdb/wscript | 25 +-
.../ABI/{tevent-0.9.21.sigs => tevent-0.9.25.sigs} | 0
lib/tevent/bindings.py | 52 +++-
lib/tevent/pytevent.c | 341 +++++++++++++++------
lib/tevent/testsuite.c | 8 +-
lib/tevent/tevent.h | 9 +-
lib/tevent/tevent_port.c | 3 +-
lib/tevent/tevent_signal.c | 2 +-
lib/tevent/wscript | 2 +-
lib/util/charset/convert_string.c | 4 +-
lib/util/wscript_configure | 2 -
source3/modules/vfs_fruit.c | 48 +--
source3/smbd/trans2.c | 4 +
source3/wscript | 4 +-
29 files changed, 453 insertions(+), 177 deletions(-)
copy lib/tdb/ABI/{tdb-1.3.1.sigs => tdb-1.3.5.sigs} (98%)
copy lib/tdb/ABI/{tdb-1.3.1.sigs => tdb-1.3.6.sigs} (98%)
copy lib/tevent/ABI/{tevent-0.9.21.sigs => tevent-0.9.25.sigs} (100%)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index cb33630..0b74adc 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -229,7 +229,18 @@ def CHECK_DECLS(conf, vars, reverse=False, headers=None, always=False):
headers=headers,
msg='Checking for declaration of %s' % v,
always=always):
- ret = False
+ if not CHECK_CODE(conf,
+ '''
+ return (int)%s;
+ ''' % (v),
+ execute=False,
+ link=False,
+ msg='Checking for declaration of %s (as enum)' % v,
+ local_include=False,
+ headers=headers,
+ define=define,
+ always=always):
+ ret = False
return ret
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c
index 7959d40..5b63d1e 100644
--- a/ctdb/server/ctdb_lock.c
+++ b/ctdb/server/ctdb_lock.c
@@ -41,6 +41,10 @@
* ctdb_lock_alldb() - get a lock on all DBs
*
* auto_mark - whether to mark/unmark DBs in before/after callback
+ * = false is used for freezing databases for
+ * recovery since the recovery cannot start till
+ * databases are locked on all the nodes.
+ * = true is used for record locks.
*/
enum lock_type {
@@ -312,7 +316,13 @@ static int ctdb_lock_context_destructor(struct lock_context *lock_ctx)
*/
static int ctdb_lock_request_destructor(struct lock_request *lock_request)
{
+ if (lock_request->lctx == NULL) {
+ return 0;
+ }
+
+ lock_request->lctx->request = NULL;
TALLOC_FREE(lock_request->lctx);
+
return 0;
}
@@ -324,8 +334,9 @@ static int ctdb_lock_request_destructor(struct lock_request *lock_request)
static void process_callbacks(struct lock_context *lock_ctx, bool locked)
{
struct lock_request *request;
+ bool auto_mark = lock_ctx->auto_mark;
- if (lock_ctx->auto_mark && locked) {
+ if (auto_mark && locked) {
switch (lock_ctx->type) {
case LOCK_RECORD:
tdb_chainlock_mark(lock_ctx->ctdb_db->ltdb->tdb, lock_ctx->key);
@@ -346,13 +357,23 @@ static void process_callbacks(struct lock_context *lock_ctx, bool locked)
}
request = lock_ctx->request;
- if (lock_ctx->auto_mark) {
- /* Reset the destructor, so request is not removed from the list */
- talloc_set_destructor(request, NULL);
+ if (auto_mark) {
+ /* Since request may be freed in the callback, unset the lock
+ * context, so request destructor will not free lock context.
+ */
+ request->lctx = NULL;
}
+
+ /* Since request may be freed in the callback, unset the request */
+ lock_ctx->request = NULL;
+
request->callback(request->private_data, locked);
- if (lock_ctx->auto_mark && locked) {
+ if (!auto_mark) {
+ return;
+ }
+
+ if (locked) {
switch (lock_ctx->type) {
case LOCK_RECORD:
tdb_chainlock_unmark(lock_ctx->ctdb_db->ltdb->tdb, lock_ctx->key);
@@ -371,6 +392,8 @@ static void process_callbacks(struct lock_context *lock_ctx, bool locked)
break;
}
}
+
+ talloc_free(lock_ctx);
}
@@ -416,7 +439,6 @@ static void ctdb_lock_handler(struct tevent_context *ev,
void *private_data)
{
struct lock_context *lock_ctx;
- TALLOC_CTX *tmp_ctx = NULL;
char c;
bool locked;
double t;
@@ -430,11 +452,6 @@ static void ctdb_lock_handler(struct tevent_context *ev,
t = timeval_elapsed(&lock_ctx->start_time);
id = lock_bucket_id(t);
- if (lock_ctx->auto_mark) {
- tmp_ctx = talloc_new(ev);
- talloc_steal(tmp_ctx, lock_ctx);
- }
-
/* Read the status from the child process */
if (sys_read(lock_ctx->fd[0], &c, 1) != 1) {
locked = false;
@@ -466,10 +483,6 @@ static void ctdb_lock_handler(struct tevent_context *ev,
}
process_callbacks(lock_ctx, locked);
-
- if (lock_ctx->auto_mark) {
- talloc_free(tmp_ctx);
- }
}
@@ -805,8 +818,6 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
/* Parent process */
close(lock_ctx->fd[1]);
- talloc_set_destructor(lock_ctx, ctdb_lock_context_destructor);
-
talloc_free(tmp_ctx);
/* Set up timeout handler */
@@ -818,7 +829,6 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
if (lock_ctx->ttimer == NULL) {
ctdb_kill(ctdb, lock_ctx->child, SIGKILL);
lock_ctx->child = -1;
- talloc_set_destructor(lock_ctx, NULL);
close(lock_ctx->fd[0]);
return;
}
@@ -834,7 +844,6 @@ static void ctdb_lock_schedule(struct ctdb_context *ctdb)
TALLOC_FREE(lock_ctx->ttimer);
ctdb_kill(ctdb, lock_ctx->child, SIGKILL);
lock_ctx->child = -1;
- talloc_set_destructor(lock_ctx, NULL);
close(lock_ctx->fd[0]);
return;
}
@@ -899,6 +908,7 @@ static struct lock_request *ctdb_lock_internal(TALLOC_CTX *mem_ctx,
if (lock_ctx->key.dptr == NULL) {
DEBUG(DEBUG_ERR, (__location__ "Memory allocation error\n"));
talloc_free(lock_ctx);
+ talloc_free(request);
return NULL;
}
lock_ctx->key_hash = ctdb_hash(&key);
@@ -932,6 +942,7 @@ static struct lock_request *ctdb_lock_internal(TALLOC_CTX *mem_ctx,
request->private_data = private_data;
talloc_set_destructor(request, ctdb_lock_request_destructor);
+ talloc_set_destructor(lock_ctx, ctdb_lock_context_destructor);
ctdb_lock_schedule(ctdb);
diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index 4e296a4..e407b54 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -197,6 +197,23 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>fruit:veto_appledouble = yes | no</term>
+ <listitem>
+ <para>Whether ._ AppleDouble files are vetoed which
+ prevents the client from seing and accessing internal
+ AppleDouble files created by vfs_fruit itself for the
+ purpose of storing a Mac resource fork.</para>
+ <para>Vetoing ._ files may break some applications, eg
+ extracting Mac ZIP archives from Mac clients failes,
+ because they contain ._ files. Setting this option to
+ false will fix this, but the abstraction leak of
+ exposing the internally created ._ files may have other
+ unknown side effects.</para>
+ <para>The default is <emphasis>yes</emphasis>.</para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
diff --git a/lib/replace/system/threads.h b/lib/replace/system/threads.h
index 25d3502..fe6d0fb 100644
--- a/lib/replace/system/threads.h
+++ b/lib/replace/system/threads.h
@@ -29,15 +29,12 @@
#if defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP) && \
!defined(HAVE_PTHREAD_MUTEXATTR_SETROBUST)
-
#define pthread_mutexattr_setrobust pthread_mutexattr_setrobust_np
+#endif
-/*
- * We assume that PTHREAD_MUTEX_ROBUST_NP goes along with
- * pthread_mutexattr_setrobust_np()
- */
+#if defined(HAVE_DECL_PTHREAD_MUTEX_ROBUST_NP) && \
+ !defined(HAVE_DECL_PTHREAD_MUTEX_ROBUST)
#define PTHREAD_MUTEX_ROBUST PTHREAD_MUTEX_ROBUST_NP
-
#endif
#if defined(HAVE_PTHREAD_MUTEX_CONSISTENT_NP) && \
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 1949448..a8182e3 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -135,6 +135,7 @@ def configure(conf):
conf.CHECK_TYPE_IN('sa_family_t', 'sys/socket.h')
conf.CHECK_TYPE_IN('sig_atomic_t', 'signal.h', define='HAVE_SIG_ATOMIC_T_TYPE')
+ conf.CHECK_FUNCS('sigsetmask siggetmask sigprocmask sigblock sigaction sigset')
conf.CHECK_FUNCS_IN('''inet_ntoa inet_aton inet_ntop inet_pton connect gethostbyname
getaddrinfo getnameinfo freeaddrinfo gai_strerror socketpair''',
@@ -446,21 +447,15 @@ removeea setea
if conf.CONFIG_SET('HAVE_PTHREAD'):
- conf.CHECK_DECLS('pthread_mutexattr_setrobust', headers='pthread.h')
- if not conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEXATTR_SETROBUST'):
- conf.CHECK_DECLS('pthread_mutexattr_setrobust_np',
- headers='pthread.h')
-
conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust', 'pthread',
checklibc=True, headers='pthread.h')
if not conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST'):
conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust_np', 'pthread',
checklibc=True, headers='pthread.h')
- conf.CHECK_DECLS('pthread_mutex_consistent', headers='pthread.h')
- if not conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEX_CONSISTENT'):
- conf.CHECK_DECLS('pthread_mutex_consistent_np',
- headers='pthread.h')
+ conf.CHECK_DECLS('PTHREAD_MUTEX_ROBUST', headers='pthread.h')
+ if not conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEX_ROBUST'):
+ conf.CHECK_DECLS('PTHREAD_MUTEX_ROBUST_NP', headers='pthread.h')
conf.CHECK_FUNCS_IN('pthread_mutex_consistent', 'pthread',
checklibc=True, headers='pthread.h')
@@ -470,6 +465,8 @@ removeea setea
if ((conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST') or
conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP')) and
+ (conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEX_ROBUST') or
+ conf.CONFIG_SET('HAVE_DECL_PTHREAD_MUTEX_ROBUST_NP')) and
(conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT') or
conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT_NP'))):
conf.DEFINE('HAVE_ROBUST_MUTEXES', 1)
diff --git a/lib/tdb/ABI/tdb-1.3.1.sigs b/lib/tdb/ABI/tdb-1.3.5.sigs
similarity index 98%
copy from lib/tdb/ABI/tdb-1.3.1.sigs
copy to lib/tdb/ABI/tdb-1.3.5.sigs
index 7d3e469..2545c99 100644
--- a/lib/tdb/ABI/tdb-1.3.1.sigs
+++ b/lib/tdb/ABI/tdb-1.3.5.sigs
@@ -4,6 +4,7 @@ tdb_chainlock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA)
tdb_chainunlock: int (struct tdb_context *, TDB_DATA)
tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA)
diff --git a/lib/tdb/ABI/tdb-1.3.1.sigs b/lib/tdb/ABI/tdb-1.3.6.sigs
similarity index 98%
copy from lib/tdb/ABI/tdb-1.3.1.sigs
copy to lib/tdb/ABI/tdb-1.3.6.sigs
index 7d3e469..2545c99 100644
--- a/lib/tdb/ABI/tdb-1.3.1.sigs
+++ b/lib/tdb/ABI/tdb-1.3.6.sigs
@@ -4,6 +4,7 @@ tdb_chainlock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_mark: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_nonblock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_read: int (struct tdb_context *, TDB_DATA)
+tdb_chainlock_read_nonblock: int (struct tdb_context *, TDB_DATA)
tdb_chainlock_unmark: int (struct tdb_context *, TDB_DATA)
tdb_chainunlock: int (struct tdb_context *, TDB_DATA)
tdb_chainunlock_read: int (struct tdb_context *, TDB_DATA)
diff --git a/lib/tdb/common/lock.c b/lib/tdb/common/lock.c
index 6644c40..195dbb5 100644
--- a/lib/tdb/common/lock.c
+++ b/lib/tdb/common/lock.c
@@ -858,6 +858,13 @@ _PUBLIC_ int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key)
return tdb_unlock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK);
}
+_PUBLIC_ int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key)
+{
+ int ret = tdb_lock_nonblock(tdb, BUCKET(tdb->hash_fn(&key)), F_RDLCK);
+ tdb_trace_1rec_ret(tdb, "tdb_chainlock_read_nonblock", key, ret);
+ return ret;
+}
+
/* record lock stops delete underneath */
int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off)
{
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 03e429c..8478ca2 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -884,6 +884,7 @@ int tdb_chainlock(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainlock_nonblock(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainunlock(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainlock_read(struct tdb_context *tdb, TDB_DATA key);
+int tdb_chainlock_read_nonblock(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainunlock_read(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainlock_mark(struct tdb_context *tdb, TDB_DATA key);
int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key);
diff --git a/lib/tdb/man/tdbbackup.8.xml b/lib/tdb/man/tdbbackup.8.xml
index 30a658d..2cc050f 100644
--- a/lib/tdb/man/tdbbackup.8.xml
+++ b/lib/tdb/man/tdbbackup.8.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="tdbbackup.8">
+<refentryinfo><date>2015-04-25</date></refentryinfo>
<refmeta>
<refentrytitle>tdbbackup</refentrytitle>
diff --git a/lib/tdb/man/tdbdump.8.xml b/lib/tdb/man/tdbdump.8.xml
index 25fd432..31e6888 100644
--- a/lib/tdb/man/tdbdump.8.xml
+++ b/lib/tdb/man/tdbdump.8.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="tdbdump.8">
+<refentryinfo><date>2015-04-25</date></refentryinfo>
<refmeta>
<refentrytitle>tdbdump</refentrytitle>
diff --git a/lib/tdb/man/tdbrestore.8.xml b/lib/tdb/man/tdbrestore.8.xml
index 64c0ba2..034db53 100644
--- a/lib/tdb/man/tdbrestore.8.xml
+++ b/lib/tdb/man/tdbrestore.8.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="tdbrestore.8">
+<refentryinfo><date>2015-04-25</date></refentryinfo>
<refmeta>
<refentrytitle>tdbrestore</refentrytitle>
diff --git a/lib/tdb/man/tdbtool.8.xml b/lib/tdb/man/tdbtool.8.xml
index cedc7eb..9a9b95e 100644
--- a/lib/tdb/man/tdbtool.8.xml
+++ b/lib/tdb/man/tdbtool.8.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<refentry id="tdbtool.8">
+<refentryinfo><date>2015-04-25</date></refentryinfo>
<refmeta>
<refentrytitle>tdbtool</refentrytitle>
diff --git a/lib/tdb/test/run-incompatible.c b/lib/tdb/test/run-incompatible.c
index b8e95b5..5f1b586 100644
--- a/lib/tdb/test/run-incompatible.c
+++ b/lib/tdb/test/run-incompatible.c
@@ -28,15 +28,17 @@ static void log_fn(struct tdb_context *tdb, enum tdb_debug_level level, const ch
static unsigned int hdr_rwlocks(const char *fname)
{
struct tdb_header hdr;
+ ssize_t nread;
int fd = open(fname, O_RDONLY);
if (fd == -1)
return -1;
- if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr))
- return -1;
-
+ nread = read(fd, &hdr, sizeof(hdr));
close(fd);
+ if (nread != sizeof(hdr)) {
+ return -1;
+ }
return hdr.rwlocks;
}
diff --git a/lib/tdb/test/run-open-during-transaction.c b/lib/tdb/test/run-open-during-transaction.c
index 1605376..9a6c6c1 100644
--- a/lib/tdb/test/run-open-during-transaction.c
+++ b/lib/tdb/test/run-open-during-transaction.c
@@ -74,6 +74,7 @@ static void check_file_intact(int fd)
if (pread(fd, contents, st.st_size, 0) != st.st_size) {
diag("Read fail");
errors++;
+ free(contents);
return;
}
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index b283795..528b9e7 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,7 +1,7 @@
#!/usr/bin/env python
APPNAME = 'tdb'
-VERSION = '1.3.4'
+VERSION = '1.3.6'
blddir = 'bin'
@@ -165,17 +165,18 @@ def build(bld):
'tools/tdbtool.c',
'tdb', manpages='man/tdbtool.8')
- # FIXME: This hardcoded list is stupid, stupid, stupid.
- bld.SAMBA_SUBSYSTEM('tdb-test-helpers',
- 'test/external-agent.c test/lock-tracking.c test/logging.c',
- tdb_deps,
- includes='include')
-
- for t in tdb1_unit_tests:
- b = "tdb1-" + t
- s = "test/" + t + ".c"
- bld.SAMBA_BINARY(b, s, 'replace tdb-test-helpers',
- includes='include', install=False)
+ if bld.env.standalone_tdb:
+ # FIXME: This hardcoded list is stupid, stupid, stupid.
+ bld.SAMBA_SUBSYSTEM('tdb-test-helpers',
+ 'test/external-agent.c test/lock-tracking.c test/logging.c',
+ tdb_deps,
+ includes='include')
+
+ for t in tdb1_unit_tests:
+ b = "tdb1-" + t
+ s = "test/" + t + ".c"
+ bld.SAMBA_BINARY(b, s, 'replace tdb-test-helpers',
+ includes='include', install=False)
if not bld.CONFIG_SET('USING_SYSTEM_PYTDB'):
bld.SAMBA_PYTHON('pytdb',
diff --git a/lib/tevent/ABI/tevent-0.9.21.sigs b/lib/tevent/ABI/tevent-0.9.25.sigs
similarity index 100%
copy from lib/tevent/ABI/tevent-0.9.21.sigs
copy to lib/tevent/ABI/tevent-0.9.25.sigs
diff --git a/lib/tevent/bindings.py b/lib/tevent/bindings.py
index 1060caf..55aafbb 100644
--- a/lib/tevent/bindings.py
+++ b/lib/tevent/bindings.py
@@ -22,8 +22,10 @@
# License along with this library; if not, see <http://www.gnu.org/licenses/>.
import signal
+from unittest import TestCase, TestProgram
+import gc
+
import _tevent
-from unittest import TestCase
class BackendListTests(TestCase):
@@ -60,3 +62,51 @@ class ContextTests(TestCase):
def test_add_signal(self):
sig = self.ctx.add_signal(signal.SIGINT, 0, lambda callback: None)
self.assertTrue(isinstance(sig, _tevent.Signal))
+
+ def test_timer(self):
+ """Test a timer is can be scheduled"""
+ collecting_list = []
+ # time "0" has already passed, callback will be scheduled immediately
+ timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
+ self.assertTrue(timer.active)
+ self.assertEqual(collecting_list, [])
+ self.ctx.loop_once()
+ self.assertFalse(timer.active)
+ self.assertEqual(collecting_list, [True])
+
+ def test_timer_deallocate_timer(self):
+ """Test timer is scheduled even if reference to it isn't held"""
+ collecting_list = []
+ def callback(t):
+ collecting_list.append(True)
+ timer = self.ctx.add_timer(0, lambda t: collecting_list.append(True))
--
Samba Shared Repository
More information about the samba-cvs
mailing list