Current Events and Technology  
Home Pictures Projects The name "Anders" Donate to Contact

publicfile is DJB's read-only FTP / HTTP server

When entering PASV mode, the FTP server in publicfile responds by saying: 227 =1,2,3,4,187,162 where is the server's ip and 256*187 + 162 is the port.

However, it isn't clear what a 227 answer should look like given the RFC and as it happens, DJB's 227 =1,2,3,4,187,162 line trips up Linux ftp connection tracking code. The fix is to make the line read: 227 Entering Passive Mode(1,2,3,4,187,162) instead. Here's a patch.

I found this because I eroneously had ftp connection tracking on the server running ftpd. Everything worked great until the server needed to respond to a PASV request from the client. I straced the calls, and sure enough, ftpd was sending the response but nothing was showing up in a tcpdump on any interface! Turns out, the connection tracking code was eating it because it didn't understand it! The messages in dmesg were the clue that helped figure that one out.

Once to every man and nation,
comes the moment to decide,
In the strife of truth with falsehood,
for the good or evil side;
Some great cause,
some great decision,
offering each the bloom or blight,
And the choice goes by forever,
'twixt that darkness and that light.
Once to Every Man and Nation.mp3
~ James R. Lowell - 1845

"In our sleep, pain that cannot forget falls drop by drop upon the heart and in our despair, against our will comes wisdom through the awful grace of God."
~ Aeschylus

"Some men see things as they are and ask 'Why?'. I dream of things things that never were and ask 'Why not?'"

"In dreams begin responsibilities."
~ U2

"... we do these things not because they are easy, but because they are hard!"
~ JFK - on sending man to the moon

user:   pass:   ©