X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmount%2Ffstab.c;fp=utils%2Fmount%2Ffstab.c;h=1fc9efe8e24410152c171b5a279c6cbb077565fb;hb=b3e190c4adfc9ec47567c968bd000d282d07b05e;hp=a742e648d0e4d133c7e24eb07f2c4d591ad44cd5;hpb=a99b7846e2abec5e26ab6b764b921d79559e0a0f;p=nfs-utils.git diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c index a742e64..1fc9efe 100644 --- a/utils/mount/fstab.c +++ b/utils/mount/fstab.c @@ -331,16 +331,43 @@ lock_mtab (void) { int sig = 0; struct sigaction sa; - sa.sa_handler = handler; sa.sa_flags = 0; sigfillset (&sa.sa_mask); - while (sigismember (&sa.sa_mask, ++sig) != -1 - && sig != SIGCHLD) { - if (sig == SIGALRM) + while (sigismember (&sa.sa_mask, ++sig) != -1) { + switch(sig) { + case SIGCHLD: + case SIGKILL: + case SIGCONT: + case SIGSTOP: + /* The cannot be caught, or should not, + * so don't even try. + */ + continue; + case SIGALRM: sa.sa_handler = setlkw_timeout; - else + break; + case SIGHUP: + case SIGINT: + case SIGQUIT: + case SIGWINCH: + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + case SIGPIPE: + case SIGXFSZ: + case SIGXCPU: + /* non-priv user can cause these to be + * generated, so ignore them. + */ + sa.sa_handler = SIG_IGN; + break; + default: + /* The rest should not be possible, so just + * print a message and unlock mtab. + */ sa.sa_handler = handler; + } sigaction (sig, &sa, (struct sigaction *) 0); } signals_have_been_setup = 1;