blob: f63df55f4719456d27a14fb7416b80fd116b384e [file] [log] [blame]
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +00001/* vi: set sw=4 ts=4: */
2/*
Eric Andersenc7bda1c2004-03-15 08:29:22 +00003 * ftpget
4 *
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +00005 * Mini implementation of FTP to retrieve a remote file.
6 *
7 * Copyright (C) 2002 Jeff Angielski, The PTR Group <jeff@theptrgroup.com>
Denis Vlasenko0beaff82007-09-21 13:16:32 +00008 * Copyright (C) 2002 Glenn McGrath
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +00009 *
10 * Based on wget.c by Chip Rosenthal Covad Communications
11 * <chip@laserlink.net>
12 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +020013 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000014 */
15
Pere Orga5bc8c002011-04-11 03:29:49 +020016//usage:#define ftpget_trivial_usage
17//usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE"
18//usage:#define ftpget_full_usage "\n\n"
19//usage: "Retrieve a remote file via FTP\n"
20//usage: "\nOptions:"
21//usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
22//usage: "\n -c,--continue Continue previous transfer"
23//usage: "\n -v,--verbose Verbose"
24//usage: "\n -u,--username Username"
25//usage: "\n -p,--password Password"
26//usage: "\n -P,--port Port number"
27//usage: )
28//usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
29//usage: "\n -c Continue previous transfer"
30//usage: "\n -v Verbose"
31//usage: "\n -u Username"
32//usage: "\n -p Password"
33//usage: "\n -P Port number"
34//usage: )
35//usage:
36//usage:#define ftpput_trivial_usage
37//usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE"
38//usage:#define ftpput_full_usage "\n\n"
39//usage: "Store a local file on a remote machine via FTP\n"
40//usage: "\nOptions:"
41//usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS(
42//usage: "\n -v,--verbose Verbose"
43//usage: "\n -u,--username Username"
44//usage: "\n -p,--password Password"
45//usage: "\n -P,--port Port number"
46//usage: )
47//usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS(
48//usage: "\n -v Verbose"
49//usage: "\n -u Username"
50//usage: "\n -p Password"
51//usage: "\n -P Port number"
52//usage: )
53
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000054#include "libbb.h"
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000055
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000056struct globals {
Denis Vlasenkob6aae0f2007-01-29 22:51:25 +000057 const char *user;
58 const char *password;
Denis Vlasenko8e9ccba2007-01-11 16:50:23 +000059 struct len_and_sockaddr *lsa;
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000060 FILE *control_stream;
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000061 int verbose_flag;
62 int do_continue;
Denys Vlasenko60a94142011-05-13 20:57:01 +020063 char buf[4]; /* actually [BUFSZ] */
Denys Vlasenko98a4c7c2010-02-04 15:00:15 +010064} FIX_ALIASING;
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000065#define G (*(struct globals*)&bb_common_bufsiz1)
66enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) };
67struct BUG_G_too_big {
Denis Vlasenko7049ff82008-06-25 09:53:17 +000068 char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000069};
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000070#define user (G.user )
71#define password (G.password )
72#define lsa (G.lsa )
73#define control_stream (G.control_stream)
74#define verbose_flag (G.verbose_flag )
75#define do_continue (G.do_continue )
76#define buf (G.buf )
Denis Vlasenko7049ff82008-06-25 09:53:17 +000077#define INIT_G() do { } while (0)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000078
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000079
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000080static void ftp_die(const char *msg) NORETURN;
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000081static void ftp_die(const char *msg)
Denis Vlasenko562dc242007-01-03 21:55:50 +000082{
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000083 char *cp = buf; /* buf holds peer's response */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000084
Denis Vlasenko562dc242007-01-03 21:55:50 +000085 /* Guard against garbage from remote server */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +000086 while (*cp >= ' ' && *cp < '\x7f')
87 cp++;
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000088 *cp = '\0';
89 bb_error_msg_and_die("unexpected server response%s%s: %s",
90 (msg ? " to " : ""), (msg ? msg : ""), buf);
Denis Vlasenko562dc242007-01-03 21:55:50 +000091}
92
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000093static int ftpcmd(const char *s1, const char *s2)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000094{
Denis Vlasenko562dc242007-01-03 21:55:50 +000095 unsigned n;
Denis Vlasenko7cb808e2008-03-29 07:40:35 +000096
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000097 if (verbose_flag) {
Denis Vlasenko3821fb12007-01-11 16:51:21 +000098 bb_error_msg("cmd %s %s", s1, s2);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +000099 }
100
101 if (s1) {
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000102 fprintf(control_stream, (s2 ? "%s %s\r\n" : "%s %s\r\n"+3),
103 s1, s2);
104 fflush(control_stream);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000105 }
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000106
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000107 do {
Denys Vlasenko60a94142011-05-13 20:57:01 +0200108 strcpy(buf, "EOF"); /* for ftp_die */
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000109 if (fgets(buf, BUFSZ - 2, control_stream) == NULL) {
110 ftp_die(NULL);
Glenn L McGrath5ec58282004-05-04 10:43:34 +0000111 }
Denis Vlasenko13858992006-10-08 12:49:22 +0000112 } while (!isdigit(buf[0]) || buf[3] != ' ');
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000113
Denis Vlasenko562dc242007-01-03 21:55:50 +0000114 buf[3] = '\0';
115 n = xatou(buf);
116 buf[3] = ' ';
117 return n;
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000118}
119
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000120static void ftp_login(void)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000121{
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000122 /* Connect to the command socket */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000123 control_stream = fdopen(xconnect_stream(lsa), "r+");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000124 if (control_stream == NULL) {
Denis Vlasenko8e9ccba2007-01-11 16:50:23 +0000125 /* fdopen failed - extremely unlikely */
Denis Vlasenko562dc242007-01-03 21:55:50 +0000126 bb_perror_nomsg_and_die();
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000127 }
128
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000129 if (ftpcmd(NULL, NULL) != 220) {
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000130 ftp_die(NULL);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000131 }
132
133 /* Login to the server */
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000134 switch (ftpcmd("USER", user)) {
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000135 case 230:
136 break;
137 case 331:
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000138 if (ftpcmd("PASS", password) != 230) {
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000139 ftp_die("PASS");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000140 }
141 break;
142 default:
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000143 ftp_die("USER");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000144 }
145
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000146 ftpcmd("TYPE I", NULL);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000147}
148
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000149static int xconnect_ftpdata(void)
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000150{
151 char *buf_ptr;
152 unsigned port_num;
153
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000154/*
155TODO: PASV command will not work for IPv6. RFC2428 describes
156IPv6-capable "extended PASV" - EPSV.
157
158"EPSV [protocol]" asks server to bind to and listen on a data port
159in specified protocol. Protocol is 1 for IPv4, 2 for IPv6.
160If not specified, defaults to "same as used for control connection".
161If server understood you, it should answer "229 <some text>(|||port|)"
162where "|" are literal pipe chars and "port" is ASCII decimal port#.
163
164There is also an IPv6-capable replacement for PORT (EPRT),
165but we don't need that.
166
167NB: PASV may still work for some servers even over IPv6.
168For example, vsftp happily answers
169"227 Entering Passive Mode (0,0,0,0,n,n)" and proceeds as usual.
170
171TODO2: need to stop ignoring IP address in PASV response.
172*/
173
174 if (ftpcmd("PASV", NULL) != 227) {
175 ftp_die("PASV");
176 }
177
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000178 /* Response is "NNN garbageN1,N2,N3,N4,P1,P2[)garbage]
179 * Server's IP is N1.N2.N3.N4 (we ignore it)
180 * Server's port for data connection is P1*256+P2 */
181 buf_ptr = strrchr(buf, ')');
182 if (buf_ptr) *buf_ptr = '\0';
183
184 buf_ptr = strrchr(buf, ',');
185 *buf_ptr = '\0';
186 port_num = xatoul_range(buf_ptr + 1, 0, 255);
187
188 buf_ptr = strrchr(buf, ',');
189 *buf_ptr = '\0';
190 port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256;
191
Denys Vlasenkoca183112011-04-07 17:52:20 +0200192 set_nport(&lsa->u.sa, htons(port_num));
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000193 return xconnect_stream(lsa);
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000194}
195
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000196static int pump_data_and_QUIT(int from, int to)
197{
198 /* copy the file */
199 if (bb_copyfd_eof(from, to) == -1) {
200 /* error msg is already printed by bb_copyfd_eof */
201 return EXIT_FAILURE;
202 }
203
204 /* close data connection */
205 close(from); /* don't know which one is that, so we close both */
206 close(to);
207
208 /* does server confirm that transfer is finished? */
209 if (ftpcmd(NULL, NULL) != 226) {
210 ftp_die(NULL);
211 }
212 ftpcmd("QUIT", NULL);
213
214 return EXIT_SUCCESS;
215}
216
Rob Landleyb1c3fbc2006-05-04 19:52:28 +0000217#if !ENABLE_FTPGET
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000218int ftp_receive(const char *local_path, char *server_path);
Rob Landleyb1c3fbc2006-05-04 19:52:28 +0000219#else
Denis Vlasenko7039a662006-10-08 17:54:47 +0000220static
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000221int ftp_receive(const char *local_path, char *server_path)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000222{
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000223 int fd_data;
Glenn L McGrath236e93d2003-12-20 05:43:34 +0000224 int fd_local = -1;
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000225 off_t beg_range = 0;
226
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000227 /* connect to the data socket */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000228 fd_data = xconnect_ftpdata();
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000229
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000230 if (ftpcmd("SIZE", server_path) != 213) {
Rob Landleybc059bc2006-01-10 06:36:00 +0000231 do_continue = 0;
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000232 }
233
Denis Vlasenko9f739442006-12-16 23:49:13 +0000234 if (LONE_DASH(local_path)) {
Eric Andersen70060d22004-03-27 10:02:48 +0000235 fd_local = STDOUT_FILENO;
Glenn L McGrath236e93d2003-12-20 05:43:34 +0000236 do_continue = 0;
237 }
238
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000239 if (do_continue) {
240 struct stat sbuf;
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000241 /* lstat would be wrong here! */
242 if (stat(local_path, &sbuf) < 0) {
243 bb_perror_msg_and_die("stat");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000244 }
245 if (sbuf.st_size > 0) {
246 beg_range = sbuf.st_size;
247 } else {
248 do_continue = 0;
249 }
250 }
251
252 if (do_continue) {
Denys Vlasenkoa3aa3e32009-12-11 12:36:10 +0100253 sprintf(buf, "REST %"OFF_FMT"u", beg_range);
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000254 if (ftpcmd(buf, NULL) != 350) {
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000255 do_continue = 0;
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000256 }
257 }
258
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000259 if (ftpcmd("RETR", server_path) > 150) {
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000260 ftp_die("RETR");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000261 }
262
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000263 /* create local file _after_ we know that remote file exists */
Glenn L McGrath236e93d2003-12-20 05:43:34 +0000264 if (fd_local == -1) {
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000265 fd_local = xopen(local_path,
266 do_continue ? (O_APPEND | O_WRONLY)
267 : (O_CREAT | O_TRUNC | O_WRONLY)
268 );
Glenn L McGrath1643f412002-12-18 02:47:40 +0000269 }
270
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000271 return pump_data_and_QUIT(fd_data, fd_local);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000272}
273#endif
274
Rob Landleyb1c3fbc2006-05-04 19:52:28 +0000275#if !ENABLE_FTPPUT
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000276int ftp_send(const char *server_path, char *local_path);
Rob Landleyb1c3fbc2006-05-04 19:52:28 +0000277#else
Denis Vlasenko7039a662006-10-08 17:54:47 +0000278static
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000279int ftp_send(const char *server_path, char *local_path)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000280{
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000281 int fd_data;
282 int fd_local;
283 int response;
284
Denis Vlasenko6c615a62008-03-28 22:11:49 +0000285 /* connect to the data socket */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000286 fd_data = xconnect_ftpdata();
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000287
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000288 /* get the local file */
Denis Vlasenko9f739442006-12-16 23:49:13 +0000289 fd_local = STDIN_FILENO;
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000290 if (NOT_LONE_DASH(local_path))
Rob Landleyd921b2e2006-08-03 15:41:12 +0000291 fd_local = xopen(local_path, O_RDONLY);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000292
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000293 response = ftpcmd("STOR", server_path);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000294 switch (response) {
295 case 125:
296 case 150:
297 break;
298 default:
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000299 ftp_die("STOR");
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000300 }
301
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000302 return pump_data_and_QUIT(fd_local, fd_data);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000303}
304#endif
305
Bernhard Reutner-Fischer01d23ad2006-05-26 20:19:22 +0000306#if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000307static const char ftpgetput_longopts[] ALIGN1 =
Denis Vlasenkobdc88fd2007-07-23 17:14:14 +0000308 "continue\0" Required_argument "c"
309 "verbose\0" No_argument "v"
310 "username\0" Required_argument "u"
311 "password\0" Required_argument "p"
312 "port\0" Required_argument "P"
Denis Vlasenko990d0f62007-07-24 15:54:42 +0000313 ;
Bernhard Reutner-Fischer01d23ad2006-05-26 20:19:22 +0000314#endif
Glenn L McGrathb51eb262003-12-19 10:37:52 +0000315
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +0000316int ftpgetput_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +0000317int ftpgetput_main(int argc UNUSED_PARAM, char **argv)
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000318{
Denis Vlasenko562dc242007-01-03 21:55:50 +0000319 const char *port = "ftp";
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000320 /* socket to ftp server */
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000321
Denis Vlasenko562dc242007-01-03 21:55:50 +0000322#if ENABLE_FTPPUT && !ENABLE_FTPGET
323# define ftp_action ftp_send
324#elif ENABLE_FTPGET && !ENABLE_FTPPUT
325# define ftp_action ftp_receive
326#else
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000327 int (*ftp_action)(const char *, char *) = ftp_send;
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000328
Glenn L McGrath266c1f52003-12-20 03:19:27 +0000329 /* Check to see if the command is ftpget or ftput */
Denis Vlasenko562dc242007-01-03 21:55:50 +0000330 if (applet_name[3] == 'g') {
Bernhard Reutner-Fischere0387a62006-06-07 13:31:59 +0000331 ftp_action = ftp_receive;
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000332 }
Denis Vlasenko562dc242007-01-03 21:55:50 +0000333#endif
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000334
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000335 INIT_G();
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000336 /* Set default values */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000337 user = "anonymous";
338 password = "busybox@";
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000339
Eric Andersenc7bda1c2004-03-15 08:29:22 +0000340 /*
341 * Decipher the command line
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000342 */
Denis Vlasenkoc61852a2006-11-29 11:09:43 +0000343#if ENABLE_FEATURE_FTPGETPUT_LONG_OPTIONS
Denis Vlasenkobdc88fd2007-07-23 17:14:14 +0000344 applet_long_options = ftpgetput_longopts;
Denis Vlasenkoc61852a2006-11-29 11:09:43 +0000345#endif
Vladimir Dronnikov1dacfbb2009-10-23 23:34:43 +0200346 opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */
Denys Vlasenko60a94142011-05-13 20:57:01 +0200347 getopt32(argv, "cvu:p:P:", &user, &password, &port,
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000348 &verbose_flag, &do_continue);
Denis Vlasenko562dc242007-01-03 21:55:50 +0000349 argv += optind;
Glenn L McGrath236e93d2003-12-20 05:43:34 +0000350
Eric Andersen04d055f2003-11-03 21:20:18 +0000351 /* We want to do exactly _one_ DNS lookup, since some
352 * sites (i.e. ftp.us.debian.org) use round-robin DNS
353 * and we want to connect to only one IP... */
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000354 lsa = xhost2sockaddr(argv[0], bb_lookup_port(port, "tcp", 21));
Eric Andersen04d055f2003-11-03 21:20:18 +0000355 if (verbose_flag) {
Denis Vlasenko85629f02007-01-22 09:36:41 +0000356 printf("Connecting to %s (%s)\n", argv[0],
Denis Vlasenko0e7940a2008-03-29 07:37:42 +0000357 xmalloc_sockaddr2dotted(&lsa->u.sa));
Eric Andersen04d055f2003-11-03 21:20:18 +0000358 }
359
Denis Vlasenko7cb808e2008-03-29 07:40:35 +0000360 ftp_login();
Vladimir Dronnikov1dacfbb2009-10-23 23:34:43 +0200361 return ftp_action(argv[1], argv[2] ? argv[2] : argv[1]);
Glenn L McGrath02d7cbf2002-12-13 02:43:50 +0000362}