Hello,
As e2fsck/util.c logic infinitely reads single bytes from stdin and
ignores anything until a byte with y/n meaning occurs, many other escape
sequences will trigger this bug. Here are few examples of affected
locales and keys in some terminals (but there are more for sure):
Key presses interpreted as Yes if French locale (fr.po) (y is localized
as o) is used:
xterm terminfo: F1, F2, F3, F4
urxvt: CTRL-LEFT arrow
cs.po (y is localized as a):
linux: F1, UP arrow
xterm: UP arrow
-- untested: --
vi.po (y is localized as c):
linux: F3, LEFT arrow
xterm: LEFT arrow
tr.po (y is localized as e):
linux: F5
Here is simple patch that reads more bytes at once (I set this to 100
but have no clue), so it will discard escape sequences of <= 100 bytes
length.
Although if you press 100 times some key generating escape sequence,
this read_a_char() function will break and it will be treated as Yes.
This is caused by "if (fail++ > 100)" condition that was never triggered
in normal operation, but now it can fail. Calling ask_yn() function do
not appear to handle this correctly.
diff --git a/e2fsck/util.c b/e2fsck/util.c
index 56c6b35..48dc919 100644
--- a/e2fsck/util.c
+++ b/e2fsck/util.c
@@ -121,7 +121,7 @@ static int read_a_char(void)
(e2fsck_global_ctx->flags & E2F_FLAG_CANCEL)) {
return 3;
}
- r = read(0, &c, 1);
+ r = read(0, &c, 100);
if (r == 1)
return c;
if (fail++ > 100)
Cheers, Petr
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org