diff options
| author | Jim Porter | 2023-01-10 15:35:18 -0800 |
|---|---|---|
| committer | Jim Porter | 2023-01-16 17:11:02 -0800 |
| commit | 0bb8a011d57cb55c16ff502125b60e8e3bb3d5aa (patch) | |
| tree | 4756c74e355419d4f14f569f0aa50ea2f13b6a49 /doc/misc | |
| parent | bcaa63ac506dc070b29db13326801ff978e8b00d (diff) | |
| download | emacs-0bb8a011d57cb55c16ff502125b60e8e3bb3d5aa.tar.gz emacs-0bb8a011d57cb55c16ff502125b60e8e3bb3d5aa.zip | |
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'.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/eshell.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index fc7d52eb711..c40ff58f42c 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi | |||
| @@ -983,6 +983,13 @@ whenever you change the current directory to a different host | |||
| 983 | the value will automatically update to reflect the search path on that | 983 | the value will automatically update to reflect the search path on that |
| 984 | host. | 984 | host. |
| 985 | 985 | ||
| 986 | @vindex $UID | ||
| 987 | @item $UID | ||
| 988 | This returns the effective @acronym{UID} for the current user. This | ||
| 989 | variable is connection-aware, so when the current directory is remote, | ||
| 990 | its value will be @acronym{UID} for the user associated with that | ||
| 991 | remote connection. | ||
| 992 | |||
| 986 | @vindex $_ | 993 | @vindex $_ |
| 987 | @item $_ | 994 | @item $_ |
| 988 | This refers to the last argument of the last command. With a | 995 | This refers to the last argument of the last command. With a |
| @@ -1014,6 +1021,7 @@ that are currently visible in the Eshell window. They are both | |||
| 1014 | copied to the environment, so external commands invoked from | 1021 | copied to the environment, so external commands invoked from |
| 1015 | Eshell can consult them to do the right thing. | 1022 | Eshell can consult them to do the right thing. |
| 1016 | 1023 | ||
| 1024 | @vindex $INSIDE_EMACS | ||
| 1017 | @item $INSIDE_EMACS | 1025 | @item $INSIDE_EMACS |
| 1018 | This variable indicates to external commands that they are being | 1026 | This variable indicates to external commands that they are being |
| 1019 | invoked from within Emacs so they can adjust their behavior if | 1027 | invoked from within Emacs so they can adjust their behavior if |