summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorKarel Zak2018-06-06 15:57:24 +0200
committerKarel Zak2018-06-06 15:57:24 +0200
commit2c4d86abdadab19be76abecb156da7f7dc284d81 (patch)
treeb72b0b850f49e466bf4ee0869f3895d660f7c594 /term-utils/agetty.c
parenttests: add empty column test (diff)
downloadkernel-qcow2-util-linux-2c4d86abdadab19be76abecb156da7f7dc284d81.tar.gz
kernel-qcow2-util-linux-2c4d86abdadab19be76abecb156da7f7dc284d81.tar.xz
kernel-qcow2-util-linux-2c4d86abdadab19be76abecb156da7f7dc284d81.zip
agetty: keep c_iflags unmodified on --autologin
agetty sets c_iflags according to interaction with serial line in get_logname(). For --autologin it does not read from the line, so we have no clue how to set the flags. The current behavior is to zeroize the flags. Unfortunately, it seems like bad idea, because the line may be already properly initialized by kernel (or systemd, etc.). The new behavior is not touch the flags on --autologin. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1252764 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 844220401..e22600e28 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1264,13 +1264,22 @@ static void termio_init(struct options *op, struct termios *tp)
* later on.
*/
+ /* The defaul is set c_iflag in termio_final() according to chardata.
+ * Unfortunately, the chardata are not set according to the serial line
+ * if --autolog is enabled. In this case we do not read from the line
+ * at all. The best what we can do in this case is to keep c_iflag
+ * unmodified for --autolog.
+ */
+ if (!op->autolog) {
#ifdef IUTF8
- tp->c_iflag = tp->c_iflag & IUTF8;
- if (tp->c_iflag & IUTF8)
- op->flags |= F_UTF8;
+ tp->c_iflag = tp->c_iflag & IUTF8;
+ if (tp->c_iflag & IUTF8)
+ op->flags |= F_UTF8;
#else
- tp->c_iflag = 0;
+ tp->c_iflag = 0;
#endif
+ }
+
tp->c_lflag = 0;
tp->c_oflag &= OPOST | ONLCR;