//usage: " 21 stream tcp nowait root ftpd ftpd /files/to/serve\n"
//usage: "It also can be ran from tcpsvd:\n"
//usage: " tcpsvd -vE 0.0.0.0 21 ftpd /files/to/serve\n"
-//usage: "\nOptions:"
//usage: "\n -w Allow upload"
//usage: "\n -v Log errors to stderr. -vv: verbose log"
//usage: "\n -S Log errors to syslog. -SS: verbose log"
gmtime_r(&statbuf.st_mtime, &broken_out);
sprintf(buf, STR(FTP_STATFILE_OK)" %04u%02u%02u%02u%02u%02u\r\n",
broken_out.tm_year + 1900,
- broken_out.tm_mon,
+ broken_out.tm_mon + 1,
broken_out.tm_mday,
broken_out.tm_hour,
broken_out.tm_min,
|| fstat(local_file_fd, &statbuf) != 0
|| !S_ISREG(statbuf.st_mode)
) {
+ free(tempname);
WRITE_ERR(FTP_UPLOADFAIL);
if (local_file_fd >= 0)
goto close_local_and_bail;
#endif
if (argv[optind]) {
- xchdir(argv[optind]);
- chroot(".");
+ xchroot(argv[optind]);
}
//umask(077); - admin can set umask before starting us