GNU bug report logs - #68074
eshell sudo/doas does not work for aliases

Previous Next

Package: emacs;

Reported by: Alfonso Sanchez-Beato <alfonsosanchezbeato <at> yahoo.es>

Date: Thu, 28 Dec 2023 04:14:02 UTC

Severity: normal

Tags: patch

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 68074 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Alfonso Sanchez-Beato <alfonsosanchezbeato <at> yahoo.es>
Cc: Jim Porter <jporterbugs <at> gmail.com>, 68074 <at> debbugs.gnu.org
Subject: Re: bug#68074: eshell sudo/doas does not work for aliases
Date: Thu, 11 Jan 2024 13:00:17 -0800
Alfonso Sanchez-Beato <alfonsosanchezbeato <at> yahoo.es> writes:

> 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 ‘em-unix.el’.
> ~ $ 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.

Jim, could you take a look at this patch please?




This bug report was last modified 1 year and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.