GNU bug report logs -
#60722
30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Tue, 10 Jan 2023 23:51:02 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 60722 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 1/11/2023 5:59 AM, Michael Albinus wrote:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
> Hi Jim,
>
>> We shouldn't do this. user-uid-for-file would return the *local* uid,
>> which is wrong. So please, for all handlers apply
>>
>>> + (user-uid-for-file . tramp-handle-user-uid-for-file)
>>
>> Except in tramp-archive.el, where ignore as handler seems to be appropriate.
>
> Thinking about, I believe we need an own function for
> tramp-archive.el. Something like (untested)
>
> --8<---------------cut here---------------start------------->8---
> (defun tramp-archive-user-uid-for-file (filename)
> "Like `user-uid-for-file' for file archives."
> (user-uid-for-file (tramp-archive-gvfs-file-name filename)))
> --8<---------------cut here---------------end--------------->8---
>
> This should return the local uid for local archives, and the remote uid
> for remote archives.
Thanks. See attached. I also updated the base implementation of
'tramp-handle-user-uid-for-file' to return -1 even if
'tramp-get-remote-uid' returns nil (some Tramp methods set the latter
handler to be 'ignore').
I also added a new Eshell special variable, '$UID', which does about
what you'd expect. This makes Eshell work like other shells, which also
have a special '$UID' variable.
Finally, I added documentation to the manuals. I didn't add any Tramp
regression tests though, since I wasn't sure of the right way to test this.
[0001-Add-user-uid-for-file-to-get-the-effective-UID-for-r.patch (text/plain, attachment)]
This bug report was last modified 2 years and 126 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.