Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d Don't specify a volume alias if none is given inste...



details:   https://anonhg.NetBSD.org/src/rev/b9c68ece28e6
branches:  trunk
changeset: 378139:b9c68ece28e6
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jul 22 10:31:35 2023 +0000

description:
Don't specify a volume alias if none is given instead of using a default
name. Otherwise iscsictl fails for using non-unique names if more than
one volume is used.

diffstat:

 etc/rc.d/iscsid_volumes |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r a0baa7e86364 -r b9c68ece28e6 etc/rc.d/iscsid_volumes
--- a/etc/rc.d/iscsid_volumes   Sat Jul 22 09:27:26 2023 +0000
+++ b/etc/rc.d/iscsid_volumes   Sat Jul 22 10:31:35 2023 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: iscsid_volumes,v 1.3 2023/02/18 07:51:52 mlelstv Exp $
+# $NetBSD: iscsid_volumes,v 1.4 2023/07/22 10:31:35 mlelstv Exp $
 #
 
 # PROVIDE: iscsid_volumes
@@ -35,6 +35,16 @@ iscsid_volumes_start()
 
                        if [ -f /etc/iscsi/auths ]; then
                                while read entry dummy; do
+
+                                       case $entry in
+                                       *:chap:*|\
+                                       *:CHAP:*|\
+                                       *:none:*)
+                                               dummy=${entry#*:}
+                                               entry=${entry%%:*}:${dummy#*:}
+                                               ;;
+                                       esac
+
                                        case $entry in
                                        \#*|"") ;;
                                        "$user":*) pass=${entry#*:} ;;
@@ -63,7 +73,7 @@ iscsid_volumes_start()
                                -u "$user" \
                                -s "$pass" \
                                -S "$mpass" \
-                               -N "${alias:--}")
+                               ${alias:+-N} ${alias:+"$alias"})
                        echo "$out"
 
                        case $out in



Home | Main Index | Thread Index | Old Index