GNU bug report logs - #25963
25.2; tramp su fails

Previous Next

Package: emacs;

Reported by: Tyler Smith <tyler <at> plantarum.ca>

Date: Sat, 4 Mar 2017 02:03:01 UTC

Severity: normal

Tags: notabug

Found in version 25.2

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25963 in the body.
You can then email your comments to 25963 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25963; Package emacs. (Sat, 04 Mar 2017 02:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tyler Smith <tyler <at> plantarum.ca>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 04 Mar 2017 02:03:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tyler Smith <tyler <at> plantarum.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; tramp su fails
Date: Fri, 03 Mar 2017 21:02:29 -0500
Hello,

I'm having a problem opening files as root. 

From emacs -Q, I issue
`(require 'tramp)`, customize tramp-verbose to 10, and try to open a
file as root: `C-x C-f /su::/etc/fstab`. I'm then prompted for my root
password. Entering the password, Emacs pauses for ca. 10 seconds, then
appears to open a new file called fstab, but it's not the fstab that
already exists in /etc/fstab. The message about calling make-directory
to create the parent directories shows up, so I've apparently opened a
new file somewhere. I can't see where, exactly, as `C-x C-f`, or even
`M-x shell-commmand pwd` both prompt me for the root password, and then
fail. 

Despite having turned `tramp-verbose` to the maximum value, there's not
much in my *Messages* buffer after all this:


Creating customization setup...done  
Tramp: Opening connection for root@<myhostname> using su...  
Tramp: Sending command ‘exec su - root’  
Tramp: Waiting for prompts from remote shell...  
Tramp: Sending Password  
Tramp: Waiting for prompts from remote shell...failed  
Tramp: Opening connection for root@<myhostname> using su...failed  
Use M-x make-directory RET RET to create the directory and its parents  

Tramp: Checking ‘vc-registered’ for /su:root@<myhostname>: 
/etc/fstab...failed  
Use M-x make-directory RET RET to create the directory and its parents  
Tramp: Opening connection for root@<myhostname> using su...  
Tramp: Sending command ‘exec su - root’  
Tramp: Waiting for prompts from remote shell...  
Tramp: Sending Password  
Tramp: Waiting for prompts from remote shell...failed  
Tramp: Opening connection for root@<myhostname> using su...failed  
Quit  

This is all on a laptop, I'm not trying to connect to another machine. 

Emacs 25.1.91.1, and confirmed again with Emacs 25.2.1.

In GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.8)
 of 2017-03-03 built on onottra672626p
Repository revision: 6e788ef0e262fafc014c21f4ad52cc5dc9f1715b
Windowing system distributor 'The X.Org Foundation', version
11.0.11901000
System Description:     Debian GNU/Linux 9.0 (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_CA.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list... [2 times]
user-error: End of history; no default available

Load-path shadows:
/home/tws/research/programs/emacs-github/lisp/net/rfc2104 hides
/home/tws/research/programs/emacs-github/lisp/gnus/rfc2104
/home/tws/research/programs/emacs-github/lisp/play/landmark hides
/home/tws/research/programs/emacs-github/lisp/obsolete/landmark
/home/tws/research/programs/emacs-github/lisp/emacs-lisp/gulp hides
/home/tws/research/programs/emacs-github/lisp/obsolete/gulp
/home/tws/research/programs/emacs-github/lisp/net/eudcb-ph hides
/home/tws/research/programs/emacs-github/lisp/obsolete/eudcb-ph
/home/tws/research/programs/emacs-github/lisp/vc/vc-arch hides
/home/tws/research/programs/emacs-github/lisp/obsolete/vc-arch

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils thingatpt time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 87181 6288)
 (symbols 48 19950 0)
 (miscs 40 53 171)
 (strings 32 14702 4549)
 (string-bytes 1 420962)
 (vectors 16 11979)
 (vector-slots 8 434895 4455)
 (floats 8 165 25)
 (intervals 56 213 4)
 (buffers 976 21))


Best,

Tyler




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25963; Package emacs. (Sat, 04 Mar 2017 13:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 25963 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tyler Smith <tyler <at> plantarum.ca>
Cc: 25963 <at> debbugs.gnu.org
Subject: Re: bug#25963: 25.2; tramp su fails
Date: Sat, 04 Mar 2017 14:37:11 +0100
Tyler Smith <tyler <at> plantarum.ca> writes:

> Hello,

Hi Tyler,

> From emacs -Q, I issue
> `(require 'tramp)`, customize tramp-verbose to 10, and try to open a
> file as root: `C-x C-f /su::/etc/fstab`. I'm then prompted for my root
> password. Entering the password, Emacs pauses for ca. 10 seconds, then
> appears to open a new file called fstab, but it's not the fstab that
> already exists in /etc/fstab. The message about calling make-directory
> to create the parent directories shows up, so I've apparently opened a
> new file somewhere. I can't see where, exactly, as `C-x C-f`, or even
> `M-x shell-commmand pwd` both prompt me for the root password, and then
> fail. 
>
> Despite having turned `tramp-verbose` to the maximum value, there's not
> much in my *Messages* buffer after all this:
>
> Creating customization setup...done  
> Tramp: Opening connection for root@<myhostname> using su...  
> Tramp: Sending command ‘exec su - root’  
> Tramp: Waiting for prompts from remote shell...  
> Tramp: Sending Password  
> Tramp: Waiting for prompts from remote shell...failed  
> Tramp: Opening connection for root@<myhostname> using su...failed  

This tells us that the su command hasn't been successful. When you have
turned `tramp-verbose' to 10, there is a Tramp debug buffer. Pls show this.

> Best,
>
> Tyler

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25963; Package emacs. (Mon, 06 Mar 2017 13:44:02 GMT) Full text and rfc822 format available.

Message #11 received at 25963 <at> debbugs.gnu.org (full text, mbox):

From: Tyler Smith <tyler <at> plantarum.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 25963 <at> debbugs.gnu.org
Subject: Re: bug#25963: 25.2; tramp su fails
Date: Mon, 06 Mar 2017 08:43:46 -0500
[Message part 1 (text/plain, inline)]
Thanks Michael,

That buffer, `debug tramp/su ...` is quite large, 1269 lines. I've
attached it as a txt file, if you'd prefer me to post it somewhere or
paste it inline, let me know. There is a second debug buffer `debug
tramp/nil nil`, which contains only:

;; GNU Emacs: 25.2.1 Tramp: 2.2.13.25.2 -*- mode: outline; -*-
;; Location: /usr/local/share/emacs/25.2/lisp/net/tramp.elc Git: nil
08:34:19.239257 tramp-call-process (6) # ‘locale -a’ nil  *temp*
08:34:19.241458 tramp-call-process (6) # 0
C
C.UTF-8
en_CA.utf8
POSIX


Best,

Tyler

-- 
plantarum.ca

On Sat, Mar 4, 2017, at 08:37 AM, Michael Albinus wrote:
> Tyler Smith <tyler <at> plantarum.ca> writes:
> 
> > Hello,
> 
> Hi Tyler,
> 
> > From emacs -Q, I issue
> > `(require 'tramp)`, customize tramp-verbose to 10, and try to open a
> > file as root: `C-x C-f /su::/etc/fstab`. I'm then prompted for my root
> > password. Entering the password, Emacs pauses for ca. 10 seconds, then
> > appears to open a new file called fstab, but it's not the fstab that
> > already exists in /etc/fstab. The message about calling make-directory
> > to create the parent directories shows up, so I've apparently opened a
> > new file somewhere. I can't see where, exactly, as `C-x C-f`, or even
> > `M-x shell-commmand pwd` both prompt me for the root password, and then
> > fail. 
> >
> > Despite having turned `tramp-verbose` to the maximum value, there's not
> > much in my *Messages* buffer after all this:
> >
> > Creating customization setup...done  
> > Tramp: Opening connection for root@<myhostname> using su...  
> > Tramp: Sending command ‘exec su - root’  
> > Tramp: Waiting for prompts from remote shell...  
> > Tramp: Sending Password  
> > Tramp: Waiting for prompts from remote shell...failed  
> > Tramp: Opening connection for root@<myhostname> using su...failed  
> 
> This tells us that the su command hasn't been successful. When you have
> turned `tramp-verbose' to 10, there is a Tramp debug buffer. Pls show
> this.
> 
> > Best,
> >
> > Tyler
> 
> Best regards, Michael.
[debug-tramp-su-root.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25963; Package emacs. (Mon, 06 Mar 2017 14:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 25963 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tyler Smith <tyler <at> plantarum.ca>
Cc: 25963 <at> debbugs.gnu.org
Subject: Re: bug#25963: 25.2; tramp su fails
Date: Mon, 06 Mar 2017 15:06:03 +0100
Tyler Smith <tyler <at> plantarum.ca> writes:

> Thanks Michael,

Hi Tyler,

> That buffer, `debug tramp/su ...` is quite large, 1269 lines. I've
> attached it as a txt file, if you'd prefer me to post it somewhere or
> paste it inline, let me know.

No, it is sufficient.

> There is a second debug buffer `debug
> tramp/nil nil`, which contains only:

This one is of no interest this time.

Let's see what happened:

> 08:34:19.246330 tramp-send-command (6) # exec su - root
> 08:34:34.147941 tramp-process-actions (6) # 
> Password: 
> [30;41m~ [0;31m‚ [m

Looks, like beside the su password, there are some further escape
sequences (color?) in the shell output, which disturb Tramp. Pls
suppress them; the Tramp manual shall tell you how.

> Best,
>
> Tyler

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25963; Package emacs. (Tue, 07 Mar 2017 00:13:01 GMT) Full text and rfc822 format available.

Message #17 received at 25963 <at> debbugs.gnu.org (full text, mbox):

From: Tyler Smith <tyler <at> plantarum.ca>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 25963 <at> debbugs.gnu.org
Subject: Re: bug#25963: 25.2; tramp su fails
Date: Mon, 06 Mar 2017 19:12:15 -0500
On Mon, Mar 6, 2017, at 09:06 AM, Michael Albinus wrote:
> 
> > 08:34:19.246330 tramp-send-command (6) # exec su - root
> > 08:34:34.147941 tramp-process-actions (6) # 
> > Password: 
> > [30;41m~ [0;31m [m
> 
> Looks, like beside the su password, there are some further escape
> sequences (color?) in the shell output, which disturb Tramp. Pls
> suppress them; the Tramp manual shall tell you how.

Thank you Michael!

Following your suggestion, I discovered that one of those escape
sequences is a special 'arrow' symbol used in the custom powerline
prompt. Adding that symbol to the appropriate place in
tramp-shell-prompt-pattern fixes the problem.

Best, 

Tyler





Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Tue, 07 Mar 2017 08:18:01 GMT) Full text and rfc822 format available.

Notification sent to Tyler Smith <tyler <at> plantarum.ca>:
bug acknowledged by developer. (Tue, 07 Mar 2017 08:18:02 GMT) Full text and rfc822 format available.

Message #22 received at 25963-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Tyler Smith <tyler <at> plantarum.ca>
Cc: 25963-done <at> debbugs.gnu.org
Subject: Re: bug#25963: 25.2; tramp su fails
Date: Tue, 07 Mar 2017 09:16:57 +0100
Tyler Smith <tyler <at> plantarum.ca> writes:

> Thank you Michael!

Hi Tyler,

> Following your suggestion, I discovered that one of those escape
> sequences is a special 'arrow' symbol used in the custom powerline
> prompt. Adding that symbol to the appropriate place in
> tramp-shell-prompt-pattern fixes the problem.

Thanks for confirmation! So there's no problem with Tramp. I'm closing
the bug.

> Best, 
>
> Tyler

Best regards, Michael.




Added tag(s) notabug. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 07 Mar 2017 08:28:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Apr 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.