Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/ftpd.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/ftpd.c
r2725 r3232 12 12 * You have to run this daemon via inetd. 13 13 */ 14 15 //usage:#define ftpd_trivial_usage 16 //usage: "[-wvS] [-t N] [-T N] [DIR]" 17 //usage:#define ftpd_full_usage "\n\n" 18 //usage: "Anonymous FTP server\n" 19 //usage: "\n" 20 //usage: "ftpd should be used as an inetd service.\n" 21 //usage: "ftpd's line for inetd.conf:\n" 22 //usage: " 21 stream tcp nowait root ftpd ftpd /files/to/serve\n" 23 //usage: "It also can be ran from tcpsvd:\n" 24 //usage: " tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n" 25 //usage: "\n -w Allow upload" 26 //usage: "\n -v Log errors to stderr. -vv: verbose log" 27 //usage: "\n -S Log errors to syslog. -SS: verbose log" 28 //usage: "\n -t,-T Idle and absolute timeouts" 29 //usage: "\n DIR Change root to this directory" 14 30 15 31 #include "libbb.h" … … 207 223 *(uint32_t *) G.msg_err = status; 208 224 xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1); 209 if (G.verbose > 1)225 if (G.verbose > 0) 210 226 verbose_log(G.msg_err); 211 227 } … … 417 433 setsockopt_reuseaddr(fd); 418 434 419 set_nport( G.local_addr, 0);435 set_nport(&G.local_addr->u.sa, 0); 420 436 xbind(fd, &G.local_addr->u.sa, G.local_addr->len); 421 437 xlisten(fd, 1); … … 526 542 #else 527 543 G.port_addr = get_peer_lsa(STDIN_FILENO); 528 set_nport( G.port_addr, htons(port));544 set_nport(&G.port_addr->u.sa, htons(port)); 529 545 #endif 530 546 WRITE_OK(FTP_PORTOK); … … 806 822 sprintf(buf, STR(FTP_STATFILE_OK)" %04u%02u%02u%02u%02u%02u\r\n", 807 823 broken_out.tm_year + 1900, 808 broken_out.tm_mon ,824 broken_out.tm_mon + 1, 809 825 broken_out.tm_mday, 810 826 broken_out.tm_hour, … … 912 928 || !S_ISREG(statbuf.st_mode) 913 929 ) { 930 free(tempname); 914 931 WRITE_ERR(FTP_UPLOADFAIL); 915 932 if (local_file_fd >= 0) … … 1164 1181 1165 1182 if (argv[optind]) { 1166 xchdir(argv[optind]); 1167 chroot("."); 1183 xchroot(argv[optind]); 1168 1184 } 1169 1185
Note:
See TracChangeset
for help on using the changeset viewer.