]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/tramp-sh.el (tramp-methods) <doas>: Add. (Bug#22542)
authorXi Lu <lx@shellcodes.org>
Fri, 5 Feb 2016 17:03:57 +0000 (18:03 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 5 Feb 2016 17:03:57 +0000 (18:03 +0100)
(tramp-default-user-alist): Add rule for "doas".
(top): Completion function for "doas" is
`tramp-completion-function-alist-su'.

lisp/net/tramp-sh.el

index 8d01a4b2120d32ac89c9e5360a121e53e382d0d5..5771269417e0cc4775c2801406e639abf8bfded8 100644 (file)
@@ -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