From: Michael Albinus <michael.albinus@gmx.de>
To: Jim Porter <jporterbugs@gmail.com>
Cc: 60722@debbugs.gnu.org
Subject: bug#60722: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil
Date: Wed, 11 Jan 2023 10:33:41 +0100 [thread overview]
Message-ID: <87eds1za8a.fsf@gmx.de> (raw)
In-Reply-To: <e92b71ba-6618-6b43-29a8-7dac35cb06a9@gmail.com> (Jim Porter's message of "Tue, 10 Jan 2023 15:50:03 -0800")
Jim Porter <jporterbugs@gmail.com> writes:
Hi Jim,
> Attached is a patch to do this. It adds a new function,
> 'user-uid-for-file', which is aware of file name handlers. Then, Tramp
> adds the appropriate handler. Now, Eshell can use that function and we
> get the prompt sigil we expect.
I haven't tested, but in general it looks good. There are some minor
changes I'm missing, for example documentation of the new function in
the Lisp Reference Manual "(elisp) User Identification", and a new test
case in tramp-tests.el, but this can wait.
More serious are the following comments:
> + ;; `user-uid-for-file' performed by default handler.
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.
> +(defun user-uid-for-file (filename)
> + "Return the effective uid for FILENAME.
> +For local files, this is equivalent to `user-uid' (which see),
> +but for remote files, this returns the effective uid for that
> +remote connection."
Please add, that it returns -1 in case the remote uid could not be
determined.
Best regards, Michael.
next prev parent reply other threads:[~2023-01-11 9:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 23:50 bug#60722: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change prompt sigil Jim Porter
2023-01-11 2:12 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-11 9:35 ` Michael Albinus
2023-01-11 9:33 ` Michael Albinus [this message]
2023-01-11 13:59 ` Michael Albinus
2023-01-14 21:59 ` Jim Porter
2023-01-14 22:10 ` Jim Porter
2023-01-15 9:23 ` Michael Albinus
2023-01-16 5:38 ` Jim Porter
2023-01-16 9:09 ` Michael Albinus
2023-01-17 1:21 ` Jim Porter
2023-01-17 9:12 ` Michael Albinus
2023-01-18 1:04 ` Jim Porter
2023-01-17 15:03 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eds1za8a.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=60722@debbugs.gnu.org \
--cc=jporterbugs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).