Ftpd sends a file using 'oldway' (not sendfile), when sendfile is not available, for example, the file is on a mounted nfs or smbfs filesystem. If the client ungracefully terminates the connection, ftpd receives a signal and dies, so the transfer does not appear in /var/log/ftpd. Fix: ftpd.c is 1.62.2.51 melkov:/usr/src/libexec/ftpd# diff ftpd.c.orig ftpd.c 222a223,227 > char *xfer_name; /* to be able to call logxfer() from dologout() */ > off_t xfer_size; > time_t xfer_start; > int xfer_log_progress = 0; /* whether transfer is in progress */ > 264c269 < static void logxfer __P((char *, off_t, time_t)); --- > static void logxfer __P((void)); 1655a1661,1664 > xfer_name = name; > xfer_size = st.st_size; > xfer_start = start; > xfer_log_progress = cmd == 0 && guest && stats; 1657a1667 > xfer_log_progress = 0; 1659c1669 < logxfer(name, st.st_size, start); --- > logxfer(); 2604a2615,2620 > > if (statfd >= 0 && xfer_log_progress) { > xfer_log_progress = 0; > logxfer(); > } > 3140,3143c3156 < logxfer(name, size, start) < char *name; < off_t size; < time_t start; --- > logxfer() 3153,3154c3166,3167 < path, name, (long long)size, < (long)(now - start + (now == start))); --- > path, xfer_name, (long long)xfer_size, > (long)(now - xfer_start + (now == xfer_start))); How-To-Repeat: (a) run /usr/libexec/ftpd -ADllS create /var/log/ftpd file Mount a NFS or SMBFS filesystem under anonymous ftp root. Get a file from that filesystem via some ftp client. While file transfer is in progress, terminate the ftp client. See tail /var/log/ftpd (b) Look into ftpd.c file - at send_data() function, label oldway:. - at lostconn(), sigquit() and dologout() functions. The problem should be apparent :)
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>