emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tramp 2.0 -> 2.1 migration woes


From: Trent W. Buck
Subject: Tramp 2.0 -> 2.1 migration woes
Date: Sun, 27 Jan 2008 15:00:53 +1100
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

[Please CC me, I am not subscribed to the list.]

I am having difficulty with my normal workflow due to changes between
TRAMP 2.0 and 2.1, and I have identified a number of specific issues
which are outlined below in order of decreasing importance (to me).


Multi-hop now hides initial hops
================================

The initial hops are no longer shown in the path, nor on the first
line of dired buffers.  Already I have been VERY confused because
a bad tramp-default-proxies-alist resulted in no proxy being used for

    /sudo:address@hidden:/etc

...so that instead of editing leek's /etc as root, I was editing my
laptop's /etc as root!  Since the path claims that I'm on address@hidden, I
would have made disastrous changes to my local system if I hadn't
noticed that there was no /etc/ssh/sshd_config (because sshd is not
installed on my laptop).

This accident makes me *extremely* afraid to trust TRAMP 2.1-style
multi-hops for anything at all, since I'm bound to make alist mistakes
that I won't catch so fortuitously.


Shell-command is no longer a shell
==================================

It seems that shell-command (M-!) no longer uses a shell in TRAMP
buffers.  For example, in /sudo::/ if I do M-! whoami && pwd RET or
M-! sh -c 'whoami && pwd' I get the following errors:

    whoami: extra operand `&&'
    Try `whoami --help' for more information.

    &&: 1: Syntax error: Unterminated quoted string

Another example was running M-! find -name \*~ -delete RET in
/ssh:leek:, which should have deleted backup files in my home
directory.  In Emacs 22, it behaves correctly.  In CVS Emacs, it
silently fails.

This means I can no longer trust basic sh commands to work correctly,
and thus cannot use this feature in TRAMP buffers.


sudo -s (without -H) now aborts connection
==========================================

My .bashrc (et al) is mode 0600 (readable only by me).  If I run "sudo
-u zippy -s" in a shell, I get the (ignorable) error

    bash: /home/twb/.bashrc: Permission denied

Because $HOME is still /home/twb.  For this reason I use sudo -i or
(on legacy systems) sudo -H -s in interactive shells.  In Emacs 22,
TRAMP ignores this error and /sudo:zippy@: works fine.  In CVS Emacs
it seems this error aborts the connection entirely:

    $ emacs -batch -Q -nw /sudo:zippy@: -f kill-emacs
    Tramp: Opening connection for address@hidden using sudo...
    Tramp: Waiting 60s for local shell to come up...
    Tramp: Sending command `sudo -u zippy -s -p Password: && exit || exit'
    Tramp: Waiting for prompts from remote shell
    File error: Permission denied
    [hangs]

I have worked around this problem successfully with the following code
in my .emacs.  Note that deleting "-H" is merely for potential
forwards compatibility.

    (eval-after-load "tramp"
      '(progn
         (add-to-list 'tramp-methods
           (cons "sudoHs" (copy-tree (cdr (assoc "sudo" tramp-methods)))))
         (let ((x (cdr (cadr (assoc 'tramp-login-args (cdr (assoc "sudo" 
tramp-methods)))))))
           (setcar x (cons "-i" (delete "-H" (delete "-s" (car x))))))
         (let ((x (cdr (cadr (assoc 'tramp-login-args (cdr (assoc "sudoHs" 
tramp-methods)))))))
           (setcar x (cons "-H" (delete "-H" (car x)))))))


Multi-hop now requires tedious alist editing
============================================

It is often the case that I need to access a customer site that I have
never accessed before, or whose network layout has changed since I
last accessed it.  On Emacs 22 I would therefore by trial and error
modify a multi: path until it was correct, do the job, and then forget
the path.  In the short term, I can switch back to an open dired for
that site, or use M-p at the C-x C-f prompt.

In the long term, by the time I need to access that customer's site
again, their network will probably have changed.  Writing it down
would be at best bloat, and at worst misleading, since the correct
information is stored elsewhere in a text file that is maintained by
other staff who are in charge of that customer's network.

Now, the trial and error step must be done by editing a setq in .emacs
and repeatedly doing C-M-x, then trying C-x C-f again (possibly
killing *tramp foo* buffers after each attempt to make sure no stale
connections cause problems.)  To remove this bloaty, misleading
information I must remember to edit .emacs again after successfully
connecting.  This is quite tedious compared to editing a single multi:
string at the C-x C-f prompt.

(I could call add-to-list in M-x ielm or M-: instead of editing the
SETQ in .emacs, but then I'd need to remove-hook (there's no
remote-from-list function) each bad attempt until I got it right, so
it's still pretty tedious.)

-- 
In GNU Emacs 23.0.50.1 (i486-pc-linux-gnu, GTK+ Version 2.12.5)
 of 2008-01-21 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20080126-1)
configured using `configure  '--build' 'i486-linux-gnu' '--host' 
'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' 
'--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' 
'--mandir=/usr/share/man' '--with-pop=yes' 
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.50/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.0.50/leim'
 '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 
'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g 
-O2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_AU.utf8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  xterm-mouse-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  icomplete-mode: t
  partial-completion-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]