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


View this message in rfc822 format

From: Alfonso Sanchez-Beato <alfonsosanchezbeato <at> yahoo.es>
To: 68074 <at> debbugs.gnu.org
Subject: bug#68074: eshell sudo/doas does not work for aliases
Date: Wed, 27 Dec 2023 21:12:26 +0000 (UTC)
[Message part 1 (text/plain, inline)]
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.
[0001-lisp-eshell-em-alias.el-eshell-maybe-replace-by-alia.patch (text/x-patch, attachment)]

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.