all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tramp 2.0 -> 2.1 migration woes
@ 2008-01-27  4:00 Trent W. Buck
  2008-01-27 13:42 ` Michael Albinus
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Trent W. Buck @ 2008-01-27  4:00 UTC (permalink / raw)
  To: emacs-pretest-bug; +Cc: rfrancoise


[-- Attachment #1.1: Type: text/plain, Size: 6430 bytes --]

[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:root@leek:/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 root@leek, 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 zippy@Clio.twb.ath.cx 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 #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2008-01-31 15:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-27  4:00 Tramp 2.0 -> 2.1 migration woes Trent W. Buck
2008-01-27 13:42 ` Michael Albinus
2008-01-28  2:13   ` Trent W. Buck
2008-01-28 15:32     ` Michael Albinus
2008-01-28 15:57       ` Trent W. Buck
2008-01-28 16:31         ` Michael Albinus
2008-01-29  0:34           ` Trent W. Buck
2008-01-31 11:00             ` Michael Albinus
2008-01-31 14:51               ` Stefan Monnier
2008-01-31 15:46                 ` Michael Albinus
2008-01-27 14:57 ` Michael Albinus
2008-01-28  2:30   ` Trent W. Buck
2008-01-28 14:50     ` Host name for su(do)? (was: Tramp 2.0 -> 2.1 migration woes) Michael Albinus
2008-01-28 15:46       ` Trent W. Buck
2008-01-28 16:10         ` Host name for su(do)? Michael Albinus
2008-01-28 21:47           ` Michael Albinus
2008-01-28 20:54 ` Shell-command is no longer a shell (was: Tramp 2.0 -> 2.1 migration woes) Michael Albinus
2008-01-29  0:43   ` Trent W. Buck
2008-01-29 21:06     ` Shell-command is no longer a shell Michael Albinus
2008-01-31  2:09       ` Trent W. Buck
2008-01-29 20:58 ` sudo -s -H (was: Tramp 2.0 -> 2.1 migration woes) 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.