]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
iscsi: do not install all of /etc/iscsi unless hostonly
authorLubomir Rintel <lkundrak@v3.sk>
Thu, 30 Aug 2018 16:38:34 +0000 (18:38 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 21 Sep 2018 09:32:01 +0000 (11:32 +0200)
/etc/iscsi/initiatorname.iscsi would leak the host initiator name (that
is host configuration) to the initramfs. Perhaps other files too.

modules.d/95iscsi/module-setup.sh

index 04beae4c93c99fc2e945517ef16073fccbfef1c2..5c2073bbf566d41ffb1f69812fb2dcc6f1a40c6f 100755 (executable)
@@ -216,7 +216,11 @@ install() {
         $systemdsystemunitdir/sockets.target.wants/iscsid.socket \
         $systemdsystemunitdir/sockets.target.wants/iscsiuio.socket
 
-    [[ -d /etc/iscsi ]] && inst_dir $(/usr/bin/find /etc/iscsi)
+    if [[ $hostonly ]]; then
+        inst_dir $(/usr/bin/find /etc/iscsi)
+    else
+        inst_simple /etc/iscsi/iscsid.conf
+    fi
 
     # Detect iBFT and perform mandatory steps
     if [[ $hostonly_cmdline == "yes" ]] ; then