1 autofs-5.0.4 - allow the automount daemon to dump core
3 From: Jeff Moyer <jmoyer@redhat.com>
5 Right now, the automount daemon blocks all signals. We should at least
6 unblock those that will cause us to dump core. Otherwise, I think the
7 behaviour could be, umm, interesting.
9 I tested this by sending SIGBUS and SIGSEGV to the automount daemon.
12 - I changed this a little so that the change to the signals is
13 done in one place and added SIGABRT and SIGTRAP to the list
14 of signals that aren't blocked.
16 Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
20 daemon/automount.c | 16 ++++++++++++----
21 2 files changed, 13 insertions(+), 4 deletions(-)
24 diff --git a/CHANGELOG b/CHANGELOG
25 index 7f27f5e..4b85649 100644
29 - mannual umount recovery fixes.
30 - fix map type info parse error.
32 +- don't block signals we expect to dump core.
34 4/11/2008 autofs-5.0.4
35 -----------------------
36 diff --git a/daemon/automount.c b/daemon/automount.c
37 index 44dcdd6..e7f801b 100644
38 --- a/daemon/automount.c
39 +++ b/daemon/automount.c
40 @@ -64,6 +64,8 @@ static int st_stat = 1;
41 static int *pst_stat = &st_stat;
42 static pthread_t state_mach_thid;
44 +static sigset_t block_sigs;
46 /* Pre-calculated kernel packet length */
47 static size_t kpkt_len;
49 @@ -1321,7 +1323,7 @@ static void *statemachine(void *arg)
53 - sigfillset(&signalset);
54 + memcpy(&signalset, &block_sigs, sizeof(signalset));
55 sigdelset(&signalset, SIGCHLD);
56 sigdelset(&signalset, SIGCONT);
58 @@ -1817,7 +1819,6 @@ int main(int argc, char *argv[])
59 unsigned foreground, have_global_options;
61 time_t age = time(NULL);
64 static const struct option long_options[] = {
66 @@ -1837,8 +1838,15 @@ int main(int argc, char *argv[])
70 - sigfillset(&allsigs);
71 - sigprocmask(SIG_BLOCK, &allsigs, NULL);
72 + sigfillset(&block_sigs);
73 + /* allow for the dropping of core files */
74 + sigdelset(&block_sigs, SIGABRT);
75 + sigdelset(&block_sigs, SIGBUS);
76 + sigdelset(&block_sigs, SIGSEGV);
77 + sigdelset(&block_sigs, SIGILL);
78 + sigdelset(&block_sigs, SIGFPE);
79 + sigdelset(&block_sigs, SIGTRAP);
80 + sigprocmask(SIG_BLOCK, &block_sigs, NULL);