From d66e8f72483ef8c6d7aa1afd391075235b4f23d2 Mon Sep 17 00:00:00 2001 From: Xi Lu Date: Fri, 5 Feb 2016 18:03:57 +0100 Subject: [PATCH] * lisp/net/tramp-sh.el (tramp-methods) : Add. (Bug#22542) (tramp-default-user-alist): Add rule for "doas". (top): Completion function for "doas" is `tramp-completion-function-alist-su'. --- lisp/net/tramp-sh.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 8d01a4b2120..5771269417e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -307,6 +307,13 @@ The string is used in `tramp-methods'.") (tramp-remote-shell-args ("-c")) (tramp-connection-timeout 10))) ;;;###tramp-autoload +(add-to-list 'tramp-methods + '("doas" + (tramp-login-program "doas") + (tramp-login-args (("-u" "%u") ("-s"))) + (tramp-remote-shell "/bin/sh") + (tramp-connection-timeout 10))) +;;;###tramp-autoload (add-to-list 'tramp-methods '("ksu" (tramp-login-program "ksu") @@ -408,7 +415,7 @@ The string is used in `tramp-methods'.") ;;;###tramp-autoload (add-to-list 'tramp-default-user-alist - `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'") + `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu" "doas")) "\\'") nil "root")) ;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored. ;; Do not add "plink" based methods, they ask interactively for the user. @@ -483,6 +490,7 @@ The string is used in `tramp-methods'.") (tramp-set-completion-function "nc" tramp-completion-function-alist-telnet) (tramp-set-completion-function "su" tramp-completion-function-alist-su) (tramp-set-completion-function "sudo" tramp-completion-function-alist-su) + (tramp-set-completion-function "doas" tramp-completion-function-alist-su) (tramp-set-completion-function "ksu" tramp-completion-function-alist-su) (tramp-set-completion-function "sg" tramp-completion-function-alist-sg) (tramp-set-completion-function -- 2.39.2