Bug 62821
Summary: | Console allows login prompt to be backspaced after delete key | ||
---|---|---|---|
Product: | Drivers | Reporter: | Phillip Susi (phill) |
Component: | Console/Framebuffers | Assignee: | James Simmons (jsimmons) |
Status: | CLOSED INVALID | ||
Severity: | low | CC: | alan |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.8.11 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Phillip Susi
2013-10-11 01:35:16 UTC
As far as I can see this is entirely userspace. File an ubuntu buggy against whatever getty is being used. Please bother reading before closing bugs; I clearly explained that getty is ruled out. Please bother learning how the tty layer works. A snarky comment does not explain where the problem is nor why it shouldn't be fixed. I believe I do know how the tty layer works, which should be evident in my analysis of the problem. If you are going to mark a bug as wont fix, then you need to explain why the fix would be undesirable. The tty layer implements posix tty semantics and an emulated vt console. The behaviour you see is what I would expect for the terminal settings in use by the standard getty process on a console and identical to a real vt terminal which is the benchmark. The "del" button on a keyboard is by default mapped to ^[[3 Now does it make sense ? Yes, that is the problem: the del key counts as 4 bytes, so 4 gets added to the count of characters on the line, and so you can backspace those 4 characters. This is what happens with echoctl on. With it off, those characters are not echoed, and so should not allow 4 backspaces. It appears that what is going on is that the 4 characters are added, then the check for -ecoctl is made, and only one of them is subtracted back out, leaving you able to backspace 3 extra characters that you are not supposed to be able to backspace ( because they were never echoed ). Under a pty in an ssh session with -echoctl, it correctly does not allow you to backspace extra unechoed characters. The console tty driver should behave the same way, and it is fairly obvious that it tries to, but didn't get it right. The characters *are* echoed. They don't produce output movements but the tty layer does not know that If that were true, then you would be able to backspace all 4 characters, not just 3, and pseudo terminals would behave the same way. All 4 characters ???? there are 3. The pty case is different because the key codes are not the same. Please learn about the tty layer or let someone in Ubuntu who understands tty coding help you. In particular ask them to explain the userspace C library "readline" if you want your getty to be "smart". |