From 5f383567e5262c2a65c117fd54772730909a743b Mon Sep 17 00:00:00 2001 From: Pavel Cahyna Date: Fri, 9 Feb 2024 20:31:36 +0100 Subject: [PATCH] Resolve libs for executable links in COPY_AS_IS Upstream PR #3073 Resolves: RHEL-15108 --- ...or-symlinks-in-COPY_AS_IS-RHEL-15108.patch | 21 +++++++++++++++++++ rear.spec | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 rear-resolve-libraries-for-symlinks-in-COPY_AS_IS-RHEL-15108.patch diff --git a/rear-resolve-libraries-for-symlinks-in-COPY_AS_IS-RHEL-15108.patch b/rear-resolve-libraries-for-symlinks-in-COPY_AS_IS-RHEL-15108.patch new file mode 100644 index 0000000..1e76b68 --- /dev/null +++ b/rear-resolve-libraries-for-symlinks-in-COPY_AS_IS-RHEL-15108.patch @@ -0,0 +1,21 @@ +diff --git a/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh b/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh +index 0e402b017..9e1810c9a 100644 +--- a/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh ++++ b/usr/share/rear/build/GNU/Linux/100_copy_as_is.sh +@@ -117,10 +117,13 @@ local copy_as_is_file="" + # cf. https://github.com/rear/rear/pull/2378 + # It is crucial to append to /dev/$DISPENSABLE_OUTPUT_DEV (cf. 'Print' in lib/_input-output-functions.sh): + while read -r copy_as_is_file ; do +- # Skip non-regular files like directories, device files, and 'tar' error messages (e.g. in case of non-existent files, see above): ++ # Skip non-regular files like directories, device files, and 'tar' error messages (e.g. in case of non-existent files, see above) ++ # but do not skip symbolic links. Their targets will be copied later by build/default/490_fix_broken_links.sh. ++ # We thus need library dependencies for symlinked executables just like for normal executables ++ # and build/default/490_fix_broken_links.sh does not perform library dependency scan. ++ # See GitHub PR https://github.com/rear/rear/pull/3073 ++ # and issue https://github.com/rear/rear/issues/3064 for details. + test -f "$copy_as_is_file" || continue +- # Skip symbolic links (only care about symbolic link targets): +- test -L "$copy_as_is_file" && continue + # Remember actual regular files that are executable: + test -x "$copy_as_is_file" && copy_as_is_executables+=( "$copy_as_is_file" ) + done < <( sort -u $copy_as_is_filelist_file ) 2>>/dev/$DISPENSABLE_OUTPUT_DEV diff --git a/rear.spec b/rear.spec index cabcee5..af759fe 100644 --- a/rear.spec +++ b/rear.spec @@ -62,6 +62,10 @@ Patch111: rear-CVE-2024-23301.patch # https://github.com/rear/rear/pull/3145 Patch113: rear-restore-hybrid-bootloader-RHEL-16864.patch +# Resolve libs for executable links in COPY_AS_IS +# https://github.com/rear/rear/commit/9f859c13f5ba285cd1d5983c9b595975c21888d3 +Patch114: rear-resolve-libraries-for-symlinks-in-COPY_AS_IS-RHEL-15108.patch + ###################### # downstream patches # ######################