scripts: bundle-libraries: fix logic flaw
authorJo-Philipp Wich <jo@mein.io>
Wed, 29 Aug 2018 11:16:34 +0000 (13:16 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 29 Aug 2018 12:19:43 +0000 (14:19 +0200)
Previous refactoring of the script moved the LDSO detection into a
file-not-exists condition, causing onyl the very first executable to
get bundled.

Solve the problem by unconditionally checking for LDSO again.

Fixes: 9030a78a71 ("scripts: bundle-libraries: prevent loading host locales")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
scripts/bundle-libraries.sh

index 4662b98dee9a77a3730fbe48888baef349d5bc0d..d3c7206a4dddd2b44a5b7d506f88212de850e0b4 100755 (executable)
@@ -156,17 +156,16 @@ for BIN in "$@"; do
                                dest="$DIR/lib/${token##*/}"
                                ddir="${dest%/*}"
 
+                               case "$token" in
+                                       */ld-*.so*) LDSO="${token##*/}" ;;
+                               esac
+
                                [ -f "$token" -a ! -f "$dest" ] && {
                                        _md "$ddir"
                                        _cp "$token" "$dest"
                                        case "$token" in
-                                               *ld-*.so*)
-                                                       LDSO="${token##*/}"
-                                                       _patch_ldso "$dest"
-                                               ;;
-                                               libc.so.6|*/libc.so.6)
-                                                       _patch_glibc "$dest"
-                                               ;;
+                                               */ld-*.so*) _patch_ldso "$dest" ;;
+                                               */libc.so.6) _patch_glibc "$dest" ;;
                                        esac
                                }
                        ;; esac