Subject: bug#31704: closed (Re: bug#31704: fixed commit not handle eshell-path-env properly in Windows platform)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 10 Sep 2018 07:55:02 +0000

Your bug report

#31704: 26.1; tramp-remote-path/shell: broken executable completion

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
31704: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31704
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#31704: fixed commit not handle eshell-path-env properly in Windows platform
From: Michael Albinus <[email-masked]>
To: Tao Fang <[email-masked]>
Cc: [email-masked]
Date: Mon, 10 Sep 2018 09:54:43 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 27.1

Tao Fang <[email-masked]> writes:

> Hi, Michael

Hi,

>  I can confirm this bug was fixed in your commit and second problem
> fixed either, thanks!

Thanks for your confirmation, I'm closing the bug.

> Best regards,

Best regards, Michael. 

Subject: 26.1; tramp-remote-path/shell: broken executable completion
From: xristos <[email-masked]>
To: [email-masked]
Date: Sun, 03 Jun 2018 21:32:09 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The issue lies in shell--command-completion-data which is called
by shell-command-completion, it only checks directories in
exec-path (local) rather than tramp-remote-path. This bug also
leaks the local exec-path to the remote server.

To reproduce:

emacs -Q

Evaluate:
(require 'tramp)

;; For debugging
(setq tramp-persistency-file-name nil
      tramp-verbose 10)

(add-to-list 'tramp-remote-path 'tramp-own-remote-path)

;; Assuming an account 'chris' exists at server 'remote',
;; to see the issue clearly make sure that there exists
;; a directory in the remote server PATH (e.g. ~/bin/)
;; but NOT in exec-path.

(let ((default-directory "/ssh:chris@remote:"))
  (shell "*remote*"))

;; Assuming executable 'testbin' exists in remote server ~/bin/
;; and not inside any directory in exec-path:

remote$ testb<TAB> ;; No completion

M-:
(add-to-list 'exec-path "~/bin/")

remote$ testb<TAB> ;; Completes fine

If one checks the tramp debug buffer, one will see tramp
checking (and leaking information to the remote server)
all the directories that exist in the local exec-path.