]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ssh-client: Include nss_ libraries 268/head
authorMichal Koutný <mkoutny@suse.com>
Tue, 15 Aug 2017 13:25:18 +0000 (15:25 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Tue, 15 Aug 2017 14:10:50 +0000 (16:10 +0200)
SSH uses passwd database and thus need various NSS plugin libraries,
depending upon setting in nsswitch.conf.

SSH binary fails within the dracut environment without the libraries:

    #:/ ssh
    No user exist for uid 0

modules.d/95ssh-client/module-setup.sh

index 2a7e0ee374dff3af0b01bf53d07fa31985240485..672de5023ed8e707e8ba0da3687f542418e5b047 100755 (executable)
@@ -63,7 +63,16 @@ inst_sshenv()
 
 # called by dracut
 install() {
+    local _nsslibs
+
     inst_multiple ssh scp
     inst_sshenv
+
+    _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
+        |  tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
+    _nsslibs=${_nsslibs#|}
+    _nsslibs=${_nsslibs%|}
+
+    inst_libdir_file -n "$_nsslibs" 'libnss_*.so*'
 }