Module Name:    src
Committed By:   mlelstv
Date:           Sat Jul 22 10:31:35 UTC 2023

Modified Files:
        src/etc/rc.d: iscsid_volumes

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/etc/rc.d/iscsid_volumes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/rc.d/iscsid_volumes
diff -u src/etc/rc.d/iscsid_volumes:1.3 src/etc/rc.d/iscsid_volumes:1.4
--- src/etc/rc.d/iscsid_volumes:1.3	Sat Feb 18 07:51:52 2023
+++ src/etc/rc.d/iscsid_volumes	Sat Jul 22 10:31:35 2023
@@ -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

Reply via email to