summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-03-23 09:55:04 +0100
committerMichael Albinus <michael.albinus@gmx.de>2019-03-23 09:55:04 +0100
commita3194e7b7654134a51bc066dbf91cf59c3ce393d (patch)
treed8dba7e07759168304f85f031b63429c9ce06c39 /lisp/net
parent86c3cd99bff27e35e25dec0ee3f0dc4536b171ea (diff)
downloademacs-a3194e7b7654134a51bc066dbf91cf59c3ce393d.tar.gz
emacs-a3194e7b7654134a51bc066dbf91cf59c3ce393d.tar.bz2
emacs-a3194e7b7654134a51bc066dbf91cf59c3ce393d.zip
Fix Bug#34943
* lisp/files-x.el (cl-lib): Require when compiling. (hack-connection-local-variables): Regard connection-local variables as safe. (Bug#34943) * lisp/shell.el (shell): Use `with-connection-local-variables' for the whole code block. (Bug#34943) * lisp/net/tramp-adb.el (tramp-connection-local-safe-shell-file-names): Do not set values. * lisp/net/tramp-integration.el (tramp-connection-local-safe-shell-file-names): Remove. (shell-file-name, shell-command-switch): Do not add safe-local-variable property. * lisp/net/tramp.el (tramp-handle-shell-command): Use proper buffer name. * test/lisp/net/tramp-tests.el (tramp-test34-explicit-shell-file-name): Tag it :unstable.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-adb.el1
-rw-r--r--lisp/net/tramp-integration.el11
-rw-r--r--lisp/net/tramp.el8
3 files changed, 7 insertions, 13 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 8eeaa8be415..68960426b68 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1299,7 +1299,6 @@ connection if a previous connection has died for some reason."
'((shell-file-name . "/system/bin/sh")
(shell-command-switch . "-c"))
"Default connection-local variables for remote adb connections.")
-(add-to-list 'tramp-connection-local-safe-shell-file-names "/system/bin/sh")
;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1.
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 946d7f8cbab..da168adce77 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -173,21 +173,10 @@ NAME must be equal to `tramp-current-connection'."
;;; Default connection-local variables for Tramp:
-;;;###tramp-autoload
-(defvar tramp-connection-local-safe-shell-file-names nil
- "List of safe `shell-file-name' values for remote hosts.")
-(add-to-list 'tramp-connection-local-safe-shell-file-names "/bin/sh")
-
(defconst tramp-connection-local-default-profile
'((shell-file-name . "/bin/sh")
(shell-command-switch . "-c"))
"Default connection-local variables for remote connections.")
-(put 'shell-file-name 'safe-local-variable
- (lambda (item)
- (and (stringp item)
- (member item tramp-connection-local-safe-shell-file-names))))
-(put 'shell-command-switch 'safe-local-variable
- (lambda (item) (and (stringp item) (string-equal item "-c"))))
;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 48c363a873a..1d7242ba8f9 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3641,7 +3641,7 @@ support symbolic links."
(prog1
;; Run the process.
(setq p (start-file-process-shell-command
- "*Async Shell*" buffer command))
+ (buffer-name output-buffer) buffer command))
;; Display output.
(with-current-buffer output-buffer
(display-buffer output-buffer '(nil (allow-no-window . t)))
@@ -4892,6 +4892,12 @@ Only works for Bourne-like shells."
;; and friends, for most of the handlers this is the major
;; difference between the different backends. Other handlers but
;; *-process-file would profit from this as well.
+;;
+;; * Get rid of `shell-command'. In its primary implementation, it
+;; uses `process-file-shell-command' and
+;; `start-file-process-shell-command', which is sufficient due to
+;; connection-local `shell-file-name'.
+
;;; tramp.el ends here