unofficial mirror of emacs-devel@gnu.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

* Re: Tramp 2.0 -> 2.1 migration woes
  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-27 14:57 ` Michael Albinus
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-27 13:42 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

Hi Trent,

> 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.

That isn't related to multi-hops. It is simply an error in Tramp, which
shall inform you about the used host.

In case of su(do)?, the host name is ignored (except there is a setting
in tramp-default-proxies-alist). The Tramp documentation says for the
su(do)?  methods: "... With other words, a specified host name in the
file name is silently ignored."

Consequently, if you open a file "/sudo:root@leek:/etc", it must be
expanded to "/sudo:root@localhost:/etc", and this shall be visible. A
warning (or an error?) shall be raised. I'll fix it.

> 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.

I'll fix it. Obviously, there was too much optimization in Tramp 2.1 -
the COMMAND shall still be called via "sh -c COMMAND".

> 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)))))))

I'll check whether this could be the default.

> 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.)

I admit, that in your use case it is a real regression. There have been
several reasons to change the multi-hop syntax. I remember, that for
people with *static* multi-hop paths the new syntax is shorter and more
convenient to type therefore; I also remember some problems in
implementation of all these Tramp 2.1 optimizations for the Tramp 2.0
multi-hop paths.

OTOH, setting up a working tramp-default-proxies-alist is kind of
complex, indeed.

On the Tramp todo list, there is the item 

;; * WIBNI there was an interactive command prompting for Tramp
;;   method, hostname, username and filename and translates the user
;;   input into the correct filename syntax (depending on the Emacs
;;   flavor) (Reiner Steib)

This could be expanded to multi-hops, where it seems to be even more
useful. I'll try to find the time to work on it (Threat: I will exploit
*you* as tester for this functionality!)

Thanks for the report, and best regards, Michael.

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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-27  4:00 Tramp 2.0 -> 2.1 migration woes Trent W. Buck
  2008-01-27 13:42 ` Michael Albinus
@ 2008-01-27 14:57 ` Michael Albinus
  2008-01-28  2:30   ` Trent W. Buck
  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 20:58 ` sudo -s -H (was: Tramp 2.0 -> 2.1 migration woes) Michael Albinus
  3 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-27 14:57 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

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

"Trent W. Buck" <trentbuck@gmail.com> writes:

> 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).

The appended patch shall fix it. Could you, please, test?

Best regards, Michael.


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

*** /home/albinus/src/tramp/lisp/tramp.el.~2.624.~	2008-01-26 15:19:11.000000000 +0100
--- /home/albinus/src/tramp/lisp/tramp.el	2008-01-27 15:43:19.000000000 +0100
***************
*** 6052,6057 ****
--- 6052,6078 ----
  	   "Method `%s' is not supported for multi-hops."
  	   (tramp-file-name-method item)))))
  
+     ;; In case the host name is not used for the remote shell
+     ;; command, the user could be misguided by applying a random
+     ;; hostname.
+     (let* ((v (car target-alist))
+ 	   (method (tramp-file-name-method v))
+ 	   (host (tramp-file-name-host v)))
+       (unless
+ 	  (or
+ 	   ;; There are multi-hops.
+ 	   (cdr target-alist)
+ 	   ;; The host name is used for the remote shell command.
+ 	   (member
+ 	    '("%h") (tramp-get-method-parameter method 'tramp-login-args))
+ 	   ;; The host is local.  We cannot use `tramp-local-host-p'
+ 	   ;; here, because it opens a connection as well.
+ 	   (string-match
+ 	    (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$")
+ 	    host))
+ 	(tramp-error
+ 	 v 'file-error "Wrong hostname `%s' for method `%s'" host method)))
+ 
      ;; Result.
      target-alist))
  

[-- Attachment #3: 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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-27 13:42 ` Michael Albinus
@ 2008-01-28  2:13   ` Trent W. Buck
  2008-01-28 15:32     ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-28  2:13 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise


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

On Sun, Jan 27, 2008 at 02:42:23PM +0100, Michael Albinus wrote:
>> The initial hops are no longer shown in the path [...]
>>     /sudo:root@leek:/etc
>> ...so that instead of editing leek's /etc as root, I was editing my
>> laptop's /etc as root!
>
> That isn't related to multi-hops. It is simply an error in Tramp,
> which shall inform you about the used host.
>
> In case of su(do)?, the host name is ignored (except there is a
> setting in tramp-default-proxies-alist). The Tramp documentation
> says for the su(do)?  methods: "... With other words, a specified
> host name in the file name is silently ignored."
>
> Consequently, if you open a file "/sudo:root@leek:/etc", it must be
> expanded to "/sudo:root@localhost:/etc", and this shall be
> visible. A warning (or an error?) shall be raised. I'll fix it.
>
>> It seems that shell-command (M-!) no longer uses a shell in TRAMP
>> 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.
>
> I'll fix it. Obviously, there was too much optimization in Tramp 2.1 -
> the COMMAND shall still be called via "sh -c COMMAND".

Thanks.  These are my two biggest concerns, and I see from your next
message that they're being addressed promptly.

>> Multi-hop now requires tedious alist editing. [details...]
>
> I admit, that in your use case it is a real regression. There have
> been several reasons to change the multi-hop syntax. I remember,
> that for people with *static* multi-hop paths the new syntax is
> shorter and more convenient to type therefore;

Granted.  I don't object to adding default proxies.

> I also remember some problems in implementation of all these Tramp
> 2.1 optimizations for the Tramp 2.0 multi-hop paths.

Would it be correct to say that the explicit multi: method was removed
because other TRAMP changes broke it, and that it will be brought back
once it's fixed?  Or is it gone for good?  I would (obviously) prefer
the former.

> OTOH, setting up a working tramp-default-proxies-alist is kind of
> complex, indeed.

Agreed.

> On the Tramp todo list, there is the item
>
> ;; * WIBNI there was an interactive command prompting for Tramp
> ;;   method, hostname, username and filename and translates the user
> ;;   input into the correct filename syntax (depending on the Emacs
> ;;   flavor) (Reiner Steib)
>
> This could be expanded to multi-hops, where it seems to be even more
> useful. I'll try to find the time to work on it (Threat: I will exploit
> *you* as tester for this functionality!)

Well, personally I prefer a single complex prompt like

    What path?  /multi:ssh:foo:sudo::

to a long series of simple prompts

    What method? ssh
    What user [twb]?  RET
    What host? foo
    Done [Y/n]? n
    What method? sudo
    What user [root]?  RET
    Done [Y/n]?  RET
    Filename? /etc/ssh/sshd_config

mainly because I find it easier to copy/paste or M-p
(previous-history-element) a single prompt than to do it repeatedly
for several prompts.

PS: tramp-default-proxies-alist really isn't an alist anymore! :-)

[-- 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

* Re: Tramp 2.0 -> 2.1 migration woes
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-28  2:30 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise


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

On Sun, Jan 27, 2008 at 03:57:49PM +0100, Michael Albinus wrote:
> "Trent W. Buck" <trentbuck@gmail.com> writes:
> 
> > 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).
> 
> The appended patch shall fix it. Could you, please, test?

Yes, that seems to work, but I would extend the whitelist:

- The class A network 127.0.0.0/8
- The unqualified system name (e.g. Clio instead of Clio.twb.ath.cx)
- The comparison should be case-insensitive.

Obviously this whitelist will never be perfect, e.g. if "mail" is a
CNAME alias in on the DNS server for the local host, /sudo:mail: is
meaningful but it would be hard to catch that.

Maybe instead of an error, it should show a warning and continue?  I'm
not sure how you could make a warning pop up so that it would be seen
by the user.  Obviously `message' wouldn't work, because the echo area
would be reused as tramp continued to sudo'ing to localhost.

I would also change the error message to read

    "Host `foo' looks like a remote host, `sudo' can only use the
    local host."

> *** /home/albinus/src/tramp/lisp/tramp.el.~2.624.~	2008-01-26 15:19:11.000000000 +0100
> --- /home/albinus/src/tramp/lisp/tramp.el	2008-01-27 15:43:19.000000000 +0100
> ***************
> *** 6052,6057 ****
> --- 6052,6078 ----
>   	   "Method `%s' is not supported for multi-hops."
>   	   (tramp-file-name-method item)))))
>   
> +     ;; In case the host name is not used for the remote shell
> +     ;; command, the user could be misguided by applying a random
> +     ;; hostname.
> +     (let* ((v (car target-alist))
> + 	   (method (tramp-file-name-method v))
> + 	   (host (tramp-file-name-host v)))
> +       (unless
> + 	  (or
> + 	   ;; There are multi-hops.
> + 	   (cdr target-alist)
> + 	   ;; The host name is used for the remote shell command.
> + 	   (member
> + 	    '("%h") (tramp-get-method-parameter method 'tramp-login-args))
> + 	   ;; The host is local.  We cannot use `tramp-local-host-p'
> + 	   ;; here, because it opens a connection as well.
> + 	   (string-match
> + 	    (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$")
> + 	    host))
> + 	(tramp-error
> + 	 v 'file-error "Wrong hostname `%s' for method `%s'" host method)))
> + 
>       ;; Result.
>       target-alist))
>   


[-- 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

* Host name for su(do)? (was: Tramp 2.0 -> 2.1 migration woes)
  2008-01-28  2:30   ` Trent W. Buck
@ 2008-01-28 14:50     ` Michael Albinus
  2008-01-28 15:46       ` Trent W. Buck
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 14:50 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

>> The appended patch shall fix it. Could you, please, test?
>
> Yes, that seems to work, but I would extend the whitelist:
>
> - The class A network 127.0.0.0/8
> - The unqualified system name (e.g. Clio instead of Clio.twb.ath.cx)
> - The comparison should be case-insensitive.
>
> Obviously this whitelist will never be perfect, e.g. if "mail" is a
> CNAME alias in on the DNS server for the local host, /sudo:mail: is
> meaningful but it would be hard to catch that.

The typical use case for "su" and "sudo" are file names like
"/sudo::/file". Therefore, I don't believe we shall invest too much in
the whitelist. "127.0.0.1" as host name doesn't seem to be needed; if
somebody uses it, s?he will be taught not to do.

`system-name' will mostly the unqualified system name I believe, so it
is already compliant to your request. Or am I wrong?

> Maybe instead of an error, it should show a warning and continue?  I'm
> not sure how you could make a warning pop up so that it would be seen
> by the user.  Obviously `message' wouldn't work, because the echo area
> would be reused as tramp continued to sudo'ing to localhost.

That was my first idea as well. But it isn't so simple to implement,
and there would be still the problem that a file name is shown as
"/sudo:otherhost:/file", although you are on the local host. It might
be inconvenient to get an error, but the user will learn very fast
that "/sudo::/file" or "/sudo:user@localhost:/file" is the better
choice.

> I would also change the error message to read
>
>     "Host `foo' looks like a remote host, `sudo' can only use the
>     local host."

OK, I'll do so.

Best regards, Michael.

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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-28  2:13   ` Trent W. Buck
@ 2008-01-28 15:32     ` Michael Albinus
  2008-01-28 15:57       ` Trent W. Buck
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 15:32 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

>> I also remember some problems in implementation of all these Tramp
>> 2.1 optimizations for the Tramp 2.0 multi-hop paths.
>
> Would it be correct to say that the explicit multi: method was removed
> because other TRAMP changes broke it, and that it will be brought back
> once it's fixed?  Or is it gone for good?  I would (obviously) prefer
> the former.

Nope. The internal data structures have changed significantly, there
is no easy way to get this syntax back. And I'm also not convinced
that this shall be the way to go.

>> On the Tramp todo list, there is the item
>>
>> ;; * WIBNI there was an interactive command prompting for Tramp
>> ;;   method, hostname, username and filename and translates the user
>> ;;   input into the correct filename syntax (depending on the Emacs
>> ;;   flavor) (Reiner Steib)
>>
>> This could be expanded to multi-hops, where it seems to be even more
>> useful. I'll try to find the time to work on it (Threat: I will exploit
>> *you* as tester for this functionality!)
>
> Well, personally I prefer a single complex prompt like
>
>     What path?  /multi:ssh:foo:sudo::
>
> to a long series of simple prompts
>
>     What method? ssh
>     What user [twb]?  RET
>     What host? foo
>     Done [Y/n]? n
>     What method? sudo
>     What user [root]?  RET
>     Done [Y/n]?  RET
>     Filename? /etc/ssh/sshd_config
>
> mainly because I find it easier to copy/paste or M-p
> (previous-history-element) a single prompt than to do it repeatedly
> for several prompts.

Hmm. Then we have conflicting requirements. Reiner's intention was to
guide the novice user ... maybe we need indeed two kinds of interactive
guidance. In your case, something like this could be done:

  Where do you want to go? /sudo:leek: RET
  Which proxy is in front of it? /ssh:twb@leek: RET
  Which proxy is in front of it? /ssh:twb@foo: RET
  Which proxy is in front of it? RET
  Do you want to add it permanently [Y/n]? n RET

  => Added to `tramp-default-proxies-alist' temporarily:
     (("leek" "root" "/ssh:twb@leek:")
      ("leek" "twb"  "/ssh:twb@foo:"))

Best regards, Michael.

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

* Re: Host name for su(do)? (was: Tramp 2.0 -> 2.1 migration woes)
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-28 15:46 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise


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

On Mon, Jan 28, 2008 at 03:50:16PM +0100, Michael Albinus wrote:
> >> The appended patch shall fix it. Could you, please, test?
> >
> > Yes, that seems to work, but I would extend the whitelist:
> >
> > - The class A network 127.0.0.0/8
> > - The unqualified system name (e.g. Clio instead of Clio.twb.ath.cx)
> > - The comparison should be case-insensitive.
> >
> > Obviously this whitelist will never be perfect, e.g. if "mail" is a
> > CNAME alias in on the DNS server for the local host, /sudo:mail: is
> > meaningful but it would be hard to catch that.
> 
> The typical use case for "su" and "sudo" are file names like
> "/sudo::/file". Therefore, I don't believe we shall invest too much
> in the whitelist.

Fair enough.

> "127.0.0.1" as host name doesn't seem to be needed; if
> somebody uses it, s?he will be taught not to do.

Hee hee, I only learnt to use 127.0.0.1 because Emacs 22 / TRAMP 2.0
wasn't working with /multi:ssh:twb@foo:sudo:root@localhost:/ but it
was with 127.0.0.1.

> `system-name' will mostly the unqualified system name I believe, so it
> is already compliant to your request. Or am I wrong?

On my system, system-name is the FQDN.  Assuming system-name is what
the default frame-title-format uses, this has been the case for as
long as I can remember (back to Emacs 21).

[-- 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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-28 15:32     ` Michael Albinus
@ 2008-01-28 15:57       ` Trent W. Buck
  2008-01-28 16:31         ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-28 15:57 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise


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

On Mon, Jan 28, 2008 at 04:32:40PM +0100, Michael Albinus wrote:
>> Would it be correct to say that the explicit multi: method was
>> removed because other TRAMP changes broke it, and that it will be
>> brought back once it's fixed?  Or is it gone for good?  I would
>> (obviously) prefer the former.
> 
> Nope. The internal data structures have changed significantly, there
> is no easy way to get this syntax back.

Darn.  Whenever I get used to something it goes and changes on me :-)

> > Well, personally I prefer a single complex prompt like [...]  to a
> > long series of simple prompts [...]  mainly because I find it
> > easier to copy/paste or M-p (previous-history-element) a single
> > prompt than to do it repeatedly for several prompts.
> 
> Hmm. Then we have conflicting requirements. Reiner's intention was to
> guide the novice user ... maybe we need indeed two kinds of interactive
> guidance. In your case, something like this could be done:
> 
>   Where do you want to go? /sudo:leek: RET
>   Which proxy is in front of it? /ssh:twb@leek: RET
>   Which proxy is in front of it? /ssh:twb@foo: RET
>   Which proxy is in front of it? RET
>   Do you want to add it permanently [Y/n]? n RET
> 
>   => Added to `tramp-default-proxies-alist' temporarily:
>      (("leek" "root" "/ssh:twb@leek:")
>       ("leek" "twb"  "/ssh:twb@foo:"))

I think I could learn to tolerate that amount of prompting... one
thing to consider is what happens if I mess up the multihop (proxy)
sequence because e.g. the notes the other sysadmin gave me are out of
date.  Would I have to manually remove the entries from
tramp-default-proxies-alist?

I'm also not sure that middling to complicated proxying arrangements
can even be set up with the current tramp-default-proxies-alist.  For
example, suppose a host allows ssh from anywhere, but locks down its
internal staff-only FTP upload area to sites on the corporate subnet?
You'd need to have the /ftp:appdev:/incoming use an /ssh:gw: proxy,
but /ssh:appdev: should not use any proxy (although it would still
work with one, it would just waste gw's bandwidth).

[-- 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

* Re: Host name for su(do)?
  2008-01-28 15:46       ` Trent W. Buck
@ 2008-01-28 16:10         ` Michael Albinus
  2008-01-28 21:47           ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 16:10 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

>> "127.0.0.1" as host name doesn't seem to be needed; if
>> somebody uses it, s?he will be taught not to do.
>
> Hee hee, I only learnt to use 127.0.0.1 because Emacs 22 / TRAMP 2.0
> wasn't working with /multi:ssh:twb@foo:sudo:root@localhost:/ but it
> was with 127.0.0.1.

Oops. I'm not aware of this Tramp 2.0 problem.

>> `system-name' will mostly the unqualified system name I believe, so it
>> is already compliant to your request. Or am I wrong?
>
> On my system, system-name is the FQDN.  Assuming system-name is what
> the default frame-title-format uses, this has been the case for as
> long as I can remember (back to Emacs 21).

init_system_name() in sysdep.c is rather complex, so it might depend
on your actual configuration what's the result.

But I could add the result of `system-name' to the host completion
list for the su(do)? methods. If a user types "/su:ho <TAB>" in the
minibuffer, it will be completed to either "/su:host:" or
"/su:host.domain:", whatever `system-name' returns. That shall be
sufficient I believe.

Best regards, Michael.

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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-28 15:57       ` Trent W. Buck
@ 2008-01-28 16:31         ` Michael Albinus
  2008-01-29  0:34           ` Trent W. Buck
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 16:31 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

> I think I could learn to tolerate that amount of prompting... one
> thing to consider is what happens if I mess up the multihop (proxy)
> sequence because e.g. the notes the other sysadmin gave me are out of
> date.  Would I have to manually remove the entries from
> tramp-default-proxies-alist?

OK. Maybe it is sufficient to add it temporarily only, and raise a
message how to add it permanently. Then it is always *your* duty to
keep it consistent.

> I'm also not sure that middling to complicated proxying arrangements
> can even be set up with the current tramp-default-proxies-alist.  For
> example, suppose a host allows ssh from anywhere, but locks down its
> internal staff-only FTP upload area to sites on the corporate subnet?
> You'd need to have the /ftp:appdev:/incoming use an /ssh:gw: proxy,
> but /ssh:appdev: should not use any proxy (although it would still
> work with one, it would just waste gw's bandwidth).

I'ld recommend to use 2 Emacs profiles, with different settings of
tramp-default-proxies-alist. I do something similar in .gnus:

(if (my-ping "mail.work.de")
    (setq send-mail-function 'smtpmail-send-it
	  smtpmail-default-smtp-server "mail.work.de"
	  smtpmail-local-domain "work.de")
  (setq send-mail-function 'smtpmail-send-it
	smtpmail-default-smtp-server "mail.home.de"
	smtpmail-local-domain "home.de"))

Of course, you might use other decision criteria than pinging a host.

Best regards, Michael.

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

* Shell-command is no longer a shell (was: Tramp 2.0 -> 2.1 migration woes)
  2008-01-27  4:00 Tramp 2.0 -> 2.1 migration woes Trent W. Buck
  2008-01-27 13:42 ` Michael Albinus
  2008-01-27 14:57 ` Michael Albinus
@ 2008-01-28 20:54 ` Michael Albinus
  2008-01-29  0:43   ` Trent W. Buck
  2008-01-29 20:58 ` sudo -s -H (was: Tramp 2.0 -> 2.1 migration woes) Michael Albinus
  3 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 20:54 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

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

"Trent W. Buck" <trentbuck@gmail.com> writes:

> It seems that shell-command (M-!) no longer uses a shell in TRAMP
> buffers.

Could you, please, test the appended patch? It shall fix the problem.

Best regards, Michael.


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

*** /home/albinus/src/tramp/lisp/tramp.el.~2.625.~	2008-01-27 15:43:19.000000000 +0100
--- /home/albinus/src/tramp/lisp/tramp.el	2008-01-28 21:41:02.000000000 +0100
***************
*** 3781,3787 ****
    (command &optional output-buffer error-buffer)
    "Like `shell-command' for Tramp files."
    (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
! 	 (args (split-string (substring command 0 asynchronous) " "))
  	 (output-buffer
  	  (cond
  	   ((bufferp output-buffer) output-buffer)
--- 3781,3789 ----
    (command &optional output-buffer error-buffer)
    "Like `shell-command' for Tramp files."
    (let* ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
! 	 ;; We cannot use `shell-file-name' and `shell-command-switch',
! 	 ;; they are variables of the local host.
! 	 (args (list "/bin/sh" "-c" (substring command 0 asynchronous)))
  	 (output-buffer
  	  (cond
  	   ((bufferp output-buffer) output-buffer)

[-- Attachment #3: 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

* Re: Host name for su(do)?
  2008-01-28 16:10         ` Host name for su(do)? Michael Albinus
@ 2008-01-28 21:47           ` Michael Albinus
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Albinus @ 2008-01-28 21:47 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

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

> But I could add the result of `system-name' to the host completion
> list for the su(do)? methods. If a user types "/su:ho <TAB>" in the
> minibuffer, it will be completed to either "/su:host:" or
> "/su:host.domain:", whatever `system-name' returns. That shall be
> sufficient I believe.

I meant of course "/su:user@ho <TAB>". But checking it in more detail,
it seems there is no additional customization need. "/su:user@ <TAB>"
completes already to "/su:user@localhost:", and that's convenient enough.

> Best regards, Michael.

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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-28 16:31         ` Michael Albinus
@ 2008-01-29  0:34           ` Trent W. Buck
  2008-01-31 11:00             ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-29  0:34 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise

On Mon, Jan 28, 2008 at 05:31:32PM +0100, Michael Albinus wrote:
>> I'm also not sure that middling to complicated proxying
>> arrangements can even be set up with the current
>> tramp-default-proxies-alist.  For example, suppose a host allows
>> ssh from anywhere, but locks down its internal staff-only FTP
>> upload area to sites on the corporate subnet?  You'd need to have
>> the /ftp:appdev:/incoming use an /ssh:gw: proxy, but /ssh:appdev:
>> should not use any proxy (although it would still work with one,
>> it would just waste gw's bandwidth).
> 
> I'd recommend to use 2 Emacs profiles, with different settings of
> tramp-default-proxies-alist. I do something similar in .gnus:
> 
> (if (my-ping "mail.work.de")
>     (setq send-mail-function 'smtpmail-send-it
> 	  smtpmail-default-smtp-server "mail.work.de"
> 	  smtpmail-local-domain "work.de")
>   (setq send-mail-function 'smtpmail-send-it
> 	smtpmail-default-smtp-server "mail.home.de"
> 	smtpmail-local-domain "home.de"))

I think I haven't been clear.  In the example above, it's desirable to
dispatch on method as well as hostname and userename.

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

* Re: Shell-command is no longer a shell (was: Tramp 2.0 -> 2.1 migration woes)
  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
  0 siblings, 1 reply; 21+ messages in thread
From: Trent W. Buck @ 2008-01-29  0:43 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise


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

On Mon, Jan 28, 2008 at 09:54:01PM +0100, Michael Albinus wrote:
> "Trent W. Buck" <trentbuck@gmail.com> writes:
>> It seems that shell-command (M-!) no longer uses a shell in TRAMP
>> buffers.
>
> Could you, please, test the appended patch? It shall fix the problem.

Confirmed, M-! sh -c 'echo foo' RET works again in TRAMP buffers.

I also tried M-! sh -c 'echo foo' & RET.  I notice that unlike normal
shell-command, it creates a new *Async Shell Command* buffer each
time, and that this buffer does not popup (in a new window).

[-- 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

* sudo -s -H (was: Tramp 2.0 -> 2.1 migration woes)
  2008-01-27  4:00 Tramp 2.0 -> 2.1 migration woes Trent W. Buck
                   ` (2 preceding siblings ...)
  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 20:58 ` Michael Albinus
  3 siblings, 0 replies; 21+ messages in thread
From: Michael Albinus @ 2008-01-29 20:58 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

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

"Trent W. Buck" <trentbuck@gmail.com> writes:

> 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.

I've added "-H" to the sudo options. "-s" is already there. That shall
provide backwards compatibility on all systems Tramp is running. See the
appended patch.

"sudo -i" might be preferrable for systems which support it, but it
would be additional effort for testing this option. This contradicts
performance consideratons.

Best regards, Michael.


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

*** /home/albinus/src/tramp/lisp/tramp.el	2008-01-29 21:35:59.000000000 +0100
--- /home/albinus/src/tramp/lisp/tramp.el.~2.626.~	2008-01-28 22:10:50.000000000 +0100
***************
*** 441,447 ****
  	     (tramp-password-end-of-line nil))
      ("sudo"  (tramp-login-program        "sudo")
               (tramp-login-args           (("-u" "%u")
! 					  ("-s") ("-H") ("-p" "Password:")))
  	     (tramp-remote-sh            "/bin/sh")
  	     (tramp-copy-program         nil)
  	     (tramp-copy-args            nil)
--- 441,447 ----
  	     (tramp-password-end-of-line nil))
      ("sudo"  (tramp-login-program        "sudo")
               (tramp-login-args           (("-u" "%u")
! 					  ("-s" "-p" "Password:")))
  	     (tramp-remote-sh            "/bin/sh")
  	     (tramp-copy-program         nil)
  	     (tramp-copy-args            nil)

[-- Attachment #3: 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

* Re: Shell-command is no longer a shell
  2008-01-29  0:43   ` Trent W. Buck
@ 2008-01-29 21:06     ` Michael Albinus
  2008-01-31  2:09       ` Trent W. Buck
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-29 21:06 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

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

"Trent W. Buck" <trentbuck@gmail.com> writes:

> I also tried M-! sh -c 'echo foo' & RET.  I notice that unlike normal
> shell-command, it creates a new *Async Shell Command* buffer each
> time, and that this buffer does not popup (in a new window).

You are a pretty good tester! Thanks a lot for this!

The appended patch shall fix it.

Best regards, Michael.


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

*** /home/albinus/src/tramp/lisp/tramp.el.~2.626.~	2008-01-28 22:10:50.000000000 +0100
--- /home/albinus/src/tramp/lisp/tramp.el	2008-01-29 21:35:59.000000000 +0100
***************
*** 3789,3795 ****
  	   ((bufferp output-buffer) output-buffer)
  	   ((stringp output-buffer) (get-buffer-create output-buffer))
  	   (output-buffer (current-buffer))
! 	   (t (generate-new-buffer
  	       (if asynchronous
  		   "*Async Shell Command*"
  		 "*Shell Command Output*")))))
--- 3789,3795 ----
  	   ((bufferp output-buffer) output-buffer)
  	   ((stringp output-buffer) (get-buffer-create output-buffer))
  	   (output-buffer (current-buffer))
! 	   (t (get-buffer-create
  	       (if asynchronous
  		   "*Async Shell Command*"
  		 "*Shell Command Output*")))))
***************
*** 3801,3822 ****
  	  (if (and (not asynchronous) error-buffer)
  	      (with-parsed-tramp-file-name default-directory nil
  		(list output-buffer (tramp-make-tramp-temp-file v)))
! 	    output-buffer)))
  
!     (prog1
! 	;; Run the process.
! 	(if (integerp asynchronous)
  	    (apply 'start-file-process "*Async Shell*" buffer args)
! 	  (apply 'process-file (car args) nil buffer nil (cdr args)))
!       ;; Insert error messages if they were separated.
!       (when (listp buffer)
! 	(with-current-buffer error-buffer (insert-file-contents (cadr buffer)))
! 	(delete-file (cadr buffer)))
!       ;; There's some output, display it.
!       (when (with-current-buffer output-buffer (> (point-max) (point-min)))
! 	(if (functionp 'display-message-or-buffer)
! 	    (funcall (symbol-function 'display-message-or-buffer) output-buffer)
! 	  (pop-to-buffer output-buffer))))))
  
  ;; File Editing.
  
--- 3801,3842 ----
  	  (if (and (not asynchronous) error-buffer)
  	      (with-parsed-tramp-file-name default-directory nil
  		(list output-buffer (tramp-make-tramp-temp-file v)))
! 	    output-buffer))
! 	 (proc (get-buffer-process output-buffer)))
  
!     ;; Check whether there is another process running.  Tramp does not
!     ;; support 2 (asynchronous) processes in parallel.
!     (when proc
!       (if (yes-or-no-p "A command is running.  Kill it? ")
! 	  (ignore-errors (kill-process proc))
! 	(error "Shell command in progress")))
! 
!     (with-current-buffer output-buffer
!       (setq buffer-read-only nil
! 	    buffer-undo-list t)
!       (erase-buffer))
! 
!     (if (integerp asynchronous)
! 	(prog1
! 	    ;; Run the process.
  	    (apply 'start-file-process "*Async Shell*" buffer args)
! 	  ;; Display output.
! 	  (pop-to-buffer output-buffer))
! 
!       (prog1
! 	  ;; Run the process.
! 	  (apply 'process-file (car args) nil buffer nil (cdr args))
! 	;; Insert error messages if they were separated.
! 	(when (listp buffer)
! 	  (with-current-buffer error-buffer
! 	    (insert-file-contents (cadr buffer)))
! 	  (delete-file (cadr buffer)))
! 	;; There's some output, display it.
! 	(when (with-current-buffer output-buffer (> (point-max) (point-min)))
! 	  (if (functionp 'display-message-or-buffer)
! 	      (funcall (symbol-function 'display-message-or-buffer)
! 		       output-buffer)
! 	    (pop-to-buffer output-buffer)))))))
  
  ;; File Editing.
  

[-- Attachment #3: 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

* Re: Shell-command is no longer a shell
  2008-01-29 21:06     ` Shell-command is no longer a shell Michael Albinus
@ 2008-01-31  2:09       ` Trent W. Buck
  0 siblings, 0 replies; 21+ messages in thread
From: Trent W. Buck @ 2008-01-31  2:09 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-pretest-bug, rfrancoise

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

On Tue, Jan 29, 2008 at 10:06:00PM +0100, Michael Albinus wrote:
>> I also tried M-! sh -c 'echo foo' & RET.  I notice that unlike
>> normal shell-command, it creates a new *Async Shell Command* buffer
>> each time, and that this buffer does not popup (in a new window).
>
> The appended patch shall fix it.

Sorry for the delay; confirmed, the patch you posted fixes this issue.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-29  0:34           ` Trent W. Buck
@ 2008-01-31 11:00             ` Michael Albinus
  2008-01-31 14:51               ` Stefan Monnier
  0 siblings, 1 reply; 21+ messages in thread
From: Michael Albinus @ 2008-01-31 11:00 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: emacs-pretest-bug, rfrancoise

"Trent W. Buck" <trentbuck@gmail.com> writes:

> On Mon, Jan 28, 2008 at 05:31:32PM +0100, Michael Albinus wrote:
>>> I'm also not sure that middling to complicated proxying
>>> arrangements can even be set up with the current
>>> tramp-default-proxies-alist.  For example, suppose a host allows
>>> ssh from anywhere, but locks down its internal staff-only FTP
>>> upload area to sites on the corporate subnet?  You'd need to have
>>> the /ftp:appdev:/incoming use an /ssh:gw: proxy, but /ssh:appdev:
>>> should not use any proxy (although it would still work with one,
>>> it would just waste gw's bandwidth).

[...]

> I think I haven't been clear.  In the example above, it's desirable to
> dispatch on method as well as hostname and userename.

The example above couldn't be handled by Tramp, because it does not
support multi hops with an ftp method at the end. Tramp forwards all
ftp related actions to ange-ftp, which opens a *local* ftp client
subprocess.

Best regards, Michael.





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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-31 11:00             ` Michael Albinus
@ 2008-01-31 14:51               ` Stefan Monnier
  2008-01-31 15:46                 ` Michael Albinus
  0 siblings, 1 reply; 21+ messages in thread
From: Stefan Monnier @ 2008-01-31 14:51 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Trent W. Buck, emacs-pretest-bug, rfrancoise

> The example above couldn't be handled by Tramp, because it does not
> support multi hops with an ftp method at the end. Tramp forwards all
> ftp related actions to ange-ftp, which opens a *local* ftp client
> subprocess.

Couldn't it open a subprocess with start-file-process instead?


        Stefan





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

* Re: Tramp 2.0 -> 2.1 migration woes
  2008-01-31 14:51               ` Stefan Monnier
@ 2008-01-31 15:46                 ` Michael Albinus
  0 siblings, 0 replies; 21+ messages in thread
From: Michael Albinus @ 2008-01-31 15:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Trent W. Buck, emacs-pretest-bug, rfrancoise

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The example above couldn't be handled by Tramp, because it does not
>> support multi hops with an ftp method at the end. Tramp forwards all
>> ftp related actions to ange-ftp, which opens a *local* ftp client
>> subprocess.
>
> Couldn't it open a subprocess with start-file-process instead?

It could. But this would be a change in the ange-ftp interface, which
would need to be instructed *not* to open a local ftp client this
case. Until now, ange-ftp does not know of Tramp ...

I'll put it on the todo. Not at a prominent place, though.

>         Stefan

Best regards, Michael.





^ 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).