chiark / gitweb /
ask-password: ask for passphrases not only on the first console of /dev/console
authorWerner Fink <werner@suse.de>
Wed, 18 Nov 2015 11:28:30 +0000 (12:28 +0100)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:12:58 +0000 (10:12 +0200)
commite3d4e3cc9bd2e9c9e421cdea775e35f529b46b3a
treeeda157a3655061d9bd2e2a7d93d48679c32ade1f
parentf54b3c4300b9c2be764969607ea6574ff9dfe276
ask-password: ask for passphrases not only on the first console of /dev/console

but also on all other consoles.  This does help on e.g. mainframes
where often a serial console together with other consoles are
used.  Even rack based servers attachted to both a serial console
as well as having a virtual console do sometimes miss a connected
monitor.

To be able to ask on all terminal devices of /dev/console the devices
are collected. If more than one device are found, then on each of the
terminals a inquiring task for passphrase is forked and do not return
to the caller.

Every task has its own session and its own controlling terminal.
If one of the tasks does handle a password, the remaining tasks
will be terminated.

Also let contradictory options on the command of
elogind-tty-ask-password-agent fail.

Spwan for each device of the system console /dev/console a own process.
Replace the system call wait() with with system call waitid().
Use SIGTERM instead of SIGHUP to get unresponsive childs down.

Port the collect_consoles() function forward to a pulbic and strv
based function "get_kernel_consoles()" in terminal-util.c and use this
in tty-ask-password-agent.c.
src/basic/terminal-util.c