From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2648 invoked from network); 17 Mar 2022 04:14:14 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 17 Mar 2022 04:14:14 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob1.topicbox.com (Postfix) with ESMTP id ECDF02FEA1 for ; Thu, 17 Mar 2022 00:14:11 -0400 (EDT) (envelope-from bounce.mMcd4d16fb44d1c44c68272702.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id EA0E548CC141; Thu, 17 Mar 2022 00:14:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=to :message-id:date:mime-version:content-type :content-transfer-encoding:from:list-help:list-id:list-post :list-subscribe:reply-to:subject:list-unsubscribe; s=dkim-1; bh= UEDLDP65XFgof8Dr52SvTgrKLHwLLV19Ivf+/s1J7sE=; b=JhH3bNJ3OtqesqGz AzAahJXToz2M28DQ2RnwDHznmLn8/cDbt/jauNWFNHv7NQ2M/2816CyXRLy/BsL5 UYAxBWJ4A9HgUOtiTXBvNvayQ1kxAFxFz+QMQw/VSOm35i4hn0lFF3xyXG/BOnjh PgNtAQYeGuFS0+6sbJOq/MiITcM= To: 9fans <9fans@9fans.net> Message-Id: <16474904390.dE6D6.98287@composer.9fans.topicbox.com> Date: Thu, 17 Mar 2022 00:13:59 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=16474904391.Bc27E25.98287 Content-Transfer-Encoding: 7bit Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: abbca8c6-a5a8-11ec-b1ca-d2a59034e1fa Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNWNiZWNmMWE0ZmI4Y2Y1ZS1NY2Q0ZDE2ZmI0NGQxYzQ0YzY4Mjcy?= =?UTF-8?B?NzAyPg==?= From: "ibrahim via 9fans" <9fans@9fans.net> List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Subject: [9fans] ftpd bugfix and enhancement List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Mcd4d16fb44d1c44c68272702:1:jmRoYmHZ0CWXALOobB5pF_WMWTxMJOgs15v66vhSnuY --16474904391.Bc27E25.98287 Date: Thu, 17 Mar 2022 00:13:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable While using ftpd in 9vx and qemu I got response messages "Permission denied= " in passive mode. This was caused in dialdata by dial(data,"20",0,0). Whil= e correcting this problem I also enhanced the options of ftpd to make it po= ssible to use alternative ports instead of 20 for the data socket. ftpd got= an optional parameter -P dataport which defaults to 20. The changes make i= t now possible to use ftpd from 9vx and qemu without port redirection. with a call like : aux/listen1 -vt tcp!*!13000 /bin/ip/ftpd -Aen namespace.ftp -P 13001 one can start a ftp server listening on port 13000 while using 13001 as its= default data port.=20 The diffs for ftpd.c and ipserv-manpage against 9legacy (latest version) ar= e : DIFF FOR ftpd.c : 137,138d136 < char *dataport=3D"20" ; < char dataadr[64] ; 177,178c175,176 < syslog(0, "ftp", "usage: %s [-aAde] [-n nsfile] [-P dataport]", arg= v0); < fprint(2, "usage: %s [-aAde] [-n nsfile] [-P dataport]\n", argv0); --- > syslog(0, "ftp", "usage: %s [-aAde] [-n nsfile]", argv0); > fprint(2, "usage: %s [-aAde] [-n nsfile]\n", argv0); 194,195c192 < int dataportid ; < --- 214,216d210 < case 'P' : < dataport =3D EARGF(usage()) ; < break ; 232,237d225 < /* prepare data port */ < dataportid=3Datol(dataport) ; < if (dataportid=3D=3D0) < dataportid=3D20 ; < snprint(dataadr,64,"tcp!*!%d",dataportid) ; < 1697c1685 < fd =3D dial(data, dataadr, 0, 0); --- > fd =3D dial(data, "20", 0, 0); 1710d1697 < Diff for man/8/ipserv 18,19d17 < .RB [ -P < .IR dataport ] 170,172d167 < .TP < .B P < the port used for the data socket (default 20) 181,188d175 < .PP < .SH EXAMPLE < .PP < Start ftpd with control port 13000 and data port 13001 while using prepar= ed namespace /usr/glenda/ftp/namespace.ftp for anonymous access. < .PP < .EX < aux/listen1 -vt tcp!*!13000 /bin/ip/ftpd -Aen /usr/glenda/ftp/names= pace.ftp -P 13001 < .EE FURTHER COMMENT : ftpd makes data exchange between UNIX hosts and plan9 guests while using qe= mu very simple. ftpd can be started from 9vx in usermode when using ports other than 21(20). Some ftp clients ask for utf8 opt and this is ignored by ftpd my next patch= will adress this problem. Comments are welcome. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T5cbecf1a4fb8cf5e-Mcd4d1= 6fb44d1c44c68272702 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --16474904391.Bc27E25.98287 Date: Thu, 17 Mar 2022 00:13:59 -0400 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
While using ftpd in 9vx and qemu I got respons= e messages "Permission denied" in passive mode. This was caused i= n dialdata by dial(data,"20",0,0). While correcting this problem = I also enhanced the options of ftpd to make it possible to use alternative = ports instead of 20 for the data socket. ftpd got an optional parameter -P = dataport which defaults to 20. The changes make it now possible to use ftpd= from 9vx and qemu without port redirection.

with a call like :

aux/listen1 -vt tcp!= *!13000 /bin/ip/ftpd -Aen namespace.ftp -P 13001

one can start a ftp server listening on port 13000 while using 13001= as its default data port.

The diffs for = ftpd.c and ipserv-manpage against 9legacy (latest version) are :

DIFF FOR ftpd.c :
=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D

137,138d136
=
< char *dataport=3D"20" ;
< char= dataadr[64] ;
177,178c175,176
< syslog= (0, "ftp", "usage: %s [-aAde] [-n nsfile] [-P dataport]"= ;, argv0);
< fprint(2, "usage: %s [-aAde] [-n nsfi= le] [-P dataport]\n", argv0);
---
>= syslog(0, "ftp", "usage: %s [-aAde] [-n nsfile]", arg= v0);
> fprint(2, "usage: %s [-aAde] [-n nsfile]\n&= quot;, argv0);
194,195c192
< int datapo= rtid ;
<
---
>
<= /div>
214,216d210
< case 'P' :
<= div>< dataport =3D EARGF(usage()) ;
< break ;
232,237d225
< /* prepare data port */
< dataportid=3Datol(dataport) ;
< if (d= ataportid=3D=3D0)
< dataportid=3D20 ;
= < snprint(dataadr,64,"tcp!*!%d",dataportid) ;
<
1697c1685
< fd =3D dial(data, da= taadr, 0, 0);
---
> fd =3D dial(data, = "20", 0, 0);
1710d1697
<
=

Diff for man/8/ipserv
=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
18,19d17
< .RB [ -P
< .IR dataport ]
170,172d167
< .TP
< .B P
< the port used for the data socket (default 20)
= 181,188d175
< .PP
< .SH EXAMPLE
=
< .PP
< Start ftpd with control port 13000= and data port 13001 while using prepared namespace /usr/glenda/ftp/namespa= ce.ftp for anonymous access.
< .PP
< = .EX
< aux/listen1 -vt tcp!*!13000 /bin/ip/ftpd -Aen /us= r/glenda/ftp/namespace.ftp -P 13001
< .EE


FURTHER COMMENT :
=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
ftpd ma= kes data exchange between UNIX hosts and plan9 guests while using qemu very= simple.

ftpd can be started from 9vx in u= sermode when using ports other than 21(20).

Some ftp clients ask for utf8 opt and this is ignored by ftpd my next pat= ch will adress this problem. Comments are welcome.

= --16474904391.Bc27E25.98287--