ip link: add VLAN support
[oweals/busybox.git] / networking / ftpd.c
index e38138c0a85b1b4d8ef0e753597ab323c5113ae9..33db964fa46c465b72bda6fa75c65adee1873ee0 100644 (file)
@@ -821,7 +821,7 @@ handle_size_or_mdtm(int need_size)
                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,
@@ -927,6 +927,7 @@ handle_upload_common(int is_append, int is_unique)
         || 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;
@@ -1179,8 +1180,7 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv)
 #endif
 
        if (argv[optind]) {
-               xchdir(argv[optind]);
-               chroot(".");
+               xchroot(argv[optind]);
        }
 
        //umask(077); - admin can set umask before starting us