all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
@ 2019-03-22  6:17 Shuguang Sun
  2019-03-22  7:16 ` Shuguang Sun
  2019-03-22 14:13 ` Michael Albinus
  0 siblings, 2 replies; 9+ messages in thread
From: Shuguang Sun @ 2019-03-22  6:17 UTC (permalink / raw)
  To: 34943

Hi,

The recent change to Tramp for shell/explict shell has break the remote shell again. For example:
- Tramp to a host
- in a remote diretory, M-x shell
  it raise the error message: env path/to/cmdproxy.exe can't be found 
  which looks tramp shell invoke the local shell, instead the remote shell
  
I have the settings:
```
  (connection-local-set-profile-variables
   'remote-bash
   '((explicit-shell-file-name . "/bin/bash")
     (explicit-bash-args . ("-i"))
     ))

  (connection-local-set-profiles
   '(:application tramp :protocol "plink" :user "user" :machine "host.com")
   'remote-bash)
```
In the previous version of tramp (about Feb), it will invoke the explicit-shell-file-name, instead of local cmdproxy.

Another issue, the emacs treat explicit-shell-file-name and explicit-bash-args as non-safe local variables and ask how to deal it (Y/N/! ...).
In the previous version of tramp (about Feb), it takes these two variables as safe which I think is reasonable because user sets it in tramp-way explicitely and it is only used in tramp only.


In GNU Emacs 27.0.50 (build 3, x86_64-w64-mingw32)
 of 2019-03-21 built on RSHMX11052
Repository revision: c569cceb2d334564d320d2b4098c855db7eb88a0
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 10.0.15063
System Description: Microsoft Windows 10 Enterprise (v10.0.1703.15063.1631)

Recent messages:
Wrote c:/Users/user/HOME/.emacs [2 times]
Tramp: Opening connection for user@host.com using plink...done
Opening directory /plink:user@host.com:/opt/bee/home_NEW/user/...done
Tramp: Opening connection for user@host.com using plink...
Tramp: Sending command `plink -l user  -ssh -t host.com " env 'TERM=dumb' 'PROMPT_COMMAND=' 'PS1=#$ ' /bin/sh " && exit || exit'
Tramp: Waiting for prompts from remote shell...
Tramp: Sending password
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `host.com'
Tramp: Opening connection for user@host.com using plink...done

Configured using:
 'configure --without-imagemagick --without-pop
 '--program-transform-name=s/^ctags$/ctags.emacs/''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY W32NOTIFY ACL GNUTLS LIBXML2
ZLIB TOOLKIT_SCROLL_BARS THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: CHS
  locale-coding-system: cp936







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-22  6:17 bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable Shuguang Sun
@ 2019-03-22  7:16 ` Shuguang Sun
  2019-03-22  7:56   ` Shuguang Sun
  2019-03-22 14:14   ` Michael Albinus
  2019-03-22 14:13 ` Michael Albinus
  1 sibling, 2 replies; 9+ messages in thread
From: Shuguang Sun @ 2019-03-22  7:16 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943

I see that according to the 49.2.6 Per-Connection Local Variables, it use shell-file-name now.

Sorry to disturbance.


-- 
Best Regards
Shuguang Sun







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-22  7:16 ` Shuguang Sun
@ 2019-03-22  7:56   ` Shuguang Sun
  2019-03-22 14:14   ` Michael Albinus
  1 sibling, 0 replies; 9+ messages in thread
From: Shuguang Sun @ 2019-03-22  7:56 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943



Shuguang Sun <shuguang79@qq.com> writes:
> I see that according to the 49.2.6 Per-Connection Local Variables, it use shell-file-name now.

1. shell-file-name to "/bin/bash" defaultly not safey local variables, and it pops to (Y/N/!) buffer
```
  (connection-local-set-profile-variables   'remote-bash
   '((shell-file-name . "/bin/bash")
     (shell-command-switch . "-c")))
```
2. In this setting, M-x shell whill ask the path to the shell like:
/plink:username@host.com:/opt/home/username//bin/bash
Even I change to (shell-file-name . "/usr/bin/bash"), it is the same. Bothe /bin/bash and /usr/bin/bash exist.



-- 
Best Regards
Shuguang Sun







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-22  6:17 bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable Shuguang Sun
  2019-03-22  7:16 ` Shuguang Sun
@ 2019-03-22 14:13 ` Michael Albinus
  2019-03-23  4:13   ` Shuguang Sun
       [not found]   ` <vk5ybm229qin.fsf@qq.com>
  1 sibling, 2 replies; 9+ messages in thread
From: Michael Albinus @ 2019-03-22 14:13 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943

[-- Attachment #1: Type: text/plain, Size: 938 bytes --]

Shuguang Sun <shuguang79@qq.com> writes:

> Hi,

> The recent change to Tramp for shell/explict shell has break the remote shell again. For example:
> - Tramp to a host
> - in a remote diretory, M-x shell
>   it raise the error message: env path/to/cmdproxy.exe can't be found
>   which looks tramp shell invoke the local shell, instead the remote shell
>
> I have the settings:
> ```
>   (connection-local-set-profile-variables
>    'remote-bash
>    '((explicit-shell-file-name . "/bin/bash")
>      (explicit-bash-args . ("-i"))
>      ))
>
>   (connection-local-set-profiles
>    '(:application tramp :protocol "plink" :user "user" :machine "host.com")
>    'remote-bash)
> ```
> In the previous version of tramp (about Feb), it will invoke the explicit-shell-file-name, instead of local cmdproxy.

If `explicit-shell-file-name' is given, it must have precedence. What
about the following patch to master:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 3387 bytes --]

*** /tmp/ediffWyfTux	2019-03-22 15:09:52.065151959 +0100
--- /home/albinus/src/emacs/lisp/shell.el	2019-03-22 15:09:35.080867417 +0100
***************
*** 721,729 ****
                   (current-buffer)))

    (with-current-buffer buffer
!     (when (file-remote-p default-directory)
!       ;; On remote hosts, the local `shell-file-name' might be useless.
!       (with-connection-local-variables
         (if (and (called-interactively-p 'any)
                  (null explicit-shell-file-name)
                  (null (getenv "ESHELL")))
--- 721,729 ----
                   (current-buffer)))

    (with-current-buffer buffer
!     (with-connection-local-variables
!      ;; On remote hosts, the local `shell-file-name' might be useless.
!      (when (file-remote-p default-directory)
         (if (and (called-interactively-p 'any)
                  (null explicit-shell-file-name)
                  (null (getenv "ESHELL")))
***************
*** 732,757 ****
  		 (expand-file-name
                    (read-file-name
                     "Remote shell path: " default-directory shell-file-name
!                    t shell-file-name))))))))

!   ;; The buffer's window must be correctly set when we call comint
!   ;; (so that comint sets the COLUMNS env var properly).
!   (pop-to-buffer buffer)
!   ;; Rain or shine, BUFFER must be current by now.
!   (unless (comint-check-proc buffer)
!     (let* ((prog (or explicit-shell-file-name
!                      (getenv "ESHELL") shell-file-name))
!            (name (file-name-nondirectory prog))
!            (startfile (concat "~/.emacs_" name))
!            (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!       (unless (file-exists-p startfile)
!         (setq startfile (concat user-emacs-directory "init_" name ".sh")))
!       (apply #'make-comint-in-buffer "shell" buffer prog
!              (if (file-exists-p startfile) startfile)
!              (if (and xargs-name (boundp xargs-name))
!                  (symbol-value xargs-name)
!                '("-i")))
!       (shell-mode)))
    buffer)

  ;;; Directory tracking
--- 732,757 ----
  		 (expand-file-name
                    (read-file-name
                     "Remote shell path: " default-directory shell-file-name
!                    t shell-file-name))))))

!      ;; The buffer's window must be correctly set when we call comint
!      ;; (so that comint sets the COLUMNS env var properly).
!      (pop-to-buffer buffer)
!      ;; Rain or shine, BUFFER must be current by now.
!      (unless (comint-check-proc buffer)
!        (let* ((prog (or explicit-shell-file-name
!                         (getenv "ESHELL") shell-file-name))
!               (name (file-name-nondirectory prog))
!               (startfile (concat "~/.emacs_" name))
!               (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!          (unless (file-exists-p startfile)
!            (setq startfile (concat user-emacs-directory "init_" name ".sh")))
!          (apply #'make-comint-in-buffer "shell" buffer prog
!                 (if (file-exists-p startfile) startfile)
!                 (if (and xargs-name (boundp xargs-name))
!                     (symbol-value xargs-name)
!                   '("-i")))
!          (shell-mode)))))
    buffer)

  ;;; Directory tracking

[-- Attachment #3: Type: text/plain, Size: 410 bytes --]


> Another issue, the emacs treat explicit-shell-file-name and explicit-bash-args as non-safe local variables and ask how to deal it (Y/N/! ...).
> In the previous version of tramp (about Feb), it takes these two variables as safe which I think is reasonable because user sets it in tramp-way explicitely and it is only used in tramp only.

I'll check when the first problem is solved.

Best regards, Michael.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-22  7:16 ` Shuguang Sun
  2019-03-22  7:56   ` Shuguang Sun
@ 2019-03-22 14:14   ` Michael Albinus
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Albinus @ 2019-03-22 14:14 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943

Shuguang Sun <shuguang79@qq.com> writes:

Hi,

> I see that according to the 49.2.6 Per-Connection Local Variables, it
> use shell-file-name now.

This manual section explains how to set shell-file-name. But
explicit-shell-file-name shall still work as it happens until recently.

> Sorry to disturbance.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-22 14:13 ` Michael Albinus
@ 2019-03-23  4:13   ` Shuguang Sun
       [not found]   ` <vk5ybm229qin.fsf@qq.com>
  1 sibling, 0 replies; 9+ messages in thread
From: Shuguang Sun @ 2019-03-23  4:13 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 34943

Michael Albinus <michael.albinus@gmx.de> writes:

> Shuguang Sun <shuguang79@qq.com> writes:
>
>> Hi,
>
>> The recent change to Tramp for shell/explict shell has break the remote shell again. For example:
>> - Tramp to a host
>> - in a remote diretory, M-x shell
>>   it raise the error message: env path/to/cmdproxy.exe can't be found
>>   which looks tramp shell invoke the local shell, instead the remote shell
>>
>> I have the settings:
>> ```
>>   (connection-local-set-profile-variables
>>    'remote-bash
>>    '((explicit-shell-file-name . "/bin/bash")
>>      (explicit-bash-args . ("-i"))
>>      ))
>>
>>   (connection-local-set-profiles
>>    '(:application tramp :protocol "plink" :user "user" :machine "host.com")
>>    'remote-bash)
>> ```
>> In the previous version of tramp (about Feb), it will invoke the explicit-shell-file-name, instead of local cmdproxy.
>
> If `explicit-shell-file-name' is given, it must have precedence. What
> about the following patch to master:
>
> *** /tmp/ediffWyfTux	2019-03-22 15:09:52.065151959 +0100
> --- /home/albinus/src/emacs/lisp/shell.el	2019-03-22 15:09:35.080867417 +0100
> ***************
> *** 721,729 ****
>                    (current-buffer)))
>
>     (with-current-buffer buffer
> !     (when (file-remote-p default-directory)
> !       ;; On remote hosts, the local `shell-file-name' might be useless.
> !       (with-connection-local-variables
>          (if (and (called-interactively-p 'any)
>                   (null explicit-shell-file-name)
>                   (null (getenv "ESHELL")))
> --- 721,729 ----
>                    (current-buffer)))
>
>     (with-current-buffer buffer
> !     (with-connection-local-variables
> !      ;; On remote hosts, the local `shell-file-name' might be useless.
> !      (when (file-remote-p default-directory)
>          (if (and (called-interactively-p 'any)
>                   (null explicit-shell-file-name)
>                   (null (getenv "ESHELL")))
> ***************
> *** 732,757 ****
>   		 (expand-file-name
>                     (read-file-name
>                      "Remote shell path: " default-directory shell-file-name
> !                    t shell-file-name))))))))
>
> !   ;; The buffer's window must be correctly set when we call comint
> !   ;; (so that comint sets the COLUMNS env var properly).
> !   (pop-to-buffer buffer)
> !   ;; Rain or shine, BUFFER must be current by now.
> !   (unless (comint-check-proc buffer)
> !     (let* ((prog (or explicit-shell-file-name
> !                      (getenv "ESHELL") shell-file-name))
> !            (name (file-name-nondirectory prog))
> !            (startfile (concat "~/.emacs_" name))
> !            (xargs-name (intern-soft (concat "explicit-" name "-args"))))
> !       (unless (file-exists-p startfile)
> !         (setq startfile (concat user-emacs-directory "init_" name ".sh")))
> !       (apply #'make-comint-in-buffer "shell" buffer prog
> !              (if (file-exists-p startfile) startfile)
> !              (if (and xargs-name (boundp xargs-name))
> !                  (symbol-value xargs-name)
> !                '("-i")))
> !       (shell-mode)))
>     buffer)
>
>   ;;; Directory tracking
> --- 732,757 ----
>   		 (expand-file-name
>                     (read-file-name
>                      "Remote shell path: " default-directory shell-file-name
> !                    t shell-file-name))))))
>
> !      ;; The buffer's window must be correctly set when we call comint
> !      ;; (so that comint sets the COLUMNS env var properly).
> !      (pop-to-buffer buffer)
> !      ;; Rain or shine, BUFFER must be current by now.
> !      (unless (comint-check-proc buffer)
> !        (let* ((prog (or explicit-shell-file-name
> !                         (getenv "ESHELL") shell-file-name))
> !               (name (file-name-nondirectory prog))
> !               (startfile (concat "~/.emacs_" name))
> !               (xargs-name (intern-soft (concat "explicit-" name "-args"))))
> !          (unless (file-exists-p startfile)
> !            (setq startfile (concat user-emacs-directory "init_" name ".sh")))
> !          (apply #'make-comint-in-buffer "shell" buffer prog
> !                 (if (file-exists-p startfile) startfile)
> !                 (if (and xargs-name (boundp xargs-name))
> !                     (symbol-value xargs-name)
> !                   '("-i")))
> !          (shell-mode)))))
>     buffer)
>
>   ;;; Directory tracking
>

The patch works. Thanks.

>
>> Another issue, the emacs treat explicit-shell-file-name and explicit-bash-args
>> as non-safe local variables and ask how to deal it (Y/N/! ...).
>> In the previous version of tramp (about Feb), it takes these two variables as
>> safe which I think is reasonable because user sets it in tramp-way explicitely
>> and it is only used in tramp only.
>
> I'll check when the first problem is solved.

FYI. explicit-shell-file-name and explicit-bash-args are still non-safe local variables now.

>
> Best regards, Michael.
>

-- 
Best Regards
Shuguang Sun







^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
       [not found]   ` <vk5ybm229qin.fsf@qq.com>
@ 2019-03-23  8:59     ` Michael Albinus
  2019-03-23 15:41       ` Shuguang Sun
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2019-03-23  8:59 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943

Shuguang Sun <shuguang79@qq.com> writes:

[Pls Cc 34943@debbugs.gnu.org, and NOT bug-gnu-emacs@gnu.org]

Hi,

> The patch works. Thanks.

Thanks for checking.

>>> Another issue, the emacs treat explicit-shell-file-name and
>>> explicit-bash-args as non-safe local variables and ask how to deal
>>> it (Y/N/! ...).  In the previous version of tramp (about Feb), it
>>> takes these two variables as safe which I think is reasonable
>>> because user sets it in tramp-way explicitely and it is only used in
>>> tramp only.
>>
>> I'll check when the first problem is solved.
>
> FYI. explicit-shell-file-name and explicit-bash-args are still
> non-safe local variables now.

This shall be fixed now as well. Could you, pls, confirm?

Everything pushed to master.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-23  8:59     ` Michael Albinus
@ 2019-03-23 15:41       ` Shuguang Sun
  2019-03-24 12:42         ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Shuguang Sun @ 2019-03-23 15:41 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 34943

[-- Attachment #1: Type: text/plain, Size: 230 bytes --]

It is fixed. Thanks.




------------------ Original ------------------
From:  "Michael Albinus"<michael.albinus@gmx.de>;



> [Pls Cc 34943@debbugs.gnu.org, and NOT bug-gnu-emacs@gnu.org]



Thanks for the reminder.

[-- Attachment #2: Type: text/html, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable
  2019-03-23 15:41       ` Shuguang Sun
@ 2019-03-24 12:42         ` Michael Albinus
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Albinus @ 2019-03-24 12:42 UTC (permalink / raw)
  To: Shuguang Sun; +Cc: 34943

"Shuguang Sun" <shuguang79@qq.com> writes:

> It is fixed. Thanks.

Thanks for checking, I'm closing the bug.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-24 12:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-22  6:17 bug#34943: 27.0.50; Tramp explicte-shell-file-name not work and not safe local variable Shuguang Sun
2019-03-22  7:16 ` Shuguang Sun
2019-03-22  7:56   ` Shuguang Sun
2019-03-22 14:14   ` Michael Albinus
2019-03-22 14:13 ` Michael Albinus
2019-03-23  4:13   ` Shuguang Sun
     [not found]   ` <vk5ybm229qin.fsf@qq.com>
2019-03-23  8:59     ` Michael Albinus
2019-03-23 15:41       ` Shuguang Sun
2019-03-24 12:42         ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.