cURL / Mailing Lists / curl-library / Single Mail

curl-library

cURL 'make test' fails on OpenBSD on PASV

From: Heikki Korpela <heko_at_iki.fi>
Date: Sat, 8 Sep 2001 21:59:03 +0300

cURL requests using PASV, including a PASV LIST to localhost,
work just fine. Make test however fails on PASV LIST. (All
tests before that one report success.)

make test output:

+++ Sat Sep 8 20:22:46 EEST 2001
[ -f test1 ] || ln -s /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests/data/test* .
srcdir=/usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests /usr/bin/perl -I/usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests/runtests.pl -a -d -k -v -g 100
********* System characteristics ********
* curl 7.9-pre3 (i386-unknown-openbsd2.9)
* libcurl 7.9-pre3 (OpenSSL 0.9.6b) (ipv6 enabled)
* Host: ip212-226-147-201.adsl.kpnqwest.fi
* System: OpenBSD ip212-226-147-201.adsl.kpnqwest.fi 2.9 GENERIC#1 i386
* Memory debugging: OFF
* HTTPS server: OFF
* FTPS server: OFF
* libcurl SSL: ON
*****************************************
CMD: perl -I/usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/tests/ftpserver.pl -v 8921 &
test 100...[FTP dir list PASV]
../src/curl --output log/curl100.out --include -v ftp://127.0.0.1:8921/ >log/stdout100 2>log/stderr100
GNU gdb 4.16.1
Copyright 1996 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-unknown-openbsd2.9"...
Arguments to give program being debugged when it is started is
    "--output log/curl100.out --include -v ftp://127.0.0.1:8921/".
(gdb) break ftp.c:222
Breakpoint 1 at 0x2c18a: file /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c, line 222.
(gdb) run
Starting program: /builds/ports-work/curl-7.9-pre3/build-i386/tests/../src/curl --output log/curl100.out --include -v ftp://127.0.0.1:8921/

Breakpoint 1, Curl_GetFTPResponse (sockfd=5, OUT:
220- _ _ ____ _
220- ___| | | | _ \| |
220- / __| | | | |_) | |
220- | (__| |_| | _ <| |___
220 \___|\___/|_| \_\_____|
buf=0x395e8 "", conn=0x38400,
    ftpcode=0xdfbfd2e4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 220- _ _ ____ _
< 220- ___| | | | _ \| |
< 220- / __| | | | |_) | |
< 220- | (__| |_| | _ <| |___
< 220 \___|\___/|_| \_\_____|
> USER anonymous
IN: USER anonymous

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "220 \\___|\\___/|_| \\_\\_____|\r\n220- ___| | | | _ \\| | \r\n220- / __| | | | |_) | | \r\n220- | (__| |_| | _ <| |___ \r\n220 \\___|\\___/|_| \\_\\_____|\r\n", conn=0x38400, ftpcode=0xdfbfd2e4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 331 We are happy you popped in!
> PASS curl_by_daniel_at_haxx.se
IN: PASS curl_by_daniel_at_haxx.se

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "331 We are happy you popped in!\r\n20- ___| | | | _ \\| | \r\n", conn=0x38400, ftpcode=0xdfbfd2e4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 230 Welcome you silly person
* We have successfully logged in
> PWD
IN: PWD

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "230 Welcome you silly person\r\n!\r\n20- ___| | | | _ \\| |", conn=0x38400, ftpcode=0xdfbfd2e4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 257 "/nowhere/anywhere" is current directory
* Entry path is '/nowhere/anywhere'
* Connected to 127.0.0.1
> PASV
IN: PASV

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "257 \"/nowhere/anywhere\" is current directory\r\n | | _ \\| |", conn=0x38400, ftpcode=0xdfbfb294)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 227 Entering Passive Mode (127,0,0,1,34,218)
* Connecting to localhost (127.0.0.1) port 8922
* Connected the data stream!
> TYPE A
IN: TYPE A

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "227 Entering Passive Mode (127,0,0,1,34,218)\n\n | | _ \\| |", conn=0x38400, ftpcode=0xdfbfb1f4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 200 I modify TYPE as you wanted
> LIST
IN: LIST

Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "200 I modify TYPE as you wanted\r\n0,1,34,218)\n\n | | _ \\| |", conn=0x38400, ftpcode=0xdfbfb294)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) c
Continuing.
< 150 here comes a directory
* Getting file with size: -1
  % Total % Received % Xferd Average Speed Time Curr.
                                 Dload Upload Total Current Left Speed

100 623 0 623 0 0 89 0 --:--:-- 0:00:06 --:--:-- 0
Breakpoint 1, Curl_GetFTPResponse (sockfd=5,
    buf=0x395e8 "total 20\r\ndrwxr-xr-x 8 98 98", ' ' <repeats 11 times>, "512 Oct 22 13:06 .\r\ndrwxr-xr-x 8 98 98", ' ' <repeats 11 times>, "512 Oct 22 13:06 ..\r\ndrwxr-xr-x 2 98 98", ' ' <repeats 11 times>, "512 May 2 1996 .NeXT\r\n-r--r--r-- 1"..., conn=0x38400, ftpcode=0xdfbfd4f4)
    at /usr/ports/net/curl/w-curl-7.9-pre3/curl-7.9-pre3/lib/ftp.c:222
222 switch (select (sockfd+1, &readfd, NULL, NULL, &interval)) {
(gdb) s
228 error = SELECT_TIMEOUT;
(gdb) c
Continuing.

100 623 0 623 0 0 0 0 --:--:-- 1:10:14 --:--:-- 0
* Connection (#0) left alive
curl: (28) Transfer aborted due to timeout
* Closing live connection (#0)

Program exited with code 034.
(gdb)
The program is not being run.
(gdb) data OK protocol OK
Test server pid 151 signalled to die
1 tests out of 1 reported OK
--- Sat Sep 8 21:33:28 EEST 2001

<!====================----------< SNIP >----------=====================>

netstat output at the time:

Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp 0 0 ip212-226-147-20.11710 ns3.eunet.fi.domain TIME_WAIT
tcp 0 0 localhost.34490 localhost.sunrpc TIME_WAIT
tcp 0 0 ip212-226-147-20.17059 ns3.eunet.fi.domain TIME_WAIT
tcp 0 0 localhost.4754 localhost.sunrpc TIME_WAIT
tcp 0 0 ip212-226-147-20.5284 ns3.eunet.fi.domain TIME_WAIT
tcp 0 0 localhost.18970 localhost.sunrpc TIME_WAIT
tcp 0 0 *.8922 *.* LISTEN
tcp 0 0 localhost.8921 localhost.7909 ESTABLISHED
tcp 0 0 localhost.7909 localhost.8921 ESTABLISHED
tcp 0 0 *.8921 *.* LISTEN
tcp 0 0 *.8999 *.* LISTEN
tcp 0 0 ip212-226-147-20.15901 pm1.contactor.se.www CLOSE_WAIT
tcp 0 0 ip212-226-147-20.6192 pm1.contactor.se.www CLOSE_WAIT
tcp 0 0 ip212-226-147-20.40949 davos.fountainpa.imap ESTABLISHED
tcp 0 0 ip212-226-147-20.13914 saitti.iqs.fi.ssh ESTABLISHED
tcp 0 0 ip212-226-147-20.34957 saitti.iqs.fi.ssh ESTABLISHED
tcp 0 0 *.6000 *.* LISTEN
tcp 0 0 *.submissi *.* LISTEN
tcp 0 0 *.smtp *.* LISTEN
tcp 0 0 *.7100 *.* LISTEN
tcp 0 0 *.ssh *.* LISTEN
tcp 0 0 *.discard *.* LISTEN
tcp 0 0 *.auth *.* LISTEN
tcp 0 0 *.ftp *.* LISTEN
tcp 0 0 *.www *.* LISTEN
tcp 0 0 *.nfsd *.* LISTEN
tcp 0 0 *.872[mountd] *.* LISTEN
tcp 0 0 localhost.sunrpc *.* LISTEN
tcp 0 0 *.sunrpc *.* LISTEN
udp 0 0 *.629[rquotad] *.*
udp 0 0 *.nfsd *.*
udp 0 0 *.829[mountd] *.*
udp 0 0 localhost.sunrpc *.*
udp 0 0 *.sunrpc *.*
udp 0 0 *.syslog *.*

<!====================----------< SNIP >----------=====================>

tests/log/ftpd.log:

151: connection from localhost [127.0.0.1] at port 7909
151: GOT: (USER) USER anonymous
151: set to state passwd
151: GOT: (PASS) PASS curl_by_daniel_at_haxx.se
151: set to state loggedin
151: GOT: (PWD) PWD
151: set to state loggedin
151: GOT: (PASV) PASV
151: 151: data connection from localhost [127.0.0.1] at port 33225
151: set to state twosock
151: GOT: (TYPE) TYPE A
151: set to state twosock
151: GOT: (LIST) LIST
151: 151: pass data to child pid
151: 151: done passing data to child pid
151: set to state twosock
Received on 2001-09-08