|
|
5113bc |
From 7974045302fe53629e70501f0180f30cbaa25b1e Mon Sep 17 00:00:00 2001
|
|
|
5113bc |
From: Karel Zak <kzak@redhat.com>
|
|
|
5113bc |
Date: Wed, 6 Jun 2018 15:57:24 +0200
|
|
|
5113bc |
Subject: [PATCH 162/173] agetty: keep c_iflags unmodified on --autologin
|
|
|
5113bc |
|
|
|
5113bc |
agetty sets c_iflags according to interaction with serial line in
|
|
|
5113bc |
get_logname(). For --autologin it does not read from the line, so we
|
|
|
5113bc |
have no clue how to set the flags.
|
|
|
5113bc |
|
|
|
5113bc |
The current behavior is to zeroize the flags. Unfortunately, it seems
|
|
|
5113bc |
like bad idea, because the line may be already properly initialized by
|
|
|
5113bc |
kernel (or systemd, etc.).
|
|
|
5113bc |
|
|
|
5113bc |
The new behavior is not touch the flags on --autologin.
|
|
|
5113bc |
|
|
|
5113bc |
Upstream: http://github.com/karelzak/util-linux/commit/2c4d86abdadab19be76abecb156da7f7dc284d81
|
|
|
5113bc |
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1252764
|
|
|
5113bc |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
5113bc |
---
|
|
|
5113bc |
term-utils/agetty.8 | 4 ++++
|
|
|
5113bc |
term-utils/agetty.c | 17 +++++++++++++----
|
|
|
5113bc |
2 files changed, 17 insertions(+), 4 deletions(-)
|
|
|
5113bc |
|
|
|
5113bc |
diff --git a/term-utils/agetty.8 b/term-utils/agetty.8
|
|
|
5113bc |
index a42cdf158..fe4bfd427 100644
|
|
|
5113bc |
--- a/term-utils/agetty.8
|
|
|
5113bc |
+++ b/term-utils/agetty.8
|
|
|
5113bc |
@@ -94,6 +94,10 @@ password. The \-f \fIusername\fP option is added to the \fB/bin/login\fP
|
|
|
5113bc |
command line by default. The \-\-login-options option changes this default
|
|
|
5113bc |
behaviour and then only \\u is replaced by the \fIusername\fP and no other
|
|
|
5113bc |
option is added to the login command line.
|
|
|
5113bc |
+
|
|
|
5113bc |
+Note that \fB\-\-autologin\fP may affect the way how agetty initializes the
|
|
|
5113bc |
+serial line, because on auto-login agetty does not read from the line and it
|
|
|
5113bc |
+has no opportunity optimize the line setting.
|
|
|
5113bc |
.TP
|
|
|
5113bc |
\-c, \-\-noreset
|
|
|
5113bc |
Don't reset terminal cflags (control modes). See \fItermios(3)\fP for more
|
|
|
5113bc |
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
|
|
|
5113bc |
index b626cdbeb..948d77246 100644
|
|
|
5113bc |
--- a/term-utils/agetty.c
|
|
|
5113bc |
+++ b/term-utils/agetty.c
|
|
|
5113bc |
@@ -1100,13 +1100,22 @@ static void termio_init(struct options *op, struct termios *tp)
|
|
|
5113bc |
/* Flush input and output queues, important for modems! */
|
|
|
5113bc |
tcflush(STDIN_FILENO, TCIOFLUSH);
|
|
|
5113bc |
|
|
|
5113bc |
+ /* The defaul is set c_iflag in termio_final() according to chardata.
|
|
|
5113bc |
+ * Unfortunately, the chardata are not set according to the serial line
|
|
|
5113bc |
+ * if --autolog is enabled. In this case we do not read from the line
|
|
|
5113bc |
+ * at all. The best what we can do in this case is to keep c_iflag
|
|
|
5113bc |
+ * unmodified for --autolog.
|
|
|
5113bc |
+ */
|
|
|
5113bc |
+ if (!op->autolog) {
|
|
|
5113bc |
#ifdef IUTF8
|
|
|
5113bc |
- tp->c_iflag = tp->c_iflag & IUTF8;
|
|
|
5113bc |
- if (tp->c_iflag & IUTF8)
|
|
|
5113bc |
- op->flags |= F_UTF8;
|
|
|
5113bc |
+ tp->c_iflag = tp->c_iflag & IUTF8;
|
|
|
5113bc |
+ if (tp->c_iflag & IUTF8)
|
|
|
5113bc |
+ op->flags |= F_UTF8;
|
|
|
5113bc |
#else
|
|
|
5113bc |
- tp->c_iflag = 0;
|
|
|
5113bc |
+ tp->c_iflag = 0;
|
|
|
5113bc |
#endif
|
|
|
5113bc |
+ }
|
|
|
5113bc |
+
|
|
|
5113bc |
tp->c_lflag = 0;
|
|
|
5113bc |
tp->c_oflag &= OPOST | ONLCR;
|
|
|
5113bc |
|
|
|
5113bc |
--
|
|
|
5113bc |
2.14.4
|
|
|
5113bc |
|