]> git.eshelyaron.com Git - emacs.git/commit
Add 'file-user-uid' to get the connection-local effective UID
authorJim Porter <jporterbugs@gmail.com>
Tue, 10 Jan 2023 23:35:18 +0000 (15:35 -0800)
committerJim Porter <jporterbugs@gmail.com>
Tue, 17 Jan 2023 01:11:02 +0000 (17:11 -0800)
commit0bb8a011d57cb55c16ff502125b60e8e3bb3d5aa
tree4756c74e355419d4f14f569f0aa50ea2f13b6a49
parentbcaa63ac506dc070b29db13326801ff978e8b00d
Add 'file-user-uid' to get the connection-local effective UID

In particular, this lets Eshell show a "#" root prompt sigil when the
user has sudo'ed via "cd /sudo::" (bug#60722).

* lisp/simple.el (file-user-uid): New function.

* lisp/net/tramp.el (tramp-file-name-for-operation): Add
'file-user-uid'.
(tramp-handle-file-user-uid): New function.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
* lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist):
* lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist):
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
* lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist):
Add 'file-user-uid'.

* lisp/net/tramp-archive.el (tramp-archive-handle-file-user-uid): New
function...
(tramp-archive-file-name-handler-alist): ... use it.

* lisp/eshell/em-prompt.el (eshell-prompt-function): Use
'file-user-uid'.

* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add '$UID'.

* test/lisp/eshell/esh-var-tests.el (esh-var-test/uid-var): New test.

* doc/lispref/os.texi (User Identification): Document 'file-user-uid'.

* doc/lispref/files.texi (Magic File Names): Mention 'file-user-uid'.

* doc/misc/eshell.texi (Variables): Document '$UID'.  Add a missing
index entry for '$INSIDE_EMACS'.

* etc/NEWS: Announce 'file-user-uid'.
18 files changed:
doc/lispref/files.texi
doc/lispref/os.texi
doc/misc/eshell.texi
etc/NEWS
lisp/eshell/em-prompt.el
lisp/eshell/esh-var.el
lisp/net/tramp-adb.el
lisp/net/tramp-archive.el
lisp/net/tramp-crypt.el
lisp/net/tramp-gvfs.el
lisp/net/tramp-rclone.el
lisp/net/tramp-sh.el
lisp/net/tramp-smb.el
lisp/net/tramp-sshfs.el
lisp/net/tramp-sudoedit.el
lisp/net/tramp.el
lisp/simple.el
test/lisp/eshell/esh-var-tests.el