diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-22 14:30:04 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-22 14:30:04 -0700 |
commit | 3d83bfef73f4faa7e674dd2601fc0731f6b279a3 (patch) | |
tree | d7b0c2662cff48ca308452ef3c849c19a60adb9b /src/connection/ssh.lisp | |
parent | 2cafe2e1273f41801471edfd3d0a4da523846421 (diff) | |
download | consfigurator-3d83bfef73f4faa7e674dd2601fc0731f6b279a3.tar.gz |
fix :SSH CONNECTION-READFILE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/ssh.lisp')
-rw-r--r-- | src/connection/ssh.lisp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/connection/ssh.lisp b/src/connection/ssh.lisp index be5afa6..faa16a9 100644 --- a/src/connection/ssh.lisp +++ b/src/connection/ssh.lisp @@ -56,10 +56,13 @@ (values (strcat err out) exit))) (defmethod connection-readfile ((c ssh-connection) path) - (multiple-value-bind (output error-code) - (run (sshcmd c "test" "-r" path "&&" "cat" path)) - (if (= 0 error-code) - output + (multiple-value-bind (out err exit-code) + (run :may-fail + (sshcmd c (format nil "test -r ~A && cat ~:*~A" + (escape-sh-token path)))) + (declare (ignore err)) + (if (= 0 exit-code) + out (error "File ~S not readable" path)))) (defmethod connection-writefile ((c ssh-connection) path contents) |