Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/ftpgetput.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/networking/ftpgetput.c
r2725 r3232 14 14 */ 15 15 16 //usage:#define ftpget_trivial_usage 17 //usage: "[OPTIONS] HOST [LOCAL_FILE] REMOTE_FILE" 18 //usage:#define ftpget_full_usage "\n\n" 19 //usage: "Download a file via FTP\n" 20 //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( 21 //usage: "\n -c,--continue Continue previous transfer" 22 //usage: "\n -v,--verbose Verbose" 23 //usage: "\n -u,--username USER Username" 24 //usage: "\n -p,--password PASS Password" 25 //usage: "\n -P,--port NUM Port" 26 //usage: ) 27 //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( 28 //usage: "\n -c Continue previous transfer" 29 //usage: "\n -v Verbose" 30 //usage: "\n -u USER Username" 31 //usage: "\n -p PASS Password" 32 //usage: "\n -P NUM Port" 33 //usage: ) 34 //usage: 35 //usage:#define ftpput_trivial_usage 36 //usage: "[OPTIONS] HOST [REMOTE_FILE] LOCAL_FILE" 37 //usage:#define ftpput_full_usage "\n\n" 38 //usage: "Upload a file to a FTP server\n" 39 //usage: IF_FEATURE_FTPGETPUT_LONG_OPTIONS( 40 //usage: "\n -v,--verbose Verbose" 41 //usage: "\n -u,--username USER Username" 42 //usage: "\n -p,--password PASS Password" 43 //usage: "\n -P,--port NUM Port" 44 //usage: ) 45 //usage: IF_NOT_FEATURE_FTPGETPUT_LONG_OPTIONS( 46 //usage: "\n -v Verbose" 47 //usage: "\n -u USER Username" 48 //usage: "\n -p PASS Password" 49 //usage: "\n -P NUM Port number" 50 //usage: ) 51 16 52 #include "libbb.h" 17 53 … … 23 59 int verbose_flag; 24 60 int do_continue; 25 char buf[ 1]; /* actually [BUFSZ] */61 char buf[4]; /* actually [BUFSZ] */ 26 62 } FIX_ALIASING; 27 63 #define G (*(struct globals*)&bb_common_bufsiz1) … … 68 104 69 105 do { 70 strcpy(buf, "EOF"); 106 strcpy(buf, "EOF"); /* for ftp_die */ 71 107 if (fgets(buf, BUFSZ - 2, control_stream) == NULL) { 72 108 ftp_die(NULL); … … 152 188 port_num += xatoul_range(buf_ptr + 1, 0, 255) * 256; 153 189 154 set_nport( lsa, htons(port_num));190 set_nport(&lsa->u.sa, htons(port_num)); 155 191 return xconnect_stream(lsa); 156 192 } … … 279 315 int ftpgetput_main(int argc UNUSED_PARAM, char **argv) 280 316 { 281 unsigned opt;282 317 const char *port = "ftp"; 283 318 /* socket to ftp server */ … … 308 343 #endif 309 344 opt_complementary = "-2:vv:cc"; /* must have 2 to 3 params; -v and -c count */ 310 opt =getopt32(argv, "cvu:p:P:", &user, &password, &port,345 getopt32(argv, "cvu:p:P:", &user, &password, &port, 311 346 &verbose_flag, &do_continue); 312 347 argv += optind;
Note:
See TracChangeset
for help on using the changeset viewer.