From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xi Lu Newsgroups: gmane.emacs.bugs Subject: bug#22542: [PATCH] Add support for `doas` command. Date: Wed, 3 Feb 2016 17:19:33 +0800 Message-ID: <1454491173-25230-1-git-send-email-lx@shellcodes.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1454491283 23354 80.91.229.3 (3 Feb 2016 09:21:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Feb 2016 09:21:23 +0000 (UTC) Cc: Xi Lu To: 22542@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 03 10:21:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aQtcc-0001lu-AX for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 10:21:10 +0100 Original-Received: from localhost ([::1]:33482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtca-0007KH-MW for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Feb 2016 04:21:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtcX-0007K8-LJ for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:21:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQtcU-0004rM-Ec for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:21:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtcU-0004rH-Ar for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aQtcU-0000L1-3e for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xi Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2016 09:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22542 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14544912071221 (code B ref -1); Wed, 03 Feb 2016 09:21:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Feb 2016 09:20:07 +0000 Original-Received: from localhost ([127.0.0.1]:57459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQtbb-0000Jc-3L for submit@debbugs.gnu.org; Wed, 03 Feb 2016 04:20:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33307) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aQtba-0000J5-A9 for submit@debbugs.gnu.org; Wed, 03 Feb 2016 04:20:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQtbU-0004cl-9x for submit@debbugs.gnu.org; Wed, 03 Feb 2016 04:20:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:58532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtbU-0004ch-6p for submit@debbugs.gnu.org; Wed, 03 Feb 2016 04:20:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtbT-00078A-BR for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:20:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQtbQ-0004br-4n for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:19:59 -0500 Original-Received: from smtpbg65.qq.com ([103.7.28.233]:15432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQtbP-0004bF-JU for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2016 04:19:56 -0500 X-QQ-mid: Xesmtp27t1454491183t301t0507 Original-Received: from lx-pc (unknown [61.157.126.25]) by esmtp4.qq.com (ESMTP) with id ; Wed, 03 Feb 2016 17:19:41 +0800 (CST) X-QQ-SSF: B1000000000000F0FF103300000000Z X-QQ-FEAT: nSUdqPGu3ttOSRLS95sEmHRw6YzpcAtoKGQVhX3rrn2IykeuCN2alJ+lZ8J07 RS/5kMZ+WLwnlx0gY7fYOqcXzlp4fJfc4d2klI40qwTEveCCFprhBc923NlKuEf/0CVR64R lFXrF5XhvH44/y7xKkeF2NewdQK9GSTzBk6L3BlHNrIsMo6MnTOlbltSZDVRP3sGDFLandT cSpBCmlxFPNhuMgq+33Tt1ZYkT3lVSIdHJKMxfU9NDiC6BCz1qwnKYYFX0TH5a2c= X-QQ-GoodBg: 0 X-Mailer: git-send-email 2.5.0 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:112330 Archived-At: In OpenBSD5.8, `sudo` has been replaced with b`doas`. --- 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 1f43747..11aa495 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -300,6 +300,13 @@ tramp-ssh-controlmaster-options (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") (tramp-login-args (("%u") ("-q"))) @@ -401,7 +408,7 @@ tramp-ssh-controlmaster-options ;;;###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. @@ -471,6 +478,7 @@ tramp-completion-function-alist-putty (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 "krlogin" tramp-completion-function-alist-rsh) -- 2.5.0