Compare commits
53 Commits
cares-1_4_
...
curl-7_16_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8d006b9d7 | ||
|
|
af4edf10f5 | ||
|
|
0f9e209534 | ||
|
|
2aed8946b0 | ||
|
|
03b03f7b60 | ||
|
|
a1b650ad7b | ||
|
|
d978f85d55 | ||
|
|
6e7f47da5b | ||
|
|
277bab0c7b | ||
|
|
fc3c5dae87 | ||
|
|
891dffb528 | ||
|
|
f0b361ecc1 | ||
|
|
df7eed16dd | ||
|
|
61db4f3e2a | ||
|
|
fe85ae15f3 | ||
|
|
cc26cc5dcd | ||
|
|
eb965e2a13 | ||
|
|
4e35395d0e | ||
|
|
b61b420cb8 | ||
|
|
b0aa11fde7 | ||
|
|
b691102ec7 | ||
|
|
2785fe7f61 | ||
|
|
db5d4bd811 | ||
|
|
dc3b3c6916 | ||
|
|
82d3f97659 | ||
|
|
235632ed2c | ||
|
|
68330c86e7 | ||
|
|
f37dc9168a | ||
|
|
17798ed740 | ||
|
|
05ba9f9fcd | ||
|
|
96f4af4db9 | ||
|
|
3ec7f8a25a | ||
|
|
375cdf89ad | ||
|
|
ab7e7144ef | ||
|
|
6f59e19b91 | ||
|
|
7800b56dc8 | ||
|
|
73c13220ee | ||
|
|
99e0597c7b | ||
|
|
3247ac1918 | ||
|
|
c45d44fee9 | ||
|
|
1e718a515a | ||
|
|
d23d686de2 | ||
|
|
c8677e9d3f | ||
|
|
a32eaffa77 | ||
|
|
1dcb99f0f7 | ||
|
|
03bc2d34da | ||
|
|
477e27f99d | ||
|
|
6a84d492f1 | ||
|
|
873d95a34c | ||
|
|
1500e95839 | ||
|
|
4f8ebd1673 | ||
|
|
cd4e6fbcac | ||
|
|
2fd2ca9dac |
89
CHANGES
89
CHANGES
@@ -6,6 +6,95 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Version 7.16.3 (25 June 2007)
|
||||||
|
|
||||||
|
Daniel S (23 June 2007)
|
||||||
|
- As reported by "Tro" in http://curl.haxx.se/mail/lib-2007-06/0161.html and
|
||||||
|
http://curl.haxx.se/mail/lib-2007-06/0238.html, libcurl didn't properly do
|
||||||
|
no-body requests on FTP files on re-used connections properly, or at least
|
||||||
|
it didn't provide the info back in the header callback properly in the
|
||||||
|
subsequent requests.
|
||||||
|
|
||||||
|
Daniel S (21 June 2007)
|
||||||
|
- Gerrit Bruchh<68>user pointed out a warning that the Intel(R) Thread Checker
|
||||||
|
tool reports and it was indeed a legitimate one and it is one fixed. It was
|
||||||
|
a use of a share without doing the proper locking first.
|
||||||
|
|
||||||
|
Daniel S (20 June 2007)
|
||||||
|
- Adam Piggott filed bug report #1740263
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1740263). Adam discovered that when
|
||||||
|
getting a large amount of URLs with curl, they were fetched slower and
|
||||||
|
slower... which turned out to be because the --libcurl data collecting which
|
||||||
|
wrongly always was enabled, but no longer is...
|
||||||
|
|
||||||
|
Daniel S (18 June 2007)
|
||||||
|
- Robson Braga Araujo filed bug report #1739100
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1739100) that mentioned that libcurl
|
||||||
|
could not actually list the contents of the root directory of a given FTP
|
||||||
|
server if the login directory isn't root. I fixed the problem and added
|
||||||
|
three test cases (one is disabled for now since I identified KNOWN_BUGS #44,
|
||||||
|
we cannot use --ftp-method nocwd and list ftp directories).
|
||||||
|
|
||||||
|
Daniel S (14 June 2007)
|
||||||
|
- Shmulik Regev:
|
||||||
|
|
||||||
|
I've encountered (and hopefully fixed) a problem involving proxy CONNECT
|
||||||
|
requests and easy handles state management. The problem isn't simple to
|
||||||
|
reproduce since it depends on socket state. It only manifests itself when
|
||||||
|
working with non-blocking sockets.
|
||||||
|
|
||||||
|
Here is the scenario:
|
||||||
|
|
||||||
|
1. in multi_runsingle the easy handle is in the CURLM_STATE_WAITCONNECT and
|
||||||
|
calls Curl_protocol_connect
|
||||||
|
|
||||||
|
2. in Curl_proxyCONNECT, line 1247, if the socket isn't ready the function
|
||||||
|
returns and conn->bits.tunnel_connecting is TRUE
|
||||||
|
|
||||||
|
3. when the call to Curl_protocol_connect returns the protocol_connect flag
|
||||||
|
is false and the easy state is changed to CURLM_STATE_PROTOCONNECT which
|
||||||
|
isn't correct if a proxy is used. Rather CURLM_STATE_WAITPROXYCONNECT
|
||||||
|
should be used.
|
||||||
|
|
||||||
|
I discovered this while performing an HTTPS request through a proxy (squid)
|
||||||
|
on my local network. The problem caused openssl to fail as it read the proxy
|
||||||
|
response to the CONNECT call ('HTTP/1.0 Established') rather than the SSL
|
||||||
|
handshake (the exact openssl error was 'wrong ssl version' but this isn't
|
||||||
|
very important)
|
||||||
|
|
||||||
|
- Dave Vasilevsky filed bug report #1736875
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1736875) almost simultanouesly as Dan
|
||||||
|
Fandrich mentioned a related build problem on the libcurl mailing list:
|
||||||
|
http://curl.haxx.se/mail/lib-2007-06/0131.html. Both problems had the same
|
||||||
|
reason: the definitions of the POLL* defines and the pollfd struct in the
|
||||||
|
libcurl code was depending on HAVE_POLL instead of HAVE_SYS_POLL_H.
|
||||||
|
|
||||||
|
Daniel S (13 June 2007)
|
||||||
|
- Tom Regner provided a patch and worked together with James Housley, so now
|
||||||
|
CURLOPT_FTP_CREATE_MISSING_DIRS works for SFTP connections as well as FTP
|
||||||
|
ones.
|
||||||
|
|
||||||
|
- Rich Rauenzahn filed bug report #1733119
|
||||||
|
(http://curl.haxx.se/bug/view.cgi?id=1733119) and we collaborated on the
|
||||||
|
fix. The problem is that for 64bit HPUX builds, several socket-related
|
||||||
|
functions would still assume int (32 bit) arguments and not socklen_t (64
|
||||||
|
bit) ones.
|
||||||
|
|
||||||
|
Daniel S (12 June 2007)
|
||||||
|
- James Housley brought his revamped SSH code that is state-machine driven to
|
||||||
|
really take advantage of the now totally non-blocking libssh2 (in CVS).
|
||||||
|
|
||||||
|
Dan F (8 June 2007)
|
||||||
|
- Incorporated Daniel Black's test706 and test707 SOCKS test cases.
|
||||||
|
|
||||||
|
- Fixed a few problems when starting the SOCKS server.
|
||||||
|
|
||||||
|
- Reverted some recent changes to runtests.pl that weren't compatible with
|
||||||
|
perl 5.0.
|
||||||
|
|
||||||
|
- Fixed the test harness so that it actually kills the ssh being used as
|
||||||
|
the SOCKS server.
|
||||||
|
|
||||||
Daniel S (6 June 2007)
|
Daniel S (6 June 2007)
|
||||||
- -s/--silent can now be used to toggle off the silence again if used a second
|
- -s/--silent can now be used to toggle off the silence again if used a second
|
||||||
time.
|
time.
|
||||||
|
|||||||
@@ -234,6 +234,10 @@ netware-clean:
|
|||||||
$(MAKE) -C lib -f Makefile.netware clean
|
$(MAKE) -C lib -f Makefile.netware clean
|
||||||
$(MAKE) -C src -f Makefile.netware clean
|
$(MAKE) -C src -f Makefile.netware clean
|
||||||
|
|
||||||
|
netware-install:
|
||||||
|
$(MAKE) -C lib -f Makefile.netware install
|
||||||
|
$(MAKE) -C src -f Makefile.netware install
|
||||||
|
|
||||||
unix: all
|
unix: all
|
||||||
|
|
||||||
unix-ssl: ssl
|
unix-ssl: ssl
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ This release includes the following changes:
|
|||||||
o upload resume works for file:// URLs
|
o upload resume works for file:// URLs
|
||||||
o asynchronous name resolves now require c-ares 1.4.0 or later
|
o asynchronous name resolves now require c-ares 1.4.0 or later
|
||||||
o added SOCKS test cases
|
o added SOCKS test cases
|
||||||
|
o CURLOPT_FTP_CREATE_MISSING_DIRS and --ftp-create-dirs now work for SFTP
|
||||||
|
operations as well
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
@@ -54,6 +56,12 @@ This release includes the following bugfixes:
|
|||||||
o FPL-SSL when built with NSS
|
o FPL-SSL when built with NSS
|
||||||
o out-of-boundary write in Curl_select()
|
o out-of-boundary write in Curl_select()
|
||||||
o -s/--silent can now be used to toggle off the silence again
|
o -s/--silent can now be used to toggle off the silence again
|
||||||
|
o builds fine on 64bit HP-UX
|
||||||
|
o multi interface HTTP CONNECT glitch
|
||||||
|
o list FTP root directories when login dir is not root
|
||||||
|
o no longer slows down when getting very many URLs on the same command line
|
||||||
|
o lock share before decreasing dirty counter
|
||||||
|
o no-body FTP requests on re-used connections
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
@@ -79,6 +87,8 @@ advice from friends like these:
|
|||||||
James Housley, Daniel Black, Steve Little, Sonia Subramanian, Peter O'Gorman,
|
James Housley, Daniel Black, Steve Little, Sonia Subramanian, Peter O'Gorman,
|
||||||
Frank Hempel, Michael Wallner, Jeff Pohlmeyer, Tobias Rundstr<74>m,
|
Frank Hempel, Michael Wallner, Jeff Pohlmeyer, Tobias Rundstr<74>m,
|
||||||
Anders Gustafsson, James Bursa, Kristian Gunstone, Feng Tu,
|
Anders Gustafsson, James Bursa, Kristian Gunstone, Feng Tu,
|
||||||
Andre Guibert de Bruet, Rob Crittenden
|
Andre Guibert de Bruet, Rob Crittenden, Rich Rauenzahn, Tom Regner,
|
||||||
|
Dave Vasilevsky, Shmulik Regev, Robson Braga Araujo, Adam Piggott,
|
||||||
|
Gerrit Bruchh<68>user
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
|||||||
@@ -1,24 +1,9 @@
|
|||||||
This is what's new and changed in the c-ares 1.4.0 release:
|
This is what's new and changed in the c-ares 1.4.1 release:
|
||||||
|
|
||||||
o fixed VS2005 compiler warnings due to time_t being 64bit
|
o
|
||||||
o introduced cryptographically secure transaction IDs
|
|
||||||
o added ares_save_options()
|
|
||||||
o added ares_destroy_options()
|
|
||||||
o added ares_process_fd()
|
|
||||||
o fixed undefined return value in init_by_resolv_conf() function for windows
|
|
||||||
o added ares_parse_ns_reply()
|
|
||||||
o fix failure to get the search sequence of /etc/hosts and DNS from
|
|
||||||
/etc/nsswitch.conf, /etc/host.conf or /etc/svc.conf when /etc/resolv.conf
|
|
||||||
did not exist
|
|
||||||
o when domains were sert in the options struct, and there were domain/search
|
|
||||||
entries in /etc/resolv.conf, the domains of the options struct would be
|
|
||||||
overridden
|
|
||||||
o removed a couple of potential zero size memory allocations
|
|
||||||
o fixed the line endings in areslib.dsp
|
|
||||||
|
|
||||||
Thanks go to these friendly people for their efforts and contributions:
|
Thanks go to these friendly people for their efforts and contributions:
|
||||||
|
|
||||||
Andreas Rieke, Yang Tse, Michael Wallner, Vlad Dinulescu, Ravi Pratap,
|
|
||||||
Brad House, Shmulik Regev, Brad Spencer
|
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
#define ARES_VERSION_MAJOR 1
|
#define ARES_VERSION_MAJOR 1
|
||||||
#define ARES_VERSION_MINOR 4
|
#define ARES_VERSION_MINOR 4
|
||||||
#define ARES_VERSION_PATCH 0
|
#define ARES_VERSION_PATCH 1
|
||||||
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
#define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\
|
||||||
(ARES_VERSION_MINOR<<8)|\
|
(ARES_VERSION_MINOR<<8)|\
|
||||||
(ARES_VERSION_PATCH))
|
(ARES_VERSION_PATCH))
|
||||||
#define ARES_VERSION_STR "1.4.0-CVS"
|
#define ARES_VERSION_STR "1.4.1-CVS"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -204,6 +204,9 @@ dnl The install stuff has already been taken care of by the automake stuff
|
|||||||
dnl AC_PROG_INSTALL
|
dnl AC_PROG_INSTALL
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
|
dnl check if there's a way to force code inline
|
||||||
|
AC_C_INLINE
|
||||||
|
|
||||||
dnl **********************************************************************
|
dnl **********************************************************************
|
||||||
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
|
||||||
dnl and ws2tcpip.h take precedence over any other further checks which
|
dnl and ws2tcpip.h take precedence over any other further checks which
|
||||||
|
|||||||
4
docs/FAQ
4
docs/FAQ
@@ -755,7 +755,9 @@ FAQ
|
|||||||
4.9 Curl can't authenticate to the server that requires NTLM?
|
4.9 Curl can't authenticate to the server that requires NTLM?
|
||||||
|
|
||||||
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
This is supported in curl 7.10.6 or later. No earlier curl version knows
|
||||||
of this magic.
|
of this magic. Later versions require the OpenSSL or Microsoft Windows
|
||||||
|
libraries to provide this functionality. Using GnuTLS or NSS libraries will
|
||||||
|
not provide NTLM authentication functionality in curl.
|
||||||
|
|
||||||
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
NTLM is a Microsoft proprietary protocol. Proprietary formats are evil. You
|
||||||
should not use such ones.
|
should not use such ones.
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ join in and help us correct one or more of these! Also be sure to check the
|
|||||||
changelog of the current development status, as one or more of these problems
|
changelog of the current development status, as one or more of these problems
|
||||||
may have been fixed since this was written!
|
may have been fixed since this was written!
|
||||||
|
|
||||||
|
44. --ftp-method nocwd does not handle URLs ending with a slash properly (it
|
||||||
|
should list the contents of that directory). See test case 351.
|
||||||
|
|
||||||
43. There seems to be a problem when connecting to the Microsoft telnet server.
|
43. There seems to be a problem when connecting to the Microsoft telnet server.
|
||||||
http://curl.haxx.se/bug/view.cgi?id=1720605
|
http://curl.haxx.se/bug/view.cgi?id=1720605
|
||||||
|
|
||||||
@@ -11,9 +14,6 @@ may have been fixed since this was written!
|
|||||||
and thus fails to issue the correct command:
|
and thus fails to issue the correct command:
|
||||||
http://curl.haxx.se/bug/view.cgi?id=1693337
|
http://curl.haxx.se/bug/view.cgi?id=1693337
|
||||||
|
|
||||||
40. Mac OS X test failures (Daniel Johnson)
|
|
||||||
http://curl.haxx.se/mail/lib-2007-03/0095.html
|
|
||||||
|
|
||||||
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
|
39. Steffen Rumler's Race Condition in Curl_proxyCONNECT:
|
||||||
http://curl.haxx.se/mail/lib-2007-01/0045.html
|
http://curl.haxx.se/mail/lib-2007-01/0045.html
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,8 @@ local directory hierarchy as needed. This option creates the dirs mentioned
|
|||||||
with the -o option, nothing else. If the -o file name uses no dir or if the
|
with the -o option, nothing else. If the -o file name uses no dir or if the
|
||||||
dirs it mentions already exist, no dir will be created.
|
dirs it mentions already exist, no dir will be created.
|
||||||
|
|
||||||
To create remote directories when using FTP, try \fI--ftp-create-dirs\fP.
|
To create remote directories when using FTP or SFTP, try
|
||||||
|
\fI--ftp-create-dirs\fP.
|
||||||
.IP "--crlf"
|
.IP "--crlf"
|
||||||
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
(FTP) Convert LF to CRLF in upload. Useful for MVS (OS/390).
|
||||||
|
|
||||||
@@ -382,7 +383,7 @@ has been provided, this data is sent off using the ACCT command. (Added in
|
|||||||
|
|
||||||
If this option is used twice, the second will override the previous use.
|
If this option is used twice, the second will override the previous use.
|
||||||
.IP "--ftp-create-dirs"
|
.IP "--ftp-create-dirs"
|
||||||
(FTP) When an FTP URL/operation uses a path that doesn't currently exist on
|
(FTP) When an FTP or SFTP URL/operation uses a path that doesn't currently exist on
|
||||||
the server, the standard behavior of curl is to fail. Using this option, curl
|
the server, the standard behavior of curl is to fail. Using this option, curl
|
||||||
will instead attempt to create missing directories.
|
will instead attempt to create missing directories.
|
||||||
|
|
||||||
|
|||||||
@@ -890,6 +890,11 @@ If the server is an IPv6 host, this option will have no effect as of 7.12.3.
|
|||||||
Pass a long. If the value is non-zero, curl will attempt to create any remote
|
Pass a long. If the value is non-zero, curl will attempt to create any remote
|
||||||
directory that it fails to CWD into. CWD is the command that changes working
|
directory that it fails to CWD into. CWD is the command that changes working
|
||||||
directory. (Added in 7.10.7)
|
directory. (Added in 7.10.7)
|
||||||
|
|
||||||
|
This setting also applies to SFTP-connections. curl will attempt to create
|
||||||
|
the remote directory if it can't obtain a handle to the target-location. The
|
||||||
|
creation will fail if a file of the same name as the directory to create
|
||||||
|
already exists or lack of permissions prevents creation. (Added in 7.16.3)
|
||||||
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
|
.IP CURLOPT_FTP_RESPONSE_TIMEOUT
|
||||||
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
|
Pass a long. Causes curl to set a timeout period (in seconds) on the amount
|
||||||
of time that the server is allowed to take in order to generate a response
|
of time that the server is allowed to take in order to generate a response
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-0.14
|
LIBSSH2_PATH = ../../libssh2-0.15
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef INSTDIR
|
ifndef INSTDIR
|
||||||
@@ -47,10 +47,10 @@ ifndef LIBARCH
|
|||||||
LIBARCH = LIBC
|
LIBARCH = LIBC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to NDEBUG or DEBUG, CURLDEBUG
|
||||||
|
ifndef DB
|
||||||
DB = NDEBUG
|
DB = NDEBUG
|
||||||
# DB = DEBUG
|
endif
|
||||||
# DB = CURLDEBUG
|
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -274,7 +274,7 @@ ifdef SCREEN
|
|||||||
else
|
else
|
||||||
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
ifeq ($(DB),DEBUG)
|
ifneq ($(DB),NDEBUG)
|
||||||
@echo $(DL)debug$(DL) >> $@
|
@echo $(DL)debug$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
||||||
|
|||||||
37
lib/ftp.c
37
lib/ftp.c
@@ -1253,9 +1253,8 @@ static CURLcode ftp_state_post_rest(struct connectdata *conn)
|
|||||||
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
|
|
||||||
if(ftp->no_transfer || conn->bits.no_body) {
|
if(ftp->no_transfer) {
|
||||||
/* doesn't transfer any data */
|
/* doesn't transfer any data */
|
||||||
ftp->no_transfer = TRUE;
|
|
||||||
|
|
||||||
/* still possibly do PRE QUOTE jobs */
|
/* still possibly do PRE QUOTE jobs */
|
||||||
state(conn, FTP_RETR_PREQUOTE);
|
state(conn, FTP_RETR_PREQUOTE);
|
||||||
@@ -3351,7 +3350,7 @@ CURLcode Curl_ftp_nextconnect(struct connectdata *conn)
|
|||||||
|
|
||||||
DEBUGF(infof(data, "DO-MORE phase starts\n"));
|
DEBUGF(infof(data, "DO-MORE phase starts\n"));
|
||||||
|
|
||||||
if(!ftp->no_transfer && !conn->bits.no_body) {
|
if(!ftp->no_transfer) {
|
||||||
/* a transfer is about to take place */
|
/* a transfer is about to take place */
|
||||||
|
|
||||||
if(data->set.upload) {
|
if(data->set.upload) {
|
||||||
@@ -3415,6 +3414,13 @@ CURLcode ftp_perform(struct connectdata *conn,
|
|||||||
|
|
||||||
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
DEBUGF(infof(conn->data, "DO phase starts\n"));
|
||||||
|
|
||||||
|
if(conn->bits.no_body) {
|
||||||
|
/* requested no body means no transfer... */
|
||||||
|
struct FTP *ftp = conn->data->reqdata.proto.ftp;
|
||||||
|
ftp->no_transfer = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*dophase_done = FALSE; /* not done yet */
|
*dophase_done = FALSE; /* not done yet */
|
||||||
|
|
||||||
/* start the first command in the DO phase */
|
/* start the first command in the DO phase */
|
||||||
@@ -3691,6 +3697,12 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
|
|
||||||
case FTPFILE_SINGLECWD:
|
case FTPFILE_SINGLECWD:
|
||||||
/* get the last slash */
|
/* get the last slash */
|
||||||
|
if(!path_to_use[0]) {
|
||||||
|
/* no dir, no file */
|
||||||
|
ftpc->dirdepth = 0;
|
||||||
|
ftp->file = NULL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
slash_pos=strrchr(cur_pos, '/');
|
slash_pos=strrchr(cur_pos, '/');
|
||||||
if(slash_pos || !*cur_pos) {
|
if(slash_pos || !*cur_pos) {
|
||||||
ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0]));
|
ftpc->dirs = (char **)calloc(1, sizeof(ftpc->dirs[0]));
|
||||||
@@ -3719,6 +3731,13 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
if(!ftpc->dirs)
|
if(!ftpc->dirs)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
/* we have a special case for listing the root dir only */
|
||||||
|
if(strequal(path_to_use, "/")) {
|
||||||
|
cur_pos++; /* make it point to the zero byte */
|
||||||
|
ftpc->dirs[0] = strdup("/");
|
||||||
|
ftpc->dirdepth++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* parse the URL path into separate path components */
|
/* parse the URL path into separate path components */
|
||||||
while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
|
||||||
/* 1 or 0 to indicate absolute directory */
|
/* 1 or 0 to indicate absolute directory */
|
||||||
@@ -3731,9 +3750,8 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
CWD requires a parameter and a non-existant parameter a) doesn't
|
CWD requires a parameter and a non-existant parameter a) doesn't
|
||||||
work on many servers and b) has no effect on the others. */
|
work on many servers and b) has no effect on the others. */
|
||||||
int len = (int)(slash_pos - cur_pos + absolute_dir);
|
int len = (int)(slash_pos - cur_pos + absolute_dir);
|
||||||
ftpc->dirs[ftpc->dirdepth] = curl_easy_unescape(conn->data,
|
ftpc->dirs[ftpc->dirdepth] =
|
||||||
cur_pos - absolute_dir,
|
curl_easy_unescape(conn->data, cur_pos - absolute_dir, len, NULL);
|
||||||
len, NULL);
|
|
||||||
if (!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
if (!ftpc->dirs[ftpc->dirdepth]) { /* run out of memory ... */
|
||||||
failf(data, "no memory");
|
failf(data, "no memory");
|
||||||
freedirs(conn);
|
freedirs(conn);
|
||||||
@@ -3763,11 +3781,11 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
ftpc->dirs = (char **)bigger;
|
ftpc->dirs = (char **)bigger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ftp->file = cur_pos; /* the rest is the file name */
|
ftp->file = cur_pos; /* the rest is the file name */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(*ftp->file) {
|
if(ftp->file && *ftp->file) {
|
||||||
ftp->file = curl_easy_unescape(conn->data, ftp->file, 0, NULL);
|
ftp->file = curl_easy_unescape(conn->data, ftp->file, 0, NULL);
|
||||||
if(NULL == ftp->file) {
|
if(NULL == ftp->file) {
|
||||||
freedirs(conn);
|
freedirs(conn);
|
||||||
@@ -3783,8 +3801,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
|||||||
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
ftp->file=NULL; /* instead of point to a zero byte, we make it a NULL
|
||||||
pointer */
|
pointer */
|
||||||
|
|
||||||
if(data->set.upload && !ftp->file &&
|
if(data->set.upload && !ftp->file && !ftp->no_transfer) {
|
||||||
(!ftp->no_transfer || conn->bits.no_body)) {
|
|
||||||
/* We need a file name when uploading. Return error! */
|
/* We need a file name when uploading. Return error! */
|
||||||
failf(data, "Uploading to a URL without a file name!");
|
failf(data, "Uploading to a URL without a file name!");
|
||||||
return CURLE_URL_MALFORMAT;
|
return CURLE_URL_MALFORMAT;
|
||||||
|
|||||||
@@ -253,8 +253,10 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
tvp = ares_timeout(data->state.areschannel, &store, &tv);
|
tvp = ares_timeout(data->state.areschannel, &store, &tv);
|
||||||
|
|
||||||
if(!ares_waitperform(conn, tv.tv_sec * 1000 + tv.tv_usec/1000))
|
/* use the timeout period ares returned to us above */
|
||||||
/* no sockets to wait on, get out of the loop */
|
ares_waitperform(conn, tv.tv_sec * 1000 + tv.tv_usec/1000);
|
||||||
|
|
||||||
|
if(conn->async.done)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */
|
timediff = Curl_tvdiff(Curl_tvnow(), now); /* spent time */
|
||||||
|
|||||||
@@ -179,28 +179,21 @@ struct thread_sync_data {
|
|||||||
static
|
static
|
||||||
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
void destroy_thread_sync_data(struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
if (tsd->hostname) {
|
if (tsd->hostname)
|
||||||
free(tsd->hostname);
|
free(tsd->hostname);
|
||||||
tsd->hostname = NULL;
|
if (tsd->event_terminate)
|
||||||
}
|
|
||||||
if (tsd->event_terminate) {
|
|
||||||
CloseHandle(tsd->event_terminate);
|
CloseHandle(tsd->event_terminate);
|
||||||
tsd->event_terminate = NULL;
|
if (tsd->mutex_terminate)
|
||||||
}
|
|
||||||
if (tsd->mutex_terminate) {
|
|
||||||
CloseHandle(tsd->mutex_terminate);
|
CloseHandle(tsd->mutex_terminate);
|
||||||
tsd->mutex_terminate = NULL;
|
if (tsd->mutex_waiting)
|
||||||
}
|
|
||||||
if (tsd->mutex_waiting) {
|
|
||||||
CloseHandle(tsd->mutex_waiting);
|
CloseHandle(tsd->mutex_waiting);
|
||||||
tsd->mutex_waiting = NULL;
|
memset(tsd,0,sizeof(*tsd));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize resolver thread synchronization data */
|
/* Initialize resolver thread synchronization data */
|
||||||
static
|
static
|
||||||
BOOL init_thread_sync_data(struct thread_data * td,
|
BOOL init_thread_sync_data(struct thread_data * td,
|
||||||
char * hostname,
|
const char * hostname,
|
||||||
struct thread_sync_data * tsd)
|
struct thread_sync_data * tsd)
|
||||||
{
|
{
|
||||||
HANDLE curr_proc = GetCurrentProcess();
|
HANDLE curr_proc = GetCurrentProcess();
|
||||||
@@ -293,6 +286,7 @@ static unsigned __stdcall gethostbyname_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
struct thread_sync_data tsd = { 0,0,0,NULL };
|
struct thread_sync_data tsd = { 0,0,0,NULL };
|
||||||
|
|
||||||
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return (unsigned)-1;
|
return (unsigned)-1;
|
||||||
@@ -353,6 +347,7 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
|
|||||||
* due to a resolver timeout.
|
* due to a resolver timeout.
|
||||||
*/
|
*/
|
||||||
struct thread_sync_data tsd = { 0,0,0,NULL };
|
struct thread_sync_data tsd = { 0,0,0,NULL };
|
||||||
|
|
||||||
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
if (!init_thread_sync_data(td, conn->async.hostname, &tsd)) {
|
||||||
/* thread synchronization data initialization failed */
|
/* thread synchronization data initialization failed */
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -1007,7 +1007,14 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
|
|||||||
if(!protocol_connect) {
|
if(!protocol_connect) {
|
||||||
/* We have a TCP connection, but 'protocol_connect' may be false
|
/* We have a TCP connection, but 'protocol_connect' may be false
|
||||||
and then we continue to 'STATE_PROTOCONNECT'. If protocol
|
and then we continue to 'STATE_PROTOCONNECT'. If protocol
|
||||||
connect is TRUE, we move on to STATE_DO. */
|
connect is TRUE, we move on to STATE_DO.
|
||||||
|
BUT if we are using a proxy we must change to WAITPROXYCONNECT
|
||||||
|
*/
|
||||||
|
#ifndef CURL_DISABLE_HTTP
|
||||||
|
if (easy->easy_conn->bits.tunnel_connecting)
|
||||||
|
multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
multistate(easy, CURLM_STATE_PROTOCONNECT);
|
multistate(easy, CURLM_STATE_PROTOCONNECT);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
* Definition of pollfd struct and constants for platforms lacking them.
|
* Definition of pollfd struct and constants for platforms lacking them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef HAVE_POLL
|
#ifndef HAVE_SYS_POLL_H
|
||||||
|
|
||||||
#define POLLIN 0x01
|
#define POLLIN 0x01
|
||||||
#define POLLPRI 0x02
|
#define POLLPRI 0x02
|
||||||
|
|||||||
@@ -365,5 +365,87 @@ typedef int sig_atomic_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (__LP64__) && defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED)
|
||||||
|
#include <sys/socket.h>
|
||||||
|
/* HP-UX has this oddity where it features a few functions that don't work
|
||||||
|
with socklen_t so we need to convert to ints
|
||||||
|
|
||||||
|
This is due to socklen_t being a 64bit int under 64bit ABI, but the
|
||||||
|
pre-xopen (default) interfaces require an int, which is 32bits.
|
||||||
|
|
||||||
|
Therefore, Anytime socklen_t is passed by pointer, the libc function
|
||||||
|
truncates the 64bit socklen_t value by treating it as a 32bit value.
|
||||||
|
|
||||||
|
|
||||||
|
Note that some socket calls are allowed to have a NULL pointer for
|
||||||
|
the socklen arg.
|
||||||
|
*/
|
||||||
|
|
||||||
|
inline static int Curl_hp_getsockname(int s, struct sockaddr *name,
|
||||||
|
socklen_t *namelen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(namelen) {
|
||||||
|
int len = *namelen;
|
||||||
|
rc = getsockname(s, name, &len);
|
||||||
|
*namelen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = getsockname(s, name, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static int Curl_hp_getsockopt(int s, int level, int optname,
|
||||||
|
void *optval, socklen_t *optlen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(optlen) {
|
||||||
|
int len = *optlen;
|
||||||
|
rc = getsockopt(s, level, optname, optval, &len);
|
||||||
|
*optlen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = getsockopt(s, level, optname, optval, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static int Curl_hp_accept(int sockfd, struct sockaddr *addr,
|
||||||
|
socklen_t *addrlen)
|
||||||
|
{
|
||||||
|
int rc;
|
||||||
|
if(addrlen) {
|
||||||
|
int len = *addrlen;
|
||||||
|
rc = accept(sockfd, addr, &len);
|
||||||
|
*addrlen = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rc = accept(sockfd, addr, 0);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline static ssize_t Curl_hp_recvfrom(int s, void *buf, size_t len, int flags,
|
||||||
|
struct sockaddr *from,
|
||||||
|
socklen_t *fromlen)
|
||||||
|
{
|
||||||
|
ssize_t rc;
|
||||||
|
if(fromlen) {
|
||||||
|
int fromlen32 = *fromlen;
|
||||||
|
rc = recvfrom(s, buf, len, flags, from, &fromlen32);
|
||||||
|
*fromlen = fromlen32;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rc = recvfrom(s, buf, len, flags, from, 0);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define getsockname(a,b,c) Curl_hp_getsockname((a),(b),(c))
|
||||||
|
#define getsockopt(a,b,c,d,e) Curl_hp_getsockopt((a),(b),(c),(d),(e))
|
||||||
|
#define accept(a,b,c) Curl_hp_accept((a),(b),(c))
|
||||||
|
#define recvfrom(a,b,c,d,e,f) Curl_hp_recvfrom((a),(b),(c),(d),(e),(f))
|
||||||
|
|
||||||
|
#endif /* HPUX work-around */
|
||||||
|
|
||||||
#endif /* __SETUP_ONCE_H */
|
#endif /* __SETUP_ONCE_H */
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#ifdef USE_LIBSSH2
|
#ifdef USE_LIBSSH2
|
||||||
|
|
||||||
CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done);
|
CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done);
|
||||||
|
CURLcode Curl_ssh_multi_statemach(struct connectdata *conn, bool *done);
|
||||||
|
|
||||||
CURLcode Curl_scp_do(struct connectdata *conn, bool *done);
|
CURLcode Curl_scp_do(struct connectdata *conn, bool *done);
|
||||||
CURLcode Curl_scp_done(struct connectdata *conn, CURLcode, bool premature);
|
CURLcode Curl_scp_done(struct connectdata *conn, CURLcode, bool premature);
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ typedef struct tftp_state_data {
|
|||||||
time_t max_time;
|
time_t max_time;
|
||||||
unsigned short block;
|
unsigned short block;
|
||||||
struct Curl_sockaddr_storage local_addr;
|
struct Curl_sockaddr_storage local_addr;
|
||||||
socklen_t local_addrlen;
|
|
||||||
struct Curl_sockaddr_storage remote_addr;
|
struct Curl_sockaddr_storage remote_addr;
|
||||||
socklen_t remote_addrlen;
|
socklen_t remote_addrlen;
|
||||||
int rbytes;
|
int rbytes;
|
||||||
|
|||||||
@@ -379,7 +379,6 @@ CURLcode Curl_readwrite(struct connectdata *conn,
|
|||||||
/* receive data from the network! */
|
/* receive data from the network! */
|
||||||
readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread);
|
readrc = Curl_read(conn, conn->sockfd, k->buf, bytestoread, &nread);
|
||||||
|
|
||||||
DEBUGF(infof(data, "Read %ld bytes from stream (readrc = %d)\n", nread, readrc));
|
|
||||||
/* subzero, this would've blocked */
|
/* subzero, this would've blocked */
|
||||||
if(0 > readrc)
|
if(0 > readrc)
|
||||||
break; /* get out of loop */
|
break; /* get out of loop */
|
||||||
|
|||||||
@@ -378,8 +378,11 @@ CURLcode Curl_close(struct SessionHandle *data)
|
|||||||
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
|
#endif /* CURL_DOES_CONVERSIONS && HAVE_ICONV */
|
||||||
|
|
||||||
/* No longer a dirty share, if it exists */
|
/* No longer a dirty share, if it exists */
|
||||||
if (data->share)
|
if (data->share) {
|
||||||
|
Curl_share_lock(data, CURL_LOCK_DATA_SHARE, CURL_LOCK_ACCESS_SINGLE);
|
||||||
data->share->dirty--;
|
data->share->dirty--;
|
||||||
|
Curl_share_unlock(data, CURL_LOCK_DATA_SHARE);
|
||||||
|
}
|
||||||
|
|
||||||
free(data);
|
free(data);
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
|
|||||||
@@ -406,6 +406,31 @@ struct ftp_conn {
|
|||||||
ftpstate state; /* always use ftp.c:state() to change state! */
|
ftpstate state; /* always use ftp.c:state() to change state! */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* SSH unique setup
|
||||||
|
***************************************************************************/
|
||||||
|
typedef enum {
|
||||||
|
SSH_STOP, /* do nothing state, stops the state machine */
|
||||||
|
SSH_S_STARTUP, /* Session startup */
|
||||||
|
SSH_AUTHLIST,
|
||||||
|
SSH_AUTH_PKEY_INIT,
|
||||||
|
SSH_AUTH_PKEY,
|
||||||
|
SSH_AUTH_PASS_INIT,
|
||||||
|
SSH_AUTH_PASS,
|
||||||
|
SSH_AUTH_HOST_INIT,
|
||||||
|
SSH_AUTH_HOST,
|
||||||
|
SSH_AUTH_KEY_INIT,
|
||||||
|
SSH_AUTH_KEY,
|
||||||
|
SSH_AUTH_DONE,
|
||||||
|
SSH_SFTP_INIT,
|
||||||
|
SSH_SFTP_REALPATH,
|
||||||
|
SSH_GET_WORKINGPATH,
|
||||||
|
SSH_SFTP_SHUTDOWN,
|
||||||
|
SSH_SESSION_FREE,
|
||||||
|
SSH_QUIT,
|
||||||
|
SSH_LAST /* never used */
|
||||||
|
} sshstate;
|
||||||
|
|
||||||
struct SSHPROTO {
|
struct SSHPROTO {
|
||||||
curl_off_t *bytecountp;
|
curl_off_t *bytecountp;
|
||||||
char *user;
|
char *user;
|
||||||
@@ -421,6 +446,18 @@ struct SSHPROTO {
|
|||||||
#endif /* USE_LIBSSH2 */
|
#endif /* USE_LIBSSH2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ssh_conn is used for struct connection-oriented data in the connectdata
|
||||||
|
struct */
|
||||||
|
struct ssh_conn {
|
||||||
|
const char *authlist; /* List of auth. methods, managed by libssh2 */
|
||||||
|
const char *passphrase;
|
||||||
|
char *rsa_pub;
|
||||||
|
char *rsa;
|
||||||
|
bool authed;
|
||||||
|
sshstate state; /* always use ssh.c:state() to change state! */
|
||||||
|
CURLcode actualCode; /* the actual error code */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* FILE unique setup
|
* FILE unique setup
|
||||||
@@ -900,6 +937,7 @@ struct connectdata {
|
|||||||
|
|
||||||
union {
|
union {
|
||||||
struct ftp_conn ftpc;
|
struct ftp_conn ftpc;
|
||||||
|
struct ssh_conn sshc;
|
||||||
} proto;
|
} proto;
|
||||||
|
|
||||||
int cselect_bits; /* bitmask of socket events */
|
int cselect_bits; /* bitmask of socket events */
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ endif
|
|||||||
|
|
||||||
# Edit the path below to point to the base of your LibSSH2 package.
|
# Edit the path below to point to the base of your LibSSH2 package.
|
||||||
ifndef LIBSSH2_PATH
|
ifndef LIBSSH2_PATH
|
||||||
LIBSSH2_PATH = ../../libssh2-0.14
|
LIBSSH2_PATH = ../../libssh2-0.15
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef INSTDIR
|
ifndef INSTDIR
|
||||||
@@ -48,9 +48,10 @@ ifndef LIBARCH
|
|||||||
LIBARCH = LIBC
|
LIBARCH = LIBC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# must be equal to DEBUG or NDEBUG
|
# must be equal to NDEBUG or DEBUG, CURLDEBUG
|
||||||
|
ifndef DB
|
||||||
DB = NDEBUG
|
DB = NDEBUG
|
||||||
# DB = DEBUG
|
endif
|
||||||
# Optimization: -O<n> or debugging: -g
|
# Optimization: -O<n> or debugging: -g
|
||||||
ifeq ($(DB),NDEBUG)
|
ifeq ($(DB),NDEBUG)
|
||||||
OPT = -O2
|
OPT = -O2
|
||||||
@@ -252,7 +253,7 @@ ifdef SCREEN
|
|||||||
else
|
else
|
||||||
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
@echo $(DL)screenname "DEFAULT"$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
ifeq ($(DB),DEBUG)
|
ifneq ($(DB),NDEBUG)
|
||||||
@echo $(DL)debug$(DL) >> $@
|
@echo $(DL)debug$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
@echo $(DL)threadname "$(TARGET)"$(DL) >> $@
|
||||||
|
|||||||
12
src/main.c
12
src/main.c
@@ -3354,13 +3354,15 @@ output_expected(const char* url, const char* uploadfile)
|
|||||||
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
return FALSE; /* non-HTTP upload, probably no output should be expected */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define my_setopt(x,y,z) _my_setopt(x, #y, y, z)
|
#define my_setopt(x,y,z) _my_setopt(x, config, #y, y, z)
|
||||||
|
|
||||||
static struct curl_slist *easycode;
|
static struct curl_slist *easycode;
|
||||||
|
|
||||||
CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...);
|
CURLcode _my_setopt(CURL *curl, struct Configurable *config, const char *name,
|
||||||
|
CURLoption tag, ...);
|
||||||
|
|
||||||
CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
CURLcode _my_setopt(CURL *curl, struct Configurable *config, const char *name,
|
||||||
|
CURLoption tag, ...)
|
||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
CURLcode ret;
|
CURLcode ret;
|
||||||
@@ -3409,6 +3411,9 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
ret = curl_easy_setopt(curl, tag, oval);
|
ret = curl_easy_setopt(curl, tag, oval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(config->libcurl) {
|
||||||
|
/* we only use this for real if --libcurl was used */
|
||||||
|
|
||||||
bufp = curl_maprintf("%scurl_easy_setopt(hnd, %s, %s);%s",
|
bufp = curl_maprintf("%scurl_easy_setopt(hnd, %s, %s);%s",
|
||||||
remark?"/* ":"", name, value,
|
remark?"/* ":"", name, value,
|
||||||
remark?" [REMARK] */":"");
|
remark?" [REMARK] */":"");
|
||||||
@@ -3417,6 +3422,7 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
ret = CURLE_OUT_OF_MEMORY;
|
ret = CURLE_OUT_OF_MEMORY;
|
||||||
if (bufp)
|
if (bufp)
|
||||||
curl_free(bufp);
|
curl_free(bufp);
|
||||||
|
}
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -4,3 +4,4 @@
|
|||||||
# per line.
|
# per line.
|
||||||
# Lines starting with '#' letters are treated as comments.
|
# Lines starting with '#' letters are treated as comments.
|
||||||
#230
|
#230
|
||||||
|
351
|
||||||
|
|||||||
@@ -41,4 +41,5 @@ EXTRA_DIST = test1 test108 test117 test127 test20 test27 test34 test46 \
|
|||||||
test603 test401 test402 test290 test291 test292 test293 test403 test404 \
|
test603 test401 test402 test290 test291 test292 test293 test403 test404 \
|
||||||
test405 test604 test605 test606 test607 test608 test609 test294 test295 \
|
test405 test604 test605 test606 test607 test608 test609 test294 test295 \
|
||||||
test296 test297 test298 test610 test611 test612 test406 test407 test408 \
|
test296 test297 test298 test610 test611 test612 test406 test407 test408 \
|
||||||
test409 test613 test614 test700 test701 test702 test704 test705 test703
|
test409 test613 test614 test700 test701 test702 test704 test705 test703 \
|
||||||
|
test706 test707 test350 test351 test352 test353
|
||||||
|
|||||||
57
tests/data/test350
Normal file
57
tests/data/test350
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list multicwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method multicwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
CWD /
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
56
tests/data/test351
Normal file
56
tests/data/test351
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list nocwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method nocwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST /
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
57
tests/data/test352
Normal file
57
tests/data/test352
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP root dir list singlecwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT// --ftp-method singlecwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
CWD /
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
56
tests/data/test353
Normal file
56
tests/data/test353
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<testcase>
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP home dir list singlecwd
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
ftp://%HOSTIP:%FTPPORT/ --ftp-method singlecwd
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
@@ -90,60 +90,66 @@ lock: dns <Pigs in space>: 16
|
|||||||
unlock: dns <Pigs in space>: 17
|
unlock: dns <Pigs in space>: 17
|
||||||
lock: cookie <Pigs in space>: 18
|
lock: cookie <Pigs in space>: 18
|
||||||
unlock: cookie <Pigs in space>: 19
|
unlock: cookie <Pigs in space>: 19
|
||||||
*** run 2
|
|
||||||
CURLOPT_SHARE
|
|
||||||
lock: share <Pigs in space>: 20
|
lock: share <Pigs in space>: 20
|
||||||
unlock: share <Pigs in space>: 21
|
unlock: share <Pigs in space>: 21
|
||||||
|
*** run 2
|
||||||
|
CURLOPT_SHARE
|
||||||
|
lock: share <Pigs in space>: 22
|
||||||
|
unlock: share <Pigs in space>: 23
|
||||||
PERFORM
|
PERFORM
|
||||||
lock: dns <Pigs in space>: 22
|
|
||||||
unlock: dns <Pigs in space>: 23
|
|
||||||
lock: dns <Pigs in space>: 24
|
lock: dns <Pigs in space>: 24
|
||||||
unlock: dns <Pigs in space>: 25
|
unlock: dns <Pigs in space>: 25
|
||||||
lock: cookie <Pigs in space>: 26
|
lock: dns <Pigs in space>: 26
|
||||||
unlock: cookie <Pigs in space>: 27
|
unlock: dns <Pigs in space>: 27
|
||||||
lock: cookie <Pigs in space>: 28
|
lock: cookie <Pigs in space>: 28
|
||||||
unlock: cookie <Pigs in space>: 29
|
unlock: cookie <Pigs in space>: 29
|
||||||
lock: cookie <Pigs in space>: 30
|
lock: cookie <Pigs in space>: 30
|
||||||
unlock: cookie <Pigs in space>: 31
|
unlock: cookie <Pigs in space>: 31
|
||||||
|
lock: cookie <Pigs in space>: 32
|
||||||
|
unlock: cookie <Pigs in space>: 33
|
||||||
run 2: set cookie 4 and 5
|
run 2: set cookie 4 and 5
|
||||||
lock: dns <Pigs in space>: 32
|
|
||||||
unlock: dns <Pigs in space>: 33
|
|
||||||
CLEANUP
|
|
||||||
lock: dns <Pigs in space>: 34
|
lock: dns <Pigs in space>: 34
|
||||||
unlock: dns <Pigs in space>: 35
|
unlock: dns <Pigs in space>: 35
|
||||||
lock: cookie <Pigs in space>: 36
|
CLEANUP
|
||||||
unlock: cookie <Pigs in space>: 37
|
lock: dns <Pigs in space>: 36
|
||||||
|
unlock: dns <Pigs in space>: 37
|
||||||
|
lock: cookie <Pigs in space>: 38
|
||||||
|
unlock: cookie <Pigs in space>: 39
|
||||||
|
lock: share <Pigs in space>: 40
|
||||||
|
unlock: share <Pigs in space>: 41
|
||||||
*** run 3
|
*** run 3
|
||||||
CURLOPT_SHARE
|
CURLOPT_SHARE
|
||||||
lock: share <Pigs in space>: 38
|
lock: share <Pigs in space>: 42
|
||||||
unlock: share <Pigs in space>: 39
|
unlock: share <Pigs in space>: 43
|
||||||
CURLOPT_COOKIEJAR
|
CURLOPT_COOKIEJAR
|
||||||
PERFORM
|
PERFORM
|
||||||
lock: dns <Pigs in space>: 40
|
lock: dns <Pigs in space>: 44
|
||||||
unlock: dns <Pigs in space>: 41
|
unlock: dns <Pigs in space>: 45
|
||||||
lock: dns <Pigs in space>: 42
|
lock: dns <Pigs in space>: 46
|
||||||
unlock: dns <Pigs in space>: 43
|
unlock: dns <Pigs in space>: 47
|
||||||
lock: cookie <Pigs in space>: 44
|
|
||||||
unlock: cookie <Pigs in space>: 45
|
|
||||||
lock: cookie <Pigs in space>: 46
|
|
||||||
unlock: cookie <Pigs in space>: 47
|
|
||||||
lock: cookie <Pigs in space>: 48
|
lock: cookie <Pigs in space>: 48
|
||||||
unlock: cookie <Pigs in space>: 49
|
unlock: cookie <Pigs in space>: 49
|
||||||
|
lock: cookie <Pigs in space>: 50
|
||||||
|
unlock: cookie <Pigs in space>: 51
|
||||||
|
lock: cookie <Pigs in space>: 52
|
||||||
|
unlock: cookie <Pigs in space>: 53
|
||||||
run 3: overwrite cookie 1 and 4
|
run 3: overwrite cookie 1 and 4
|
||||||
lock: dns <Pigs in space>: 50
|
|
||||||
unlock: dns <Pigs in space>: 51
|
|
||||||
try SHARE_CLEANUP...
|
|
||||||
lock: share <Pigs in space>: 52
|
|
||||||
unlock: share <Pigs in space>: 53
|
|
||||||
SHARE_CLEANUP failed, correct
|
|
||||||
CLEANUP
|
|
||||||
lock: dns <Pigs in space>: 54
|
lock: dns <Pigs in space>: 54
|
||||||
unlock: dns <Pigs in space>: 55
|
unlock: dns <Pigs in space>: 55
|
||||||
lock: cookie <Pigs in space>: 56
|
try SHARE_CLEANUP...
|
||||||
unlock: cookie <Pigs in space>: 57
|
lock: share <Pigs in space>: 56
|
||||||
|
unlock: share <Pigs in space>: 57
|
||||||
|
SHARE_CLEANUP failed, correct
|
||||||
|
CLEANUP
|
||||||
|
lock: dns <Pigs in space>: 58
|
||||||
|
unlock: dns <Pigs in space>: 59
|
||||||
|
lock: cookie <Pigs in space>: 60
|
||||||
|
unlock: cookie <Pigs in space>: 61
|
||||||
|
lock: share <Pigs in space>: 62
|
||||||
|
unlock: share <Pigs in space>: 63
|
||||||
SHARE_CLEANUP
|
SHARE_CLEANUP
|
||||||
lock: share <Pigs in space>: 58
|
lock: share <Pigs in space>: 64
|
||||||
unlock: share <Pigs in space>: 59
|
unlock: share <Pigs in space>: 65
|
||||||
GLOBAL_CLEANUP
|
GLOBAL_CLEANUP
|
||||||
</stdout>
|
</stdout>
|
||||||
<stderr>
|
<stderr>
|
||||||
|
|||||||
59
tests/data/test706
Normal file
59
tests/data/test706
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<testcase>
|
||||||
|
#based off test 100
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
SOCKS4
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
socks4
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP dir list PASV via SOCKS4
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--socks4 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
59
tests/data/test707
Normal file
59
tests/data/test707
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<testcase>
|
||||||
|
#based off test 100
|
||||||
|
<info>
|
||||||
|
<keywords>
|
||||||
|
FTP
|
||||||
|
PASV
|
||||||
|
LIST
|
||||||
|
SOCKS5
|
||||||
|
</keywords>
|
||||||
|
</info>
|
||||||
|
#
|
||||||
|
# Server-side
|
||||||
|
<reply>
|
||||||
|
# When doing LIST, we get the default list output hard-coded in the test
|
||||||
|
# FTP server
|
||||||
|
<datacheck>
|
||||||
|
total 20
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 .
|
||||||
|
drwxr-xr-x 8 98 98 512 Oct 22 13:06 ..
|
||||||
|
drwxr-xr-x 2 98 98 512 May 2 1996 .NeXT
|
||||||
|
-r--r--r-- 1 0 1 35 Jul 16 1996 README
|
||||||
|
lrwxrwxrwx 1 0 1 7 Dec 9 1999 bin -> usr/bin
|
||||||
|
dr-xr-xr-x 2 0 1 512 Oct 1 1997 dev
|
||||||
|
drwxrwxrwx 2 98 98 512 May 29 16:04 download.html
|
||||||
|
dr-xr-xr-x 2 0 1 512 Nov 30 1995 etc
|
||||||
|
drwxrwxrwx 2 98 1 512 Oct 30 14:33 pub
|
||||||
|
dr-xr-xr-x 5 0 1 512 Oct 1 1997 usr
|
||||||
|
</datacheck>
|
||||||
|
</reply>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Client-side
|
||||||
|
<client>
|
||||||
|
<server>
|
||||||
|
ftp
|
||||||
|
socks5
|
||||||
|
</server>
|
||||||
|
<name>
|
||||||
|
FTP dir list PASV via SOCKS5
|
||||||
|
</name>
|
||||||
|
<command>
|
||||||
|
--socks5 %HOSTIP:%SOCKSPORT ftp://%HOSTIP:%FTPPORT/
|
||||||
|
</command>
|
||||||
|
</client>
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify data after the test has been "shot"
|
||||||
|
<verify>
|
||||||
|
<protocol>
|
||||||
|
USER anonymous
|
||||||
|
PASS ftp@example.com
|
||||||
|
PWD
|
||||||
|
EPSV
|
||||||
|
TYPE A
|
||||||
|
LIST
|
||||||
|
QUIT
|
||||||
|
</protocol>
|
||||||
|
</verify>
|
||||||
|
</testcase>
|
||||||
@@ -113,7 +113,7 @@ if($valgrind) {
|
|||||||
if (($? >> 8)==0) {
|
if (($? >> 8)==0) {
|
||||||
$valgrind_tool="--tool=memcheck ";
|
$valgrind_tool="--tool=memcheck ";
|
||||||
}
|
}
|
||||||
open(C, "<", $CURL);
|
open(C, "<$CURL");
|
||||||
my $l = <C>;
|
my $l = <C>;
|
||||||
if($l =~ /^\#\!/) {
|
if($l =~ /^\#\!/) {
|
||||||
# The first line starts with "#!" which implies a shell-script.
|
# The first line starts with "#!" which implies a shell-script.
|
||||||
@@ -273,17 +273,12 @@ sub startnew {
|
|||||||
if(0 == $child) {
|
if(0 == $child) {
|
||||||
# Here we are the child. Run the given command.
|
# Here we are the child. Run the given command.
|
||||||
|
|
||||||
# Calling exec() within a pseudo-process actually spawns the requested
|
# Put an "exec" in front of the command so that the child process
|
||||||
# executable in a separate process and waits for it to complete before
|
# keeps this child's process ID.
|
||||||
# exiting with the same exit status as that process. This means that
|
exec("exec $cmd") || die "Can't exec() $cmd: $!";
|
||||||
# the process ID reported within the running executable will be
|
|
||||||
# different from what the earlier Perl fork() might have returned.
|
|
||||||
|
|
||||||
# exec() should never return back here to this process. We protect
|
# exec() should never return back here to this process. We protect
|
||||||
# ourselfs calling die() just in case something goes really bad.
|
# ourselves by calling die() just in case something goes really bad.
|
||||||
|
|
||||||
exec($cmd) || die "Can't exec() $cmd: $!";
|
|
||||||
|
|
||||||
die "error: exec() has returned";
|
die "error: exec() has returned";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,11 +286,11 @@ sub startnew {
|
|||||||
# Ugly hack but ssh doesn't support pid files
|
# Ugly hack but ssh doesn't support pid files
|
||||||
if ($fake) {
|
if ($fake) {
|
||||||
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
logmsg "$pidfile faked with pid=$child\n" if($verbose);
|
||||||
open(OUT, ">", $pidfile);
|
open(OUT, ">$pidfile");
|
||||||
print OUT $child;
|
print OUT $child . "\n";
|
||||||
close(OUT);
|
close(OUT);
|
||||||
# could/should do a while connect fails sleep a bit and loop
|
# could/should do a while connect fails sleep a bit and loop
|
||||||
sleep 1;
|
sleep 5;
|
||||||
if (checkdied($child)) {
|
if (checkdied($child)) {
|
||||||
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
logmsg "startnew: Warning: child process has failed to start\n" if($verbose);
|
||||||
return (-1,-1);
|
return (-1,-1);
|
||||||
@@ -304,7 +299,7 @@ sub startnew {
|
|||||||
my $count=12;
|
my $count=12;
|
||||||
while($count--) {
|
while($count--) {
|
||||||
if(-f $pidfile) {
|
if(-f $pidfile) {
|
||||||
open(PID, "<", $pidfile);
|
open(PID, "<$pidfile");
|
||||||
$pid2 = 0 + <PID>;
|
$pid2 = 0 + <PID>;
|
||||||
close(PID);
|
close(PID);
|
||||||
if($pid2 && kill(0, $pid2)) {
|
if($pid2 && kill(0, $pid2)) {
|
||||||
@@ -326,6 +321,9 @@ sub startnew {
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Return two PIDs, the one for the child process we spawned and the one
|
||||||
|
# reported by the server itself (in case it forked again on its own).
|
||||||
|
# Both (potentially) need to be killed at the end of the test.
|
||||||
return ($child, $pid2);
|
return ($child, $pid2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -521,7 +519,7 @@ sub verifyhttp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open(FILE, "<", "log/verifiedserver");
|
open(FILE, "<log/verifiedserver");
|
||||||
my @file=<FILE>;
|
my @file=<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
$data=$file[0]; # first line
|
$data=$file[0]; # first line
|
||||||
@@ -590,7 +588,7 @@ sub verifyftp {
|
|||||||
|
|
||||||
sub verifyssh {
|
sub verifyssh {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
open(FILE, "<" . $SSHPIDFILE);
|
open(FILE, "<$SSHPIDFILE");
|
||||||
my $pid=0+<FILE>;
|
my $pid=0+<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
return $pid;
|
return $pid;
|
||||||
@@ -601,7 +599,7 @@ sub verifyssh {
|
|||||||
|
|
||||||
sub verifysocks {
|
sub verifysocks {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
open(FILE, "<" . $SOCKSPIDFILE);
|
open(FILE, "<$SOCKSPIDFILE");
|
||||||
my $pid=0+<FILE>;
|
my $pid=0+<FILE>;
|
||||||
close(FILE);
|
close(FILE);
|
||||||
return $pid;
|
return $pid;
|
||||||
@@ -609,7 +607,9 @@ sub verifysocks {
|
|||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Verify that the server that runs on $ip, $port is our server.
|
# Verify that the server that runs on $ip, $port is our server.
|
||||||
# Retry during 5 seconds before giving up.
|
# Retry over several seconds before giving up. The ssh server in
|
||||||
|
# particular can take a long time to start if it needs to generate
|
||||||
|
# keys on a slow or loaded host.
|
||||||
#
|
#
|
||||||
|
|
||||||
my %protofunc = ('http' => \&verifyhttp,
|
my %protofunc = ('http' => \&verifyhttp,
|
||||||
@@ -623,7 +623,7 @@ my %protofunc = ('http' => \&verifyhttp,
|
|||||||
sub verifyserver {
|
sub verifyserver {
|
||||||
my ($proto, $ip, $port) = @_;
|
my ($proto, $ip, $port) = @_;
|
||||||
|
|
||||||
my $count = 5; # try for this many seconds
|
my $count = 30; # try for this many seconds
|
||||||
my $pid;
|
my $pid;
|
||||||
|
|
||||||
while($count--) {
|
while($count--) {
|
||||||
@@ -678,7 +678,7 @@ sub runhttpserver {
|
|||||||
my ($httppid, $pid2) =
|
my ($httppid, $pid2) =
|
||||||
startnew($cmd, $pidfile,0); # start the server in a new process
|
startnew($cmd, $pidfile,0); # start the server in a new process
|
||||||
|
|
||||||
if(!kill(0, $httppid)) {
|
if($httppid <= 0 || !kill(0, $httppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the HTTP server\n";
|
logmsg "RUN: failed to start the HTTP server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -732,7 +732,7 @@ sub runhttpsserver {
|
|||||||
|
|
||||||
my ($httpspid, $pid2) = startnew($cmd, $HTTPSPIDFILE,0);
|
my ($httpspid, $pid2) = startnew($cmd, $HTTPSPIDFILE,0);
|
||||||
|
|
||||||
if(!kill(0, $httpspid)) {
|
if($httpspid <= 0 || !kill(0, $httpspid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the HTTPS server\n";
|
logmsg "RUN: failed to start the HTTPS server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -798,7 +798,7 @@ sub runftpserver {
|
|||||||
|
|
||||||
my ($ftppid, $pid2) = startnew($cmd, $pidfile,0);
|
my ($ftppid, $pid2) = startnew($cmd, $pidfile,0);
|
||||||
|
|
||||||
if(!$ftppid || !kill(0, $ftppid)) {
|
if($ftppid <= 0 || !kill(0, $ftppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
||||||
return -1;
|
return -1;
|
||||||
@@ -851,7 +851,7 @@ sub runftpsserver {
|
|||||||
|
|
||||||
my ($ftpspid, $pid2) = startnew($cmd, $FTPSPIDFILE,0);
|
my ($ftpspid, $pid2) = startnew($cmd, $FTPSPIDFILE,0);
|
||||||
|
|
||||||
if(!kill(0, $ftpspid)) {
|
if($ftpspid <= 0 || !kill(0, $ftpspid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTPS server\n";
|
logmsg "RUN: failed to start the FTPS server\n";
|
||||||
stopservers($verbose);
|
stopservers($verbose);
|
||||||
@@ -917,7 +917,7 @@ sub runtftpserver {
|
|||||||
|
|
||||||
my ($tftppid, $pid2) = startnew($cmd, $pidfile,0);
|
my ($tftppid, $pid2) = startnew($cmd, $pidfile,0);
|
||||||
|
|
||||||
if(!$tftppid || !kill(0, $tftppid)) {
|
if($tftppid <= 0 || !kill(0, $tftppid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
logmsg "RUN: failed to start the FTP$id$nameext server\n";
|
||||||
return -1;
|
return -1;
|
||||||
@@ -960,7 +960,7 @@ sub runsshserver {
|
|||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,0); # start the server in a new process
|
startnew($cmd, $pidfile,0); # start the server in a new process
|
||||||
|
|
||||||
if(!$sshpid || !kill(0, $sshpid)) {
|
if($sshpid <= 0 || !kill(0, $sshpid)) {
|
||||||
# it is NOT alive
|
# it is NOT alive
|
||||||
logmsg "RUN: failed to start the SSH server\n";
|
logmsg "RUN: failed to start the SSH server\n";
|
||||||
# failed to talk to it properly. Kill the server and return failure
|
# failed to talk to it properly. Kill the server and return failure
|
||||||
@@ -989,7 +989,7 @@ sub runsocksserver {
|
|||||||
my $pidfile = $SOCKSPIDFILE;
|
my $pidfile = $SOCKSPIDFILE;
|
||||||
|
|
||||||
my $flag=$debugprotocol?"-v ":"";
|
my $flag=$debugprotocol?"-v ":"";
|
||||||
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} >log/ssh.log 2>&1";
|
my $cmd="ssh -D ${HOSTIP}:$SOCKSPORT -N -F curl_ssh_config ${USER}\@${HOSTIP} -p ${SSHPORT} -vv >log/ssh.log 2>&1";
|
||||||
my ($sshpid, $pid2) =
|
my ($sshpid, $pid2) =
|
||||||
startnew($cmd, $pidfile,1); # start the server in a new process
|
startnew($cmd, $pidfile,1); # start the server in a new process
|
||||||
|
|
||||||
@@ -1043,10 +1043,10 @@ sub filteroff {
|
|||||||
my $filter=$_[1];
|
my $filter=$_[1];
|
||||||
my $ofile=$_[2];
|
my $ofile=$_[2];
|
||||||
|
|
||||||
open(IN, "<", $infile)
|
open(IN, "<$infile")
|
||||||
|| return 1;
|
|| return 1;
|
||||||
|
|
||||||
open(OUT, ">", $ofile)
|
open(OUT, ">$ofile")
|
||||||
|| return 1;
|
|| return 1;
|
||||||
|
|
||||||
# logmsg "FILTER: off $filter from $infile to $ofile\n";
|
# logmsg "FILTER: off $filter from $infile to $ofile\n";
|
||||||
@@ -1107,7 +1107,7 @@ sub checksystem {
|
|||||||
$versretval = system($versioncmd);
|
$versretval = system($versioncmd);
|
||||||
$versnoexec = $!;
|
$versnoexec = $!;
|
||||||
|
|
||||||
open(VERSOUT, "<", $curlverout);
|
open(VERSOUT, "<$curlverout");
|
||||||
@version = <VERSOUT>;
|
@version = <VERSOUT>;
|
||||||
close(VERSOUT);
|
close(VERSOUT);
|
||||||
|
|
||||||
@@ -1259,7 +1259,7 @@ sub checksystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(-r "../lib/config.h") {
|
if(-r "../lib/config.h") {
|
||||||
open(CONF, "<", "../lib/config.h");
|
open(CONF, "<../lib/config.h");
|
||||||
while(<CONF>) {
|
while(<CONF>) {
|
||||||
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
|
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
|
||||||
$has_getrlimit = 1;
|
$has_getrlimit = 1;
|
||||||
@@ -1634,7 +1634,7 @@ sub singletest {
|
|||||||
my $fileContent = join('', @inputfile);
|
my $fileContent = join('', @inputfile);
|
||||||
subVariables \$fileContent;
|
subVariables \$fileContent;
|
||||||
# logmsg "DEBUG: writing file " . $filename . "\n";
|
# logmsg "DEBUG: writing file " . $filename . "\n";
|
||||||
open(OUTFILE, ">", $filename);
|
open(OUTFILE, ">$filename");
|
||||||
binmode OUTFILE; # for crapage systems, use binary
|
binmode OUTFILE; # for crapage systems, use binary
|
||||||
print OUTFILE $fileContent;
|
print OUTFILE $fileContent;
|
||||||
close(OUTFILE);
|
close(OUTFILE);
|
||||||
@@ -1715,7 +1715,7 @@ sub singletest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($gdbthis) {
|
if($gdbthis) {
|
||||||
open(GDBCMD, ">", "log/gdbcmd");
|
open(GDBCMD, ">log/gdbcmd");
|
||||||
print GDBCMD "set args $cmdargs\n";
|
print GDBCMD "set args $cmdargs\n";
|
||||||
print GDBCMD "show args\n";
|
print GDBCMD "show args\n";
|
||||||
close(GDBCMD);
|
close(GDBCMD);
|
||||||
@@ -1752,7 +1752,7 @@ sub singletest {
|
|||||||
logmsg "core dumped\n";
|
logmsg "core dumped\n";
|
||||||
if(0 && $gdb) {
|
if(0 && $gdb) {
|
||||||
logmsg "running gdb for post-mortem analysis:\n";
|
logmsg "running gdb for post-mortem analysis:\n";
|
||||||
open(GDBCMD, ">", "log/gdbcmd2");
|
open(GDBCMD, ">log/gdbcmd2");
|
||||||
print GDBCMD "bt\n";
|
print GDBCMD "bt\n";
|
||||||
close(GDBCMD);
|
close(GDBCMD);
|
||||||
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
|
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
|
||||||
@@ -2263,7 +2263,7 @@ sub startservers {
|
|||||||
if (!checkcmd("ssh")) {
|
if (!checkcmd("ssh")) {
|
||||||
return "failed to find SSH client for socks support";
|
return "failed to find SSH client for socks support";
|
||||||
}
|
}
|
||||||
if ($what eq "socks5") {
|
if(!$run{'socks'}) {
|
||||||
my $sshversion=`ssh -V 2>&1`;
|
my $sshversion=`ssh -V 2>&1`;
|
||||||
if ($sshversion =~ /SSH_(\d+)\.(\d+)/i) {
|
if ($sshversion =~ /SSH_(\d+)\.(\d+)/i) {
|
||||||
if ($1*10+$2 < 37) {
|
if ($1*10+$2 < 37) {
|
||||||
@@ -2273,8 +2273,7 @@ sub startservers {
|
|||||||
} else {
|
} else {
|
||||||
return "Unsupported ssh client\n";
|
return "Unsupported ssh client\n";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(!$run{'socks'}) {
|
|
||||||
($pid, $pid2) = runsocksserver("", $verbose);
|
($pid, $pid2) = runsocksserver("", $verbose);
|
||||||
if($pid <= 0) {
|
if($pid <= 0) {
|
||||||
return "failed starting socks server";
|
return "failed starting socks server";
|
||||||
@@ -2466,7 +2465,7 @@ if($valgrind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# open the executable curl and read the first 4 bytes of it
|
# open the executable curl and read the first 4 bytes of it
|
||||||
open(CHECK, "<", $CURL);
|
open(CHECK, "<$CURL");
|
||||||
my $c;
|
my $c;
|
||||||
sysread CHECK, $c, 4;
|
sysread CHECK, $c, 4;
|
||||||
close(CHECK);
|
close(CHECK);
|
||||||
@@ -2514,7 +2513,7 @@ if ( $TESTCASES eq "all") {
|
|||||||
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
|
my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
|
||||||
closedir(DIR);
|
closedir(DIR);
|
||||||
|
|
||||||
open(D, "$TESTDIR/DISABLED");
|
open(D, "<$TESTDIR/DISABLED");
|
||||||
while(<D>) {
|
while(<D>) {
|
||||||
if(/^ *\#/) {
|
if(/^ *\#/) {
|
||||||
# allow comments
|
# allow comments
|
||||||
@@ -2549,7 +2548,7 @@ if ( $TESTCASES eq "all") {
|
|||||||
#######################################################################
|
#######################################################################
|
||||||
# Start the command line log
|
# Start the command line log
|
||||||
#
|
#
|
||||||
open(CMDLOG, ">", $CURLLOG) ||
|
open(CMDLOG, ">$CURLLOG") ||
|
||||||
logmsg "can't log command lines to $CURLLOG\n";
|
logmsg "can't log command lines to $CURLLOG\n";
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'dos' || $^O
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Where to look for sftp-server
|
# Where to look for sftp-server
|
||||||
my @sftppath=qw(/usr/lib/openssh /usr/libexec/openssh /usr/libexec /usr/local/libexec /opt/local/libexec /usr/lib/ssh /usr/libexec/ssh /usr/sbin /usr/lib /usr/lib/ssh/openssh /usr/lib64/ssh /usr/lib64/misc);
|
my @sftppath=qw(/usr/lib/openssh /usr/libexec/openssh /usr/libexec /usr/local/libexec /opt/local/libexec /usr/lib/ssh /usr/libexec/ssh /usr/sbin /usr/lib /usr/lib/ssh/openssh /usr/lib64/ssh /usr/lib64/misc /usr/lib/misc);
|
||||||
|
|
||||||
my $username = $ENV{USER};
|
my $username = $ENV{USER};
|
||||||
|
|
||||||
@@ -147,11 +147,11 @@ if (! -e "curl_client_key.pub") {
|
|||||||
}
|
}
|
||||||
# Make sure all files are gone so ssh-keygen doesn't complain
|
# Make sure all files are gone so ssh-keygen doesn't complain
|
||||||
unlink("curl_host_dsa_key", "curl_client_key","curl_host_dsa_key.pub", "curl_client_key.pub");
|
unlink("curl_host_dsa_key", "curl_client_key","curl_host_dsa_key.pub", "curl_client_key.pub");
|
||||||
system "ssh-keygen -q -t dsa -f curl_host_dsa_key -C 'curl test server' -N ''" and die "Could not generate key";
|
system "ssh-keygen -q -t dsa -f curl_host_dsa_key -C 'curl test server' -N ''" and die "Could not generate host key";
|
||||||
system "ssh-keygen -q -t dsa -f curl_client_key -C 'curl test client' -N ''" and die "Could not generate key";
|
system "ssh-keygen -q -t dsa -f curl_client_key -C 'curl test client' -N ''" and die "Could not generate client key";
|
||||||
}
|
}
|
||||||
|
|
||||||
open(FILE, ">>", $conffile) || die "Could not write $conffile";
|
open(FILE, ">>$conffile") || die "Could not write $conffile";
|
||||||
print FILE <<EOFSSHD
|
print FILE <<EOFSSHD
|
||||||
AllowUsers $username
|
AllowUsers $username
|
||||||
DenyUsers
|
DenyUsers
|
||||||
@@ -205,20 +205,15 @@ if ($supports_ChReAu) {
|
|||||||
|
|
||||||
|
|
||||||
# Now, set up some configuration files for the ssh client
|
# Now, set up some configuration files for the ssh client
|
||||||
open(DSAKEYFILE, "<", "curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
open(DSAKEYFILE, "<curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
||||||
my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
|
my @dsahostkey = do { local $/ = ' '; <DSAKEYFILE> };
|
||||||
close DSAKEYFILE || die "Could not close RSAKEYFILE";
|
close DSAKEYFILE || die "Could not close DSAKEYFILE";
|
||||||
|
|
||||||
open(RSAKEYFILE, "<", "curl_host_dsa_key.pub") || die 'Could not read curl_host_dsa_key.pub';
|
open(KNOWNHOSTS, ">$knownhostsfile") || die "Could not write $knownhostsfile";
|
||||||
my @rsahostkey = do { local $/ = ' '; <RSAKEYFILE> };
|
|
||||||
close RSAKEYFILE || die "Could not close RSAKEYFILE";
|
|
||||||
|
|
||||||
open(KNOWNHOSTS, ">", $knownhostsfile) || die "Could not write $knownhostsfile";
|
|
||||||
print KNOWNHOSTS "[127.0.0.1]:$port ssh-dss $dsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
print KNOWNHOSTS "[127.0.0.1]:$port ssh-dss $dsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
||||||
print KNOWNHOSTS "[127.0.0.1]:$port ssh-rsa $rsahostkey[1]\n" || die 'Could not write to KNOWNHOSTS';
|
|
||||||
close KNOWNHOSTS || die "Could not close KNOWNHOSTS";
|
close KNOWNHOSTS || die "Could not close KNOWNHOSTS";
|
||||||
|
|
||||||
open(SSHFILE, ">", $conffile_ssh) || die "Could not write $conffile_ssh";
|
open(SSHFILE, ">$conffile_ssh") || die "Could not write $conffile_ssh";
|
||||||
print SSHFILE <<EOFSSH
|
print SSHFILE <<EOFSSH
|
||||||
IdentityFile $path/curl_client_key
|
IdentityFile $path/curl_client_key
|
||||||
UserKnownHostsFile $path/$knownhostsfile
|
UserKnownHostsFile $path/$knownhostsfile
|
||||||
|
|||||||
Reference in New Issue
Block a user