tdb: avoid a race condition when checking for robust mutexes
authorRalph Boehme <slow@samba.org>
Sat, 26 Mar 2016 11:43:55 +0000 (12:43 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 29 Mar 2016 14:04:19 +0000 (16:04 +0200)
This fixes a race between calling waitpid() in two places (SIGCHLD the
signal handler and the rendezvous code when waiting for the child to
terminate), by

- blocking SIGCHLD before installing our signal handler

- in the rendezvous code call sigssuspend() which unblocks SIGCHLD and
  suspends the thread and waits for signal delivery

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11808

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Mar 29 16:04:19 CEST 2016 on sn-devel-144


No differences found