]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
url-lib/module-setup.sh: install ca-bundle.crt by libcurl.so
authorHarald Hoyer <harald@redhat.com>
Thu, 11 Apr 2013 09:29:00 +0000 (11:29 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 12 Apr 2013 13:27:27 +0000 (15:27 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=950770

curl seems to look for /etc/pki/tls/certs/ca-bundle.crt

extract the correct path by disecting libcurl.so

modules.d/45url-lib/module-setup.sh

index 0fb3667a761ae990d36d8f8416f3633bf19ffea2..e8b97003e01760797bdb5fb85d9e2288f9470b20 100755 (executable)
@@ -12,6 +12,7 @@ depends() {
 }
 
 install() {
+    local _dir _crt _found
     inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
     dracut_install curl
     # also install libs for curl https
@@ -20,11 +21,17 @@ install() {
     inst_libdir_file "libsoftokn3.so*"
     inst_libdir_file "libsqlite3.so*"
 
-    mkdir -m 0755 -p "$initdir/etc/ssl/certs"
-    if ! inst_any -t /etc/ssl/certs/ca-bundle.crt \
-            /etc/ssl/certs/ca-bundle.crt \
-            /etc/ssl/certs/ca-certificates.crt; then
-        dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
-    fi
+    for _dir in $libdirs; do
+           [[ -d $_dir ]] || continue
+            _crt=$(grep -F --binary-files=text -z .crt $_dir/libcurl.so)
+            [[ $_crt ]] || continue
+            [[ $_crt == /*/* ]] || continue
+            if ! inst_simple "$_crt"; then
+                dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
+                continue
+            fi
+            _found=1
+    done
+    [[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
 }