From 37020ca341a5b406648b4f72976ab7206771d81e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 15 Sep 2021 15:14:24 +0200 Subject: [PATCH] * lisp/net/tramp-sh.el (tramp-methods): : Change template. (Bug#50594) --- lisp/net/tramp-sh.el | 9 +++++---- 1 file 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")) -- 2.39.5