chiark / gitweb /
zone.lisp: Fix `:sshfp' handling of literals.
[zone] / zone.lisp
index 8d35c0976dff20284c3f8c86efbccc042e1b2be6..a6c49447b1e0bd8f19a1b3c2506470cbd6d5ccec 100644 (file)
--- a/zone.lisp
+++ b/zone.lisp
@@ -207,8 +207,12 @@ (defstruct (zone-subdomain (:conc-name zs-))
   records)
 
 (export '*zone-output-path*)
-(defvar *zone-output-path* *default-pathname-defaults*
-  "Pathname defaults to merge into output files.")
+(defvar *zone-output-path* nil
+  "Pathname defaults to merge into output files.
+
+   If this is nil then use the prevailing `*default-pathname-defaults*'.
+   This is not the same as capturing the `*default-pathname-defaults*' from
+   load time.")
 
 (export '*preferred-subnets*)
 (defvar *preferred-subnets* nil
@@ -221,7 +225,7 @@ (defun zone-file-name (zone type)
   "Choose a file name for a given ZONE and TYPE."
   (merge-pathnames (make-pathname :name (string-downcase zone)
                                  :type (string-downcase type))
-                  *zone-output-path*))
+                  (or *zone-output-path* *default-pathname-defaults*)))
 
 (export 'zone-preferred-subnet-p)
 (defun zone-preferred-subnet-p (name)
@@ -696,12 +700,12 @@ (defzoneparse :sshfp (name data rec)
                 (fixnum what)
                 (symbol (or (get what prop)
                             (error "~S is not a known ~A" what prop))))))
-       (dolist (item (listify data)
-                (destructuring-bind (fpr &key (alg 'rsa) (type 'sha-1))
-                    (listify item)
-                  (rec :data (list (lookup alg 'sshfp-algorithm)
-                                   (lookup type 'sshfp-type)
-                                   fpr))))))))
+       (dolist (item (listify data))
+         (destructuring-bind (fpr &key (alg 'rsa) (type 'sha-1))
+             (listify item)
+           (rec :data (list (lookup alg 'sshfp-algorithm)
+                            (lookup type 'sshfp-type)
+                            fpr)))))))
 
 (defzoneparse :mx (name data rec :zname zname)
   ":mx ((HOST :prio INT :ip IPADDR)*)"