From nobody Tue Jan 27 18:44:14 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f0vSt5f77z6QFFB for ; Tue, 27 Jan 2026 18:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0vSt3Zp3z3rGC for ; Tue, 27 Jan 2026 18:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769539454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zd4dRs4e+lNHZAmyEh/fL28iPdYWzJVNQreGU/lsW3Y=; b=GxmPwp0o7Ck5cjCveFT0G5dI7fj2Dd1WAkIVr6A5ybxvtDb1/asT6xNeE5QJlIGFg6VDqZ kT+0bekANw9cjr+suc2wtJSBsVu3GYCafgpiRITvwrQK6vUOUZq4JMiwGeBOmEisScFC29 0Z1YzTtMiJzORSEeTAeNxE3ZDnSHOOjitHW9Ihq3JIWirI96ovqRgMKtmn24c76HMn5yJO 1/8lGV72GpAIE7/PsgR5NNE5ykQzYxUEvr1qm/7NducmORMEfMtYfr7is5iBRfmslSbjbz EII8U93LkfSs2Fu8KEqQrkAaiXD9OoUmkS7Mnoz/M4Xwh6knjOzjt2Rj1uUaNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769539454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zd4dRs4e+lNHZAmyEh/fL28iPdYWzJVNQreGU/lsW3Y=; b=BmbhJwBoRESmR499iTlyJQd4HleZkjBon4oGFsmJ8kx9jJQkfqjNB+VjbLy5eXokD9S2CL V0kpaqUr3AQxmFUsbCspTRCxgnxCV+qyn+b/LDEGGphTDFhZhMYuklhpMCijlFdWlRe3f1 EKBZxbT2CEzrEfduT6oL3Fo7GGkr3l+Z23dCY3EuFk4jgzVaXUZDg2uVcRO+DOalAf52Vp 2NVekWpad4s11dk4XtDOd3XcRBZs6Kij1ue7Sx3nnDkNNeSzTywOne2oU4tzD4BPgkkzfo tmCIorAQc9fKXW3jz8no4DUbZejOuaQDVO1q7tXePQ/IZ/iTZrFGICfoKO1Fow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769539454; a=rsa-sha256; cv=none; b=xhJIMRgymvN/5PRfri2PM4VDBLb3MiwB2qpy1JKGZcrp5SvOzLO5GqQ47SVJEqs7nSBWgu 5LsMqErRMp6S7TddUeQptbjGbGKDQl/kMflH/mCf27O8MtKim9/+WLfGaDh6YLfKuELK2/ /hQt+8RJlalXhCppaXTUG/fRGgxkUq95UNTBzWvAto+kYy+0Eq0uYbYt3YXF61b68JsPpY bKKuZvn6TbOY1oTAPvnpymQCI2t7dk/zGamrfXgBWL0nBumpmfi+QmjC4Fw5ViBc3bH/TM 8WOYGeqXmQvTFfQirkm0pMYJ25qktRISJRt2OD60r3/+PePgD0JcSoghIUVkng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0vSt2JsGz379 for ; Tue, 27 Jan 2026 18:44:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e175 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 27 Jan 2026 18:44:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8824cd3a1170 - stable/14 - ctld: Be more consistent for auth parameters in the UCL config List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8824cd3a11708c48f1f989d1b948e67a2bf956fc Auto-Submitted: auto-generated Date: Tue, 27 Jan 2026 18:44:14 +0000 Message-Id: <6979077e.e175.11eab342@gitrepo.freebsd.org> The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8824cd3a11708c48f1f989d1b948e67a2bf956fc commit 8824cd3a11708c48f1f989d1b948e67a2bf956fc Author: John Baldwin AuthorDate: 2025-02-26 15:11:30 +0000 Commit: John Baldwin CommitDate: 2026-01-27 18:15:57 +0000 ctld: Be more consistent for auth parameters in the UCL config The auth-group context required an array of entries for "chap", "chap-mutual", "initiator-name", and "initiator-portal" whereas the target context required exactly one entry (and only permitted a single entry). Allow either a single entry or an array of entries for these keywords in both the auth-group and target contexts. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48935 (cherry picked from commit e28b758b35d0f80b38c295587271ec9588040077) --- usr.sbin/ctld/uclparse.c | 163 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 42 deletions(-) diff --git a/usr.sbin/ctld/uclparse.c b/usr.sbin/ctld/uclparse.c index 2dc4872bee84..e8e026247b71 100644 --- a/usr.sbin/ctld/uclparse.c +++ b/usr.sbin/ctld/uclparse.c @@ -420,66 +420,90 @@ uclparse_auth_group(const char *name, const ucl_object_t *top) } if (strcmp(key, "chap") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"chap\" property of " - "auth-group \"%s\" is not an array", + if (obj->type == UCL_OBJECT) { + if (!uclparse_chap(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_chap(name, tmp)) + goto fail; + } + } else { + log_warnx("\"chap\" property of auth-group " + "\"%s\" is not an array or object", name); goto fail; } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (!uclparse_chap(name, tmp)) - goto fail; - } } if (strcmp(key, "chap-mutual") == 0) { - if (obj->type != UCL_ARRAY) { + if (obj->type == UCL_OBJECT) { + if (!uclparse_chap_mutual(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_chap_mutual(name, tmp)) + goto fail; + } + } else { log_warnx("\"chap-mutual\" property of " - "auth-group \"%s\" is not an array", + "auth-group \"%s\" is not an array or object", name); goto fail; } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - if (!uclparse_chap_mutual(name, tmp)) - goto fail; - } } if (strcmp(key, "initiator-name") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"initiator-name\" property of " - "auth-group \"%s\" is not an array", - name); - goto fail; - } - - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - const char *value = ucl_object_tostring(tmp); + if (obj->type == UCL_STRING) { + const char *value = ucl_object_tostring(obj); if (!auth_group_add_initiator_name(value)) goto fail; - } - } + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + const char *value = + ucl_object_tostring(tmp); - if (strcmp(key, "initiator-portal") == 0) { - if (obj->type != UCL_ARRAY) { - log_warnx("\"initiator-portal\" property of " - "auth-group \"%s\" is not an array", + if (!auth_group_add_initiator_name( + value)) + goto fail; + } + } else { + log_warnx("\"initiator-name\" property of " + "auth-group \"%s\" is not an array or string", name); goto fail; } + } - it2 = NULL; - while ((tmp = ucl_iterate_object(obj, &it2, true))) { - const char *value = ucl_object_tostring(tmp); + if (strcmp(key, "initiator-portal") == 0) { + if (obj->type == UCL_STRING) { + const char *value = ucl_object_tostring(obj); if (!auth_group_add_initiator_portal(value)) goto fail; + } else if (obj->type == UCL_ARRAY) { + it2 = NULL; + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + const char *value = + ucl_object_tostring(tmp); + + if (!auth_group_add_initiator_portal( + value)) + goto fail; + } + } else { + log_warnx("\"initiator-portal\" property of " + "auth-group \"%s\" is not an array or string", + name); + goto fail; } } } @@ -746,25 +770,80 @@ uclparse_target(const char *name, const ucl_object_t *top) } if (strcmp(key, "chap") == 0) { - if (!uclparse_target_chap(name, obj)) + if (obj->type == UCL_OBJECT) { + if (!uclparse_target_chap(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_target_chap(name, tmp)) + goto fail; + } + } else { + log_warnx("\"chap\" property of target " + "\"%s\" is not an array or object", + name); goto fail; + } } if (strcmp(key, "chap-mutual") == 0) { - if (!uclparse_target_chap_mutual(name, obj)) + if (obj->type == UCL_OBJECT) { + if (!uclparse_target_chap_mutual(name, obj)) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!uclparse_target_chap_mutual(name, + tmp)) + goto fail; + } + } else { + log_warnx("\"chap-mutual\" property of target " + "\"%s\" is not an array or object", + name); goto fail; + } } if (strcmp(key, "initiator-name") == 0) { - if (!target_add_initiator_name( - ucl_object_tostring(obj))) + if (obj->type == UCL_STRING) { + if (!target_add_initiator_name( + ucl_object_tostring(obj))) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!target_add_initiator_name( + ucl_object_tostring(tmp))) + goto fail; + } + } else { + log_warnx("\"initiator-name\" property of " + "target \"%s\" is not an array or string", + name); goto fail; + } } if (strcmp(key, "initiator-portal") == 0) { - if (!target_add_initiator_portal( - ucl_object_tostring(obj))) + if (obj->type == UCL_STRING) { + if (!target_add_initiator_portal( + ucl_object_tostring(obj))) + goto fail; + } else if (obj->type == UCL_ARRAY) { + while ((tmp = ucl_iterate_object(obj, &it2, + true))) { + if (!target_add_initiator_portal( + ucl_object_tostring(tmp))) + goto fail; + } + } else { + log_warnx("\"initiator-portal\" property of " + "target \"%s\" is not an array or string", + name); goto fail; + } } if (strcmp(key, "portal-group") == 0) {