diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-06 21:47:57 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-06 21:47:57 -0800 |
commit | ef8da1698371c95495add53df81a978df709c88d (patch) | |
tree | b527c22721d903e8f565acafd86afe846d6a0ef0 /source/lib/util_tdb.c | |
parent | 47640fb20e42f226e7ea104076fd52547bfe1abb (diff) | |
download | samba-ef8da1698371c95495add53df81a978df709c88d.tar.gz |
Fix bug where tdb lock call interrupted with
an alarm sig would not terminate and could lead
to runaway smbd processes.
Thanks to Dave Daugherty @ Centrify for pointing
this out to us.
Jeremy.
Diffstat (limited to 'source/lib/util_tdb.c')
-rw-r--r-- | source/lib/util_tdb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/lib/util_tdb.c b/source/lib/util_tdb.c index 6aa7a5348f0..35c1a92ad5c 100644 --- a/source/lib/util_tdb.c +++ b/source/lib/util_tdb.c @@ -72,6 +72,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key, if (timeout) { CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig); + tdb_setalarm_sigptr(tdb, &gotalarm); alarm(timeout); } @@ -82,6 +83,7 @@ static int tdb_chainlock_with_timeout_internal( TDB_CONTEXT *tdb, TDB_DATA key, if (timeout) { alarm(0); + tdb_setalarm_sigptr(tdb, NULL); CatchSignal(SIGALRM, SIGNAL_CAST SIG_IGN); if (gotalarm) { DEBUG(0,("tdb_chainlock_with_timeout_internal: alarm (%u) timed out for key %s in tdb %s\n", |