X-Git-Url: https://git.distorted.org.uk/~mdw/zone/blobdiff_plain/bd54e5099ea4282d3fdb094d0516a09006b08b26..0516211301c96f9394b73f36575b72ad21f51e4c:/zone.lisp diff --git a/zone.lisp b/zone.lisp index 53800f0..e819cd1 100644 --- a/zone.lisp +++ b/zone.lisp @@ -861,8 +861,8 @@ (rec :type :txt :data (nreverse things))))) -(defenum sshfp-algorithm (rsa 1) (dsa 2) (ecdsa 3)) -(defenum sshfp-type (sha-1 1) (sha-256 2)) +(defenum sshfp-algorithm () (:rsa 1) (:dsa 2) (:ecdsa 3)) +(defenum sshfp-type () (:sha-1 1) (:sha-256 2)) (export '*sshfp-pathname-defaults*) (defvar *sshfp-pathname-defaults* @@ -1245,7 +1245,7 @@ $TTL ~2@*~D~2%" (export 'bind-format-record) (defun bind-format-record (zr format &rest args) (format *zone-output-stream* - "~A~20T~@[~8D~]~30TIN ~A~40T~?~%" + "~A~20T~@[~8D~]~30TIN ~A~40T~?" (bind-output-hostname (zr-name zr)) (let ((ttl (zr-ttl zr))) (and (/= ttl (zone-default-ttl *writing-zone*)) @@ -1279,35 +1279,36 @@ $TTL ~2@*~D~2%" (format *zone-output-stream* " )~%"))))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :a)) zr) - (bind-format-record zr "~A" (ipaddr-string (zr-data zr)))) + (bind-format-record zr "~A~%" (ipaddr-string (zr-data zr)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :aaaa)) zr) - (bind-format-record zr "~A" (ipaddr-string (zr-data zr)))) + (bind-format-record zr "~A~%" (ipaddr-string (zr-data zr)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :ptr)) zr) - (bind-format-record zr "~A" (bind-hostname (zr-data zr)))) + (bind-format-record zr "~A~%" (bind-hostname (zr-data zr)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :cname)) zr) - (bind-format-record zr "~A" (bind-hostname (zr-data zr)))) + (bind-format-record zr "~A~%" (bind-hostname (zr-data zr)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :ns)) zr) - (bind-format-record zr "~A" (bind-hostname (zr-data zr)))) + (bind-format-record zr "~A~%" (bind-hostname (zr-data zr)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :mx)) zr) - (bind-format-record zr "~2D ~A" + (bind-format-record zr "~2D ~A~%" (cdr (zr-data zr)) (bind-hostname (car (zr-data zr))))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :srv)) zr) (destructuring-bind (prio weight port host) (zr-data zr) - (bind-format-record zr "~2D ~5D ~5D ~A" + (bind-format-record zr "~2D ~5D ~5D ~A~%" prio weight port (bind-hostname host)))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :sshfp)) zr) - (bind-format-record zr "~{~2D ~2D ~A~}" (zr-data zr))) + (bind-format-record zr "~{~2D ~2D ~A~}~%" (zr-data zr))) (defmethod zone-write-record ((format (eql :bind)) (type (eql :txt)) zr) - (bind-format-record zr "~{~#[\"\"~;~S~:;(~@{~%~8T~S~} )~]~}" (zr-data zr))) + (bind-format-record zr "~{~#[\"\"~;~S~:;(~@{~%~8T~S~} )~]~}~%" + (zr-data zr))) ;;;-------------------------------------------------------------------------- ;;; tinydns-data output format. @@ -1322,7 +1323,7 @@ $TTL ~2@*~D~2%" (dotimes (i (length data)) (let ((byte (aref data i))) (if (or (<= byte 32) - (>= byte 128) + (>= byte 127) (member byte '(#\: #\\) :key #'char-code)) (format out "\\~3,'0O" byte) (write-char (code-char byte) out)))))