]> git.pld-linux.org Git - packages/autofs.git/blob - autofs-5.0.4-allow-automount-daemon-to-dump-core.patch
2542621202c9c3924e8c9d69eff2b250df65cecc
[packages/autofs.git] / autofs-5.0.4-allow-automount-daemon-to-dump-core.patch
1 autofs-5.0.4 - allow the automount daemon to dump core
2
3 From: Jeff Moyer <jmoyer@redhat.com>
4
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.
8
9 I tested this by sending SIGBUS and SIGSEGV to the automount daemon.
10
11 edit - raven
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.
15
16 Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
17 ---
18
19  CHANGELOG          |    1 +
20  daemon/automount.c |   16 ++++++++++++----
21  2 files changed, 13 insertions(+), 4 deletions(-)
22
23
24 diff --git a/CHANGELOG b/CHANGELOG
25 index 7f27f5e..4b85649 100644
26 --- a/CHANGELOG
27 +++ b/CHANGELOG
28 @@ -57,6 +57,7 @@
29  - mannual umount recovery fixes.
30  - fix map type info parse error.
31  - fix an RPC fd leak.
32 +- don't block signals we expect to dump core.
33  
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;
43  
44 +static sigset_t block_sigs;
45 +
46  /* Pre-calculated kernel packet length */
47  static size_t kpkt_len;
48  
49 @@ -1321,7 +1323,7 @@ static void *statemachine(void *arg)
50         sigset_t signalset;
51         int sig;
52  
53 -       sigfillset(&signalset);
54 +       memcpy(&signalset, &block_sigs, sizeof(signalset));
55         sigdelset(&signalset, SIGCHLD);
56         sigdelset(&signalset, SIGCONT);
57  
58 @@ -1817,7 +1819,6 @@ int main(int argc, char *argv[])
59         unsigned foreground, have_global_options;
60         time_t timeout;
61         time_t age = time(NULL);
62 -       sigset_t allsigs;
63         struct rlimit rlim;
64         static const struct option long_options[] = {
65                 {"help", 0, 0, 'h'},
66 @@ -1837,8 +1838,15 @@ int main(int argc, char *argv[])
67                 {0, 0, 0, 0}
68         };
69  
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);
81  
82         program = argv[0];
83  
This page took 0.055025 seconds and 2 git commands to generate.