From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#18199: 24.4.50; tramp uses wrong arguments to nc Date: Wed, 06 Aug 2014 09:43:46 +0200 Message-ID: <878un26p1p.fsf@gmx.de> References: <87oavzx6vr.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407311159 6343 80.91.229.3 (6 Aug 2014 07:45:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Aug 2014 07:45:59 +0000 (UTC) Cc: 18199@debbugs.gnu.org To: Jason Rumney Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 06 09:45:53 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XEvuy-0008Ub-3i for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 09:45:52 +0200 Original-Received: from localhost ([::1]:37146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEvux-00009N-Q1 for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Aug 2014 03:45:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEvuH-00085l-4d for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 03:45:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEvuB-00069I-80 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 03:45:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEvuB-00067m-44 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 03:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XEvuA-0003gR-92 for bug-gnu-emacs@gnu.org; Wed, 06 Aug 2014 03:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Aug 2014 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18199 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18199-submit@debbugs.gnu.org id=B18199.140731104614072 (code B ref 18199); Wed, 06 Aug 2014 07:45:02 +0000 Original-Received: (at 18199) by debbugs.gnu.org; 6 Aug 2014 07:44:06 +0000 Original-Received: from localhost ([127.0.0.1]:59855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEvtF-0003et-SG for submit@debbugs.gnu.org; Wed, 06 Aug 2014 03:44:06 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:56553) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XEvtC-0003eC-3U for 18199@debbugs.gnu.org; Wed, 06 Aug 2014 03:44:03 -0400 Original-Received: from detlef.gmx.de ([87.146.59.162]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LfSeH-1Wd8DW2FIn-00p2oC; Wed, 06 Aug 2014 09:43:51 +0200 In-Reply-To: <87oavzx6vr.fsf@gnu.org> (Jason Rumney's message of "Wed, 06 Aug 2014 00:01:44 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-Provags-ID: V03:K0:ibcAnf82fTmCuPw94dccFxVR8UdElVOcKcV64+tBNrZpOAoA86U PQ1HIt+kyEB3UbtWeQQAk6qYN6lQNNlSR205EBSVZiKnBfnZYR0yShWvirHiTQj4CETDMpg L5X9pL0jh0iDWDi4jc4Hao6AGoJ3/R1Pd9RqfYpfCiSQzBOGyvhcL6UYsfICrQTMmsuToVu pOoXlmO+lZqcQezlAjFew== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92165 Archived-At: Jason Rumney 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 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 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.