Resolve libs for executable links in COPY_AS_IS

Upstream PR #3073

Resolves: RHEL-15108
This commit is contained in:
Pavel Cahyna 2024-02-09 20:31:36 +01:00
parent 53b4b110c7
commit 5f383567e5
2 changed files with 25 additions and 0 deletions

View File

@ -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

View File

@ -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 #
######################