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
View this message in rfc822 format
Jim Porter <jporterbugs <at> 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.
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.