Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/ftpd.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/networking/ftpd.c

    r2725 r3232  
    1212 * You have to run this daemon via inetd.
    1313 */
     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"
    1430
    1531#include "libbb.h"
     
    207223    *(uint32_t *) G.msg_err = status;
    208224    xwrite(STDOUT_FILENO, G.msg_err, sizeof("NNN " MSG_ERR) - 1);
    209     if (G.verbose > 1)
     225    if (G.verbose > 0)
    210226        verbose_log(G.msg_err);
    211227}
     
    417433    setsockopt_reuseaddr(fd);
    418434
    419     set_nport(G.local_addr, 0);
     435    set_nport(&G.local_addr->u.sa, 0);
    420436    xbind(fd, &G.local_addr->u.sa, G.local_addr->len);
    421437    xlisten(fd, 1);
     
    526542#else
    527543    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));
    529545#endif
    530546    WRITE_OK(FTP_PORTOK);
     
    806822        sprintf(buf, STR(FTP_STATFILE_OK)" %04u%02u%02u%02u%02u%02u\r\n",
    807823            broken_out.tm_year + 1900,
    808             broken_out.tm_mon,
     824            broken_out.tm_mon + 1,
    809825            broken_out.tm_mday,
    810826            broken_out.tm_hour,
     
    912928     || !S_ISREG(statbuf.st_mode)
    913929    ) {
     930        free(tempname);
    914931        WRITE_ERR(FTP_UPLOADFAIL);
    915932        if (local_file_fd >= 0)
     
    11641181
    11651182    if (argv[optind]) {
    1166         xchdir(argv[optind]);
    1167         chroot(".");
     1183        xchroot(argv[optind]);
    11681184    }
    11691185
Note: See TracChangeset for help on using the changeset viewer.