diff options
| author | Glenn Morris | 2020-11-23 09:41:53 -0800 |
|---|---|---|
| committer | Glenn Morris | 2020-11-23 09:41:53 -0800 |
| commit | 593c262124ecf213da1f24fcf46c8cca8fea2fd8 (patch) | |
| tree | 1135e567f6dba59d87a88195bf9b2b81968bc945 | |
| parent | 34012517447deb2361ee2f573ca6f569ed330394 (diff) | |
| parent | 3ceee398192e312faa3ea073365c49bcce9ef61b (diff) | |
| download | emacs-593c262124ecf213da1f24fcf46c8cca8fea2fd8.tar.gz emacs-593c262124ecf213da1f24fcf46c8cca8fea2fd8.zip | |
Merge from origin/emacs-27
3ceee39819 Fix Bug#44481
| -rw-r--r-- | lisp/net/tramp-sh.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index d2265ed1dfa..2851110826c 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -4979,7 +4979,7 @@ connection if a previous connection has died for some reason." | |||
| 4979 | (setenv "PS1" tramp-initial-end-of-output) | 4979 | (setenv "PS1" tramp-initial-end-of-output) |
| 4980 | (unless (stringp tramp-encoding-shell) | 4980 | (unless (stringp tramp-encoding-shell) |
| 4981 | (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) | 4981 | (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) |
| 4982 | (let* ((current-host (system-name)) | 4982 | (let* ((current-host tramp-system-name) |
| 4983 | (target-alist (tramp-compute-multi-hops vec)) | 4983 | (target-alist (tramp-compute-multi-hops vec)) |
| 4984 | ;; We will apply `tramp-ssh-controlmaster-options' | 4984 | ;; We will apply `tramp-ssh-controlmaster-options' |
| 4985 | ;; only for the first hop. | 4985 | ;; only for the first hop. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index d40f9a5927c..6ae79be9e35 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -175,6 +175,12 @@ See the variable `tramp-encoding-shell' for more information." | |||
| 175 | :version "24.1" | 175 | :version "24.1" |
| 176 | :type '(choice (const nil) string)) | 176 | :type '(choice (const nil) string)) |
| 177 | 177 | ||
| 178 | ;; Since Emacs 26.1, `system-name' can return `nil' at build time if | ||
| 179 | ;; Emacs is compiled with "--no-build-details". We do expect it to be | ||
| 180 | ;; a string. (Bug#44481) | ||
| 181 | (defconst tramp-system-name (or (system-name) "") | ||
| 182 | "The system name Tramp is running locally.") | ||
| 183 | |||
| 178 | (defvar tramp-methods nil | 184 | (defvar tramp-methods nil |
| 179 | "Alist of methods for remote files. | 185 | "Alist of methods for remote files. |
| 180 | This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | 186 | This is a list of entries of the form (NAME PARAM1 PARAM2 ...). |
| @@ -417,7 +423,7 @@ empty string for the method name." | |||
| 417 | (choice :tag " Host regexp" regexp sexp) | 423 | (choice :tag " Host regexp" regexp sexp) |
| 418 | (choice :tag " User name" string (const nil))))) | 424 | (choice :tag " User name" string (const nil))))) |
| 419 | 425 | ||
| 420 | (defcustom tramp-default-host (system-name) | 426 | (defcustom tramp-default-host tramp-system-name |
| 421 | "Default host to use for transferring files. | 427 | "Default host to use for transferring files. |
| 422 | Useful for su and sudo methods mostly." | 428 | Useful for su and sudo methods mostly." |
| 423 | :type 'string) | 429 | :type 'string) |
| @@ -472,8 +478,8 @@ interpreted as a regular expression which always matches." | |||
| 472 | (defcustom tramp-restricted-shell-hosts-alist | 478 | (defcustom tramp-restricted-shell-hosts-alist |
| 473 | (when (memq system-type '(windows-nt)) | 479 | (when (memq system-type '(windows-nt)) |
| 474 | (list (format "\\`\\(%s\\|%s\\)\\'" | 480 | (list (format "\\`\\(%s\\|%s\\)\\'" |
| 475 | (regexp-quote (downcase (system-name))) | 481 | (regexp-quote (downcase tramp-system-name)) |
| 476 | (regexp-quote (upcase (system-name)))))) | 482 | (regexp-quote (upcase tramp-system-name))))) |
| 477 | "List of hosts, which run a restricted shell. | 483 | "List of hosts, which run a restricted shell. |
| 478 | This is a list of regular expressions, which denote hosts running | 484 | This is a list of regular expressions, which denote hosts running |
| 479 | a restricted shell like \"rbash\". Those hosts can be used as | 485 | a restricted shell like \"rbash\". Those hosts can be used as |
| @@ -486,7 +492,7 @@ host runs a restricted shell, it shall be added to this list, too." | |||
| 486 | (concat | 492 | (concat |
| 487 | "\\`" | 493 | "\\`" |
| 488 | (regexp-opt | 494 | (regexp-opt |
| 489 | (list "localhost" "localhost6" (system-name) "127.0.0.1" "::1") t) | 495 | (list "localhost" "localhost6" tramp-system-name "127.0.0.1" "::1") t) |
| 490 | "\\'") | 496 | "\\'") |
| 491 | "Host names which are regarded as local host. | 497 | "Host names which are regarded as local host. |
| 492 | If the local host runs a chrooted environment, set this to nil." | 498 | If the local host runs a chrooted environment, set this to nil." |