From a745d97c174ef1d85649b2a8ad7ca22e3dea9e58 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 27 Oct 2019 03:05:10 -0400 Subject: makepkg: protect against unexpected whitespace in filenames zipman: read -r protects against those evil manpages whose filenames contain backslash escapes, (muahahaha?) IFS= read protects against filenames with: - leading whitespace (but no one is actually stupid enough to configure their MAN_DIRS=() in makepkg.conf with such silly directories, *right*?) - trailing whitespace (but likewise, no one should be stupid enough to write an uncompressed manpage for section '1 ' or something) Also fix several other cases where we read filenames without protecting against surrounding whitespace, or without using null-delimited filenames when we could trivially do so. Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- scripts/libmakepkg/tidy/staticlibs.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/libmakepkg/tidy/staticlibs.sh.in') diff --git a/scripts/libmakepkg/tidy/staticlibs.sh.in b/scripts/libmakepkg/tidy/staticlibs.sh.in index eaa6ac8a..bf7601d2 100644 --- a/scripts/libmakepkg/tidy/staticlibs.sh.in +++ b/scripts/libmakepkg/tidy/staticlibs.sh.in @@ -34,7 +34,7 @@ tidy_staticlibs() { if check_option "staticlibs" "n"; then msg2 "$(gettext "Removing static library files...")" local l - while read -rd '' l; do + while IFS= read -rd '' l; do if [[ -f "${l%.a}.so" || -h "${l%.a}.so" ]]; then rm "$l" fi -- cgit v1.2.3-24-g4f1b