commit: ff13f4817fd7b4a36534b0b253b8620ee02c4c6e
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jun 10 00:11:14 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 11 03:26:22 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ff13f481
estrip: ensure IFS= is in effect for some read invocations
Where read is given at least one name to assign to, word splitting
mechanics apply. Given the default value of IFS, records will
effectively be trimmed of any surrounding <blank> characters. It is
categorically incorrect to permit this in the course of processing
pathnames. Where necessary, address the issue by ensuring that the value
of IFS is the null string upon invoking the read builtin.
See-also: 3c24f8c4ab1bc34cc208c343f4152d8f0818d0bb
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/estrip | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bin/estrip b/bin/estrip
index 56f24d45a7..250c943833 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -553,7 +553,7 @@ cd "${tmpdir}/inodes" || die "cd failed unexpectedly"
# advance, so that we can avoid interference due to trying to strip the same
# (hardlinked) file multiple times in parallel. See bug #421099.
if (( do_prepstrip )); then
- while read -r x ; do
+ while IFS= read -r x; do
inode_link=$(get_inode_number "${x}") || die "stat failed
unexpectedly"
echo "${x}" >> "${inode_link}" || die "echo failed unexpectedly"
done < <(
@@ -585,7 +585,7 @@ read -rd '' -a safe_strip_flags <<<"${SAFE_STRIP_FLAGS}"
for inode_link in *; do
test -e "${inode_link}" || continue
# shellcheck disable=2094
- while read -r x; do
+ while IFS= read -r x; do
if (( do_banner )); then
__vecho "strip: ${name_of[strip]}
${portage_strip_flags[*]}"
do_banner=0
@@ -682,7 +682,7 @@ then
# Preserve directory structure.
# Needed after running save_elf_sources.
# https://bugzilla.redhat.com/show_bug.cgi?id=444310
- while read -r -d $'\0' emptydir; do
+ while IFS= read -rd '' emptydir; do
: >> "${emptydir}"/.keepdir
done < <(printf '%s\0' "${D%/}/${prepstrip_sources_dir#/}/" | find0
-type d -empty -print0)
fi