From 22d031f644d38e385f422ffc4855385d9052659b Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 16 Aug 2023 11:48:28 +0200 Subject: [PATCH] Fix infloop error in Tramp * lisp/net/tramp-sh.el (tramp-find-file-exists-command): Do not call `tramp-get-ls-command'. (Bug#65321) --- lisp/net/tramp-sh.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 426682ddef1..4e6ba6e38d7 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4255,8 +4255,10 @@ file exists and nonzero exit status otherwise." vec (format "%s %s" result existing)) (not (tramp-send-command-and-check vec (format "%s %s" result nonexistent))))) + ;; We cannot use `tramp-get-ls-command', this results in an infloop. + ;; (Bug#65321) (ignore-errors - (and (setq result (format "%s -d" (tramp-get-ls-command vec))) + (and (setq result (format "ls -d >%s" (tramp-get-remote-null-device vec))) (tramp-send-command-and-check vec (format "%s %s" result existing)) (not (tramp-send-command-and-check -- 2.39.2