Changed some FTP tests to validate the format of the PORT and EPRT commands
sent by curl, if not the addresses themselves.
This commit is contained in:
		
							
								
								
									
										7
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								CHANGES
									
									
									
									
									
								
							@@ -6,6 +6,13 @@
 | 
			
		||||
 | 
			
		||||
                                  Changelog
 | 
			
		||||
 | 
			
		||||
Dan F (17 September 2007)
 | 
			
		||||
- Added hooks to the test suite to make it possible to test a curl running
 | 
			
		||||
  on a remote host.
 | 
			
		||||
 | 
			
		||||
- Changed some FTP tests to validate the format of the PORT and EPRT commands
 | 
			
		||||
  sent by curl, if not the addresses themselves.
 | 
			
		||||
 | 
			
		||||
Daniel S (15 September 2007)
 | 
			
		||||
- Michal Marek made libcurl automatically append ";type=<a|i>" when using HTTP
 | 
			
		||||
  proxies for FTP urls.
 | 
			
		||||
 
 | 
			
		||||
@@ -34,17 +34,16 @@ ftp
 | 
			
		||||
FTP dir list, PORT with specified IP
 | 
			
		||||
 </name>
 | 
			
		||||
 <command>
 | 
			
		||||
ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP
 | 
			
		||||
ftp://%HOSTIP:%FTPPORT/ -P %CLIENTIP
 | 
			
		||||
</command>
 | 
			
		||||
</client>
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -33,18 +33,18 @@ ftp://%HOSTIP:%FTPPORT/a/path/103 -P -
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
<strippart>
 | 
			
		||||
s/^LPRT.*[\r\n]*//
 | 
			
		||||
s/^EPRT.*[\r\n]*//
 | 
			
		||||
s/^(PORT 127,0,0,1,)([0-9,]+)/$1/
 | 
			
		||||
</strippart>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
PASS ftp@example.com
 | 
			
		||||
PWD
 | 
			
		||||
CWD a
 | 
			
		||||
CWD path
 | 
			
		||||
PORT 127,0,0,1,
 | 
			
		||||
PORT 127,0,0,1,0,0
 | 
			
		||||
TYPE I
 | 
			
		||||
SIZE 103
 | 
			
		||||
RETR 103
 | 
			
		||||
 
 | 
			
		||||
@@ -31,10 +31,10 @@ Moooooooooooo
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT .*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ ftp
 | 
			
		||||
FTP download, failed PORT
 | 
			
		||||
 </name>
 | 
			
		||||
 <command>
 | 
			
		||||
ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1
 | 
			
		||||
ftp://%HOSTIP:%FTPPORT/116 -P 1.2.3.4
 | 
			
		||||
</command>
 | 
			
		||||
</client>
 | 
			
		||||
 | 
			
		||||
@@ -31,15 +31,17 @@ ftp://%HOSTIP:%FTPPORT/116 -P 127.0.0.1
 | 
			
		||||
<errorcode>
 | 
			
		||||
30
 | 
			
		||||
</errorcode>
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
</strip>
 | 
			
		||||
# Strip the port number but leave the rest
 | 
			
		||||
<strippart>
 | 
			
		||||
s/^(PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},)\d{1,3},\d{1,3}/$1/
 | 
			
		||||
s/^(EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|)\d{1,5}\|/$1/
 | 
			
		||||
</strippart>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
PASS ftp@example.com
 | 
			
		||||
PWD
 | 
			
		||||
EPRT |1|1.2.3.4|
 | 
			
		||||
PORT 1,2,3,4,
 | 
			
		||||
QUIT
 | 
			
		||||
</protocol>
 | 
			
		||||
</verify>
 | 
			
		||||
 
 | 
			
		||||
@@ -32,10 +32,10 @@ ftp://%HOSTIP:%FTPPORT/119 -P -
 | 
			
		||||
<errorcode>
 | 
			
		||||
19
 | 
			
		||||
</errorcode>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT.*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -23,11 +23,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -26,11 +26,10 @@ ftp://%HOSTIP:%FTPPORT/ -P - -l
 | 
			
		||||
<errorcode>
 | 
			
		||||
19
 | 
			
		||||
</errorcode>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -21,11 +21,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/146 ftp://%HOSTIP:%FTPPORT/146
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -25,11 +25,10 @@ ftp://%HOSTIP:%FTPPORT/first/dir/here/147 --ftp-create-dirs
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -22,11 +22,10 @@ ftp://%HOSTIP:%FTPPORT/attempt/to/get/this/148 --ftp-create-dirs
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<errorcode>
 | 
			
		||||
9
 | 
			
		||||
 
 | 
			
		||||
@@ -21,11 +21,10 @@ send away this contents
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -31,9 +31,10 @@ data blobb
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip the addresses and port number but leave the rest
 | 
			
		||||
<strippart>
 | 
			
		||||
s/^(EPRT \|1\|127.0.0.1).*/$1/
 | 
			
		||||
s/^(PORT 127,0,0,1,).*/$1/
 | 
			
		||||
s/^(EPRT \|1\|)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|/$1/
 | 
			
		||||
s/^(PORT )\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}/$1/
 | 
			
		||||
</strippart>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
@@ -41,12 +42,12 @@ PASS ftp@example.com
 | 
			
		||||
PWD
 | 
			
		||||
CWD a
 | 
			
		||||
CWD path
 | 
			
		||||
EPRT |1|127.0.0.1
 | 
			
		||||
PORT 127,0,0,1,
 | 
			
		||||
EPRT |1|
 | 
			
		||||
PORT 
 | 
			
		||||
TYPE I
 | 
			
		||||
SIZE 212
 | 
			
		||||
RETR 212
 | 
			
		||||
PORT 127,0,0,1,
 | 
			
		||||
PORT 
 | 
			
		||||
SIZE 212
 | 
			
		||||
RETR 212
 | 
			
		||||
QUIT
 | 
			
		||||
 
 | 
			
		||||
@@ -36,11 +36,10 @@ ftp://%HOSTIP:%FTPPORT/ -P %HOSTIP
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -39,18 +39,17 @@ ftps
 | 
			
		||||
FTPS dir list, PORT with specified IP
 | 
			
		||||
 </name>
 | 
			
		||||
 <command>
 | 
			
		||||
-k --ftp-ssl-control -P %HOSTIP ftps://%HOSTIP:%FTPSPORT/
 | 
			
		||||
-k --ftp-ssl-control -P %CLIENTIP ftps://%HOSTIP:%FTPSPORT/
 | 
			
		||||
</command>
 | 
			
		||||
</client>
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# strip all kinds of PORT, EPRT and LPRT curl can do
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT 127,0,0,1,.*
 | 
			
		||||
^EPRT.*
 | 
			
		||||
^LPRT.*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -34,10 +34,10 @@ Moooooooooooo
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT .*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -34,10 +34,10 @@ Moooooooooooo
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT .*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -34,10 +34,10 @@ Moooooooooooo
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT .*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
@@ -37,10 +37,10 @@ don't upload this
 | 
			
		||||
 | 
			
		||||
# Verify data after the test has been "shot"
 | 
			
		||||
<verify>
 | 
			
		||||
# Strip all valid kinds of PORT and EPRT that curl can send
 | 
			
		||||
<strip>
 | 
			
		||||
^PORT .*
 | 
			
		||||
^EPRT .*
 | 
			
		||||
^LPRT .*
 | 
			
		||||
^PORT \d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3},\d{1,3}
 | 
			
		||||
^EPRT \|1\|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\|\d{1,5}\|
 | 
			
		||||
</strip>
 | 
			
		||||
<protocol>
 | 
			
		||||
USER anonymous
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user