From 11ffed50b537d37f8aad3cbdfc4cc2b03e46eacb Mon Sep 17 00:00:00 2001 From: Dennis Groenen Date: Fri, 27 Apr 2012 10:55:25 +0200 Subject: [PATCH] apply BusyBox 1.20.0 hotfixes --- ...x-history-saving-when-history-MAX_HISTORY.patch | 36 -------------------- debian/patches/hotfixes/busybox-1.20.0-getty.patch | 17 +++++++++ .../patches/hotfixes/busybox-1.20.0-lineedit.patch | 22 ++++++++++++ debian/patches/hotfixes/busybox-1.20.0-sed.patch | 29 ++++++++++++++++ debian/patches/series | 4 ++- 5 files changed, 71 insertions(+), 37 deletions(-) delete mode 100644 debian/patches/0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch create mode 100644 debian/patches/hotfixes/busybox-1.20.0-getty.patch create mode 100644 debian/patches/hotfixes/busybox-1.20.0-lineedit.patch create mode 100644 debian/patches/hotfixes/busybox-1.20.0-sed.patch diff --git a/debian/patches/0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch b/debian/patches/0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch deleted file mode 100644 index 70020fd..0000000 --- a/debian/patches/0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 75e6cc9e70e426f7cdfd552585506360d7537f7c Mon Sep 17 00:00:00 2001 -From: Dennis Groenen -Date: Wed, 7 Sep 2011 20:24:21 +0200 -Subject: [PATCH 1/4] lineedit: fix history saving when history < MAX_HISTORY - ---- - libbb/lineedit.c | 6 ++---- - 1 files changed, 2 insertions(+), 4 deletions(-) - -diff --git a/libbb/lineedit.c b/libbb/lineedit.c -index 603bbfc..a8b4609 100644 ---- a/libbb/lineedit.c -+++ b/libbb/lineedit.c -@@ -1352,8 +1352,7 @@ static void load_history(line_input_t *st_parm) - /* fill temp_h[], retaining only last MAX_HISTORY lines */ - memset(temp_h, 0, sizeof(temp_h)); - idx = 0; -- if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) -- st_parm->cnt_history_in_file = 0; -+ st_parm->cnt_history_in_file = 0; - while ((line = xmalloc_fgetline(fp)) != NULL) { - if (line[0] == '\0') { - free(line); -@@ -1361,8 +1360,7 @@ static void load_history(line_input_t *st_parm) - } - free(temp_h[idx]); - temp_h[idx] = line; -- if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) -- st_parm->cnt_history_in_file++; -+ st_parm->cnt_history_in_file++; - idx++; - if (idx == st_parm->max_history) - idx = 0; --- -1.7.6.1 - diff --git a/debian/patches/hotfixes/busybox-1.20.0-getty.patch b/debian/patches/hotfixes/busybox-1.20.0-getty.patch new file mode 100644 index 0000000..ed52159 --- /dev/null +++ b/debian/patches/hotfixes/busybox-1.20.0-getty.patch @@ -0,0 +1,17 @@ +--- busybox-1.20.0/loginutils/getty.c ++++ busybox-1.20.0-getty/loginutils/getty.c +@@ -561,8 +561,14 @@ int getty_main(int argc UNUSED_PARAM, ch + */ + fd = open("/dev/tty", O_RDWR | O_NONBLOCK); + if (fd >= 0) { ++ /* TIOCNOTTY sends SIGHUP to the foreground ++ * process group - which may include us! ++ * Make sure to not die on it: ++ */ ++ sighandler_t old = signal(SIGHUP, SIG_IGN); + ioctl(fd, TIOCNOTTY); + close(fd); ++ signal(SIGHUP, old); + } + } + diff --git a/debian/patches/hotfixes/busybox-1.20.0-lineedit.patch b/debian/patches/hotfixes/busybox-1.20.0-lineedit.patch new file mode 100644 index 0000000..ee236ff --- /dev/null +++ b/debian/patches/hotfixes/busybox-1.20.0-lineedit.patch @@ -0,0 +1,22 @@ +--- busybox-1.20.0/libbb/lineedit.c ++++ busybox-1.20.0-lineedit/libbb/lineedit.c +@@ -1352,8 +1352,7 @@ static void load_history(line_input_t *s + /* fill temp_h[], retaining only last MAX_HISTORY lines */ + memset(temp_h, 0, sizeof(temp_h)); + idx = 0; +- if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) +- st_parm->cnt_history_in_file = 0; ++ st_parm->cnt_history_in_file = 0; + while ((line = xmalloc_fgetline(fp)) != NULL) { + if (line[0] == '\0') { + free(line); +@@ -1361,8 +1360,7 @@ static void load_history(line_input_t *s + } + free(temp_h[idx]); + temp_h[idx] = line; +- if (!ENABLE_FEATURE_EDITING_SAVE_ON_EXIT) +- st_parm->cnt_history_in_file++; ++ st_parm->cnt_history_in_file++; + idx++; + if (idx == st_parm->max_history) + idx = 0; diff --git a/debian/patches/hotfixes/busybox-1.20.0-sed.patch b/debian/patches/hotfixes/busybox-1.20.0-sed.patch new file mode 100644 index 0000000..70dc63f --- /dev/null +++ b/debian/patches/hotfixes/busybox-1.20.0-sed.patch @@ -0,0 +1,29 @@ +--- busybox-1.20.0/editors/sed.c ++++ busybox-1.20.0-sed/editors/sed.c +@@ -743,7 +743,7 @@ static int do_subst_command(sed_cmd_t *s + */ + if (!G.regmatch[0].rm_so && !G.regmatch[0].rm_eo && match_count) { + pipe_putc(*line++); +- continue; ++ goto next; + } + + match_count++; +@@ -755,7 +755,7 @@ static int do_subst_command(sed_cmd_t *s + ) { + for (i = 0; i < G.regmatch[0].rm_eo; i++) + pipe_putc(*line++); +- continue; ++ goto next; + } + + /* print everything before the match */ +@@ -773,7 +773,7 @@ static int do_subst_command(sed_cmd_t *s + /* if we're not doing this globally, get out now */ + if (sed_cmd->which_match != 0) + break; +- ++ next: + if (*line == '\0') + break; + diff --git a/debian/patches/series b/debian/patches/series index a007471..6242d20 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -21,9 +21,11 @@ ps-accept-and-ignore-missing-options.patch showkey-default-option.patch #Hotfixes +hotfixes/busybox-1.20.0-getty.patch +hotfixes/busybox-1.20.0-lineedit.patch +hotfixes/busybox-1.20.0-sed.patch #Patched pulled from busybox git #Miscellaneous -0001-lineedit-fix-history-saving-when-history-MAX_HISTORY.patch -- 1.7.9.5