unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Jason Rumney <jasonr@gnu.org>
Cc: 18199@debbugs.gnu.org
Subject: bug#18199: 24.4.50; tramp uses wrong arguments to nc
Date: Wed, 06 Aug 2014 09:43:46 +0200	[thread overview]
Message-ID: <878un26p1p.fsf@gmx.de> (raw)
In-Reply-To: <87oavzx6vr.fsf@gnu.org> (Jason Rumney's message of "Wed, 06 Aug 2014 00:01:44 +0800")

Jason Rumney <jasonr@gnu.org> writes:

Hi Jason,

> When connecting to a Busybox/Linux based router with tramp's new nc method,
> the file transfer fails.  Below is the relevant debug log:
>
> ---------------------------------------------------------------------
> ///3359aa65e9a4645eb0b84d831a25d5c2#$
> 23:26:29.200991 tramp-send-command (6) # nc -l -p 51257 </etc/TZ &
> 23:26:29.250828 tramp-wait-for-regexp (6) # 
>
> ///3359aa65e9a4645eb0b84d831a25d5c2#$
> 23:26:29.251550 tramp-send-command (6) # netstat -l | grep -q :51257
> 23:26:29.308484 tramp-wait-for-regexp (6) # 
> BusyBox v1.6.1 (2011-05-25 14:47:48 CST) multi-call binary
>
> Usage: 
> nc [IPADDR PORTNUM]
>
> Open a pipe to IP:port

[...]

> The actual command required is
>
>    nc -l 51257 </etc/TZ &

Well, as you might guess I have tested this with my own equipment. My
silly router runs a more recent version of busybox, which requires the
"-p" prefix for nc's port specification:

--8<---------------cut here---------------start------------->8---
# nc -l 51257
nc: bad address '51257'
# nc -h
nc: invalid option -- h
BusyBox v1.19.3 (2012-08-08 12:53:46 CEST) multi-call binary.

Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]

Open a pipe to IP:PORT or FILE

        -e PROG Run PROG after connect
        -l      Listen mode, for inbound connects
                (use -l twice with -e for persistent server)
        -p PORT Local port
        -w SEC  Timeout for connect
        -i SEC  Delay interval for lines sent
        -f FILE Use file (ala /dev/ttyS0) instead of network
--8<---------------cut here---------------end--------------->8---

I don't see how to unify both syntax variants. Therfore, I will add a
check for nc prior the first call, in order to determine what to
use. Alternatively, it could be made configurable; haven't decided yet.

This might take some days. For further testing (which would much be
appreciated!), you could use the following patch:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/lisp/net/tramp-sh.el.~117648~	2014-08-06 09:23:05.687261671 +0200
--- /home/albinus/src/emacs/lisp/net/tramp-sh.el	2014-08-06 09:22:01.750100553 +0200
***************
*** 218,225 ****
      ;; We use "-v" for better error tracking.
      (tramp-copy-args            (("-w" "1") ("-v") ("%h") ("%r")))
      (tramp-remote-copy-program  "nc")
!     ;; We use "-p" as required for busyboxes.
!     (tramp-remote-copy-args     (("-l") ("-p" "%r")))
      (tramp-default-port         23)))
  ;;;###tramp-autoload
  (add-to-list 'tramp-methods
--- 218,224 ----
      ;; We use "-v" for better error tracking.
      (tramp-copy-args            (("-w" "1") ("-v") ("%h") ("%r")))
      (tramp-remote-copy-program  "nc")
!     (tramp-remote-copy-args     (("-l") ("%r")))
      (tramp-default-port         23)))
  ;;;###tramp-autoload
  (add-to-list 'tramp-methods
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





  reply	other threads:[~2014-08-06  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 16:01 bug#18199: 24.4.50; tramp uses wrong arguments to nc Jason Rumney
2014-08-06  7:43 ` Michael Albinus [this message]
2014-08-06  8:18   ` Andreas Schwab
2014-08-06  9:35     ` Michael Albinus
2014-08-06 15:36     ` Jason Rumney
2014-08-07  9:27       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878un26p1p.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=18199@debbugs.gnu.org \
    --cc=jasonr@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).