summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorKarel Zak2017-06-23 14:26:47 +0200
committerKarel Zak2017-06-23 14:26:47 +0200
commit2a14beb4e9c6cdf4466993741d86e45dd57ddef3 (patch)
tree6462e9b6bd94fdf2b672eae538a39ae3bc5dae24 /sys-utils/lscpu.c
parentMerge branch 'master' of https://github.com/pali/util-linux (diff)
downloadkernel-qcow2-util-linux-2a14beb4e9c6cdf4466993741d86e45dd57ddef3.tar.gz
kernel-qcow2-util-linux-2a14beb4e9c6cdf4466993741d86e45dd57ddef3.tar.xz
kernel-qcow2-util-linux-2a14beb4e9c6cdf4466993741d86e45dd57ddef3.zip
agetty: fix login name DEL/CTRL^U issue
agetty refresh prompt (/etc/issue file etc.) when requested by inotify or netlink. For this purpose we monitor some file descriptors by select(). The terminal input file descriptor is switched to non-canonical mode before select(). The goal is to be informed about user activity before new-line. The FD is immediately switched back to canonical mode when activity is detected. The side effect is that all not-read-yet chars in the input buffer are lost ... so we need to call read() before switch to canonical mode to save the chars. The original implementation has been based on TIOCSTI ioctl. It returns already read chars back to the terminal input buffer to make them useful for canonical mode. The problem was race (agetty writes to input buffer in the same time as user) and result was reordered chars in login name... so useless. This issue has been later fixed by extra buffer (commit 790119b8850ae13bb4254c5096a54b2aeb355b20) for already read data. And TIOCSTI ioctl has been removed. Unfortunately this solution is also wrong, because the buffer is maintained only by agetty and inaccessible for terminal when user edit (by DEL/CTRL^U) login name in canonical mode. The solution is simple -- just don't try to be smart and keep terminal in canonical mode all time (so terminal controls DEL, CTRL^U, etc) and flush input buffer (=discard unread data) and ask user for login name again after prompt reload. The agetty reload is very rarely situation and for user it's pretty obvious that he has to type login name again (as all terminal has been clear+redraw). Addresses: https://github.com/karelzak/util-linux/issues/454 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1464148 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/lscpu.c')
0 files changed, 0 insertions, 0 deletions