[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tramp 73bdb480f6: Tramp ELPA version 2.7.1.5 released
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tramp 73bdb480f6: Tramp ELPA version 2.7.1.5 released |
Date: |
Fri, 29 Nov 2024 03:59:05 -0500 (EST) |
branch: externals/tramp
commit 73bdb480f64af3b7f39f382905f3edc5a76cb665
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Tramp ELPA version 2.7.1.5 released
---
README | 6 +-
test/tramp-tests.el | 99 ++++++++++--
texi/tramp.texi | 438 ++++++++++++++++++++++++++++++----------------------
texi/trampver.texi | 2 +-
tramp-adb.el | 9 +-
tramp-cache.el | 17 +-
tramp-message.el | 2 +-
tramp-sh.el | 13 +-
tramp-smb.el | 2 +-
tramp-sudoedit.el | 2 +-
tramp.el | 308 ++++++++++++++++++++++--------------
trampver.el | 6 +-
12 files changed, 571 insertions(+), 333 deletions(-)
diff --git a/README b/README
index 11936ba7ef..939c9c06f6 100644
--- a/README
+++ b/README
@@ -32,11 +32,11 @@ Emacs 28 or older
• Remove all byte-compiled Tramp files
- $ rm -f ~/.emacs.d/elpa/tramp-2.7.1.4/tramp*.elc
+ $ rm -f ~/.emacs.d/elpa/tramp-2.7.1.5/tramp*.elc
• Start Emacs with Tramp's source files
- $ emacs -L ~/.emacs.d/elpa/tramp-2.7.1.4 -l tramp
+ $ emacs -L ~/.emacs.d/elpa/tramp-2.7.1.5 -l tramp
This should not give you the error.
@@ -50,7 +50,7 @@ Mitigation of a bug in Emacs 29.1
---------------------------------
Due to a bug in Emacs 29.1, you must apply the following change prior
-installation or upgrading Tramp 2.7.1.4 from GNU ELPA:
+installation or upgrading Tramp 2.7.1.5 from GNU ELPA:
(when (string-equal emacs-version "29.1")
(with-current-buffer
diff --git a/test/tramp-tests.el b/test/tramp-tests.el
index 42eec4c6b1..d864fd2e96 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -179,7 +179,8 @@ A resource file is in the resource directory as per
(tramp-dissect-file-name ert-remote-temporary-file-directory))
"The used `tramp-file-name' structure.")
-(setq auth-source-save-behavior nil
+(setq auth-source-cache-expiry nil
+ auth-source-save-behavior nil
password-cache-expiry nil
remote-file-name-inhibit-cache nil
tramp-allow-unsafe-temporary-files t
@@ -209,6 +210,7 @@ being the result.")
(when (cdr tramp--test-enabled-checked)
;; Remove old test files.
(dolist (dir `(,temporary-file-directory
+ ,tramp-compat-temporary-file-directory
,ert-remote-temporary-file-directory))
(dolist (file (directory-files dir 'full (rx bos (? ".#") "tramp-test")))
(ignore-errors
@@ -217,7 +219,7 @@ being the result.")
(delete-file file)))))
;; Cleanup connection.
(ignore-errors
- (tramp-cleanup-connection tramp-test-vec nil 'keep-password)))
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))
;; Return result.
(cdr tramp--test-enabled-checked))
@@ -2176,7 +2178,7 @@ is greater than 10.
(when (assoc m tramp-methods)
(let (tramp-connection-properties tramp-default-proxies-alist)
(ignore-errors
- (tramp-cleanup-connection tramp-test-vec nil 'keep-password))
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password))
;; Single hop. The host name must match `tramp-local-host-regexp'.
(should-error
(find-file (format "/%s:foo:" m))
@@ -4946,7 +4948,7 @@ This tests also `make-symbolic-link', `file-truename' and
`add-name-to-file'."
(ert-deftest tramp-test26-interactive-file-name-completion ()
"Check interactive completion with different `completion-styles'."
;; Method, user and host name in completion mode.
- (tramp-cleanup-connection tramp-test-vec nil 'keep-password)
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
(let ((method (file-remote-p ert-remote-temporary-file-directory 'method))
(user (file-remote-p ert-remote-temporary-file-directory 'user))
@@ -5477,6 +5479,8 @@ If UNSTABLE is non-nil, the test is tagged as
`:unstable'."
direct-async-process-profile)
connection-local-criteria-alist)))
(skip-unless (tramp-direct-async-process-p))
+ (when-let* ((result (ert-test-most-recent-result ert-test)))
+ (skip-unless (< (ert-test-result-duration result) 300)))
;; We do expect an established connection already,
;; `file-truename' does it by side-effect. Suppress
;; `tramp--test-enabled', in order to keep the connection.
@@ -6015,7 +6019,9 @@ INPUT, if non-nil, is a string sent to the process."
;; Test `async-shell-command-width'.
(when (and (tramp--test-asynchronous-processes-p) (tramp--test-sh-p))
- (let* ((async-shell-command-width 1024)
+ (let* (;; Since Fedora 41, this seems to be the upper limit. Used
+ ;; to be 1024 before.
+ (async-shell-command-width 512)
(default-directory ert-remote-temporary-file-directory)
(cols (ignore-errors
(read (tramp--test-shell-command-to-string-asynchronously
@@ -6536,6 +6542,7 @@ INPUT, if non-nil, is a string sent to the process."
(tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (expand-file-name "foo" tmp-name1))
(tramp-remote-process-environment tramp-remote-process-environment)
+ ;; Suppress nasty messages.
(inhibit-message t)
(vc-handled-backends
(cond
@@ -6558,9 +6565,7 @@ INPUT, if non-nil, is a string sent to the process."
(tramp-cleanup-connection
tramp-test-vec 'keep-debug 'keep-password)
'(Bzr))
- (t nil)))
- ;; Suppress nasty messages.
- (inhibit-message t))
+ (t nil))))
(skip-unless vc-handled-backends)
(unless quoted (tramp--test-message "%s" vc-handled-backends))
@@ -8063,7 +8068,7 @@ process sentinels. They shall not disturb each other."
(let ((pass "secret")
(mock-entry (copy-tree (assoc "mock" tramp-methods)))
- mocked-input tramp-methods)
+ mocked-input tramp-methods auth-sources)
;; We must mock `read-string', in order to avoid interactive
;; arguments.
(cl-letf* (((symbol-function #'read-string)
@@ -8107,7 +8112,37 @@ process sentinels. They shall not disturb each other."
"machine %s port mock password %s"
(file-remote-p ert-remote-temporary-file-directory 'host) pass)
(let ((auth-sources `(,netrc-file)))
- (should (file-exists-p ert-remote-temporary-file-directory)))))))))
+ (should (file-exists-p ert-remote-temporary-file-directory))))))
+
+ ;; Checking session-timeout.
+ (with-no-warnings (when (symbol-plist 'ert-with-temp-file)
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug)
+ (let ((tramp-connection-properties
+ (cons '(nil "session-timeout" 1)
+ tramp-connection-properties)))
+ (setq mocked-input nil)
+ (auth-source-forget-all-cached)
+ (ert-with-temp-file netrc-file
+ :prefix "tramp-test" :suffix ""
+ :text (format
+ "machine %s port mock password %s"
+ (file-remote-p ert-remote-temporary-file-directory 'host)
+ pass)
+ (let ((auth-sources `(,netrc-file)))
+ (should (file-exists-p ert-remote-temporary-file-directory))))
+ ;; Session established, password cached.
+ (should
+ (password-in-cache-p
+ (auth-source-format-cache-entry
+ (tramp-get-connection-property tramp-test-vec "pw-spec"))))
+ ;; We want to see the timeout message.
+ (tramp--test-instrument-test-case 3
+ (sleep-for 2))
+ ;; Session canceled, no password in cache.
+ (should-not
+ (password-in-cache-p
+ (auth-source-format-cache-entry
+ (tramp-get-connection-property tramp-test-vec "pw-spec"))))))))))
(ert-deftest tramp-test47-read-otp-password ()
"Check Tramp one-time password handling."
@@ -8168,6 +8203,49 @@ process sentinels. They shall not disturb each other."
(should-error
(file-exists-p ert-remote-temporary-file-directory)))))))))
+(ert-deftest tramp-test47-read-fingerprint ()
+ "Check Tramp fingerprint handling."
+ :tags '(:expensive-test)
+ (skip-unless (tramp--test-mock-p))
+
+ (let (;; Suppress "exec".
+ (tramp-restricted-shell-hosts-alist `(,tramp-system-name)))
+
+ ;; Reading fingerprint works.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug)
+ (let ((tramp-connection-properties
+ `((nil "login-args"
+ (("-c")
+ (,(tramp-shell-quote-argument
+ "echo Place your finger on the fingerprint reader"))
+ (";") ("sleep" "1")
+ (";") ("sh" "-i"))))))
+ (should (file-exists-p ert-remote-temporary-file-directory)))
+
+ ;; Falling back after a timeout works.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug)
+ (let ((tramp-connection-properties
+ `((nil "login-args"
+ (("-c")
+ (,(tramp-shell-quote-argument
+ "echo Place your finger on the fingerprint reader"))
+ (";") ("sleep" "1")
+ (";") ("echo" "Failed to match fingerprint")
+ (";") ("sh" "-i"))))))
+ (should (file-exists-p ert-remote-temporary-file-directory)))
+
+ ;; Interrupting the fingerprint handshaking works.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug)
+ (let ((tramp-connection-properties
+ `((nil "login-args"
+ (("-c")
+ (,(tramp-shell-quote-argument
+ "echo Place your finger on the fingerprint reader"))
+ (";") ("sleep" "1")
+ (";") ("sh" "-i")))))
+ tramp-use-fingerprint)
+ (should (file-exists-p ert-remote-temporary-file-directory)))))
+
;; This test is inspired by Bug#29163.
(ert-deftest tramp-test48-auto-load ()
"Check that Tramp autoloads properly."
@@ -8388,7 +8466,6 @@ If INTERACTIVE is non-nil, the tests are run
interactively."
;; * file-equal-p (partly done in `tramp-test21-file-links')
;; * file-in-directory-p
;; * file-name-case-insensitive-p
-;; * memory-info
;; * tramp-get-home-directory
;; * tramp-set-file-uid-gid
diff --git a/texi/tramp.texi b/texi/tramp.texi
index e84869222e..edc258cb5a 100644
--- a/texi/tramp.texi
+++ b/texi/tramp.texi
@@ -819,18 +819,18 @@ availability and usability of one of the commands defined
in
@code{tramp-inline-compress-commands}.
@table @asis
-@item @option{rsh}
@cindex method @option{rsh}
@cindex @option{rsh} method
+@item @option{rsh}
@command{rsh} is an option for connecting to hosts within local
networks since @command{rsh} is not as secure as other methods.
There should be no reason to use it, as @command{ssh} is a both a
complete replacement and ubiquitous.
-@item @option{ssh}
@cindex method @option{ssh}
@cindex @option{ssh} method
+@item @option{ssh}
@command{ssh} is a more secure option than others to connect to a
remote host.
@@ -840,25 +840,26 @@ example, a host on port 42 is specified as @file{host#42}
(the real
host name, a hash sign, then a port number). It is the same as passing
@samp{-p 42} to the @command{ssh} command.
-@item @option{telnet}
@cindex method @option{telnet}
@cindex @option{telnet} method
+@item @option{telnet}
Connecting to a remote host with @command{telnet} is as insecure
as the @option{rsh} method.
-@item @option{su}
@cindex method @option{su}
@cindex @option{su} method
+@item @option{su}
Instead of connecting to a remote host, @command{su} program allows
editing as another user. The host can be either @samp{localhost} or
the host returned by the function @command{(system-name)}. See
@ref{Multi-hops} for an exception to this behavior.
-@item @option{androidsu}
@cindex method @option{androidsu}
@cindex @option{androidsu} method
+@item @option{androidsu}
+
Because the default implementation of the @option{su} method and other
shell-based methods conflict with non-standard @command{su}
implementations popular among Android users and the restricted
@@ -870,9 +871,9 @@ multi-hops are unsupported.
This is an optional method, @pxref{Optional methods}. It is enabled by
default on @code{android} systems only.
-@item @option{sudo}
@cindex method @option{sudo}
@cindex @option{sudo} method
+@item @option{sudo}
Similar to @option{su} method, @option{sudo} uses @command{sudo}.
@command{sudo} must have sufficient rights to start a shell.
@@ -881,17 +882,17 @@ For security reasons, a @option{sudo} connection is
disabled after a
predefined timeout (5 minutes by default). This can be changed,
@pxref{Predefined connection information}.
-@item @option{doas}
@cindex method @option{doas}
@cindex @option{doas} method
+@item @option{doas}
This method is used on OpenBSD like the @command{sudo} command. Like
the @option{sudo} method, a @option{doas} connection is disabled after
a predefined timeout.
-@item @option{run0}
@cindex method @option{run0}
@cindex @option{run0} method
+@item @option{run0}
@c This requires systemd 256. Check with 'systemd-run --version'.
This method is used on @code{systemd}-based hosts. A @option{run0}
@@ -899,9 +900,9 @@ connection is disabled after a predefined timeout as well.
This is an optional method, @pxref{Optional methods}.
-@item @option{sg}
@cindex method @option{sg}
@cindex @option{sg} method
+@item @option{sg}
The @command{sg} program allows editing as different group. The host
can be either @samp{localhost} or the host returned by the function
@@ -909,9 +910,9 @@ can be either @samp{localhost} or the host returned by the
function
denotes a group name. See @ref{Multi-hops} for an exception to this
behavior.
-@item @option{sshx}
@cindex method @option{sshx}
@cindex @option{sshx} method
+@item @option{sshx}
Works like @option{ssh} but without the extra authentication prompts.
@option{sshx} uses @samp{ssh -t -t -l @var{user} -o
@@ -932,27 +933,27 @@ missing shell prompts that confuses @value{tramp}.
@option{sshx} supports the @samp{-p} argument.
-@item @option{krlogin}
@cindex method @option{krlogin}
@cindex @option{krlogin} method
@cindex kerberos (with @option{krlogin} method)
+@item @option{krlogin}
This method is also similar to @option{ssh}. It uses the
@command{krlogin -x} command only for remote host login.
This method is an optional method, @pxref{Optional methods}.
-@item @option{ksu}
@cindex method @option{ksu}
@cindex @option{ksu} method
@cindex kerberos (with @option{ksu} method)
+@item @option{ksu}
This is another method from the Kerberos suite. It behaves like
@option{su}. It is an optional method, @pxref{Optional methods}.
-@item @option{plink}
@cindex method @option{plink}
@cindex @option{plink} method
+@item @option{plink}
@option{plink} method is for MS Windows users with the PuTTY
implementation of SSH@. It uses @samp{plink -ssh} to log in to the
@@ -963,9 +964,9 @@ session.
@option{plink} method supports the @samp{-P} argument.
-@item @option{plinkx}
@cindex method @option{plinkx}
@cindex @option{plinkx} method
+@item @option{plinkx}
Another method using PuTTY on MS Windows with session names instead of
host names. @option{plinkx} calls @samp{plink -load @var{session}
@@ -981,23 +982,23 @@ The following methods allow to access running containers
in different
ways:
@table @asis
-@item @option{docker}
@cindex method @option{docker}
@cindex @option{docker} method
+@item @option{docker}
Integration for Docker containers. The host name may be either a
running container's name or ID, as returned by @samp{docker ps}.
-@item @option{podman}
@cindex method @option{podman}
@cindex @option{podman} method
+@item @option{podman}
Podman is an alternative to @option{docker} which may be run rootless,
if desired.
-@item @option{kubernetes}
@cindex method @option{kubernetes}
@cindex @option{kubernetes} method
+@item @option{kubernetes}
Integration for containers in Kubernetes pods. The host name is
@samp{@var{pod}}, or @samp{@var{container}.@var{pod}} if an
@@ -1006,12 +1007,12 @@ in a pod is used.
This method does not support user names.
-@item @option{toolbox}
-@item @option{distrobox}
@cindex method @option{toolbox}
@cindex @option{toolbox} method
+@item @option{toolbox}
@cindex method @option{distrobox}
@cindex @option{distrobox} method
+@item @option{distrobox}
Integration of Toolbox or Distrobox system containers, respectively.
The host name may be either a container's name or ID, as returned by
@@ -1025,9 +1026,9 @@ a created container, if it isn't running yet.
These are optional methods, @pxref{Optional methods}. They do not
support user names.
-@item @option{flatpak}
@cindex method @option{flatpak}
@cindex @option{flatpak} method
+@item @option{flatpak}
Integration of Flatpak sandboxes. The host name may be either an
application ID, a sandbox instance ID, or a PID, as returned by
@@ -1036,9 +1037,9 @@ application ID, a sandbox instance ID, or a PID, as
returned by
This is an optional method, @pxref{Optional methods}. It does not
support user names.
-@item @option{apptainer}
@cindex method @option{apptainer}
@cindex @option{apptainer} method
+@item @option{apptainer}
Integration of Apptainer instances. The host name is the instance
name, as returned by @samp{apptainer instance list}.
@@ -1046,9 +1047,9 @@ name, as returned by @samp{apptainer instance list}.
This is an optional method, @pxref{Optional methods}. It does not
support user names.
-@item @option{nspawn}
@cindex method @option{nspawn}
@cindex @option{nspawn} method
+@item @option{nspawn}
Integration of @code{systemd-nspawn} instances. The host name is the
instance name, as returned by @samp{machinectl list --all}.
@@ -1074,10 +1075,10 @@ files smaller than @code{tramp-copy-size-limit} still
use inline
methods.
@table @asis
-@item @option{rcp}
@cindex method @option{rcp}
@cindex @option{rcp} method
@cindex @command{rsh} (with @option{rcp} method)
+@item @option{rcp}
This method uses the @command{rsh} and @command{rcp} commands to
connect to the remote host and transfer files. This is the fastest
@@ -1086,10 +1087,10 @@ access method available.
The alternative method @option{remcp} uses the @command{remsh} and
@command{rcp} commands.
-@item @option{scp}
@cindex method @option{scp}
@cindex @option{scp} method
@cindex @command{ssh} (with @option{scp} method)
+@item @option{scp}
Using a combination of @command{ssh} to connect and @command{scp} to
transfer is the most secure. While the performance is good, it is
@@ -1102,10 +1103,10 @@ port numbers. For example, @file{host#42} passes
@samp{-p 42} in the
argument list to @command{ssh}, and @samp{-P 42} in the argument list
to @command{scp}.
-@item @option{rsync}
@cindex method @option{rsync}
@cindex @option{rsync} method
@cindex @command{ssh} (with @option{rsync} method)
+@item @option{rsync}
@command{ssh} command to connect in combination with @command{rsync}
command to transfer is similar to the @option{scp} method.
@@ -1116,10 +1117,10 @@ is lost if the file exists only on one side of the
connection.
This method supports the @samp{-p} argument.
-@item @option{scpx}
@cindex method @option{scpx}
@cindex @option{scpx} method
@cindex @command{ssh} (with @option{scpx} method)
+@item @option{scpx}
@option{scpx} is useful to avoid login shell questions. It is similar
in performance to @option{scp}. @option{scpx} uses @samp{ssh -t -t -l
@@ -1133,16 +1134,16 @@ missing shell prompts that confuses @value{tramp}.
This method supports the @samp{-p} argument.
-@item @option{pscp}
-@item @option{psftp}
@cindex method @option{pscp}
@cindex @option{pscp} method
@cindex @command{plink} (with @option{pscp} method)
@cindex @command{putty} (with @option{pscp} method)
+@item @option{pscp}
@cindex method @option{psftp}
@cindex @option{psftp} method
@cindex @command{plink} (with @option{psftp} method)
@cindex @command{putty} (with @option{psftp} method)
+@item @option{psftp}
These methods are similar to @option{scp} or @option{sftp}, but they
use the @command{plink} command to connect to the remote host, and
@@ -1156,12 +1157,12 @@ session.
These methods support the @samp{-P} argument.
-@item @option{dockercp}
-@item @option{podmancp}
@cindex method @option{dockercp}
@cindex @option{dockercp} method
+@item @option{dockercp}
@cindex method @option{podmancp}
@cindex @option{podmancp} method
+@item @option{podmancp}
These methods are similar to @option{docker} or @option{podman}, but
they use the command @command{docker cp} or @command{podman cp} for
@@ -1170,10 +1171,10 @@ transferring large files.
These copy commands do not support file globs, and they ignore a user
name.
-@item @option{fcp}
@cindex method @option{fcp}
@cindex @option{fcp} method
@cindex @command{fsh} (with @option{fcp} method)
+@item @option{fcp}
This method is similar to @option{scp}, but uses @command{fsh} to
connect and @command{fcp} to transfer files. @command{fsh/fcp}, a
@@ -1194,10 +1195,10 @@ and @value{tramp} keeps that one connection open.
This is an optional method, @pxref{Optional methods}.
-@item @option{nc}
@cindex method @option{nc}
@cindex @option{nc} method
@cindex @command{telnet} (with @option{nc} method)
+@item @option{nc}
Using @command{telnet} to connect and @command{nc} to transfer files
is sometimes the only combination suitable for accessing routers or
@@ -1207,9 +1208,9 @@ decode programs.
This is an optional method, @pxref{Optional methods}.
-@item @option{sudoedit}
@cindex method @option{sudoedit}
@cindex @option{sudoedit} method
+@item @option{sudoedit}
The @option{sudoedit} method facilitates editing a file as a different
user on the local host. You could regard this as @value{tramp}'s
@@ -1231,19 +1232,19 @@ use any host name in the remote file name, like
Like the @option{sudo} method, a @option{sudoedit} password expires
after a predefined timeout.
-@item @option{ftp}
@cindex method @option{ftp}
@cindex @option{ftp} method
+@item @option{ftp}
When @value{tramp} uses @option{ftp}, it forwards requests to whatever
ftp program is specified by Ange FTP@. This external program must be
capable of servicing requests from @value{tramp}.
-@item @option{smb}
@cindex method @option{smb}
@cindex @option{smb} method
@cindex ms windows (with @option{smb} method)
@cindex @command{smbclient}
+@item @option{smb}
This non-native @value{tramp} method connects via the Server Message
Block (SMB) networking protocol to hosts running file servers that are
@@ -1312,10 +1313,10 @@ UNC file name specification does not allow the
specification of a
different user name for authentication like the @command{smbclient}
can.
-@item @option{adb}
@cindex method @option{adb}
@cindex @option{adb} method
@cindex android (with @option{adb} method)
+@item @option{adb}
@vindex tramp-adb-program
@vindex PATH@r{, environment variable}
@@ -1370,22 +1371,22 @@ Emacs must have the message bus system, D-Bus
integration active,
@pxref{Top, , D-Bus, dbus}.
@table @asis
-@item @option{afp}
@cindex method @option{afp}
@cindex @option{afp} method
+@item @option{afp}
This method is for connecting to remote hosts with the Apple Filing
Protocol for accessing files on macOS volumes. @value{tramp} access
syntax requires a leading volume (share) name, for example:
@file{@trampfn{afp,user@@host,/volume}}.
-@item @option{dav}
-@item @option{davs}
@cindex WebDAV
@cindex method @option{dav}
-@cindex method @option{davs}
@cindex @option{dav} method
+@item @option{dav}
+@cindex method @option{davs}
@cindex @option{davs} method
+@item @option{davs}
@option{dav} method provides access to WebDAV files and directories
based on standard protocols, such as HTTP@. @option{davs} does the same
@@ -1396,11 +1397,11 @@ as it is common for OwnCloud or NextCloud file names,
are not
supported by these methods. See method @option{nextcloud} for
handling them.
-@item @option{gdrive}
@cindex @acronym{GNOME} Online Accounts
@cindex method @option{gdrive}
@cindex @option{gdrive} method
@cindex google drive
+@item @option{gdrive}
Via the @option{gdrive} method it is possible to access your Google
Drive online storage. User and host name of the remote file name are
@@ -1414,10 +1415,10 @@ could produce unexpected behavior in case two files in
the same
directory have the same @code{display-name}, such a situation must be
avoided.
-@item @option{mtp}
@cindex method @option{mtp}
@cindex @option{mtp} method
@cindex media
+@item @option{mtp}
Media devices, like cell phones, tablets, cameras, can be accessed via
the @option{mtp} method. Just the device name is needed in order to
@@ -1433,10 +1434,10 @@ different parts of their file system.
name when a single media device is connected. @value{tramp} instead
uses @file{@trampfn{mtp,,}} as the default name.
-@item @option{nextcloud}
@cindex method @option{nextcloud}
@cindex @option{nextcloud} method
@cindex nextcloud
+@item @option{nextcloud}
As the name indicates, the method @option{nextcloud} allows you to
access OwnCloud or NextCloud hosted files and directories. Like the
@@ -1444,9 +1445,9 @@ access OwnCloud or NextCloud hosted files and
directories. Like the
@command{Online Accounts} application outside Emacs. The method
supports port numbers.
-@item @option{sftp}
@cindex method @option{sftp}
@cindex @option{sftp} method
+@item @option{sftp}
This method uses @command{sftp} in order to securely access remote
hosts. @command{sftp} is a more secure option for connecting to hosts
@@ -1495,9 +1496,9 @@ operation on them. For some of the file name operations
this is not
possible, @value{tramp} emulates those operations otherwise.
@table @asis
-@item @option{rclone}
@cindex method @option{rclone}
@cindex @option{rclone} method
+@item @option{rclone}
@vindex tramp-rclone-program
The program @command{rclone} enables accessing different system
@@ -1508,7 +1509,7 @@ absolute path via the user option
@code{tramp-rclone-program}.
A system storage must be configured via the @command{rclone config}
command, outside Emacs. If you have configured a storage in
-@command{rclone} under a name @samp{storage} (for example), you could
+@command{rclone} under a name @samp{storage} (for example), you can
access it via the remote file name
@example
@@ -1524,9 +1525,9 @@ for accessing the system storage, you should use it.
@ref{GVFS-based methods} for example, methods @option{gdrive} and
@option{nextcloud}.
-@item @option{sshfs}
@cindex method @option{sshfs}
@cindex @option{sshfs} method
+@item @option{sshfs}
@vindex tramp-sshfs-program
On local hosts which have installed the @command{sshfs} client for
@@ -1549,7 +1550,7 @@ User name and port number are optional. This method does
not support
password handling, the file system must either be mounted already, or
the connection must be established passwordless via ssh keys.
-The mount point and mount arguments could be passed as connection
+The mount point and mount arguments can be passed as connection
properties, @xref{Setup of sshfs method}.
@end table
@@ -1878,7 +1879,7 @@ support this command.
@subsection Tunneling with ssh
@vindex ProxyCommand@r{, ssh option}
-With @command{ssh}, you could use the @option{ProxyCommand} entry in
+With @command{ssh}, you can use the @option{ProxyCommand} entry in
@file{~/.ssh/config}:
@example
@@ -1931,50 +1932,50 @@ They can be installed with Emacs's Package Manager.
This includes
@c @item ibuffer-tramp.el
@c Contact Svend Sorensen <svend@@ciffer.net>
-@item incus-tramp
@cindex method @option{incus}
@cindex @option{incus} method
+@item incus-tramp
Integration for Incus containers. A container is accessed via
@file{@trampfn{incus,user@@container,/path/to/file}}, @samp{user} and
@samp{container} have the same meaning as with the @option{docker}
method.
-@item lxc-tramp
@cindex method @option{lxc}
@cindex @option{lxc} method
+@item lxc-tramp
Integration for LXC containers. A container is accessed via
@file{@trampfn{lxc,container,/path/to/file}}, @samp{container} has the
same meaning as with the @option{docker} method. A @samp{user}
specification is ignored.
-@item lxd-tramp
@cindex method @option{lxd}
@cindex @option{lxd} method
+@item lxd-tramp
Integration for LXD containers. A container is accessed via
@file{@trampfn{lxd,user@@container,/path/to/file}}, @samp{user} and
@samp{container} have the same meaning as with the @option{docker}
method.
-@item magit-tramp
@cindex method @option{git}
@cindex @option{git} method
+@item magit-tramp
Browsing Git repositories with @code{magit}. A versioned file is
accessed via @file{@trampfn{git,rev@@root-dir,/path/to/file}}.
@samp{rev} is a Git revision, and @samp{root-dir} is a virtual host
name for the root directory, specified in
@code{magit-tramp-hosts-alist}.
-@item tramp-hdfs
@cindex method @option{hdfs}
@cindex @option{hdfs} method
+@item tramp-hdfs
Access of a hadoop/hdfs file system. A file is accessed via
@file{@trampfn{hdfs,user@@node,/path/to/file}}, where @samp{user} is
the user that you want to use, and @samp{node} is the name of the
hadoop server.
-@item vagrant-tramp
@cindex method @option{vagrant}
@cindex @option{vagrant} method
+@item vagrant-tramp
Convenience method to access vagrant boxes. It is often used in
multi-hop file names like
@file{@trampfn{vagrant@value{postfixhop}box|sudo,box,/path/to/file}},
@@ -2203,14 +2204,24 @@ like this:
@value{tramp} can cache passwords as entered and reuse when needed for
the same user or host name independent of the access method.
-@vindex password-cache-expiry
-@code{password-cache-expiry} sets the duration (in seconds) the
-passwords are remembered. Passwords are never saved permanently nor
-can they extend beyond the lifetime of the current Emacs session. Set
-@code{password-cache-expiry} to @code{nil} to disable expiration.
+@vindex auth-source-cache-expiry
+@code{auth-source-cache-expiry}@footnote{It overrides
+@code{password-cache-expiry}.} sets the duration (in seconds) the
+passwords are remembered. Set @code{auth-source-cache-expiry} to
+@code{nil} to disable expiration.
+
+Cached passwords are never saved permanently nor can they extend
+beyond the lifetime of the current Emacs session unless you confirm
+this interactively.
-@vindex password-cache
-Set @code{password-cache} to @code{nil} to disable password caching.
+@vindex auth-source-do-cache
+Set @code{auth-source-do-cache} to @code{nil} to disable password caching.
+
+For connections which use a session-timeout, like @option{sudo},
+@option{doas} and @option{run0}, the password cache is expired by
+@value{tramp} when the session expires (@pxref{Predefined connection
+information}). However, this makes only sense if the password cannot
+be retrieved from a persistent authentication file or store.
@node Connection caching
@@ -2275,7 +2286,7 @@ The parameters @code{tramp-remote-shell} and
@code{tramp-remote-shell-login} in @code{tramp-methods} now have new
values for the remote host.
-@var{property} could also be any property found in
+@var{property} can also be any property found in
@code{tramp-persistency-file-name}.
@@ -2425,7 +2436,7 @@ variables, @xref{Connection Variables, , , emacs}.
@ifnotinfo
variables.
@end ifnotinfo
-You could define your own search directories like this:
+You can define your own search directories like this:
@lisp
@group
@@ -2540,20 +2551,20 @@ login security, especially not the exotic ones.
However, @value{tramp}
provides a few tweaks to address the most common ones.
@table @asis
-@item @code{tramp-shell-prompt-pattern}
@vindex tramp-shell-prompt-pattern
+@item @code{tramp-shell-prompt-pattern}
@code{tramp-shell-prompt-pattern} is for remote login shell prompt,
which may not be the same as the local login shell prompt,
@code{shell-prompt-pattern}. Since most hosts use identical prompts,
@value{tramp} sets a similar default value for both prompts.
-@item @code{tramp-password-prompt-regexp}
-@item @code{tramp-otp-password-prompt-regexp}
-@item @code{tramp-wrong-passwd-regexp}
@vindex tramp-password-prompt-regexp
+@item @code{tramp-password-prompt-regexp}
@vindex tramp-otp-password-prompt-regexp
+@item @code{tramp-otp-password-prompt-regexp}
@vindex tramp-wrong-passwd-regexp
+@item @code{tramp-wrong-passwd-regexp}
@value{tramp} uses @code{tramp-password-prompt-regexp} to
distinguish between prompts for passwords and prompts for passphrases.
@@ -2593,16 +2604,16 @@ by @value{tramp} for reuse.
Similar localization may be necessary for handling wrong password
prompts, for which @value{tramp} uses @code{tramp-wrong-passwd-regexp}.
-@item @code{tramp-terminal-type}
@vindex tramp-terminal-type
@vindex TERM@r{, environment variable}
+@item @code{tramp-terminal-type}
@value{tramp} uses the user option @code{tramp-terminal-type} to set
the remote environment variable @env{TERM} for the shells it runs.
-By default, it is @t{"dumb"}, but this could be changed. A dumb
+By default, it is @t{"dumb"}, but this can be changed. A dumb
terminal is best suited to run the background sessions of
@value{tramp}. However, running interactive remote shells might
-require a different setting. This could be achieved by tweaking the
+require a different setting. This can be achieved by tweaking the
@env{TERM} environment variable in @code{process-environment}.
@lisp
@@ -2613,9 +2624,9 @@ require a different setting. This could be achieved by
tweaking the
@end group
@end lisp
-@item Determining a @value{tramp} session
@vindex TERM@r{, environment variable}
@vindex INSIDE_EMACS@r{, environment variable}
+@item Determining a @value{tramp} session
Sometimes, it is needed to identify whether a shell runs under
@value{tramp} control. The setting of environment variable @env{TERM}
@@ -2638,7 +2649,7 @@ process, @xref{Interactive Shell, , , emacs}.
@ifnotinfo
process.
@end ifnotinfo
-@value{tramp} adds its own package version to this string, which could
+@value{tramp} adds its own package version to this string, which can
be used for further tests in an inferior shell. The string of that
environment variable looks always like
@@ -2649,9 +2660,9 @@ echo $INSIDE_EMACS
@end group
@end example
-@item @command{tset} and other questions
@cindex unix command @command{tset}
@cindex @command{tset} unix command
+@item @command{tset} and other questions
To suppress inappropriate prompts for terminal type, @value{tramp}
sets the @env{TERM} environment variable before the remote login
@@ -2765,9 +2776,9 @@ fi
@xref{Interactive Shell, , , emacs}.
@end ifinfo
-@item @command{busybox} / @command{nc}
@cindex unix command @command{nc}
@cindex @command{nc} unix command
+@item @command{busybox} / @command{nc}
@value{tramp}'s @option{nc} method uses the @command{nc} command to
install and execute a listener as follows (see @code{tramp-methods}):
@@ -2858,7 +2869,8 @@ Host *
The corresponding PuTTY configuration is in the @option{Connection}
entry, @option{Seconds between keepalives} option. Set this to 5.
-There is no counter which could be set.
+PuTTY does not have a configuration option equivalent to OpenSSH's
+@option{ServerAliveCountMax}.
@anchor{Using ssh connection sharing}
@@ -3615,8 +3627,8 @@ This command changes the syntax @value{tramp} uses for
remote file
names. Beside the @code{default} value, @var{syntax} can be
@itemize
-@item @code{simplified}
@cindex simplified syntax
+@item @code{simplified}
This remote file name syntax is similar to the syntax used by Ange FTP@.
A remote file name has the form
@@ -3624,8 +3636,8 @@ A remote file name has the form
@samp{user@@} part is optional, and the method is determined by
@ref{Default Method}.
-@item @code{separate}
@cindex separate syntax
+@item @code{separate}
@clear unified
@set separate
@@ -3909,7 +3921,7 @@ directory has been used already.
The methods @option{adb}, @option{rclone} and @option{sshfs} do not
support home directory expansion at all. However, @value{tramp} keeps
-the home directory in the cache. Therefore, those methods could be
+the home directory in the cache. Therefore, those methods can be
configured to expand a home directory via a connection property,
@xref{Predefined connection information}. Example:
@@ -4109,18 +4121,18 @@ Due to the remote shell saving tilde expansions
triggered by
@code{tramp-histfile-override}. When set to @code{t}, environment
variable @env{HISTFILE} is unset, and environment variables
@env{HISTFILESIZE} and @env{HISTSIZE} are set to 0. Don't use this
-with @command{bash} 5.0.0. There is a bug in @command{bash} which
-lets @command{bash} die.
+with @command{bash} 5.0.0@: that version has a bug which
+causes @command{bash} to die.
-Alternatively, @code{tramp-histfile-override} could be a string.
-Environment variable @env{HISTFILE} is set to this file name then. Be
-careful when setting to @file{/dev/null}; this might result in
-undesired results when using @command{bash} as remote shell.
+Alternatively, @code{tramp-histfile-override} can be a string.
+The environment variable @env{HISTFILE} is then set to this file name. Be
+careful if using @file{/dev/null}; this might result in undesired
+results when using @command{bash} as remote shell.
-Another approach is to disable @value{tramp}'s handling of the
-@env{HISTFILE} at all by setting @code{tramp-histfile-override} to
-@code{nil}. In this case, saving history could be turned off by
-putting this shell code in @file{.bashrc} or @file{.kshrc}:
+Another approach is to completely disable @value{tramp}'s handling of
+the @env{HISTFILE} by setting @code{tramp-histfile-override} to
+@code{nil}. In this case, saving history can be turned off by putting
+this shell code in @file{.bashrc} or @file{.kshrc}:
@example
@group
@@ -4157,7 +4169,7 @@ ensures the correct name of the remote shell program.
When @code{explicit-shell-file-name} is equal to @code{nil}, calling
@code{shell} interactively will prompt for a shell name.
-You could use connection-local variables for setting different values
+You can use connection-local variables for setting different values
of @code{explicit-shell-file-name} for different remote hosts.
@ifinfo
@xref{Connection Variables, , , emacs}.
@@ -4447,11 +4459,11 @@ the @code{process-attributes} output plus the key
@code{pid}, and
be
-@multitable {@bullet{} @code{numberp}} {--- a string of @var{number} width,
could contain spaces}
+@multitable {@bullet{} @code{numberp}} {--- a string of @var{number} width,
can contain spaces}
@item @bullet{} @code{numberp} @tab --- a number
@item @bullet{} @code{stringp} @tab --- a string without spaces
@item @bullet{} @var{number}
-@tab --- a string of @var{number} width, could contain spaces
+@tab --- a string of @var{number} width, can contain spaces
@item @bullet{} @code{nil} @tab --- a string until end of line
@end multitable
@@ -4558,6 +4570,18 @@ which must be set to a non-@code{nil} value. Example:
@end group
@end lisp
+This enables direct async processes for the host @samp{remotehost}.
+If you want to enable direct async processes for all remote hosts
+connected via the same method (e.g., @option{ssh}), use instead
+
+@lisp
+@group
+(connection-local-set-profiles
+ '(:application tramp :protocol "ssh")
+ 'remote-direct-async-process)
+@end group
+@end lisp
+
Using direct asynchronous processes in @value{tramp} is not possible,
if the remote host is connected via multiple hops
(@pxref{Multi-hops}). In this case, @value{tramp} falls back to its
@@ -4683,7 +4707,7 @@ anymore.
@deffn Command tramp-rename-files source target
Replace in all buffers the visiting file name from @var{source} to
-@var{target}. @var{source} is a remote directory name, which could
+@var{target}. @var{source} is a remote directory name, which can
contain also a localname part. @var{target} is the directory name
@var{source} is replaced with. Often, @var{target} is a remote
directory name on another host, but it can also be a local directory
@@ -4732,17 +4756,19 @@ The default target for renaming remote buffer file
names. This is an
alist of cons cells @code{(source . target)}. The first matching item
specifies the target to be applied for renaming buffer file names from
source via @code{tramp-rename-files}. @code{source} is a regular
-expressions, which matches a remote file name. @code{target} must be
-a directory name, which could be remote (including remote directories
-@value{tramp} infers by default, such as @file{@trampfn{method,user@@host,}}).
+expression, which is used to match a remote file name. @code{target}
+must be a directory name, which can be remote (including remote
+directories which @value{tramp} infers by default, such as
+@file{@trampfn{method,user@@host,}}).
-@code{target} can contain the patterns @code{%m}, @code{%u} or
-@code{%h}, which are replaced by the method name, user name or host
-name of @code{source} when calling @code{tramp-rename-files}.
+@code{target} can contain the format specifiers @code{%m}, @code{%u},
+or @code{%h}, which are replaced by the method name, user name, or host
+name of @code{source} respectively when calling @code{tramp-rename-files}.
-@code{source} could also be a Lisp form, which will be evaluated. The
-result must be a string or @code{nil}, which is interpreted as a
-regular expression which always matches.
+@code{source} can also be a Lisp form, which is evaluated. The result
+must be a string (which is used as a regular expression to match) or
+@code{nil}, which is interpreted as a regular expression which always
+matches.
Example entries:
@@ -4822,90 +4848,87 @@ archive file names. Accepted suffixes are listed in
the constant
@code{tramp-archive-suffixes}. They are
@itemize
-@item @samp{.7z} ---
-7-Zip archives
@cindex @file{7z} file archive suffix
@cindex file archive suffix @file{7z}
+@item @samp{.7z} ---
+7-Zip archives
-@item @samp{.apk} ---
-Android package kits
@cindex @file{apk} file archive suffix
@cindex file archive suffix @file{apk}
+@item @samp{.apk} ---
+Android package kits
-@item @samp{.ar} ---
-UNIX archiver formats
@cindex @file{ar} file archive suffix
@cindex file archive suffix @file{ar}
+@item @samp{.ar} ---
+UNIX archiver formats
-@item @samp{.cab}, @samp{.CAB} ---
-Microsoft Windows cabinets
@cindex @file{cab} file archive suffix
@cindex @file{CAB} file archive suffix
@cindex file archive suffix @file{cab}
@cindex file archive suffix @file{CAB}
+@item @samp{.cab}, @samp{.CAB} ---
+Microsoft Windows cabinets
-@item @samp{.cpio} ---
-CPIO archives
@cindex @file{cpio} file archive suffix
@cindex file archive suffix @file{cpio}
+@item @samp{.cpio} ---
+CPIO archives
-@item @samp{.crate} ---
-Cargo (Rust) packages
@cindex @file{crate} file archive suffix
@cindex file archive suffix @file{crate}
+@item @samp{.crate} ---
+Cargo (Rust) packages
-@item @samp{.deb} ---
-Debian packages
@cindex @file{deb} file archive suffix
@cindex file archive suffix @file{deb}
+@item @samp{.deb} ---
+Debian packages
-@item @samp{.depot} ---
-HP-UX SD depots
@cindex @file{depot} file archive suffix
@cindex file archive suffix @file{depot}
+@item @samp{.depot} ---
+HP-UX SD depots
-@item @samp{.epub} ---
-Electronic publications
@cindex @file{epub} file archive suffix
@cindex file archive suffix @file{epub}
+@item @samp{.epub} ---
+Electronic publications
-@item @samp{.exe} ---
-Self extracting Microsoft Windows EXE files
@cindex @file{exe} file archive suffix
@cindex file archive suffix @file{exe}
+@item @samp{.exe} ---
+Self extracting Microsoft Windows EXE files
-@item @samp{.iso} ---
-ISO 9660 images
@cindex @file{iso} file archive suffix
@cindex file archive suffix @file{iso}
+@item @samp{.iso} ---
+ISO 9660 images
-@item @samp{.jar} ---
-Java archives
@cindex @file{jar} file archive suffix
@cindex file archive suffix @file{jar}
+@item @samp{.jar} ---
+Java archives
-@item @samp{.lzh}, @samp{.LZH} ---
-Microsoft Windows compressed LHA archives
@cindex @file{lzh} file archive suffix
@cindex @file{LZH} file archive suffix
@cindex file archive suffix @file{lzh}
@cindex file archive suffix @file{LZH}
+@item @samp{.lzh}, @samp{.LZH} ---
+Microsoft Windows compressed LHA archives
-@item @samp{.msu}, @samp{.MSU} ---
-Microsoft Windows Update packages
@cindex @file{msu} file archive suffix
@cindex @file{MSU} file archive suffix
@cindex file archive suffix @file{msu}
@cindex file archive suffix @file{MSU}
+@item @samp{.msu}, @samp{.MSU} ---
+Microsoft Windows Update packages
-@item @samp{.mtree} ---
-BSD mtree format
@cindex @file{mtree} file archive suffix
@cindex file archive suffix @file{mtree}
+@item @samp{.mtree} ---
+BSD mtree format
-@item @samp{.odb}, @samp{.odf}, @samp{.odg}, @samp{.odp}, @samp{.ods},
-@samp{.odt} ---
-OpenDocument formats
@cindex @file{odb} file archive suffix
@cindex @file{odf} file archive suffix
@cindex @file{odg} file archive suffix
@@ -4918,30 +4941,30 @@ OpenDocument formats
@cindex file archive suffix @file{odp}
@cindex file archive suffix @file{ods}
@cindex file archive suffix @file{odt}
+@item @samp{.odb}, @samp{.odf}, @samp{.odg}, @samp{.odp}, @samp{.ods},
+@samp{.odt} ---
+OpenDocument formats
-@item @samp{.pax} ---
-Posix archives
@cindex @file{pax} file archive suffix
@cindex file archive suffix @file{pax}
+@item @samp{.pax} ---
+Posix archives
-@item @samp{.rar} ---
-RAR archives
@cindex @file{rar} file archive suffix
@cindex file archive suffix @file{rar}
+@item @samp{.rar} ---
+RAR archives
-@item @samp{.rpm} ---
-Red Hat packages
@cindex @file{rpm} file archive suffix
@cindex file archive suffix @file{rpm}
+@item @samp{.rpm} ---
+Red Hat packages
-@item @samp{.shar} ---
-Shell archives
@cindex @file{shar} file archive suffix
@cindex file archive suffix @file{shar}
+@item @samp{.shar} ---
+Shell archives
-@item @samp{.tar}, @samp{.tbz}, @samp{.tgz}, @samp{.tlz}, @samp{.txz},
-@samp{.tzst} ---
-(Compressed) tape archives
@cindex @file{tar} file archive suffix
@cindex @file{tbz} file archive suffix
@cindex @file{tgz} file archive suffix
@@ -4954,33 +4977,36 @@ Shell archives
@cindex file archive suffix @file{tlz}
@cindex file archive suffix @file{txz}
@cindex file archive suffix @file{tzst}
+@item @samp{.tar}, @samp{.tbz}, @samp{.tgz}, @samp{.tlz}, @samp{.txz},
+@samp{.tzst} ---
+(Compressed) tape archives
-@item @samp{.warc} ---
-Web archives
@cindex @file{warc} file archive suffix
@cindex file archive suffix @file{warc}
+@item @samp{.warc} ---
+Web archives
-@item @samp{.xar} ---
-macOS XAR archives
@cindex @file{xar} file archive suffix
@cindex file archive suffix @file{xar}
+@item @samp{.xar} ---
+macOS XAR archives
-@item @samp{.xpi} ---
-XPInstall Mozilla addons
@cindex @file{xpi} file archive suffix
@cindex file archive suffix @file{xpi}
+@item @samp{.xpi} ---
+XPInstall Mozilla addons
-@item @samp{.xps} ---
-Open XML Paper Specification (OpenXPS) documents
@cindex @file{xps} file archive suffix
@cindex file archive suffix @file{xps}
+@item @samp{.xps} ---
+Open XML Paper Specification (OpenXPS) documents
-@item @samp{.zip}, @samp{.ZIP} ---
-ZIP archives
@cindex @file{zip} file archive suffix
@cindex @file{ZIP} file archive suffix
@cindex file archive suffix @file{zip}
@cindex file archive suffix @file{ZIP}
+@item @samp{.zip}, @samp{.ZIP} ---
+ZIP archives
@end itemize
@vindex tramp-archive-compression-suffixes
@@ -4994,7 +5020,7 @@ constant @code{tramp-archive-compression-suffixes}. They
are
row are possible, like @file{/path/to/dir/file.tar.gz.uu/dir/file}.
@vindex tramp-archive-all-gvfs-methods
-An archive file name could be a remote file name, as in
+An archive file name can be a remote file name, as in
@file{/ftp:anonymous@@ftp.gnu.org:/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}.
Since all file operations are mapped internally to @acronym{GVFS}
operations, remote file names supported by @code{tramp-gvfs} perform
@@ -5004,7 +5030,7 @@ than the similar @samp{/scp:user@@host:@dots{}}. See the
constant
@code{tramp-archive-all-gvfs-methods} for a complete list of
@code{tramp-gvfs} supported method names.
-If @code{url-handler-mode} is enabled, archives could be visited via
+If @code{url-handler-mode} is enabled, archives can be visited via
URLs, like
@file{https://ftp.gnu.org/gnu/tramp/tramp-2.4.5.tar.gz/INSTALL}. This
allows complex file operations like
@@ -5032,7 +5058,7 @@ coreutils_8.28-1_amd64.deb/control.tar.gz/control"))
@end lisp
@vindex tramp-archive-enabled
-In order to disable file archives, you could add the following form to
+In order to disable file archives, you can add the following form to
your init file:
@lisp
@@ -5108,21 +5134,21 @@ When including @value{tramp}'s messages in the bug
report, increase
the verbosity level to 6 (@pxref{Traces and Profiles, Traces}) in the
@file{~/.emacs} file before repeating steps to the bug. Include the
contents of the @file{*tramp/foo*} and @file{*debug tramp/foo*}
-buffers with the bug report. Both buffers could contain
+buffers with the bug report. Since those buffers could contain
non-@acronym{ASCII} characters which are relevant for analysis, append
-the buffers as attachments to the bug report. This is also needed in
-order to avoid line breaks during mail transfer.
+the buffers as attachments to the bug report rather than placing them
+inline. This is also needed in order to avoid line breaks getting added
+or deleted during mail transfer.
-If you send the message from Emacs, you are asked about to append
+If you send the message from Emacs, you are asked whether to append
these buffers to the bug report. If you use an external mail program,
you must save these buffers to files, and append them with that mail
program.
-@strong{Note} that a verbosity level greater than 6 is not necessary
-at this stage. Also note that a verbosity level of 6 or greater, the
-contents of files and directories will be included in the debug
-buffer. Passwords typed in @value{tramp} will never be included
-there.
+@strong{Note} that a verbosity level greater than 6 is not necessary at
+this stage. Also note that with a verbosity level of 6 or greater, the
+contents of files and directories will be included in the debug buffer.
+Passwords typed in @value{tramp} will never be included there.
If you find, that using @value{tramp} with @command{emacs -Q} doesn't
cause any problem, you might check your init file for the suspicious
@@ -5133,7 +5159,7 @@ Otherwise, comment out the active code, and uncomment the
just
commented code.
Call @command{emacs}, again. Reiterate, until you find the suspicious
-configuaration.
+configuration.
@node Frequently Asked Questions
@@ -5227,14 +5253,14 @@ about, for example:
(setq vc-handled-backends '(SVN Git))
@end lisp
-@item
@vindex remote-file-name-inhibit-locks
+@item
Disable file locks. Set @code{remote-file-name-inhibit-locks} to
@code{t} if you know that different Emacs sessions are not modifying
the same remote file.
-@item
@vindex remote-file-name-inhibit-auto-save
+@item
Keep auto-save files local. This is already the default configuration
in Emacs, don't change it. If you want to disable auto-saving for
remote files at all, set @code{remote-file-name-inhibit-auto-save} to
@@ -5316,7 +5342,7 @@ as value of the @env{TERM} environment variable. If you
want to use
another value for @env{TERM}, change @code{tramp-terminal-type} and
this line accordingly.
-Alternatively, you could set the remote login shell explicitly. See
+Alternatively, you can set the remote login shell explicitly. See
@ref{Remote shell setup} for discussion of this technique,
When using fish shell on remote hosts, disable fancy formatting by
@@ -5460,6 +5486,23 @@ nitrokey, or titankey.
(residential) keys by @command{ssh-agent}. As workaround, you might
disable @command{ssh-agent} for such keys.
+
+@item
+Does @value{tramp} support fingerprint readers?
+
+Yes. A fingerprint reader can be used as an additional authentication
+method for @option{sudo}-based logins. @value{tramp} supports the
+required additional handshaking messages@footnote{It supports
+fingerprint readers driven by @command{fprintd}.}. If the fingerprint
+isn't recognized by the fingerprint reader in time, authentication
+falls back to requesting a password.
+
+@vindex tramp-use-fingerprint
+If the user option @code{tramp-use-fingerprint} is @code{nil},
+@value{tramp} interrupts the fingerprint request, falling back to
+password authentication immediately.
+
+
@item
@value{tramp} does not connect to Samba or MS Windows hosts running
SMB1 connection protocol
@@ -5623,7 +5666,7 @@ encrypted}), which are deleted anyway.
@c Since Emacs 30.
@vindex trash-directory
If you want to trash a remote file into a remote trash directory, you
-could configure the user option @code{trash-directory} to a
+can configure the user option @code{trash-directory} to a
connection-local value.
@ifinfo
@xref{Connection Variables, , , emacs}.
@@ -5643,6 +5686,7 @@ connection-local value.
@end group
@end lisp
+@vindex XDG_DATA_HOME@r{, environment variable}
If Emacs is configured to use the XDG conventions for the trash
directory, remote files cannot be restored with the respective tools,
because those conventions don't specify remote paths. Such files must
@@ -5662,7 +5706,7 @@ is
@file{@trampfn{ssh,news@@news.my.domain,/opt/news/etc}}, then:
Use simplified syntax:
If you always apply the default method (@pxref{Default Method}), you
-could use the simplified @value{tramp} syntax (@pxref{Change file name
+can use the simplified @value{tramp} syntax (@pxref{Change file name
syntax}):
@lisp
@@ -5974,7 +6018,7 @@ the buffer is remote. See the optional arguments of
How to save files when a remote host isn't reachable anymore?
If the local machine Emacs is running on changes its network
-integration, remote hosts could become unreachable. This happens for
+integration, remote hosts could become unreachable. This happens, for
example, if the local machine is moved between your office and your
home without restarting Emacs.
@@ -5994,9 +6038,9 @@ an unresponsive remote host could trigger @code{recentf}
to connect
that host again and again.
If you find the cleanup disturbing, because the file names in
-@code{recentf-list} are precious to you, you could add the following
-two forms in your @file{~/.emacs} after loading the @code{tramp} and
-@code{recentf} packages:
+@code{recentf-list} are precious to you, you can add the following
+two forms in your @file{~/.emacs} (after loading the @code{tramp} and
+@code{recentf} packages):
@vindex tramp-cleanup-connection-hook
@vindex tramp-cleanup-all-connections-hook
@@ -6076,6 +6120,36 @@ as above in your @file{~/.emacs}:
@end lisp
+@item
+I get an error @samp{unix_listener: path
+"/very/long/path/.cache/emacs/tramp.XXX" too long for Unix domain
+socket} when connectiong via @option{ssh} to a remote host.
+
+@vindex small-temporary-file-directory
+By default, @value{tramp} uses the directory @file{~/.cache/emacs/}
+for creation of OpenSSH Unix domain sockets. On GNU/Linux, domain
+sockets have a much lower maximum path length (currently 107
+characters) than normal files.
+
+You can change this directory by setting the user option
+@code{small-temporary-file-directory} to another name, like
+
+@lisp
+@group
+(unless small-temporary-file-directory
+ (customize-set-variable
+ 'small-temporary-file-directory
+ (format "/run/user/%d/emacs/" (user-uid)))
+ (make-directory small-temporary-file-directory t))
+@end group
+@end lisp
+
+@vindex XDG_RUNTIME_DIR@r{, environment variable}
+@t{"/run/user/UID"} is the value of the environment variable
+@env{XDG_RUNTIME_DIR}, which you can use instead via @code{(getenv
+"XDG_RUNTIME_DIR")}.
+
+
@item
How to ignore errors when changing file attributes?
@@ -6146,8 +6220,8 @@ If you want to enable Ange FTP's syntax, add the
following form:
(tramp-change-syntax 'simplified)
@end lisp
-@item
@vindex tramp-ignored-file-name-regexp
+@item
To deactivate @value{tramp} for some look-alike remote file names, set
@code{tramp-ignored-file-name-regexp} to a proper regexp in
@file{.emacs}. @strong{Note}, that we don't use
@@ -6161,8 +6235,8 @@ To deactivate @value{tramp} for some look-alike remote
file names, set
This is needed, if you mount for example a virtual file system on your
local host's root directory as @file{/ssh:example.com:}.
-@item
@findex inhibit-remote-files
+@item
To disable both @value{tramp} (and Ange FTP), type @kbd{M-x
inhibit-remote-files @key{RET}}. You can also add this to your
@file{.emacs}.
@@ -6171,8 +6245,8 @@ inhibit-remote-files @key{RET}}. You can also add this
to your
(inhibit-remote-files)
@end lisp
-@item
@findex without-remote-files
+@item
If you write code, which is intended to run only for local files, you
can use the @code{without-remote-files} macro.
@@ -6183,8 +6257,8 @@ can use the @code{without-remote-files} macro.
This improves performance, because many primitive file name operations
don't check any longer for @value{tramp} file name regexps then.
-@item
@findex tramp-unload-tramp
+@item
To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp @key{RET}}.
Unloading @value{tramp} resets Ange FTP plugins also.
@end itemize
diff --git a/texi/trampver.texi b/texi/trampver.texi
index 496ac3e02e..d47b115277 100644
--- a/texi/trampver.texi
+++ b/texi/trampver.texi
@@ -7,7 +7,7 @@
@c In the Tramp GIT, the version number and the bug report address
@c are auto-frobbed from configure.ac.
-@set trampver 2.7.1.4
+@set trampver 2.7.1.5
@set trampurl https://www.gnu.org/software/tramp/
@set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 27.1
diff --git a/tramp-adb.el b/tramp-adb.el
index a6d5d04aa8..b9399bffec 100644
--- a/tramp-adb.el
+++ b/tramp-adb.el
@@ -1125,6 +1125,11 @@ connection if a previous connection has died for some
reason."
tramp-adb-program args)))
(prompt (md5 (concat (prin1-to-string process-environment)
(current-time-string)))))
+
+ ;; Set sentinel. Initialize variables.
+ (set-process-sentinel p #'tramp-process-sentinel)
+ (tramp-post-process-creation p vec)
+
;; Wait for initial prompt. On some devices, it needs
;; an initial RET, in order to get it.
(sleep-for 0.1)
@@ -1133,10 +1138,6 @@ connection if a previous connection has died for some
reason."
(unless (process-live-p p)
(tramp-error vec 'file-error "Terminated!"))
- ;; Set sentinel. Initialize variables.
- (set-process-sentinel p #'tramp-process-sentinel)
- (tramp-post-process-creation p vec)
-
;; Set connection-local variables.
(tramp-set-connection-local-variables vec)
diff --git a/tramp-cache.el b/tramp-cache.el
index 3c5c415589..c9165a7d4d 100644
--- a/tramp-cache.el
+++ b/tramp-cache.el
@@ -68,10 +68,10 @@
;; Some properties are handled special:
;;
-;; - "process-name", "process-buffer" and "first-password-request" are
-;; not saved in the file `tramp-persistency-file-name', although
-;; being connection properties related to a `tramp-file-name'
-;; structure.
+;; - "process-name", "process-buffer", "first-password-request" and
+;; "pw-spec" are not saved in the file
+;; `tramp-persistency-file-name', although being connection
+;; properties related to a `tramp-file-name' structure.
;;
;; - Reusable properties, which should not be saved, are kept in the
;; process key retrieved by `tramp-get-process' (the main connection
@@ -388,7 +388,8 @@ the connection, return DEFAULT."
(not (and (processp key) (not (process-live-p key)))))
(setq value cached
cache-used t))
- (tramp-message key 7 "%s %s; cache used: %s" property value cache-used)
+ (unless (eq key tramp-cache-version)
+ (tramp-message key 7 "%s %s; cache used: %s" property value cache-used))
value))
;;;###tramp-autoload
@@ -405,7 +406,8 @@ Return VALUE."
(puthash property value hash))
(setq tramp-cache-data-changed
(or tramp-cache-data-changed (tramp-file-name-p key)))
- (tramp-message key 7 "%s %s" property value)
+ (unless (eq key tramp-cache-version)
+ (tramp-message key 7 "%s %s" property value))
value)
;;;###tramp-autoload
@@ -579,7 +581,8 @@ PROPERTIES is a list of file properties (strings)."
(progn
(remhash "process-name" value)
(remhash "process-buffer" value)
- (remhash "first-password-request" value))
+ (remhash "first-password-request" value)
+ (remhash "pw-spec" value))
(remhash key cache)))
cache)
;; Dump it.
diff --git a/tramp-message.el b/tramp-message.el
index f01fbe2221..12da4d5de1 100644
--- a/tramp-message.el
+++ b/tramp-message.el
@@ -470,7 +470,7 @@ to `tramp-message'."
(declare (tramp-suppress-trace t))
(let (signal-hook-function)
(apply 'tramp-message vec-or-proc 2 fmt-string arguments)
- (lwarn 'tramp :warning fmt-string arguments)))
+ (apply 'lwarn 'tramp :warning fmt-string arguments)))
(defun tramp-test-message (fmt-string &rest arguments)
"Emit a Tramp message according `default-directory'."
diff --git a/tramp-sh.el b/tramp-sh.el
index e213b89c16..c6563ac87d 100644
--- a/tramp-sh.el
+++ b/tramp-sh.el
@@ -597,6 +597,7 @@ shell from reading its init file."
'((tramp-login-prompt-regexp tramp-action-login)
(tramp-password-prompt-regexp tramp-action-password)
(tramp-otp-password-prompt-regexp tramp-action-otp-password)
+ (tramp-fingerprint-prompt-regexp tramp-action-fingerprint)
(tramp-wrong-passwd-regexp tramp-action-permission-denied)
(shell-prompt-pattern tramp-action-succeed)
(tramp-shell-prompt-pattern tramp-action-succeed)
@@ -3101,8 +3102,7 @@ will be used."
;; needed when sending signals remotely.
(let ((pid (tramp-send-command-and-read v "echo $$")))
(setq p (tramp-get-connection-process v))
- (process-put p 'remote-pid pid)
- (tramp-set-connection-property p "remote-pid" pid))
+ (process-put p 'remote-pid pid))
(when (memq connection-type '(nil pipe))
;; Disable carriage return to newline
;; translation. This does not work on
@@ -3753,7 +3753,7 @@ Fall back to normal file name handler if no Tramp handler
exists."
;; When `tramp-mode' is not enabled, or the file name is not a
;; remote file name, we don't do anything. Same for default
- ;; file namne handlers.
+ ;; file name handlers.
(tramp-run-real-handler operation args))))
(defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback)
@@ -5250,9 +5250,10 @@ connection if a previous connection has died for some
reason."
(setq r-shell t)))
(setq current-host l-host)
- ;; Set password prompt vector.
+ ;; Set hop and password prompt vector.
+ (tramp-set-connection-property p "hop-vector" hop)
(tramp-set-connection-property
- p "password-vector"
+ p "pw-vector"
(if (tramp-get-method-parameter
hop 'tramp-password-previous-hop)
(let ((pv (copy-tramp-file-name previous-hop)))
@@ -5308,6 +5309,8 @@ connection if a previous connection has died for some
reason."
tramp-actions-before-shell connection-timeout))
;; Next hop.
+ (tramp-flush-connection-property p "hop-vector")
+ (tramp-flush-connection-property p "pw-vector")
(setq options ""
target-alist (cdr target-alist)
previous-hop hop)))
diff --git a/tramp-smb.el b/tramp-smb.el
index 2a8340a5ac..fac1163d30 100644
--- a/tramp-smb.el
+++ b/tramp-smb.el
@@ -766,7 +766,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are
completely ignored."
(forward-line)
(delete-region (point-min) (point)))
(while (and (not (eobp)) (looking-at-p (rx bol (+ nonl) ":" (+ nonl))))
- (forward-line))
+ (forward-line))
(delete-region (point) (point-max))
(throw 'tramp-action 'ok))))
diff --git a/tramp-sudoedit.el b/tramp-sudoedit.el
index 8c18fcdd04..fad5464d0a 100644
--- a/tramp-sudoedit.el
+++ b/tramp-sudoedit.el
@@ -785,7 +785,7 @@ in case of error, t otherwise."
;; Avoid process status message in output buffer.
(set-process-sentinel p #'ignore)
(tramp-post-process-creation p vec)
- (tramp-set-connection-property p "password-vector"
tramp-sudoedit-null-hop)
+ (tramp-set-connection-property p "pw-vector" tramp-sudoedit-null-hop)
(tramp-process-actions p vec nil tramp-sudoedit-sudo-actions)
(tramp-message vec 6 "%s\n%s" (process-exit-status p) (buffer-string))
(prog1
diff --git a/tramp.el b/tramp.el
index 14204dafdb..0638d7660b 100644
--- a/tramp.el
+++ b/tramp.el
@@ -703,12 +703,51 @@ The regexp should match at end of buffer."
"No supported authentication methods left to try!"
(: "Login " (| "Incorrect" "incorrect"))
(: "Connection " (| "refused" "closed"))
- (: "Received signal " (+ digit)))
+ (: "Received signal " (+ digit))
+ ;; Fingerprint.
+ "Verification timed out"
+ "Failed to match fingerprint"
+ "An unknown error occurred")
(* nonl))
"Regexp matching a `login failed' message.
The regexp should match at end of buffer."
:type 'regexp)
+;;
<https://gitlab.freedesktop.org/libfprint/fprintd/-/blob/master/pam/fingerprint-strings.h?ref_type=heads>
+(defcustom tramp-fingerprint-prompt-regexp
+ (rx (| "Place your finger on"
+ "Swipe your finger across"
+ "Place your left thumb on"
+ "Swipe your left thumb across"
+ "Place your left index finger on"
+ "Swipe your left index finger across"
+ "Place your left middle finger on"
+ "Swipe your left middle finger across"
+ "Place your left ring finger on"
+ "Swipe your left ring finger across"
+ "Place your left little finger on"
+ "Swipe your left little finger across"
+ "Place your right thumb on"
+ "Swipe your right thumb across"
+ "Place your right index finger on"
+ "Swipe your right index finger across"
+ "Place your right middle finger on"
+ "Swipe your right middle finger across"
+ "Place your right ring finger on"
+ "Swipe your right ring finger across"
+ "Place your right little finger on"
+ "Swipe your right little finger across"
+ "Place your finger on the reader again"
+ "Swipe your finger again"
+ "Swipe was too short, try again"
+ "Your finger was not centred, try swiping your finger again"
+ "Remove your finger, and try swiping your finger again")
+ (* nonl) (* (any "\r\n")))
+ "Regexp matching fingerprint prompts.
+The regexp should match at end of buffer."
+ :version "30.2"
+ :type 'regexp)
+
(defcustom tramp-yesno-prompt-regexp
(rx "Are you sure you want to continue connecting (yes/no"
(? "/[fingerprint]") ")?"
@@ -4915,69 +4954,74 @@ Do not set it manually, it is used buffer-local in
`tramp-get-lock-pid'.")
(item vec)
choices proxy)
- ;; Ad-hoc proxy definitions.
- (tramp-add-hops vec)
-
- ;; Look for proxy hosts to be passed.
- (setq choices tramp-default-proxies-alist)
- (while choices
- (setq item (pop choices)
- proxy (eval (nth 2 item) t))
- (when (and
- ;; Host.
- (string-match-p
- (or (eval (nth 0 item) t) "")
- (or (tramp-file-name-host-port (car target-alist)) ""))
- ;; User.
- (string-match-p
- (or (eval (nth 1 item) t) "")
- (or (tramp-file-name-user-domain (car target-alist)) "")))
- (if (null proxy)
- ;; No more hops needed.
- (setq choices nil)
- ;; Replace placeholders.
- (setq proxy
- (format-spec
- proxy
- (format-spec-make
- ?u (or (tramp-file-name-user (car target-alist)) "")
- ?h (or (tramp-file-name-host (car target-alist)) ""))))
- (with-parsed-tramp-file-name proxy l
- ;; Add the hop.
- (push l target-alist)
- ;; Start next search.
- (setq choices tramp-default-proxies-alist)))))
-
- ;; Foreign and out-of-band methods are not supported for multi-hops.
- (when (cdr target-alist)
- (setq choices target-alist)
- (while (setq item (pop choices))
- (unless (tramp-multi-hop-p item)
- (setq tramp-default-proxies-alist saved-tdpa)
- (tramp-user-error
- vec "Method `%s' is not supported for multi-hops"
- (tramp-file-name-method item)))))
-
- ;; Some methods ("su", "sg", "sudo", "doas", "run0", "ksu") do not
- ;; use the host name in their command template. In this case, the
- ;; remote file name must use either a local host name (first hop),
- ;; or a host name matching the previous hop.
- (let ((previous-host (or tramp-local-host-regexp "")))
- (setq choices target-alist)
- (while (setq item (pop choices))
- (let ((host (tramp-file-name-host item)))
- (unless
- (or
- ;; The host name is used for the remote shell command.
- (member
- "%h" (flatten-tree
- (tramp-get-method-parameter item 'tramp-login-args)))
- ;; The host name must match previous hop.
- (string-match-p previous-host host))
+ ;; `tramp-compute-multi-hops' could be called also for other file
+ ;; name handlers, for example in `tramp-clear-passwd'.
+ (when (tramp-sh-file-name-handler-p vec)
+
+ ;; Ad-hoc proxy definitions.
+ (tramp-add-hops vec)
+
+ ;; Look for proxy hosts to be passed.
+ (setq choices tramp-default-proxies-alist)
+ (while choices
+ (setq item (pop choices)
+ proxy (eval (nth 2 item) t))
+ (when (and
+ ;; Host.
+ (string-match-p
+ (or (eval (nth 0 item) t) "")
+ (or (tramp-file-name-host-port (car target-alist)) ""))
+ ;; User.
+ (string-match-p
+ (or (eval (nth 1 item) t) "")
+ (or (tramp-file-name-user-domain (car target-alist)) "")))
+ (if (null proxy)
+ ;; No more hops needed.
+ (setq choices nil)
+ ;; Replace placeholders.
+ (setq proxy
+ (format-spec
+ proxy
+ (format-spec-make
+ ?u (or (tramp-file-name-user (car target-alist)) "")
+ ?h (or (tramp-file-name-host (car target-alist)) ""))))
+ (with-parsed-tramp-file-name proxy l
+ ;; Add the hop.
+ (push l target-alist)
+ ;; Start next search.
+ (setq choices tramp-default-proxies-alist)))))
+
+ ;; Foreign and out-of-band methods are not supported for
+ ;; multi-hops.
+ (when (cdr target-alist)
+ (setq choices target-alist)
+ (while (setq item (pop choices))
+ (unless (tramp-multi-hop-p item)
(setq tramp-default-proxies-alist saved-tdpa)
(tramp-user-error
- vec "Host name `%s' does not match `%s'" host previous-host))
- (setq previous-host (rx bol (literal host) eol)))))
+ vec "Method `%s' is not supported for multi-hops"
+ (tramp-file-name-method item)))))
+
+ ;; Some methods ("su", "sg", "sudo", "doas", "run0", "ksu") do
+ ;; not use the host name in their command template. In this
+ ;; case, the remote file name must use either a local host name
+ ;; (first hop), or a host name matching the previous hop.
+ (let ((previous-host (or tramp-local-host-regexp "")))
+ (setq choices target-alist)
+ (while (setq item (pop choices))
+ (let ((host (tramp-file-name-host item)))
+ (unless
+ (or
+ ;; The host name is used for the remote shell command.
+ (member
+ "%h" (flatten-tree
+ (tramp-get-method-parameter item 'tramp-login-args)))
+ ;; The host name must match previous hop.
+ (string-match-p previous-host host))
+ (setq tramp-default-proxies-alist saved-tdpa)
+ (tramp-user-error
+ vec "Host name `%s' does not match `%s'" host previous-host))
+ (setq previous-host (rx bol (literal host) eol))))))
;; Result.
target-alist))
@@ -5646,7 +5690,11 @@ of."
;; Sometimes, the process returns a new password request
;; immediately after rejecting the previous (wrong) one.
(unless (or tramp-password-prompt-not-unique
- (tramp-get-connection-property vec "first-password-request"))
+ (tramp-get-connection-property
+ (tramp-get-connection-property
+ proc "hop-vector"
+ (process-get proc 'tramp-vector))
+ "first-password-request"))
(tramp-clear-passwd vec))
(goto-char (point-min))
(tramp-check-for-regexp proc tramp-process-action-regexp)
@@ -5684,6 +5732,22 @@ of."
(narrow-to-region (point-max) (point-max))))
t)
+(defcustom tramp-use-fingerprint t
+ "Whether fingerprint prompts shall be used for authentication."
+ :version "30.2"
+ :type 'boolean)
+
+(defun tramp-action-fingerprint (proc vec)
+ "Query the user for a fingerprint verification.
+Interrupt the query if `tramp-use-fingerprint' is nil."
+ (with-current-buffer (process-buffer proc)
+ (if tramp-use-fingerprint
+ (tramp-action-show-message proc vec)
+ (interrupt-process proc)
+ ;; Hide message.
+ (narrow-to-region (point-max) (point-max))))
+ t)
+
(defun tramp-action-succeed (_proc _vec)
"Signal success in finding shell prompt."
(throw 'tramp-action 'ok))
@@ -5730,6 +5794,26 @@ The terminal type can be configured with
`tramp-terminal-type'."
(tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line))
t)
+(defun tramp-action-show-message (proc vec)
+ "Show the user a message for confirmation.
+Wait, until the connection buffer changes."
+ (with-current-buffer (process-buffer proc)
+ (let ((cursor-in-echo-area t)
+ set-message-function clear-message-function tramp-dont-suspend-timers)
+ (with-tramp-suspended-timers
+ ;; Silence byte compiler.
+ (ignore set-message-function clear-message-function)
+ (tramp-message vec 6 "\n%s" (buffer-string))
+ (goto-char (point-min))
+ (tramp-check-for-regexp proc tramp-process-action-regexp)
+ (with-temp-message (concat (string-trim (match-string 0)) " ")
+ ;; Hide message in buffer.
+ (narrow-to-region (point-max) (point-max))
+ ;; Wait for new output.
+ (while (tramp-compat-length= (buffer-string) 0)
+ (tramp-accept-process-output proc))))))
+ t)
+
(defun tramp-action-confirm-message (_proc vec)
"Return RET in order to confirm the message."
(tramp-message
@@ -5747,6 +5831,7 @@ Wait, until the connection buffer changes."
;; Silence byte compiler.
(ignore set-message-function clear-message-function)
(tramp-message vec 6 "\n%s" (buffer-string))
+ (goto-char (point-min))
(tramp-check-for-regexp proc tramp-process-action-regexp)
(with-temp-message (concat (string-trim (match-string 0)) " ")
;; Hide message in buffer.
@@ -5849,10 +5934,10 @@ because the shell prompt has been detected), it shall
throw a
result. The symbol `ok' means that all ACTIONs have been
performed successfully. Any other value means an error."
;; Enable `auth-source', unless "emacs -Q" has been called. We must
- ;; use the "password-vector" property in case we have several hops.
+ ;; use the "hop-vector" property in case we have several hops.
(tramp-set-connection-property
(tramp-get-connection-property
- proc "password-vector" (process-get proc 'tramp-vector))
+ proc "hop-vector" (process-get proc 'tramp-vector))
"first-password-request" tramp-cache-read-persistent-data)
(save-restriction
(with-tramp-progress-reporter
@@ -6351,12 +6436,10 @@ Convert file mode bits to string and set virtual device
number.
Set file uid and gid according to ID-FORMAT. LOCALNAME is used
to cache the result. Return the modified ATTR."
(declare (indent 3) (debug t))
- `(with-tramp-file-property
- ,vec ,localname (format "file-attributes-%s" (or ,id-format 'integer))
- (when-let*
- ((attr ,attr)
- (result
- (with-tramp-file-property ,vec ,localname "file-attributes"
+ `(when-let*
+ ((result
+ (with-tramp-file-property ,vec ,localname "file-attributes"
+ (when-let* ((attr ,attr))
(save-match-data
;; Remove ANSI control escape sequences from symlink.
(when (stringp (car attr))
@@ -6449,14 +6532,14 @@ to cache the result. Return the modified ATTR."
(split-string (nth 12 attr) ":" 'omit)))
;; Remove optional entries.
(setcdr (nthcdr 11 attr) nil)
- attr))))
+ attr)))))
- ;; Return normalized result.
- (append (tramp-compat-take 2 result)
- (if (eq ,id-format 'string)
- (list (car (nth 2 result)) (car (nth 3 result)))
- (list (cdr (nth 2 result)) (cdr (nth 3 result))))
- (nthcdr 4 result)))))
+ ;; Return normalized result.
+ (append (tramp-compat-take 2 result)
+ (if (eq ,id-format 'string)
+ (list (car (nth 2 result)) (car (nth 3 result)))
+ (list (cdr (nth 2 result)) (cdr (nth 3 result))))
+ (nthcdr 4 result))))
(defun tramp-get-home-directory (vec &optional user)
"The remote home directory for connection VEC as local file name.
@@ -6797,15 +6880,16 @@ Consults the auth-source package."
;; adapt `default-directory'. (Bug#39389, Bug#39489)
(default-directory tramp-compat-temporary-file-directory)
(case-fold-search t)
- ;; In tramp-sh.el, we must use "password-vector" due to
- ;; multi-hop.
- (vec (tramp-get-connection-property
- proc "password-vector" (process-get proc 'tramp-vector)))
- (key (tramp-make-tramp-file-name vec 'noloc))
- (method (tramp-file-name-method vec))
- (user-domain (or (tramp-file-name-user-domain vec)
- (tramp-get-connection-property key "login-as")))
- (host-port (tramp-file-name-host-port vec))
+ ;; In tramp-sh.el, we must use "hop-vector" and "pw-vector"
+ ;; due to multi-hop.
+ (vec (process-get proc 'tramp-vector))
+ (hop-vec (tramp-get-connection-property proc "hop-vector" vec))
+ (pw-vec (tramp-get-connection-property proc "pw-vector" hop-vec))
+ (key (tramp-make-tramp-file-name pw-vec 'noloc))
+ (method (tramp-file-name-method pw-vec))
+ (user-domain (or (tramp-file-name-user-domain pw-vec)
+ (tramp-get-connection-property pw-vec "login-as")))
+ (host-port (tramp-file-name-host-port pw-vec))
(pw-prompt
(string-trim-left
(or prompt
@@ -6814,28 +6898,23 @@ Consults the auth-source package."
(if (string-match-p "passphrase" (match-string 1))
(match-string 0)
(format "%s for %s " (capitalize (match-string 1)) key))))))
+ ;; If there is no user name, `:create' triggers to ask for.
+ ;; We suppress it.
+ (pw-spec (list :max 1 :user user-domain :host host-port :port method
+ :require (cons :secret (and user-domain '(:user)))
+ :create (and user-domain t)))
(auth-source-creation-prompts `((secret . ,pw-prompt)))
;; Use connection-local value.
(auth-sources (buffer-local-value 'auth-sources (process-buffer proc)))
auth-info auth-passwd tramp-dont-suspend-timers)
(unwind-protect
- ;; We cannot use `with-parsed-tramp-file-name', because it
- ;; expands the file name.
(or
(setq tramp-password-save-function nil)
- ;; See if auth-sources contains something useful.
+ ;; See if `auth-sources' contains something useful.
(ignore-errors
- (and (tramp-get-connection-property vec "first-password-request")
- ;; Try with Tramp's current method. If there is no
- ;; user name, `:create' triggers to ask for. We
- ;; suppress it.
- (setq auth-info
- (car
- (auth-source-search
- :max 1 :user user-domain :host host-port :port method
- :require (cons :secret (and user-domain '(:user)))
- :create (and user-domain t)))
+ (and (tramp-get-connection-property hop-vec "first-password-request")
+ (setq auth-info (car (apply #'auth-source-search pw-spec))
tramp-password-save-function
(plist-get auth-info :save-function)
auth-passwd
@@ -6843,16 +6922,23 @@ Consults the auth-source package."
;; Try the password cache.
(with-tramp-suspended-timers
- (setq auth-passwd (password-read pw-prompt key)
+ (setq auth-passwd
+ (password-read
+ pw-prompt (auth-source-format-cache-entry pw-spec))
tramp-password-save-function
- (lambda () (password-cache-add key auth-passwd)))
+ (when auth-source-do-cache
+ (lambda ()
+ (password-cache-add
+ (auth-source-format-cache-entry pw-spec) auth-passwd))))
auth-passwd))
;; Workaround. Prior Emacs 28.1, auth-source has saved empty
;; passwords. See discussion in Bug#50399.
(when (tramp-string-empty-or-nil-p auth-passwd)
(setq tramp-password-save-function nil))
- (tramp-set-connection-property vec "first-password-request" nil))))
+ ;; Remember the values.
+ (tramp-set-connection-property hop-vec "pw-spec" pw-spec)
+ (tramp-set-connection-property hop-vec "first-password-request" nil))))
(defun tramp-read-passwd-without-cache (proc &optional prompt)
"Read a password from user (compat function)."
@@ -6869,17 +6955,11 @@ Consults the auth-source package."
(defun tramp-clear-passwd (vec)
"Clear password cache for connection related to VEC."
(declare (tramp-suppress-trace t))
- (let ((method (tramp-file-name-method vec))
- (user-domain (tramp-file-name-user-domain vec))
- (host-port (tramp-file-name-host-port vec))
- (hop (tramp-file-name-hop vec)))
- (when hop
- ;; Clear also the passwords of the hops.
- (tramp-clear-passwd (tramp-dissect-hop-name hop)))
- (auth-source-forget
- `(:max 1 ,(and user-domain :user) ,user-domain
- :host ,host-port :port ,method))
- (password-cache-remove (tramp-make-tramp-file-name vec 'noloc))))
+ (when-let* ((hop (cadr (reverse (tramp-compute-multi-hops vec)))))
+ ;; Clear also the passwords of the hops.
+ (tramp-clear-passwd hop))
+ (when-let* ((pw-spec (tramp-get-connection-property vec "pw-spec")))
+ (auth-source-forget pw-spec)))
(defun tramp-time-diff (t1 t2)
"Return the difference between the two times, in seconds.
diff --git a/trampver.el b/trampver.el
index 01534ec389..98bd738000 100644
--- a/trampver.el
+++ b/trampver.el
@@ -7,7 +7,7 @@
;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes
;; Package: tramp
-;; Version: 2.7.1.4
+;; Version: 2.7.1.5
;; Package-Requires: ((emacs "27.1"))
;; Package-Type: multi
;; URL: https://www.gnu.org/software/tramp/
@@ -40,7 +40,7 @@
;; ./configure" to change them.
;;;###tramp-autoload
-(defconst tramp-version "2.7.1.4"
+(defconst tramp-version "2.7.1.5"
"This version of Tramp.")
;;;###tramp-autoload
@@ -76,7 +76,7 @@
;; Check for Emacs version.
(let ((x (if (not (string-version-lessp emacs-version "27.1"))
"ok"
- (format "Tramp 2.7.1.4 is not fit for %s"
+ (format "Tramp 2.7.1.5 is not fit for %s"
(replace-regexp-in-string "\n" "" (emacs-version))))))
(unless (string-equal "ok" x) (error "%s" x)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/tramp 73bdb480f6: Tramp ELPA version 2.7.1.5 released,
ELPA Syncer <=