From 0a2507ff9095bb725e8c30017c413840c11ff132 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 7 Dec 2021 16:20:13 +0100 Subject: [PATCH] Backport: Make a more robust check in Tramp using scripts * lisp/net/tramp-sh.el (tramp-find-inline-encoding): Check, whether scripts in `tramp-remote-coding-commands' are expandable. (cherry picked from commit 1d0a60113fd155c77ef5ea4ea44fcba3504adcbf) --- lisp/net/tramp-sh.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6f3b3245225..21217381f14 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4585,6 +4585,8 @@ Goes through the list `tramp-local-coding-commands' and (value (symbol-value rem-enc))) (while (string-match "-" name) (setq name (replace-match "_" nil t name))) + (unless (tramp-expand-script vec value) + (throw 'wont-work-remote nil)) (tramp-maybe-send-script vec value name) (setq rem-enc name))) (tramp-message @@ -4602,6 +4604,8 @@ Goes through the list `tramp-local-coding-commands' and (value (symbol-value rem-dec))) (while (string-match "-" name) (setq name (replace-match "_" nil t name))) + (unless (tramp-expand-script vec value) + (throw 'wont-work-remote nil)) (tramp-maybe-send-script vec value name) (setq rem-dec name))) (tramp-message -- 2.39.2