]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: test ECHO on c_lflag
authorKarel Zak <kzak@redhat.com>
Mon, 26 Sep 2011 10:34:10 +0000 (12:34 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 18 Oct 2011 12:22:27 +0000 (14:22 +0200)
Reported-by: xinglp <xinglp@gmail.com>
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=739522
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index 35bb3895455756adc0a9fbdce97f53c87b485adb..fc6bdebeb6d44766e9cc17ba8448744b64c0ee24 100644 (file)
@@ -1459,7 +1459,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
                        case '#':
                                cp->erase = ascval; /* set erase character */
                                if (bp > logname) {
-                                       if ((tp->c_cflag & (ECHO)) == 0)
+                                       if ((tp->c_lflag & ECHO) == 0)
                                                write_all(1, erase[cp->parity], 3);
                                        bp--;
                                }
@@ -1468,7 +1468,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
                        case '@':
                                cp->kill = ascval;              /* set kill character */
                                while (bp > logname) {
-                                       if ((tp->c_cflag & (ECHO)) == 0)
+                                       if ((tp->c_lflag & ECHO) == 0)
                                                write_all(1, erase[cp->parity], 3);
                                        bp--;
                                }
@@ -1480,7 +1480,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
                                        break;
                                if ((size_t)(bp - logname) >= sizeof(logname) - 1)
                                        log_err(_("%s: input overrun"), op->tty);
-                               if ((tp->c_cflag & (ECHO)) == 0)
+                               if ((tp->c_lflag & ECHO) == 0)
                                        write_all(1, &c, 1);    /* echo the character */
                                *bp++ = ascval;                 /* and store it */
                                break;