aboutsummaryrefslogtreecommitdiff
path: root/src/connection/sudo.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection/sudo.lisp')
-rw-r--r--src/connection/sudo.lisp3
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)))