]> 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>
Mon, 26 Sep 2011 10:34:10 +0000 (12:34 +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 8398015cc01f3eba19b6c08ea73b017bef179b00..75c2b1453b9433aa07a1ee91578cd297b6207f90 100644 (file)
@@ -1466,7 +1466,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--;
                                }
@@ -1475,7 +1475,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--;
                                }
@@ -1487,7 +1487,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;