[PATCH] services: knot: Fix an acl and a key verification.

  • Done
  • quality assurance status badge
Details
2 participants
  • 宋文武
  • Alexey Abramov
Owner
unassigned
Submitted by
Alexey Abramov
Severity
normal

Debbugs page

Alexey Abramov wrote 4 years ago
(address . guix-patches@gnu.org)
20210130081932.31088-1-levenson@mmer.org
* gnu/services/dns.scm (verify-knot-key-configuration): Change the order of memq attributes.
(verify-knot-keystore-configuration): Likewise.
(verify-knot-acl-configuration): Replace fold with every procedure.
---
gnu/services/dns.scm | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index b339eb0619..d4aefe6285 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -256,9 +256,9 @@
(let ((id (knot-key-configuration-id key)))
(unless (and (string? id) (not (equal? id "")))
(error-out "key id must be a non empty string.")))
- (unless (memq '(#f hmac-md5 hmac-sha1 hmac-sha224 hmac-sha256 hmac-sha384 hmac-sha512)
- (knot-key-configuration-algorithm key))
- (error-out "algorithm must be one of: #f, 'hmac-md5, 'hmac-sha1,
+ (unless (memq (knot-key-configuration-algorithm key)
+ '(#f hmac-md5 hmac-sha1 hmac-sha224 hmac-sha256 hmac-sha384 hmac-sha512))
+ (error-out "algorithm must be one of: #f, 'hmac-md5, 'hmac-sha1,
'hmac-sha224, 'hmac-sha256, 'hmac-sha384 or 'hmac-sha512")))
(define (verify-knot-keystore-configuration keystore)
@@ -267,9 +267,9 @@
(let ((id (knot-keystore-configuration-id keystore)))
(unless (and (string? id) (not (equal? id "")))
(error-out "keystore id must be a non empty string.")))
- (unless (memq '(pem pkcs11)
- (knot-keystore-configuration-backend keystore))
- (error-out "backend must be one of: 'pem or 'pkcs11")))
+ (unless (memq (knot-keystore-configuration-backend keystore)
+ '(pem pkcs11))
+ (error-out "backend must be one of: 'pem or 'pkcs11")))
(define (verify-knot-policy-configuration policy)
(unless (knot-policy-configuration? policy)
@@ -288,7 +288,7 @@
(unless (and (string? id) (not (equal? id "")))
(error-out "acl id must be a non empty string."))
(unless (and (list? address)
- (fold (lambda (x1 x2) (and (string? x1) (string? x2))) "" address))
+ (every string? address))
(error-out "acl address must be a list of strings.")))
(unless (boolean? (knot-acl-configuration-deny? acl))
(error-out "deny? must be #t or #f.")))
--
2.30.0
宋文武 wrote 4 years ago
(name . Alexey Abramov)(address . levenson@mmer.org)(address . 46185-done@debbugs.gnu.org)
OSZP286MB0664D26BF0A6871BCA43D725A38C9@OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM
Alexey Abramov <levenson@mmer.org> writes:

Toggle quote (9 lines)
> * gnu/services/dns.scm (verify-knot-key-configuration): Change the
> order of memq attributes.
> (verify-knot-keystore-configuration): Likewise.
> (verify-knot-acl-configuration): Replace fold with every procedure.
> ---
> gnu/services/dns.scm | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>

I adjust the commit message a bit and pushed, thank you!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 46185@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 46185
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help