Changelog
Daniel (26 July 2006)
+- Dan Nelson added the CURLOPT_FTP_ALTERNATIVE_TO_USER libcurl option and curl
+ tool option named --ftp-alternative-to-user. It provides a mean to send a
+ particular command if the normal USER/PASS approach fails.
+
- Michael Jerris added magic that builds lib/curllib.vcproj automatically for
newer MSVC.
Public curl release number: 95
Releases counted from the very beginning: 122
- Available command line options: 112
- Available curl_easy_setopt() options: 132
+ Available command line options: 113
+ Available curl_easy_setopt() options: 133
Number of public functions in libcurl: 49
Amount of public web site mirrors: 33
Number of known libcurl bindings: 32
This release includes the following changes:
+ o added CURLOPT_FTP_ALTERNATIVE_TO_USER and --ftp-alternative-to-user
+ o now includes a vcproj file for building libcurl
o added curl_formget()
o added CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE
o configure --enable-hidden-symbols
Dan Fandrich, Peter Silva, Arve Knudsen, Michael Wallner, Toshiyuki Maezawa,
Ingmar Runge, Ates Goral, David McCreedy, Jari Sundell, Georg Horn,
- Gisle Vanem, Yang Tse
+ Gisle Vanem, Yang Tse, Michael Jerris, Dan Nelson
Thanks! (and sorry if I forgot to mention someone)
If this option is used several times, the following occurrences make no
difference.
+.IP "--ftp-alternative-to-user <command>"
+(FTP) If authenticating with the USER and PASS commands fails, send this
+command. When connecting to Tumbleweed's Secure Transport server over FTPS
+using a client certificate, using "SITE AUTH" will tell the server to retrieve
+the username from the certificate. (Added in 7.15.5)
.IP "--ftp-skip-pasv-ip"
(FTP) Tell curl to not use the IP address the server suggests in its response
to curl's PASV command when curl connects the data connection. Instead curl
recommended that if used in conjunction with \fICURLOPT_TIMEOUT\fP, you set
\fICURLOPT_FTP_RESPONSE_TIMEOUT\fP to a value smaller than
\fICURLOPT_TIMEOUT\fP. (Added in 7.10.8)
+.IP CURLOPT_FTP_ALTERNATIVE_TO_USER
+Pass a char * as parameter, pointing to a string which will be used to
+authenticate if the usual FTP "USER user" and "PASS password" negotiation
+fails. This is currently only known to be required when connecting to
+Tumbleweed's Secure Transport FTPS server using client certificates for
+authentication. (Added in 7.15.5)
.IP CURLOPT_FTP_SKIP_PASV_IP
Pass a long. If set to a non-zero value, it instructs libcurl to not use the
IP address the server suggests in its 227-response to libcurl's PASV command
#ifdef CURL_HIDDEN_SYMBOLS
/*
- * This definition is used to make external definitions visibile in the
+ * This definition is used to make external definitions visibile in the
* shared library when symbols are hidden by default. It makes no
* difference when compiling applications whether this is set or not,
* only when compiling the library.
*/
#define CURL_EXTERN CURL_EXTERN_SYMBOL
#else
-#define CURL_EXTERN
+#define CURL_EXTERN
#endif
#endif
CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
+ /* Pointer to command string to send if USER/PASS fails. */
+ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
+
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
NBFTPSENDF(conn, "USER %s", ftp->user?ftp->user:"");
state(conn, FTP_USER);
+ conn->data->state.ftp_trying_alternative = FALSE;
return CURLE_OK;
}
530 User ... access denied
(the server denies to log the specified user) */
- failf(data, "Access denied: %03d", ftpcode);
- result = CURLE_LOGIN_DENIED;
+
+ if (conn->data->set.ftp_alternative_to_user &&
+ !conn->data->state.ftp_trying_alternative) {
+ /* Ok, USER failed. Let's try the supplied command. */
+ NBFTPSENDF(conn, "%s", conn->data->set.ftp_alternative_to_user);
+ conn->data->state.ftp_trying_alternative = TRUE;
+ state(conn, FTP_USER);
+ result = CURLE_OK;
+ }
+ else {
+ failf(data, "Access denied: %03d", ftpcode);
+ result = CURLE_LOGIN_DENIED;
+ }
}
return result;
}
data->set.connect_only = va_arg(param, long)?TRUE:FALSE;
break;
+ case CURLOPT_FTP_ALTERNATIVE_TO_USER:
+ data->set.ftp_alternative_to_user = va_arg(param, char *);
+ break;
+
default:
/* unknown tag and its companion, just ignore: */
result = CURLE_FAILED_INIT; /* correct this */
/* a place to store the most recenlty set FTP entrypath */
char *most_recent_ftp_entrypath;
+ /* set after initial USER failure, to prevent an authentication loop */
+ bool ftp_trying_alternative;
+
#ifndef WIN32
/* do FTP line-end conversions on most platforms */
#define CURL_DO_LINEEND_CONV
bool cookiesession; /* new cookie session? */
bool crlf; /* convert crlf on ftp upload(?) */
char *ftp_account; /* ftp account data */
+ char *ftp_alternative_to_user; /* command to send if USER/PASS fails */
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_postquote;
struct curl_slist *tp_prequote;
char *ftp_account; /* for ACCT */
+ char *ftp_alternative_to_user; /* send command if USER/PASS fails */
int ftp_filemethod;
bool ignorecl; /* --ignore-content-length */
{"$r", "ftp-method", TRUE},
{"$s", "local-port", TRUE},
{"$t", "socks4", TRUE},
+ {"$u", "ftp-alternative-to-user", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
}
}
break;
+ case 'u': /* --ftp-alternative-to-user */
+ GetStr(&config->ftp_alternative_to_user, nextarg);
+ break;
}
break;
case '#': /* --progress-bar */
curl_easy_setopt(curl, CURLOPT_LOCALPORTRANGE, config->localportrange);
}
+ /* curl x.xx.x */
+ curl_easy_setopt(curl, CURLOPT_FTP_ALTERNATIVE_TO_USER, config->ftp_alternative_to_user);
+
retry_numretries = config->req_retry;
retrystart = curlx_tvnow();