]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions: handle shared objects in find_binary w/o the exec flag
authorHarald Hoyer <harald@redhat.com>
Thu, 17 Feb 2011 09:48:35 +0000 (10:48 +0100)
committerHarald Hoyer <harald@redhat.com>
Thu, 17 Feb 2011 09:50:16 +0000 (10:50 +0100)
dracut-functions

index eef8f1ed2f24739e8cec5535f5f5d9ac72566baa..ebcb7d8fb5da8dfbe98b7040033a8b6d5c61bb7f 100755 (executable)
@@ -320,7 +320,12 @@ inst_library() {
 # search in the usual places to find the binary.
 find_binary() {
     local binpath="/bin /sbin /usr/bin /usr/sbin" p
-    [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } 
+    if [[ -z ${1##/*} ]]; then
+        if [[ -x $1 ]] || ldd $1 &>/dev/null; then
+            echo $1
+            return 0
+        fi
+    fi
     for p in $binpath; do
         [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
     done