From 218e271abb8a1a56a7f8abc4902afcbcdbb2464f Mon Sep 17 00:00:00 2001 From: jakub-nt <175944085+jakub-nt@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:03:30 +0200 Subject: [PATCH] Rewrote a loop over files to be safer with regard to passed paths Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com> --- build-scripts/package | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/build-scripts/package b/build-scripts/package index 9a269d439..a927c9751 100755 --- a/build-scripts/package +++ b/build-scripts/package @@ -219,14 +219,7 @@ rpm | lpp) # Link all packaging files (except spec files) to SOURCES directory log_debug "Linking packaging files to SOURCES directory" - # shellcheck disable=SC2044 - # TODO: CFE-4584 - for i in $(find "$BASEDIR/buildscripts/packaging/$PKG" ! -name "*.spec"); do - ( - cd "$BASEDIR/$PKG/SOURCES" - ln -sf "$i" . - ) || false - done + find "$BASEDIR/buildscripts/packaging/$PKG" ! -name "*.spec" -exec ln -sf {} "$BASEDIR/$PKG/SOURCES" \; # Build the RPM package using rpmbuild # eval is needed to preserve spaces in arguments within quotes