diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2021-03-09 17:46:52 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2021-03-13 21:18:02 +0100 |
commit | c1f3c52564fdec85394e7c338f56df0943ce8b10 (patch) | |
tree | 8a659d80b078c98d23c9ba200b0c4db25723820c /package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch | |
parent | 79b6a4bd3cabf6ae711e1e8f82ce43f717696cf4 (diff) | |
download | upstream-c1f3c52564fdec85394e7c338f56df0943ce8b10.tar.gz upstream-c1f3c52564fdec85394e7c338f56df0943ce8b10.tar.bz2 upstream-c1f3c52564fdec85394e7c338f56df0943ce8b10.zip |
busybox: backport fixes for 1.33.0
Backport two fixes for 1.33.0
* history file storing
* traceroute command option parsing
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch')
-rw-r--r-- | package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch b/package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch new file mode 100644 index 0000000000..b495227d9f --- /dev/null +++ b/package/utils/busybox/patches/001-backport1330fix-ash-make-strdup-copy.patch @@ -0,0 +1,40 @@ +From 67cc582d4289c5de521d11b08307c8ab26ee1e28 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko <vda.linux@googlemail.com> +Date: Sun, 3 Jan 2021 10:55:39 +0100 +Subject: ash: make a strdup copy of $HISTFILE for line editing + +Otherwise if $HISTFILE is unset or reassigned, bad things can happen. + +function old new delta +ash_main 1210 1218 +8 + +Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> +--- + shell/ash.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/shell/ash.c b/shell/ash.c +index f16d7fb6a..ecbfbf091 100644 +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -14499,7 +14499,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) + + if (sflag || minusc == NULL) { + #if MAX_HISTORY > 0 && ENABLE_FEATURE_EDITING_SAVEHISTORY +- if (iflag) { ++ if (line_input_state) { + const char *hp = lookupvar("HISTFILE"); + if (!hp) { + hp = lookupvar("HOME"); +@@ -14513,7 +14513,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv) + } + } + if (hp) +- line_input_state->hist_file = hp; ++ line_input_state->hist_file = xstrdup(hp); + # if ENABLE_FEATURE_SH_HISTFILESIZE + hp = lookupvar("HISTFILESIZE"); + line_input_state->max_history = size_from_HISTFILESIZE(hp); +-- +cgit v1.2.1 + |