From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#58899: [PATCH v1] Add the "doas" alias to eshell. Date: Sun, 30 Oct 2022 14:51:26 -0700 Message-ID: <286825e7-2dc2-9cc7-73a3-1056a249d56f@gmail.com> References: <87pme92rge.fsf@ditto.jhoto.spork.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11948"; mail-complaints-to="usenet@ciao.gmane.io" To: Brian Cully , 58899@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 30 22:52:22 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opGE9-0002xG-EJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Oct 2022 22:52:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opGDt-0004DL-4S; Sun, 30 Oct 2022 17:52:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opGDq-0004DB-UM for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 17:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opGDq-0005Hi-Mn for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 17:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opGDq-0000uC-AV for bug-gnu-emacs@gnu.org; Sun, 30 Oct 2022 17:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Oct 2022 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58899 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58899-submit@debbugs.gnu.org id=B58899.16671666963445 (code B ref 58899); Sun, 30 Oct 2022 21:52:02 +0000 Original-Received: (at 58899) by debbugs.gnu.org; 30 Oct 2022 21:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:39114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opGDP-0000tV-Ii for submit@debbugs.gnu.org; Sun, 30 Oct 2022 17:51:35 -0400 Original-Received: from mail-pj1-f48.google.com ([209.85.216.48]:36760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opGDO-0000tI-1x for 58899@debbugs.gnu.org; Sun, 30 Oct 2022 17:51:34 -0400 Original-Received: by mail-pj1-f48.google.com with SMTP id u8-20020a17090a5e4800b002106dcdd4a0so14330980pji.1 for <58899@debbugs.gnu.org>; Sun, 30 Oct 2022 14:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=dwR3ZHRYOvJWdZ0KvRQ5aBa6iJMJ5+yqBdrd7oD9ta4=; b=N+7LIXdiSdTKaCHMIddXO1jsAoNOyBKx3aA1jR9cI4IN3y1eobGwZ+aBPB6gkgMrtV 5iTDpa/neeQd/QtlUq593EYuviTIeQjmi33V3cc33FKkgVRCDwWRZWH+AcFkfn5d6fuO Y246UAZ00jK5czvWL8nZrx6k3emFXhXEjiPxjG9I+UeSD2cz8oxCH+ODn0tQbHhmRH8R qYKMFrrLxnqqtR2kx69rCFxiYGUqv+ijaA0x2ZcEvIjJbNUu9erEr7Z22BsMNwME1y3y GgX1B53gyk++/OdUNyFl+bgHRNn6/pojo6BbsaTVZafF2q3j/zdeniuwpKjn+i36fA8L IcAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dwR3ZHRYOvJWdZ0KvRQ5aBa6iJMJ5+yqBdrd7oD9ta4=; b=L9Df4mSHHTPxiKgtq872xfCL0OT2CAmtZeM12mmGDa210SHYdbROxlEYRPEZRpSC3O +siCx34wRIAwuKfXl4UqReyYA8XjVxzSlxbbN7rSgzT/mULJqrAKY4pHcTZF+wrWa1NH 3ROkN2MSC77gw6xALZ9kOlmFh7PoNGOVpWiMObTMHLc46JB/6J4t5071thb4xt6Zm1yp TOlH9MirCE/7h4lR6ieQRgv7EPVLM4DrSPlHhGfdQsyGGqsgii1nIAaWSIq2ei06NPXc mriI2gjL3rF6HP/Xy8kAA1lA07qQk3Dbdak7By/do6GRakHW/YLiBLLlJDg3GAjSNU9l lr3g== X-Gm-Message-State: ACrzQf1cOFDJcLVdxIbi7/04ps9h5Aso3DZ/iiia3bLBuCVKnenBPbCp nxOq0evmyG2TYKaH2nRku2R9uG8itg0= X-Google-Smtp-Source: AMsMyM5+rpn4W/En3fZzPYsAIzoMVNPj7/Ms9RdPXLdOR14Y60X2mDc2keHu2cmwHSCG0PGUSIeh5g== X-Received: by 2002:a17:90b:3c8a:b0:213:e48a:3ac5 with SMTP id pv10-20020a17090b3c8a00b00213e48a3ac5mr1790843pjb.48.1667166687968; Sun, 30 Oct 2022 14:51:27 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id b9-20020a17090a9bc900b0020af2411721sm2761370pjw.34.2022.10.30.14.51.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Oct 2022 14:51:27 -0700 (PDT) Content-Language: en-US In-Reply-To: <87pme92rge.fsf@ditto.jhoto.spork.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246652 Archived-At: On 10/30/2022 9:42 AM, Brian Cully via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > > This patch adds a “doas” command alias to eshell for users who prefer > doas, similar to the existing “su” and “sudo” command aliases. Thanks. I think this would be a good addition to Eshell. > I'm unsare whether to use “TRAMP” or “Tramp” spelling. The existing > routines in the file use the former, but I've been informed the latter > is correct. A future patch should make all spellings (at least within > this module) consistent. I'd say go with "Tramp" like you did in your patch. Since you're modifying code near most of the existing usages of "TRAMP", now would probably be a good time to fix that everywhere in the file too. > Additionaly, I've added a function for calculating the remote-path for > files accessed with doas. This function is currently limited to *only* > doas, because I didn't want to mess with the other su and sudo > functions, but there's no reason it can't be shared, and a future patch > should implement that sharing if this patch is considered desirable. Since the 'eshell/doas' and 'eshell/sudo' functions are so similar, I definitely think it would make sense to share as much code as possible here. In particular, you could also add support for "--shell" to 'eshell/sudo'. There are some existing tests in test/lisp/eshell/em-tramp-tests.el, so I think it should be fairly safe to adjust 'eshell/sudo'; the regression tests should catch any problems. (Well ok, *some* problems.) It would probably be good to add some simple tests for 'eshell/doas' too.