* bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root
@ 2024-12-03 19:51 the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-04 20:47 ` bug#74674: (No Subject) the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-03 19:51 UTC (permalink / raw)
To: 74674
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]
If I evaluate the code to enable trashing for root and try to delete an empty symbolic link from Eshell, I get:
File is missing: /path/to/link
Steps to reproduce:
1. emacs -Q
2. M-: (connection-local-set-profile-variables 'remote-trash-directory '((trash-directory . "/sudo::~/.local/share/trash/")))
3. M-: (connection-local-set-profiles `(:application tramp :protocol "sudo" :machine ,(system-name)) 'remote-trash-directory)
4. M-x eshell
5. (require 'em-tramp)
6. (setq delete-by-moving-to-trash t)
7. sudo touch /usr/local/bin/test-file
8. ln -s /sudo::/usr/local/bin/test-file /sudo::/usr/local/bin/test-file-line
9. sudo rm /usr/local/bin/test-file
10. sudo rm /usr/local/bin/test-file-line
"File is missing: /usr/local/bin/test-file-link".
Expected behavior:
I'm able to delete it.
[-- Attachment #2: Type: text/html, Size: 1383 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74674: (No Subject)
2024-12-03 19:51 bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-04 20:47 ` the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 2:04 ` Jim Porter
2024-12-06 17:35 ` the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 1:49 ` bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root Stefan Kangas
2 siblings, 1 reply; 5+ messages in thread
From: the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-04 20:47 UTC (permalink / raw)
To: 74674@debbugs.gnu.org
[-- Attachment #1: Type: text/plain, Size: 356 bytes --]
The problem got even more complicated. Now i'm trying to just delete any file, and i can't do that whether i have trashing enabled or not:
~/.emacs.d $ (require 'em-tramp)
em-tramp
~/.emacs.d [1] $ eshell/sudo touch /usr/local/bin/test-file
~/.emacs.d $ eshell/sudo rm /usr/local/bin/test-fileRemoving old name: Permission denied, /usr/local/bin/test-file
[-- Attachment #2: Type: text/html, Size: 662 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74674: (No Subject)
2024-12-03 19:51 bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-04 20:47 ` bug#74674: (No Subject) the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-06 17:35 ` the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 1:49 ` bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root Stefan Kangas
2 siblings, 0 replies; 5+ messages in thread
From: the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-12-06 17:35 UTC (permalink / raw)
To: 74674@debbugs.gnu.org
[-- Attachment #1: Type: text/plain, Size: 56 bytes --]
I can delete the file if i just use /usr/bin/rm instead.
[-- Attachment #2: Type: text/html, Size: 231 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root
2024-12-03 19:51 bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-04 20:47 ` bug#74674: (No Subject) the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-06 17:35 ` the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-09 1:49 ` Stefan Kangas
2 siblings, 0 replies; 5+ messages in thread
From: Stefan Kangas @ 2024-12-09 1:49 UTC (permalink / raw)
To: the_wurfkreuz, 74674; +Cc: Jim Porter
the_wurfkreuz via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:
> If I evaluate the code to enable trashing for root and try to delete an empty symbolic link from Eshell, I get:
> File is missing: /path/to/link
>
> Steps to reproduce:
>
> 1. emacs -Q
> 2. M-: (connection-local-set-profile-variables 'remote-trash-directory '((trash-directory . "/sudo::~/.local/share/trash/")))
> 3. M-: (connection-local-set-profiles `(:application tramp :protocol "sudo" :machine ,(system-name)) 'remote-trash-directory)
> 4. M-x eshell
> 5. (require 'em-tramp)
> 6. (setq delete-by-moving-to-trash t)
> 7. sudo touch /usr/local/bin/test-file
> 8. ln -s /sudo::/usr/local/bin/test-file /sudo::/usr/local/bin/test-file-line
> 9. sudo rm /usr/local/bin/test-file
> 10. sudo rm /usr/local/bin/test-file-line
>
> "File is missing: /usr/local/bin/test-file-link".
>
> Expected behavior:
>
> I'm able to delete it.
I'm copying in Jim Porter.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#74674: (No Subject)
2024-12-04 20:47 ` bug#74674: (No Subject) the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-12-09 2:04 ` Jim Porter
0 siblings, 0 replies; 5+ messages in thread
From: Jim Porter @ 2024-12-09 2:04 UTC (permalink / raw)
To: the_wurfkreuz, 74674@debbugs.gnu.org
On 12/4/2024 12:47 PM, the_wurfkreuz via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
> The problem got even more complicated. Now i'm trying to just delete any
> file, and i can't do that whether i have trashing enabled or not:
>
> ~/.emacs.d $ (require 'em-tramp)
> em-tramp
> ~/.emacs.d [1] $ eshell/sudo touch /usr/local/bin/test-file
> ~/.emacs.d $ eshell/sudo rm /usr/local/bin/test-file
> Removing old name: Permission denied, /usr/local/bin/test-file
This is the correct behavior; you shouldn't be able to delete the file
using this method. In short, "/usr/local/bin/test-file" refers to a
*local* file name, so it's not going through Tramp's "sudo" method, and
thus it's correct to report that you don't have permission.
Some more detail: Eshell built-in commands like "rm" (which the built-in
"eshell/sudo" will call) treat absolute file names as ordinary, local
files, just like the rest of Emacs would. Specifically, it won't
automatically prepend the "/sudo::" method to it. Doing that is
bug#70792, which I have a patch for but haven't finished yet.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-12-09 2:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 19:51 bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-04 20:47 ` bug#74674: (No Subject) the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 2:04 ` Jim Porter
2024-12-06 17:35 ` the_wurfkreuz via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-09 1:49 ` bug#74674: 30.0.91; Can't delete an empty symlink when trashing is enabled for root Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).