busybox: Make high ASCII chars printable
PATCH 1/1 busybox: Make high ASCII chars printable
Currently busybox utilty "ls" fails to display filenames contains UTF-8 characters and replaces with "?".
Steps to reproduce:
bin/busybox touch utf_test-Ü
bin/busybox ls utf_test-* > sample.log
bin/busybox cat sample.log
utf_test-??
bin/busybox hexdump -C sample.log | grep "c3 9c"
Therefore, above hexdump command is unable to find matching hex value for the umlaute character.
Hence, change the libbb's printable_string() function to allow high ASCII characters so that unicode filenames are displayed correctly. This issue is not observed in upstream busybox.
Signed-off-by Sana Kazi <[email protected]>
Signed-off-by Sana Kazi <[email protected]>
Signed-off-by Nikhil R <[email protected]>
--- .../270-libbb_make_unicode_printable.patch | 39 +++++++++++++++++++ meta/recipes-core/busybox/busybox_1.35.0.bb | 1 + 2 files changed, 40 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/270-libbb_make_unicode_printable.patch
meta/recipes-core/busybox/busybox/270-libbb_make_unicode_printable.patch new file +39 -0
@@ -0,0 +1,39 @@ +busybox: make high ASCII chars printable (#7993) + +Currently busybox utils like "ls" fail to display filenames containing UTF-8 +characters, replacing any special characters with "?". + +Change libbb's printable_string() function to allow high ASCII characters so +that unicode filenames are displayed correctls. + +Signed-off-by: Jo-Philipp Wich <[email protected]> +Upstream-Status: Pending [https://git.openwrt.org/?p=openwrt/svn-archive/archive.git;a=patch;h=bbca780ca657d894fc457cac8eaaaec9d414bfc8] + +SVN-Revision: 43084 +--- + .../270-libbb_make_unicode_printable.patch | 20 +++++++++++++++++++ + create mode 100644 package/utils/busybox/patches/270-libbb_make_unicode_printable.patch + +diff --git a/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch b/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch +--- a/libbb/printable_string.c ++++ b/libbb/printable_string.c +@@ -28,8 +28,6 @@ + } + if (c < ' ') + break; +- if (c >= 0x7f) +- break; + s++; + } + +@@ -42,7 +40,7 @@ + unsigned char c = *d; + if (c == '\0') + break; +- if (c < ' ' || c >= 0x7f) ++ if (c < ' ') + *d = '?'; + d++; + } +-- +2.20.1
meta/recipes-core/busybox/busybox_1.35.0.bb +1 -0
@@ -51,6 +51,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://0002-nslookup-sanitize-all-printed-strings-with-printable.patch \ file://CVE-2022-30065.patch \ file://0001-devmem-add-128-bit-width.patch \ + file://270-libbb_make_unicode_printable.patch \ " SRC_URI:append:libc-musl = " file://musl.cfg "
Signature · 1 line
2.25.1