forcing FTP-uploaded files to be of certain types only

Mikhail Teterin mi+mx at aldan.algebra.com
Mon Jul 17 17:58:34 UTC 2006


понеділок 17 липень 2006 13:51, David J. Orman написав:
> The stock ftp server? If you can't base the prohibitions on file extension
> alone (such as the 100kb example you made) then you're going to have to
> modify the source of the ftp daemon yourself. Size, extension, etc - those
> are relatively easy limits to impliment. Actual file typing by examination
> of the first 100kb isn't easy, and it isn't part of the core functionality
> AFAIK. You'll have to write that. In fact, I'm not aware of any ftp server
> that does what you're asking.

I was hoping for some sort of plugin-API for the server... Determining the 
file's type is not really hard -- file(1) does just that. I'm not looking to 
prevent _malicious_ users -- just the ignorant ones.

We don't mind LARGE files -- some of those are legitimate. We just want them 
to be compressed before being uploaded. In fact, checking for this is even 
easier, than the usual byte-sniffing done by file(1) -- just try to compress 
those first 100K. If the result is smaller than 50K, the whole gets 
rejected :-)

> Maybe it would be better to examine files periodically that were uploaded
> via a simple program, and anything that isn't allowed, destroy.

No, destruction is not an option :-)

> You could also make it compress things that weren't compressed to begin
> with, etc etc etc.

Yeah, and we are doing that now -- kind of. But I would like an educational 
message sent to the uploader instead: "Transfer aborted: please compress 
large files before uploading"...

	-mi


More information about the freebsd-isp mailing list