[bug#77001,v2,3/8] services: krb5-realm: Add default-principal-flags field.
Commit Message
* 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(+)
@@ -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.")