diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-10-31 11:53:41 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-10-31 11:53:41 +0100 |
commit | bc3ec7bd45814a75845529fd0aca5c5a9d9f0c14 (patch) | |
tree | aa2d20a8f74779e5a7f95bf2757fbd557883365e /udev/udevadm-settle.c | |
parent | 88fbff03df6be4f0f71df11047d4a31daed357e4 (diff) |
unblock signals we might want to handle
On Thu, Oct 29, 2009 at 19:15, Christian P. Schmidt <schmidt@digadd.de> wrote:
> After the getty replaces itself with login the pam module pam_mount
> calls mount. This in turn determines that the partition to be mounted is
> LUKS encrypted, and calls cryptsetup. Cryptsetup receives the password,
> unlocks the partition, and calls udevadm settle in order to avoid some
> problems in interaction with LVM.
>
> udevadm settle never returns.
>
> The problem here is that SIGUSR1 and SIGALRM are both blocked in oldmask
> already, and never reach udevadm. No care is ever taken to ensure those
> signals are not blocked.
Diffstat (limited to 'udev/udevadm-settle.c')
-rw-r--r-- | udev/udevadm-settle.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/udev/udevadm-settle.c b/udev/udevadm-settle.c index 5030f18602..4f422f9092 100644 --- a/udev/udevadm-settle.c +++ b/udev/udevadm-settle.c @@ -66,6 +66,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) const char *exists = NULL; int timeout = DEFAULT_TIMEOUT; struct sigaction act; + sigset_t mask; struct udev_queue *udev_queue = NULL; int rc = 1; @@ -78,6 +79,10 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) act.sa_flags = 0; sigaction(SIGALRM, &act, NULL); sigaction(SIGUSR1, &act, NULL); + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + sigaddset(&mask, SIGALRM); + sigprocmask(SIG_UNBLOCK, &mask, NULL); while (1) { int option; @@ -163,7 +168,7 @@ int udevadm_settle(struct udev *udev, int argc, char *argv[]) uctrl = udev_ctrl_new_from_socket(udev, UDEV_CTRL_SOCK_PATH); if (uctrl != NULL) { - sigset_t mask, oldmask; + sigset_t oldmask; sigemptyset(&mask); sigaddset(&mask, SIGUSR1); |