summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/net/tramp-sh.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index dc049782fd2..d0a340a5df7 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -280,13 +280,14 @@ The string is used in `tramp-methods'.")
(tramp-connection-timeout 10)))
(add-to-list 'tramp-methods
`("sudo"
- (tramp-login-program "sudo")
+ (tramp-login-program "env")
;; The password template must be masked. Otherwise,
;; it could be interpreted as password prompt if the
;; remote host echoes the command.
- (tramp-login-args (("-u" "%u") ("-s") ("-H")
- ("-p" "P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":")
- ("%l")))
+ ;; The "-p" argument doesn't work reliably, see Bug#50594.
+ (tramp-login-args (("SUDO_PROMPT=P\"\"a\"\"s\"\"s\"\"w\"\"o\"\"r\"\"d\"\":")
+ ("sudo") ("-u" "%u") ("-s") ("-H")
+ ("%l")))
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-c"))