Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:Update
python-libmount
util-linux-agetty-smart-reload-08.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File util-linux-agetty-smart-reload-08.patch of Package python-libmount
Refresh. From 8b58ffddf44ab020fa61a9df202358c6db485b5f Mon Sep 17 00:00:00 2001 From: Lubomir Rintel <lkundrak@v3.sk> Date: Fri, 19 Oct 2018 22:08:17 +0200 Subject: [PATCH 08/14] agetty: don't put the VC into canonical mode The wait_for_term_input()'s select() needs to be tripped when the user starts typing. Otherwise the reloads can abort an already in-progress login. Coupled with \4 and \6 expansions that happen to be there on Fedora Server, this means reload on every netlink event. With a couple of IPv6 routers announcing their networks and temporary addresses in use can make it sometimes virtually impossible to log in. Seems like zero lflags do the job just fine on a Linux VT. Reset it to canonical mode before running login. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com> --- term-utils/agetty.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) Index: util-linux-2.29.2/term-utils/agetty.c =================================================================== --- util-linux-2.29.2.orig/term-utils/agetty.c +++ util-linux-2.29.2/term-utils/agetty.c @@ -304,7 +304,7 @@ static void parse_speeds(struct options static void update_utmp(struct options *op); static void open_tty(char *tty, struct termios *tp, struct options *op); static void termio_init(struct options *op, struct termios *tp); -static void reset_vc (const struct options *op, struct termios *tp); +static void reset_vc(const struct options *op, struct termios *tp, int canon); static void auto_baud(struct termios *tp); static void output_special_char (struct issue *ie, unsigned char c, struct options *op, struct termios *tp, FILE *fp); @@ -485,13 +485,14 @@ int main(int argc, char **argv) if (options.timeout) alarm(0); - if ((options.flags & F_VCONSOLE) == 0) { - /* Finalize the termios settings. */ + /* Finalize the termios settings. */ + if ((options.flags & F_VCONSOLE) == 0) termio_final(&options, &termios, &chardata); + else + reset_vc(&options, &termios, 1); - /* Now the newline character should be properly written. */ - write_all(STDOUT_FILENO, "\r\n", 2); - } + /* Now the newline character should be properly written. */ + write_all(STDOUT_FILENO, "\r\n", 2); sigaction(SIGQUIT, &sa_quit, NULL); sigaction(SIGINT, &sa_int, NULL); @@ -1241,7 +1242,7 @@ static void termio_init(struct options * setlocale(LC_CTYPE, "POSIX"); op->flags &= ~F_UTF8; #endif - reset_vc(op, tp); + reset_vc(op, tp, 0); if ((tp->c_cflag & (CS8|PARODD|PARENB)) == CS8) op->flags |= F_EIGHTBITS; @@ -1347,7 +1348,7 @@ static void termio_init(struct options * } /* Reset virtual console on stdin to its defaults */ -static void reset_vc(const struct options *op, struct termios *tp) +static void reset_vc(const struct options *op, struct termios *tp, int canon) { int fl = 0; @@ -1356,6 +1357,15 @@ static void reset_vc(const struct option reset_virtual_console(tp, fl); +#ifdef AGETTY_RELOAD + /* + * Discard all the flags that makes the line go canonical with echoing. + * We need to know when the user starts typing. + */ + if (canon == 0) + tp->c_lflag = 0; +#endif + if (tcsetattr(STDIN_FILENO, TCSADRAIN, tp)) log_warn(_("setting terminal attributes failed: %m"));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor