]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: tty eol defaults to REPRINT
authorSami Loone <sami@loone.fi>
Tue, 9 Feb 2021 09:46:36 +0000 (10:46 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 10 Feb 2021 16:48:46 +0000 (17:48 +0100)
Adapting tty eol settings from defaults misbehaves as CTRL('r') aka
REPRINT is confused with CR. Consequently --skip-login does not set
tty CR<->NL translations and thus acts against advertised CR as eol
default.

[kzak@redhat.com:
   It seems this issue has been introduced by commit f566447 where we
   merged sulogin and agetty terminal initialization together to the file
   include/ttyutils.h.

  The original agetty has really used .eol=13 (aka CR) for the default.
  The problem is invisible for sulogin(1) because it always asks for a
  password and .eol= is set to NL/CR, the same agetty when it asks for
  username.]

Addresses: https://github.com/karelzak/util-linux/pull/1247
Signed-off-by: Karel Zak <kzak@redhat.com>
include/ttyutils.h

index f164a580fb4f24c004f93d5cd8e35bc4826a53c3..5f58460d6d81bf731e8ef02f330ff8a8baa627b9 100644 (file)
@@ -73,7 +73,7 @@ struct chardata {
 #define INIT_CHARDATA(ptr) do {              \
                (ptr)->erase    = DEF_ERASE; \
                (ptr)->kill     = DEF_KILL;  \
-               (ptr)->eol      = CTRL('r'); \
+               (ptr)->eol      = CR;        \
                (ptr)->parity   = 0;         \
                (ptr)->capslock = 0;         \
        } while (0)