diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-19 10:42:16 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-19 18:55:47 -0700 |
commit | 03faea5bac3337a23d821078984c12bdbedeb022 (patch) | |
tree | d56799fd215e102e61323f43a8670dd67f5b56ed /src/connection/sudo.lisp | |
parent | b79d04778cd98026370336dce955d668a5ef8395 (diff) | |
download | consfigurator-03faea5bac3337a23d821078984c12bdbedeb022.tar.gz |
:SUDO connection type: reset the working directory
We want use of this connection type to be as close as possible to just SSHing
in as root.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/sudo.lisp')
-rw-r--r-- | src/connection/sudo.lisp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp index 95d31fa..6612414 100644 --- a/src/connection/sudo.lisp +++ b/src/connection/sudo.lisp @@ -78,7 +78,8 @@ ;; wrap in sh -c so that it is more likely we are either asked for a ;; password for all our commands or not asked for one for any (format nil "sudo -HkS --prompt=\"\" --user=~A sh -c ~A" - (slot-value connection 'user) (escape-sh-token cmd))) + (slot-value connection 'user) + (escape-sh-token (strcat "cd \"$HOME\"; " cmd)))) (defmethod connection-run ((c sudo-connection) cmd (input null)) (call-next-method c cmd (slot-value c 'password))) |