diff options
| author | root <root@alpha.trunkmasters.com> | 2026-07-27 03:04:55 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-07-27 03:04:55 -0500 |
| commit | cae7be1ab2bd23fee3929a8e940d968ee86a78e6 (patch) | |
| tree | 97cc406771ec329a0480aab0f7fad2319be66e5c /app-shells | |
| parent | 704373259ee68c274d8ce04949a32d64de4b6014 (diff) | |
| download | baldeagleos-repo-cae7be1ab2bd23fee3929a8e940d968ee86a78e6.tar.gz baldeagleos-repo-cae7be1ab2bd23fee3929a8e940d968ee86a78e6.tar.xz baldeagleos-repo-cae7be1ab2bd23fee3929a8e940d968ee86a78e6.zip | |
Adding metadata
Diffstat (limited to 'app-shells')
3 files changed, 0 insertions, 270 deletions
diff --git a/app-shells/dash/files/0001-builtin-Fix-octal-escapes-in-dollar-single-quotes.patch b/app-shells/dash/files/0001-builtin-Fix-octal-escapes-in-dollar-single-quotes.patch deleted file mode 100644 index 63da50ae880a..000000000000 --- a/app-shells/dash/files/0001-builtin-Fix-octal-escapes-in-dollar-single-quotes.patch +++ /dev/null @@ -1,88 +0,0 @@ -From cd610905162812ca7dcf246b3dc46bce5e28e7cb Mon Sep 17 00:00:00 2001 -Message-ID: <cd610905162812ca7dcf246b3dc46bce5e28e7cb.1781226895.git.sam@gentoo.org> -From: Kerin Millar <kfm@plushkava.net> -Date: Sun, 31 May 2026 13:36:09 +0800 -Subject: [PATCH 1/2] builtin: Fix octal escapes in dollar-single-quotes - -The test suite of gentoo-functions recently uncovered a bug concerning -the handling of octal escape sequences within dollar-single-quotes. -Here is a reproducer: - - $ dash -c "x=\$'\\201'; printf '%s' \"\$x\"" | od -An -tx1 - 88 - -That is, despite the input being 0x81, the output is 0x88. Indeed, any -input between 0x81..0x88 is adversely affected and some - such as 0x82 - -induce a segfault. - -I noticed the following macros in src/parser.h: - - #define CTL_FIRST -127 /* first 'special' character */ - #define CTLESC -127 /* escape next character */ - #define CTL_LAST -120 /* last 'special' character */ - -Reinterpreted as unsigned char, the CTL_FIRST..CTL_LAST range maps -exactly to 0x81..0x88: - - $ perl -e 'printf "%x\0", $_ & 0xFF for -127..-120' | xargs -0 - 81 82 83 84 85 86 87 88 - -From this, I was able to deduce that all of these bytes must be preceded -by CTLESC in order to be taken literally. Make it so. - -Link: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=947090fb7704 -Signed-off-by: Kerin Millar <kfm@plushkava.net> - -The escape should also be applied to \x sequences. In fact \x81 -was totally broken as it produced a multi-byte character. Fix this -by merging these two code paths. - -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> ---- - src/bltin/printf.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/bltin/printf.c b/src/bltin/printf.c -index 106aecd..671e781 100644 ---- a/src/bltin/printf.c -+++ b/src/bltin/printf.c -@@ -332,6 +332,7 @@ unsigned conv_escape(char *str0, char *out0, bool mbchar) - char *out = out0; - char *str = str0; - unsigned value; -+ int och; - int ch; - - ch = *str; -@@ -359,12 +360,18 @@ unsigned conv_escape(char *str0, char *out0, bool mbchar) - } - - str--; -+ -+check_value: -+ if (mbchar && (signed char)value >= CTL_FIRST && -+ (signed char)value <= CTL_LAST) -+ USTPUTC(CTLESC, out); - break; - - case 'x': - ch = 2; - - hex: -+ och = ch; - value = 0; - do { - int c = *++str; -@@ -391,6 +398,9 @@ hex: - if (value < 0x80) - break; - -+ if (och <= 2) -+ goto check_value; -+ - if (value < 0x110000) { - int mboff = (mbchar - 1) * 2; - unsigned uni = value; --- -2.54.0 - diff --git a/app-shells/dash/files/0002-builtin-Fix-unaligned-access-in-conv_escape.patch b/app-shells/dash/files/0002-builtin-Fix-unaligned-access-in-conv_escape.patch deleted file mode 100644 index 05a92a295021..000000000000 --- a/app-shells/dash/files/0002-builtin-Fix-unaligned-access-in-conv_escape.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 28c4d5b126e336f1632c074fa002969ff42e7a51 Mon Sep 17 00:00:00 2001 -Message-ID: <28c4d5b126e336f1632c074fa002969ff42e7a51.1781226895.git.sam@gentoo.org> -In-Reply-To: <cd610905162812ca7dcf246b3dc46bce5e28e7cb.1781226895.git.sam@gentoo.org> -References: <cd610905162812ca7dcf246b3dc46bce5e28e7cb.1781226895.git.sam@gentoo.org> -From: Herbert Xu <herbert@gondor.apana.org.au> -Date: Sun, 31 May 2026 13:51:02 +0800 -Subject: [PATCH 2/2] builtin: Fix unaligned access in conv_escape - -When writing out the unicode character in conv_escape, use memcpy -instead of direct assignment as the output buffer may not be aligned -sufficiently. - -Reported-by: Nathan Mills <the.true.nathan.mills@gmail.com> -Fixes: 776424a8f915 ("parser: Add dollar single quote") -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> ---- - src/bltin/printf.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bltin/printf.c b/src/bltin/printf.c -index 671e781..c2c3615 100644 ---- a/src/bltin/printf.c -+++ b/src/bltin/printf.c -@@ -429,7 +429,7 @@ hex: - USTPUTC(CTLMBCHAR, out); - USTPUTC(len, out); - STADJUST(mboff, out); -- *(uint32_t *)out = value; -+ memcpy(out, &value, 4); - STADJUST(len, out); - USTPUTC(len, out); - USTPUTC(CTLMBCHAR, out); --- -2.54.0 - diff --git a/app-shells/dash/files/0003-input-Fix-overeager-NUL-deletion-in-SMALL-mode.patch b/app-shells/dash/files/0003-input-Fix-overeager-NUL-deletion-in-SMALL-mode.patch deleted file mode 100644 index 6e17a9d031bc..000000000000 --- a/app-shells/dash/files/0003-input-Fix-overeager-NUL-deletion-in-SMALL-mode.patch +++ /dev/null @@ -1,147 +0,0 @@ -From e170d9a49b3652460d6272bba9cd20afbb8140f2 Mon Sep 17 00:00:00 2001 -From: Herbert Xu <herbert@gondor.apana.org.au> -Date: Sat, 20 Jun 2026 17:23:30 +0800 -Subject: [PATCH] input: Fix overeager NUL deletion in SMALL mode - -NUL characters should not be removed from input lines that are -yet to be processed because they could become the input to the -next executed utility. - -Fix this by moving the NUL deletion into pgetc when history support -is off (IS_DEFINED_SMALL). - -Also fold __pgetc into pgetc since the only other caller of it -is preadbuffer and that logic can also be moved up. - -Finally add a missing signed char cast for the unget characters. - -Reported-by: Kerin Millar <kfm@plushkava.net> -Fixes: 44ae22beedf8 ("input: Disable lleft in SMALL mode") -Fixes: 2c92409145d0 ("input: Allow MB_LEN_MAX calls to pungetc") -Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> ---- - src/input.c | 66 ++++++++++++++++++++++++++++------------------------- - 1 file changed, 35 insertions(+), 31 deletions(-) - -diff --git a/src/input.c b/src/input.c -index 0fb2f18..e9b9d33 100644 ---- a/src/input.c -+++ b/src/input.c -@@ -217,39 +217,47 @@ static void freestrings(struct strpush *sp) - } - - --static int __pgetc(void) -+/* -+ * Read a character from the script, returning PEOF on end of file. -+ * Nul characters in the input are silently discarded. -+ */ -+ -+int __attribute__((noinline)) pgetc(void) - { -+ struct strpush *sp = parsefile->spfree; - int c; - -+ if (unlikely(sp)) -+ freestrings(sp); -+ -+again: - if (parsefile->unget) { - long unget = -(long)(unsigned)parsefile->unget--; - -- return parsefile->nextc[unget]; -+ return (signed char)parsefile->nextc[unget]; - } - -- if (parsefile->nleft > 0) { -+nextc: -+ if (likely(parsefile->nleft > 0)) { - parsefile->nleft--; - c = (signed char)*parsefile->nextc++; -+ } else if (unlikely(parsefile->strpush)) { -+ popstring(); -+ /* The freestrings call must be delayed til the next -+ * pgetc call for PEOA to work properly. -+ */ -+ goto again; - } else - c = preadbuffer(); - -- return c; --} -- -- --/* -- * Read a character from the script, returning PEOF on end of file. -- * Nul characters in the input are silently discarded. -- */ -- --int __attribute__((noinline)) pgetc(void) --{ -- struct strpush *sp = parsefile->spfree; -- -- if (unlikely(sp)) -- freestrings(sp); -+ /* delete nul characters */ -+ if (IS_DEFINED_SMALL && unlikely(!c)) { -+ parsefile->nextc = memmove(parsefile->nextc - 1, -+ parsefile->nextc, parsefile->nleft); -+ goto nextc; -+ } - -- return __pgetc(); -+ return c; - } - - int pgetc_eoa(void) -@@ -374,10 +382,6 @@ static int preadbuffer(void) - int more; - char *q; - -- if (unlikely(parsefile->strpush)) { -- popstring(); -- return __pgetc(); -- } - if (parsefile->eof & 2) { - eof: - parsefile->eof = 3; -@@ -408,6 +412,12 @@ again: - } - } - -+ if (IS_DEFINED_SMALL) { -+ q += more; -+ more = 0; -+ goto done; -+ } -+ - /* delete nul characters */ - for (;;) { - int c; -@@ -422,9 +432,6 @@ again: - - q++; - -- if (IS_DEFINED_SMALL) -- goto check; -- - switch (c) { - case '\n': - goto done; -@@ -439,11 +446,8 @@ again: - } - - check: -- if (more <= 0) { -- if (!IS_DEFINED_SMALL) -- goto again; -- break; -- } -+ if (more <= 0) -+ goto again; - } - done: - input_set_lleft(parsefile, more); --- -2.53.0 - |
