From owner-freebsd-net@FreeBSD.ORG Mon Jul 17 17:49:49 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C088516A4DE; Mon, 17 Jul 2006 17:49:49 +0000 (UTC) (envelope-from ormandj@corenode.com) Received: from zone2.corenode.com (zone2.corenode.com [66.91.129.184]) by mx1.FreeBSD.org (Postfix) with ESMTP id 672F743D70; Mon, 17 Jul 2006 17:49:45 +0000 (GMT) (envelope-from ormandj@corenode.com) Received: from corenode.com ([127.0.0.1]) by zone2.corenode.com (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0J2K00F356XXAL10@zone2.corenode.com>; Mon, 17 Jul 2006 07:51:33 -1000 (HST) Received: from [132.160.192.10] by zone2.corenode.com (mshttpd); Mon, 17 Jul 2006 07:51:33 -1000 Date: Mon, 17 Jul 2006 07:51:33 -1000 From: "David J. Orman" In-reply-to: <200607171306.01882.mi+mx@aldan.algebra.com> To: Mikhail Teterin Message-id: MIME-version: 1.0 X-Mailer: Sun Java(tm) System Messenger Express 6.2-3.04 (built Jul 15 2005) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal References: <200607171306.01882.mi+mx@aldan.algebra.com> Cc: isp@freebsd.org, net@freebsd.org Subject: Re: forcing FTP-uploaded files to be of certain types only X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2006 17:49:49 -0000 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. Maybe it would be better to examine files periodically that were uploaded via a simple program, and anything that isn't allowed, destroy. You could also make it compress things that weren't compressed to begin with, etc etc etc. Good luck, David ----- Original Message ----- From: Mikhail Teterin Date: Monday, July 17, 2006 7:06 am Subject: forcing FTP-uploaded files to be of certain types only > Hello! > > We run an FTP server for the customers to upload their data > (usually -- giant > core-files and database-dumps). > > Sometimes they forget compress them, however, wasting many > gigabytes of our > server's space... > > How hard would it be to make the stock FreeBSD FTP-server to > examine the > first, say, 100Kb of the uploaded file and interrupt transfer if > the file is > of a prohibited or is not of an allowed type? > > Anything under 100Kb is fine, I guess, and 100Kb is more than > enough to detect > compression or lack thereof... > > Thanks for ideas! > > -mi > _______________________________________________ > freebsd-isp@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-isp > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" >