From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alfonso Sanchez-Beato via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68074: eshell sudo/doas does not work for aliases Date: Wed, 27 Dec 2023 21:12:26 +0000 (UTC) Message-ID: <31356544.8861481.1703711546895@mail.yahoo.com> References: <31356544.8861481.1703711546895.ref@mail.yahoo.com> Reply-To: Alfonso Sanchez-Beato Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_8861480_915044301.1703711546895" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30208"; mail-complaints-to="usenet@ciao.gmane.io" To: 68074@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 28 05:14:31 2023 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 1rIhmx-0007gr-Gp for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Dec 2023 05:14:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIhmX-0008Pt-UD; Wed, 27 Dec 2023 23:14:06 -0500 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 1rIhmW-0008Ow-3x for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 23:14:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIhmV-0006Ci-S7 for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 23:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIhmU-0006pz-MY for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 23:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alfonso Sanchez-Beato Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Dec 2023 04:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68074 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.170373678626176 (code B ref -1); Thu, 28 Dec 2023 04:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Dec 2023 04:13:06 +0000 Original-Received: from localhost ([127.0.0.1]:38217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIhlZ-0006o2-Fa for submit@debbugs.gnu.org; Wed, 27 Dec 2023 23:13:06 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:51234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIbCp-00074J-9m for submit@debbugs.gnu.org; Wed, 27 Dec 2023 16:12:48 -0500 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 1rIbCk-0003V7-5z for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 16:12:42 -0500 Original-Received: from sonic309-25.consmr.mail.ir2.yahoo.com ([77.238.179.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIbCZ-0007ul-Ug for bug-gnu-emacs@gnu.org; Wed, 27 Dec 2023 16:12:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1703711547; bh=98E52AuraGVkGK29nri9Sz1f19oLfqV2lVFDWYIhDZ4=; h=Date:From:To:Subject:References:From:Subject:Reply-To; b=iau7ULLVPiiiJBuRF9PbJ6Fk4eAAdBUgXz7wcoeqvUFcVTAIMdN5/7Y1fqJQQ0IVVGG04lBfv6zOgOsQB3WQoRosBIH+XLl9zClmvSkrOeA0IDDxBVfHxsNO1mIGZIT0kGsMfpiRogI0rvodUmCxkRAovQcbJmVkgB8lzTEEWTOHNyrzAvqmmNpb21i+JY2kH94JwqUsFUH/+5S41kvOujeKXBl0l+HgcZReFrYjTLbwKayFHVe/sc9cEqsbiz08jr1PhRY8zUa4P9/5oyCfES4+iUK9byzg0sXdPhc/wZLX+sLXNdizkOHvxpVoBXaA+aZ2VdIV1UMsEacGJO6Mkw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1703711547; bh=8Pj+v53DCP794mI25Iz1ra1FFhhGuKGho6JM1KV+AOW=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=Gf9Li8N9+qLH3lAY1NYDUDDd3iX9e5yR90bsRHyAgIeBLubXw60RWP6B78P6ymUmyMDMWLEh5f5YtGGTwwn+061LeHYpLIZwF1jUZVOQZTWQgg+nlGxl3S3uHE3DU/uxQ2aCCXWvZ/iczFyh4nksv7LGTjXvna4jSeYBLzPirtkSgi36NbdHAKeZ/VNUnIKV493MZMOQF0tFR/D2SW0s2s5Jy8PO4QI3qPHb7zDUSJKW5PQO1eCCRymnB+fQkqfkUv1vMmOjArq5jhoPBYGVrp8Ksutu9IFIAy80ThAoRAgVFdewZJjSWZ0aE6xPhQawUUVPas5HrrrP2vuu48jDXg== X-YMail-OSG: dfaOhZIVM1mc2JEJoXvqWht412sseRI47FBOuSBNcADwY24X93wzK7KSusUB37y oojNABxpQnEMRegD.XjX7byhXlhv.Q_hmwROGre2OFZlMF0g4726h9Kq_jiz4fdAKVAAMvMU3gxD c7EXNvts2j7FLk842FEjm8qbxsK3af4PFeLk6K0VU2RIhg.y9f9QzjCG0K047yNurOzKEVQVX75s AniAwOQNAjOEm7AMUBEj0OL67FKsYyHBj9hEYDhixMudiZ6h7_Hj9uBPugPf03OPXjUOuUPJT2oK OBXYzwRA.KUq8CogNCEsmQypDJNPUr6rb2ye8bW7zQeuFXDVNyLvaIRKD6pwqs07cMCOU5R3On4e O26s6uXQ1tvgyeYeRpAA27dZzOzobRNfk.NV1n_eVNmdCFUfV519ANdV2GvDvQxfqnidEve42dWV Z58i2SJ82so9dj6KJYNQLyb9W6Fw8dfxheikKJWH4RUeyxprgRGPuZrLJlkEPqs3tv1Jz3WoEUKq G45soUhyBONRrEMtxSJgAe8HpfvVRvo.jNvlV1Rvc1ZzrD3IRnLn3Va_7HR2Gb96WRI3XMbCA9yP TeURiYjnn0X4mS81EF0553okRqz_PrqqS2Jb0D2zBTubkg887VIXmVVd9NfwiAOo04XcXO8qt_2U NKvCJ6J0hc7Ltmph5f3MCjpscPA0J6wWr6.Qrah.MmQFRCJTt5x701XF.W6Svgu.ofV6.gNUH5wV XqKKuLiP2zgtdJr6CWSESooQchsiFAD2MHye_FHJ9Bo331rGEXGpSSwQwSAfe4Fj9mIIN2wWMQLR mJ4N89oUKgg7P1B3wjhJQy8njO6VUcOz57Zzo8.of7 X-Sonic-MF: X-Sonic-ID: 1074bac6-8820-4df7-8667-9f6a4815260c Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.ir2.yahoo.com with HTTP; Wed, 27 Dec 2023 21:12:27 +0000 X-Mailer: WebService/1.1.21952 YMailNorrin Received-SPF: pass client-ip=77.238.179.83; envelope-from=alfonsosanchezbeato@yahoo.es; helo=sonic309-25.consmr.mail.ir2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 27 Dec 2023 23:13:03 -0500 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276951 Archived-At: ------=_Part_8861480_915044301.1703711546895 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable sudo/doas does not give the expected permissions when using an eshell alias= : When no alias has been defined: ~ $ which cp eshell/cp is a native-compiled Lisp function in =E2=80=98em-unix.el=E2=80= =99. ~ $ touch test ~ $ cp test /boot/efi/ Opening output file: Permission denied, /boot/efi/test ~ $ sudo cp test /boot/efi/ ~ $ echo $? 0 But after defining the alias: ~ $ alias cp '*cp $*' ~ $ which cp cp is an alias, defined as "*cp $*" ~ $ sudo cp test /boot/efi/ /usr/bin/cp: cannot stat '/boot/efi/test': Permission denied I have attached a patch with a possible fix. ------=_Part_8861480_915044301.1703711546895 Content-Type: text/x-patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-lisp-eshell-em-alias.el-eshell-maybe-replace-by-alia.patch" Content-ID: <2b873efe-c2d9-103d-9be2-f28c689d864d@yahoo.com> RnJvbSAyNWUxMmU1OTEyZTJlZjViY2FiMzU5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IGFmdGVyIG1hbnVhbGx5IGVkaXRpbmcgdGhlIGNvbnRlbnRzIG9mIHRo ZSBmaWxlLiIKIAkgICAgICAgKG1lbWJlciBjb21tYW5kIGVzaGVsbC1wcmV2ZW50LWFsaWFzLWV4 cGFuc2lvbikpCiAgICAgKGxldCAoKGFsaWFzIChlc2hlbGwtbG9va3VwLWFsaWFzIGNvbW1hbmQp KSkKICAgICAgIChpZiBhbGlhcwotCSAgKHRocm93ICdlc2hlbGwtcmVwbGFjZS1jb21tYW5kCi0J CSBgKGxldCAoKGVzaGVsbC1jb21tYW5kLW5hbWUgJyxlc2hlbGwtbGFzdC1jb21tYW5kLW5hbWUp CisgICAgICAgICAgKGxldCAoKHZhcnMgYCgoZXNoZWxsLWNvbW1hbmQtbmFtZSAnLGVzaGVsbC1s YXN0LWNvbW1hbmQtbmFtZSkKICAgICAgICAgICAgICAgICAgICAgICAgIChlc2hlbGwtY29tbWFu ZC1hcmd1bWVudHMgJyxlc2hlbGwtbGFzdC1hcmd1bWVudHMpCiAgICAgICAgICAgICAgICAgICAg ICAgICAoZXNoZWxsLXByZXZlbnQtYWxpYXMtZXhwYW5zaW9uCi0gICAgICAgICAgICAgICAgICAg ICAgICAgJywoY29ucyBjb21tYW5kIGVzaGVsbC1wcmV2ZW50LWFsaWFzLWV4cGFuc2lvbikpKQot ICAgICAgICAgICAgICAgICAgICAsKGVzaGVsbC1wYXJzZS1jb21tYW5kIChudGggMSBhbGlhcykp KSkpKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgJywoY29ucyBjb21tYW5kIGVzaGVsbC1w cmV2ZW50LWFsaWFzLWV4cGFuc2lvbikpKSkpCisgICAgICAgICAgICA7OyBTZXQgZGVmYXVsdC1k aXJlY3RvcnkgYXMgaXQgbWlnaHQgaGF2ZSBiZWVuIHNldCBieSBzdWRvL2RvYXMsIHVubGVzcwor ICAgICAgICAgICAgOzsgd2Ugd2FudCB0byBjaGFuZ2UgaXQgcGVybWFuZW50bHkuCisgICAgICAg ICAgICAoaWYgKG5vdCAoc3RyaW5nLXByZWZpeC1wIChjYXIgKHNwbGl0LXN0cmluZyAobnRoIDEg YWxpYXMpICIgIikpICJjZCIpKQorICAgICAgICAgICAgICAgIChwdXNoIGAoZGVmYXVsdC1kaXJl Y3RvcnkgJyxkZWZhdWx0LWRpcmVjdG9yeSkgdmFycykpCisJICAgICh0aHJvdyAnZXNoZWxsLXJl cGxhY2UtY29tbWFuZAorCQkgICBgKGxldCAsdmFycworICAgICAgICAgICAgICAgICAgICAgICwo ZXNoZWxsLXBhcnNlLWNvbW1hbmQgKG50aCAxIGFsaWFzKSkpKSkpKSkpCiAKIChkZWZ1biBlc2hl bGwtYWxpYXMtY29tcGxldGlvbnMgKG5hbWUpCiAgICJGaW5kIGFsbCBwb3NzaWJsZSBjb21wbGV0 aW9ucyBmb3IgTkFNRS4KLS0gCjIuMzQuMQoK ------=_Part_8861480_915044301.1703711546895--