From patchwork Wed Mar 19 16:24:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Volf <~@wolfsden.cz> X-Patchwork-Id: 40435 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1847527BBEA; Wed, 19 Mar 2025 16:26:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E1E3427BBE2 for ; Wed, 19 Mar 2025 16:26:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuwFT-0005Zj-Hn; Wed, 19 Mar 2025 12:26:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tuwF7-0004r3-JO for guix-patches@gnu.org; Wed, 19 Mar 2025 12:26:14 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tuwF5-0000MO-41 for guix-patches@gnu.org; Wed, 19 Mar 2025 12:26:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=DQAe6kYz7WtuJqrCe0b7bgj0I7sOJCkq5g1zGn5K8eE=; b=veT454XXrdBLiDNs7uJm3JPz7nqh+MeQ6XtrahgmaY5xhH1lujYt+3FhSuJvqZWO08N48lWbBlBy25zuNio0anYzkmxDifujurn/mJHRB0oDWT2z42t1ovRXiFo3IIVoE0tgmBjhmCuUMTYgoyLdpetsJ6LdqVXDrUn/HkQJvooDR96XY7iGJA4FX0VWa6oqq6e/clq5QuMy0xA9g8Q3pyZp58JVLsofg+bhSEiyojUrbRD+vcAUHGJYmF0L1khjqT2qzq/uDtZrehDL/vxdT4XyxL/SGfaWJXVY3XQKaSsmzrqw8MOSZBIwcg1YCXuTJyAl7VG3BfW4g3+LI1GcNw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tuwF4-0007Lr-S8 for guix-patches@gnu.org; Wed, 19 Mar 2025 12:26:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77001] [PATCH v2 3/8] services: krb5-realm: Add default-principal-flags field. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 19 Mar 2025 16:26:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77001 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77001@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz> Received: via spool by 77001-submit@debbugs.gnu.org id=B77001.174240153927996 (code B ref 77001); Wed, 19 Mar 2025 16:26:06 +0000 Received: (at 77001) by debbugs.gnu.org; 19 Mar 2025 16:25:39 +0000 Received: from localhost ([127.0.0.1]:52696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tuwEZ-0007H3-2M for submit@debbugs.gnu.org; Wed, 19 Mar 2025 12:25:39 -0400 Received: from wolfsden.cz ([37.205.8.62]:48800) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tuwDz-00075P-FY for 77001@debbugs.gnu.org; Wed, 19 Mar 2025 12:25:06 -0400 Received: by wolfsden.cz (Postfix, from userid 104) id 9CEBF387FE7; Wed, 19 Mar 2025 16:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1742401497; bh=9dsUKkXRGPUcPFkwpov1axZg1+xzg9gyBITE3abNN34=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iamew77XDA61l95FoJZXBaqQdCy8ZnJJMysLvtlBode2X6eyrNAVbxIPRl0H535Ik Vwz+9vDXRl/7y6je6J1pJ3AuxW6+qDq7z5Cxp9YiPgJkwVuC/xmSkPxBVYwnksMA9F o2XPTQJmnqzKCMrShEMoCoGR2qMEe+ktybWGKHSGHlI7Qfs9FTqjfL8uKDOSTp061K i3jcD/uRjaFn10eLzo7UR5/D/DI1KvNb2scLoTsxLATVu9g+EW57/A2lUT8m1/a+aj /2Uv9CuUnpA16YaQu6XsZe1Y83Ju2zZMyHJ4uw7Mn/Gch+g2asVCArjFAZ4h1e0dfP e05Xf1ic60ZuhWM0PrE8WtRCIa7B18YuhU1HIEBJj1Xij19clFXiGettDCo4NabZgV 6RQIhsUFXAHQQC27e+6pDSn3UVA/SEKz1Jdw5x/sif3mrvGAh+32m0mhkiZJqHk0H4 qWmWsvdnqp7QpBk8HV9Zs7pc2Uyl9eQUegezMcyu9HCbJFz/TxE0aGVUe+Dp97bdYM JZTBAotFt9A9/phOX4vlWBV6BYKxfKC3V3mIgwWSBoSus5xkhYz1fmV0kNTpmrRWD4 RkkWtblOAsnE+CXiRwJJm4/2+jTFtdQjyRsxZ/9ZppAgV2+xo4jCdbDD8sEorRo/6q wNbkNFn0hUkUeU1oi8GZvnoE= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 47152387E71; Wed, 19 Mar 2025 16:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1742401497; bh=9dsUKkXRGPUcPFkwpov1axZg1+xzg9gyBITE3abNN34=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iamew77XDA61l95FoJZXBaqQdCy8ZnJJMysLvtlBode2X6eyrNAVbxIPRl0H535Ik Vwz+9vDXRl/7y6je6J1pJ3AuxW6+qDq7z5Cxp9YiPgJkwVuC/xmSkPxBVYwnksMA9F o2XPTQJmnqzKCMrShEMoCoGR2qMEe+ktybWGKHSGHlI7Qfs9FTqjfL8uKDOSTp061K i3jcD/uRjaFn10eLzo7UR5/D/DI1KvNb2scLoTsxLATVu9g+EW57/A2lUT8m1/a+aj /2Uv9CuUnpA16YaQu6XsZe1Y83Ju2zZMyHJ4uw7Mn/Gch+g2asVCArjFAZ4h1e0dfP e05Xf1ic60ZuhWM0PrE8WtRCIa7B18YuhU1HIEBJj1Xij19clFXiGettDCo4NabZgV 6RQIhsUFXAHQQC27e+6pDSn3UVA/SEKz1Jdw5x/sif3mrvGAh+32m0mhkiZJqHk0H4 qWmWsvdnqp7QpBk8HV9Zs7pc2Uyl9eQUegezMcyu9HCbJFz/TxE0aGVUe+Dp97bdYM JZTBAotFt9A9/phOX4vlWBV6BYKxfKC3V3mIgwWSBoSus5xkhYz1fmV0kNTpmrRWD4 RkkWtblOAsnE+CXiRwJJm4/2+jTFtdQjyRsxZ/9ZppAgV2+xo4jCdbDD8sEorRo/6q wNbkNFn0hUkUeU1oi8GZvnoE= From: Tomas Volf <~@wolfsden.cz> Date: Wed, 19 Mar 2025 17:24:29 +0100 Message-ID: <369678163bb94b49a39ca88319e3292dd5498626.1742401473.git.~@wolfsden.cz> X-Mailer: git-send-email 2.48.1 In-Reply-To: <43cc10a6e9e4f8359465adcd73ba59e9404012ba.1742401473.git.~@wolfsden.cz> References: <43cc10a6e9e4f8359465adcd73ba59e9404012ba.1742401473.git.~@wolfsden.cz> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/kerberos.scm (krb5-realm): Add default-principal-flags field. (serialize-comma-separated-string-list/unset, comma-separated-string-list?) (comma-separated-string-list/unset?): New procedures. Change-Id: Ie5f787ca0745dd6234ea4577b39a58d71e4fa6d2 --- gnu/services/kerberos.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gnu/services/kerberos.scm b/gnu/services/kerberos.scm index ee0deec2e4..1a7cc5774a 100644 --- a/gnu/services/kerberos.scm +++ b/gnu/services/kerberos.scm @@ -107,6 +107,19 @@ (define (space-separated-string-list? val) (define space-separated-string-list/unset? (predicate/unset space-separated-string-list?)) +(define (serialize-comma-separated-string-list/unset field-name val) + (unless (eq? val unset-field) + (serialize-field* field-name (string-join val ",")))) + +(define (comma-separated-string-list? val) + (and (list? val) + (and-map (lambda (x) + (and (string? x) (not (string-index x #\,)))) + val))) + +(define comma-separated-string-list/unset? + (predicate/unset comma-separated-string-list?)) + (define comma-separated-integer-list/unset? (predicate/unset (lambda (val) (and (list? val) @@ -199,6 +212,13 @@ (define-configuration krb5-realm (string/unset unset-field) "The server where password changes are performed.") + (default-principal-flags + (comma-separated-string-list/unset unset-field) + "Specifies the default attributes of principals created in this realm. The +format for this string is a list of strings, with '+' before each flag that +should be enabled and '-' before each flag that should be disabled. See the +manual page for details on available flags.") + (auth-to-local (free-form-fields '()) "Rules to map between principals and local users.")