diff options
author | Karel Zak | 2017-03-27 14:54:39 +0200 |
---|---|---|
committer | Karel Zak | 2017-03-27 14:54:39 +0200 |
commit | 790119b8850ae13bb4254c5096a54b2aeb355b20 (patch) | |
tree | 27860e60ec38db62619935773437df4dba5037df /lib/idcache.c | |
parent | unshare: add note about persisten PID namespaces (diff) | |
download | kernel-qcow2-util-linux-790119b8850ae13bb4254c5096a54b2aeb355b20.tar.gz kernel-qcow2-util-linux-790119b8850ae13bb4254c5096a54b2aeb355b20.tar.xz kernel-qcow2-util-linux-790119b8850ae13bb4254c5096a54b2aeb355b20.zip |
agetty: fix characters reorder in login prompt
The current agetty uses TIOCSTI ioctl to return already read chars
from login name back to the terminal (without read() before
tcsetattr() we will lost data already written by user). The ioctl
based solution is fragile due to race -- we can return chars when
terminal already contains another new chars. The result is reordered
chars in login name.
The solution is to use extra buffer for already read data.
Reported-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/idcache.c')
-rw-r--r-- | lib/idcache.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/idcache.c b/lib/idcache.c index a1a957b93..2facf13e0 100644 --- a/lib/idcache.c +++ b/lib/idcache.c @@ -7,10 +7,6 @@ #include "c.h" #include "idcache.h" -#ifndef LOGIN_NAME_MAX -#define LOGIN_NAME_MAX 256 -#endif - struct identry *get_id(struct idcache *ic, unsigned long int id) { struct identry *ent; |