bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#60722: 30.0.50; [PATCH] Using Tramp to sudo in Eshell doesn't change


From: Michael Albinus
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
User-agent: Gnus/5.13 (Gnus v5.13)

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]