Changelog
Daniel (25 January 2005)
+- Ian Ford asked about support for the FTP command ACCT, and I discovered it
+ is present in RFC959... so now (lib)curl supports it as well. --ftp-account
+ and CURLOPT_FTP_ACCOUNT set the account string. (The server may ask for an
+ account string after PASS have been sent away. The client responds
+ with "ACCT [account string]".) Added test case 228 and 229 to verify the
+ functionality. Updated the test FTP server to support ACCT somewhat.
+
- David Shaw contributed a fairly complete and detailed autoconf test you can
use to detect libcurl and setup variables for the protocols the installed
libcurl supports: docs/libcurl/libcurl.m4
Public curl release number: 85
Releases counted from the very beginning: 112
- Available command line options: 103
- Available curl_easy_setopt() options: 121
+ Available command line options: 104
+ Available curl_easy_setopt() options: 122
Number of public functions in libcurl: 46
Amount of public web site mirrors: 15
Number of known libcurl bindings: 29
This release includes the following changes:
+ o added --ftp-account and CURLOPT_FTP_ACCOUNT
o added CURLOPT_SOURCE_URL and CURLOPT_SOURCE_QUOTE
o obsoleted CURLOPT_SOURCE_HOST, CURLOPT_SOURCE_PATH, CURLOPT_SOURCE_PORT
and CURLOPT_PASV_HOST
Werner Koch, Gisle Vanem, Alex Neblett, Kai Sommerfeld, Marty Kuhrt,
Hzhijun, Pavel Orehov, Bruce Mitchener, Cyrill Osterwalder, Dan Torop,
Martijn Koster, Alex aka WindEagle, Cody Jones, Samuel Díaz García,
- Stephan Bergmann, Philippe Hameau
+ Stephan Bergmann, Philippe Hameau, Ian Ford
Thanks! (and sorry if I forgot to mention someone)
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl 1 "20 Jan 2005" "Curl 7.13.0" "Curl Manual"
+.TH curl 1 "25 Jan 2005" "Curl 7.13.0" "Curl Manual"
.SH NAME
curl \- transfer a URL
.SH SYNOPSIS
prevent curl from outputting that and fail silently instead.
If this option is used twice, the second will again disable silent failure.
+.IP "--ftp-account [data]"
+(FTP) When an FTP server asks for "account data" after user name and password
+has been provided, this data is sent off using the ACCT command. (Added in
+7.13.0)
+
+If this option is used twice, the second will override the previous use.
.IP "--ftp-create-dirs"
(FTP) When an FTP 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
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl_easy_setopt 3 "20 Jan 2005" "libcurl 7.12.4" "libcurl Manual"
+.TH curl_easy_setopt 3 "25 Jan 2005" "libcurl 7.13.0" "libcurl Manual"
.SH NAME
curl_easy_setopt - set options for a curl easy handle
.SH SYNOPSIS
Exactly like \fICURLOPT_PREQUOTE\fP, but for the source host.
.IP CURLOPT_SOURCE_POSTQUOTE
Exactly like \fICURLOPT_POSTQUOTE\fP, but for the source host.
+.IP CURLOPT_FTP_ACCOUNT
+Pass a pointer to a zero-terminated string (or NULL to disable). When an FTP
+server asks for "account data" after user name and password has been provided,
+this data is sent off using the ACCT command. (Added in 7.13.0)
.SH PROTOCOL OPTIONS
.IP CURLOPT_TRANSFERTEXT
A non-zero parameter tells the library to use ASCII mode for ftp transfers,
commands with this */
CINIT(SOURCE_QUOTE, OBJECTPOINT, 133),
+ /* zero terminated string for pass on to the FTP server when asked for
+ "account" info */
+ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
+
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
infof(data, "We have successfully logged in\n");
}
+ else if(ftpcode == 332) {
+ /* 332 Please provide account info */
+ if(data->set.ftp_account) {
+ FTPSENDF(conn, "ACCT %s", data->set.ftp_account);
+ result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
+ if(!result && (ftpcode != 230)) {
+ failf(data, "ACCT rejected by server: %03d", ftpcode);
+ result = CURLE_FTP_WEIRD_PASS_REPLY; /* FIX */
+ }
+ }
+ else {
+ failf(data, "ACCT requested by none available");
+ result = CURLE_FTP_WEIRD_PASS_REPLY;
+ }
+ if(result)
+ return result;
+ }
else {
failf(data, "Odd return code after PASS");
return CURLE_FTP_WEIRD_PASS_REPLY;
data->set.source_postquote = va_arg(param, struct curl_slist *);
break;
+ case CURLOPT_FTP_ACCOUNT:
+ data->set.ftp_account = va_arg(param, char *);
+ break;
+
default:
/* unknown tag and its companion, just ignore: */
result = CURLE_FAILED_INIT; /* correct this */
char *cookiejar; /* dump all cookies to this file */
bool cookiesession; /* new cookie session? */
bool crlf; /* convert crlf on ftp upload(?) */
+ char *ftp_account; /* ftp account data */
struct curl_slist *quote; /* after connection is established */
struct curl_slist *postquote; /* after the transfer */
struct curl_slist *prequote; /* before the transfer, after type */
struct curl_slist *tp_quote;
struct curl_slist *tp_postquote;
struct curl_slist *tp_prequote;
-
+ char *ftp_account; /* for ACCT */
};
/* global variable to hold info about libcurl */
{"$g", "retry", TRUE},
{"$h", "retry-delay", TRUE},
{"$i", "retry-max-time", TRUE},
-
{"$j", "3p-url", TRUE},
{"$k", "3p-user", TRUE},
{"$l", "3p-quote", TRUE},
+ {"$m", "ftp-account", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
break;
/* break */
+ case 'm': /* --ftp-account */
+ GetStr(&config->ftp_account, nextarg);
+ break;
}
break;
case '#': /* added 19990617 larsa */
free(config->tp_url);
if(config->tp_user)
free(config->tp_user);
+ if(config->ftp_account)
+ free(config->ftp_account);
curl_slist_free_all(config->quote); /* checks for config->quote == NULL */
curl_slist_free_all(config->prequote);
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
}
- /* curl 7.12.4 */
+ /* curl 7.13.0 */
curl_easy_setopt(curl, CURLOPT_SOURCE_URL, config->tp_url);
curl_easy_setopt(curl, CURLOPT_SOURCE_USERPWD, config->tp_user);
curl_easy_setopt(curl, CURLOPT_SOURCE_PREQUOTE, config->tp_prequote);
curl_easy_setopt(curl, CURLOPT_SOURCE_POSTQUOTE, config->tp_postquote);
curl_easy_setopt(curl, CURLOPT_SOURCE_QUOTE, config->tp_quote);
+ curl_easy_setopt(curl, CURLOPT_FTP_ACCOUNT, config->ftp_account);
retry_numretries = config->req_retry;
test517 test518 test210 test211 test212 test220 test221 test222 \
test223 test224 test206 test207 test208 test209 test213 test240 \
test241 test242 test519 test214 test215 test216 test217 test218 \
- test199 test225 test226 test227 test230 test231 test232
+ test199 test225 test226 test227 test230 test231 test232 test228 \
+ test229
# The following tests have been removed from the dist since they no longer
# work. We need to fix the test suite's FTPS server first, then bring them
--- /dev/null
+# Server-side
+<reply>
+<data>
+data
+ to
+ see
+that FTP
+works
+ so does it?
+</data>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR with ACCT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/228 --ftp-account "one count"
+</command>
+<file name="log/ftpserver.cmd">
+REPLY PASS 332 please provide account name
+REPLY ACCT 230 thank you
+</file>
+</client>
+
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS curl_by_daniel@haxx.se\r
+ACCT one count\r
+PWD\r
+EPSV\r
+TYPE I\r
+SIZE 228\r
+RETR 228\r
+QUIT\r
+</protocol>
+</verify>
--- /dev/null
+# Server-side
+<reply>
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+</server>
+ <name>
+FTP RETR with bad ACCT
+ </name>
+ <command>
+ftp://%HOSTIP:%FTPPORT/229 --ftp-account "one count"
+</command>
+<file name="log/ftpserver.cmd">
+REPLY PASS 332 please provide account name
+REPLY ACCT 532 bluah!
+</file>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+USER anonymous\r
+PASS curl_by_daniel@haxx.se\r
+ACCT one count\r
+</protocol>
+<errorcode>
+11
+</errorcode>
+</verify>