From 159ff0bda5c67767599509313468c157118ad70e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 2 Apr 2022 14:06:53 -0700 Subject: rename READFILE, WRITEFILE, corresponding generics and some wrappers Signed-off-by: Sean Whitton --- src/connection/local.lisp | 12 ++++++------ src/connection/shell-wrap.lisp | 12 ++++++------ src/connection/sudo.lisp | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/connection') diff --git a/src/connection/local.lisp b/src/connection/local.lisp index 2c79036..d8a6880 100644 --- a/src/connection/local.lisp +++ b/src/connection/local.lisp @@ -42,16 +42,16 @@ (declare (ignore _)) (values output exit-code))) -(defmethod connection-readfile ((connection local-connection) path) +(defmethod connection-read-file ((connection local-connection) path) (read-file-string path)) -(defmethod connection-readfile-and-remove ((connection local-connection) path) +(defmethod connection-read-and-remove-file ((connection local-connection) path) (prog1 (read-file-string path) (delete-file path))) -(defmethod connection-writefile ((connection local-connection) - path - content - mode) +(defmethod connection-write-file ((connection local-connection) + path + content + mode) ;; we cannot use UIOP:WITH-TEMPORARY-FILE etc., because those do not ensure ;; the file is only readable by us, and we might be writing a secret key (with-remote-temporary-file diff --git a/src/connection/shell-wrap.lisp b/src/connection/shell-wrap.lisp index 2867e20..51591b8 100644 --- a/src/connection/shell-wrap.lisp +++ b/src/connection/shell-wrap.lisp @@ -36,16 +36,16 @@ out (error "Could not read~:[~; and/or remove~] ~S" delete path)))) -(defmethod connection-readfile ((c shell-wrap-connection) path) +(defmethod connection-read-file ((c shell-wrap-connection) path) (%readfile c path)) -(defmethod connection-readfile-and-remove ((c shell-wrap-connection) path) +(defmethod connection-read-and-remove-file ((c shell-wrap-connection) path) (%readfile c path t)) -(defmethod connection-writefile ((conn shell-wrap-connection) - path - content - mode) +(defmethod connection-write-file ((conn shell-wrap-connection) + path + content + mode) (let ((cmd (format nil "set -e diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp index a8fa3dc..cbdf259 100644 --- a/src/connection/sudo.lisp +++ b/src/connection/sudo.lisp @@ -66,9 +66,9 @@ ;; We'll send the password followed by ^M, then the ;; real stdin. Use CODE-CHAR in this way so that we ;; can be sure ASCII ^M is what will get emitted. - (writefile it (strcat (passphrase password) - (string (code-char 13))) - :mode #o600))))) + (write-remote-file it (strcat (passphrase password) + (string (code-char 13))) + :mode #o600))))) (defmethod connection-tear-down :after ((connection sudo-connection)) (when-let ((file (slot-value connection 'password-file))) -- cgit v1.2.3