git: eb837cb8b207 - main - ctld: normalize iSCSI TargetName on login
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Apr 2026 07:48:33 UTC
The branch main has been updated by js:
URL: https://cgit.FreeBSD.org/src/commit/?id=eb837cb8b2073c09bafaf3318f5bb103827b2bca
commit eb837cb8b2073c09bafaf3318f5bb103827b2bca
Author: Johan Söllvander <js@FreeBSD.org>
AuthorDate: 2026-04-24 07:44:43 +0000
Commit: Johan Söllvander <js@FreeBSD.org>
CommitDate: 2026-04-24 07:44:43 +0000
ctld: normalize iSCSI TargetName on login
Case-insensitive TargetName matching on logins was accidentally removed,
let's fix that by normalizing TargetName again according to RFC 3722.
PR: 294522
Fixes: 4b1aac931465f39c5c26bfa1d5539a428d340f20
Sponsored by: ConnectWise
MFC after: 1 week
Reviewed by: asomers, jhb
Approved by: asomers (mentor)
Differential Revision: https://reviews.freebsd.org/D56469
---
usr.sbin/ctld/login.cc | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/usr.sbin/ctld/login.cc b/usr.sbin/ctld/login.cc
index cda11cc1f21b..fb4b60c37f54 100644
--- a/usr.sbin/ctld/login.cc
+++ b/usr.sbin/ctld/login.cc
@@ -967,12 +967,18 @@ iscsi_connection::login()
login_send_error(request, 0x02, 0x07);
log_errx(1, "received Login PDU without TargetName");
}
+ /*
+ * Normalize target_name according to RFC 3722
+ */
+ std::string t_name(target_name);
+ for (char &c : t_name)
+ c = tolower(c);
- conn_port = pg->find_port(target_name);
+ conn_port = pg->find_port(t_name);
if (conn_port == NULL) {
login_send_error(request, 0x02, 0x03);
log_errx(1, "requested target \"%s\" not found",
- target_name);
+ t_name.c_str());
}
conn_target = conn_port->target();
}