diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-09-06 13:28:10 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-09-06 13:28:10 +0200 |
| commit | 9e71e3cea59c06d40234d8f3363c3f05112e8d5a (patch) | |
| tree | 1a483c9e1482fa83465563f15f1ad2ecaef22e98 /shell | |
| parent | 50157f3decce78d3172314a5f97363faedba565a (diff) | |
| download | busybox-w32-9e71e3cea59c06d40234d8f3363c3f05112e8d5a.tar.gz busybox-w32-9e71e3cea59c06d40234d8f3363c3f05112e8d5a.tar.bz2 busybox-w32-9e71e3cea59c06d40234d8f3363c3f05112e8d5a.zip | |
ash: fix "read -s" + ^C. Closes 5504
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/ash.c | 5 | ||||
| -rw-r--r-- | shell/shell_common.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index b20c32b89..153bcc057 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -12803,6 +12803,10 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 12803 | } | 12803 | } |
| 12804 | } | 12804 | } |
| 12805 | 12805 | ||
| 12806 | /* "read -s" needs to save/restore termios, can't allow ^C | ||
| 12807 | * to jump out of it. | ||
| 12808 | */ | ||
| 12809 | INT_OFF; | ||
| 12806 | r = shell_builtin_read(setvar2, | 12810 | r = shell_builtin_read(setvar2, |
| 12807 | argptr, | 12811 | argptr, |
| 12808 | bltinlookup("IFS"), /* can be NULL */ | 12812 | bltinlookup("IFS"), /* can be NULL */ |
| @@ -12812,6 +12816,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 12812 | opt_t, | 12816 | opt_t, |
| 12813 | opt_u | 12817 | opt_u |
| 12814 | ); | 12818 | ); |
| 12819 | INT_ON; | ||
| 12815 | 12820 | ||
| 12816 | if ((uintptr_t)r > 1) | 12821 | if ((uintptr_t)r > 1) |
| 12817 | ash_msg_and_raise_error(r); | 12822 | ash_msg_and_raise_error(r); |
diff --git a/shell/shell_common.c b/shell/shell_common.c index 780e27ebd..0051f21d9 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c | |||
| @@ -170,7 +170,7 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val), | |||
| 170 | int timeout; | 170 | int timeout; |
| 171 | 171 | ||
| 172 | if ((bufpos & 0xff) == 0) | 172 | if ((bufpos & 0xff) == 0) |
| 173 | buffer = xrealloc(buffer, bufpos + 0x100); | 173 | buffer = xrealloc(buffer, bufpos + 0x101); |
| 174 | 174 | ||
| 175 | timeout = -1; | 175 | timeout = -1; |
| 176 | if (end_ms) { | 176 | if (end_ms) { |
