[bug#71064,v2,2/2] gnu: services: nscd: Sanitize nscd-configuration's implementation.
Commit Message
* gnu/services/base.scm (<nscd-configuration>): Sanitize
nscd-configuration's implementation field with ...
(warn-unexpected-nscd-implementation): New procedure.
---
gnu/services/base.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
@@ -1363,11 +1363,20 @@ (define-deprecated (mingetty-service config)
the tty to run, among other things."
(service mingetty-service-type config))
+(define-with-syntax-properties (warn-unexpected-nscd-implementation
+ (value properties))
+ (unless (member value '(glibc nsncd))
+ (leave (source-properties->location properties)
+ (G_ "The nscd-configuration object's implementation field supports \
+only 'glibc and 'nsncd values.")))
+ value)
+
(define-record-type* <nscd-configuration> nscd-configuration
make-nscd-configuration
nscd-configuration?
(implementation nscd-implementation
- (default 'glibc)) ;'glibc or 'nsncd
+ (default 'glibc) ;'glibc or 'nsncd
+ (sanitize warn-unexpected-nscd-implementation))
(log-file nscd-configuration-log-file ;string
(default #f))
(debug-level nscd-debug-level ;integer