From owner-freebsd-ports@FreeBSD.ORG Tue Dec 4 00:44:29 2007 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F52E16A46E for ; Tue, 4 Dec 2007 00:44:29 +0000 (UTC) (envelope-from jekillen@prodigy.net) Received: from smtp122.sbc.mail.sp1.yahoo.com (smtp122.sbc.mail.sp1.yahoo.com [69.147.64.95]) by mx1.freebsd.org (Postfix) with SMTP id 7828713C457 for ; Tue, 4 Dec 2007 00:44:29 +0000 (UTC) (envelope-from jekillen@prodigy.net) Received: (qmail 4441 invoked from network); 4 Dec 2007 00:44:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=prodigy.net; h=Received:X-YMail-OSG:In-Reply-To:References:Mime-Version:Content-Type:Message-Id:Content-Transfer-Encoding:Cc:From:Subject:Date:To:X-Mailer; b=NYryqWqLUdMPCyBfEPvzgdnUuxTQAF7Tv4IXb1H+ilzZU/rMOJUC7gd20MGuoGWKx/2DRO3m1tlGQXc4hN48T1eaBO/Et++YvUwQo1FBRJUwY3iWWvF3oBLJlFIMW8YgS8LAib8YfhIXFzZZhiRW4+L647l0uZUwrocsoz5f/y8= ; Received: from unknown (HELO ?75.7.236.228?) (jekillen@prodigy.net@75.7.236.228 with plain) by smtp122.sbc.mail.sp1.yahoo.com with SMTP; 4 Dec 2007 00:44:28 -0000 X-YMail-OSG: bofNAF4VM1mz4.yohCtA1qx7wGniKNqKY_sPlf7K9u2eo1.04Cm5iNP4XvdFE4oLVSnY1RlBUA-- In-Reply-To: <5297d6fd0712030621l25916c7et9fe487b76c557dd4@mail.gmail.com> References: <4751A84A.2070007@infracaninophile.co.uk> <5297d6fd0712030621l25916c7et9fe487b76c557dd4@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v622) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6d08c6fb17ee02796eea380a2f065430@prodigy.net> Content-Transfer-Encoding: 7bit From: jekillen Date: Mon, 3 Dec 2007 16:45:36 -0800 To: Attos X-Mailer: Apple Mail (2.622) Cc: freebsd-ports Subject: Re: PHP ClamAV Lib X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2007 00:44:29 -0000 On Dec 3, 2007, at 6:21 AM, Attos wrote: > You can execute ClamAV from PHP and parse the result. > The exec() function can do the job. This is the description from the > PHP manual: > > exec > (PHP 3, PHP 4, PHP 5) > > exec -- Execute an external program > Description > string exec ( string command [, array &output [, int &return_var]] ) > > > exec() executes the given command. > > Parameters > > > command > The command that will be executed. > > output > If the output argument is present, then the specified array will be > filled with every line of output from the command. Trailing > whitespace, such as \n, is not included in this array. Note that if > the array already contains some elements, exec() will append to the > end of the array. If you do not want the function to append elements, > call unset() on the array before passing it to exec(). > > return_var > If the return_var argument is present along with the output argument, > then the return status of the executed command will be written to this > variable. > > > Return Values > The last line from the result of the command. If you need to execute a > command and have all the data from the command passed directly back > without any interference, use the passthru() function. > > To get the output of the executed command, be sure to set and use the > output parameter. > > Examples > Example 1. An exec() example > > // outputs the username that owns the running php/httpd process > // (on a system with the "whoami" executable in the path) > echo exec('whoami'); > ?> > > Yes, I could use exec(); accept I would have to be vary careful to code the script so it could not be exploited by a client. I would be a little leery of scanning an uploaded file with a script that is run in a shell rather than run under the auspices of the web server. More than viruses, an image file could contain embedded php scripts. Or any other file for that matter. True it would have to have a recognized file name suffix for the file to be executed as php. but a call to gd functions can be made by specifying a php file rather than an image file in an image tag. Anyhow, I suspect I would have to rebuild php to include the Clamav module anyhow. And porting the php-clamav module, if it only builds the code, would leave the user having to do a rebuild of php to use it. And if there is no means of rebuilding a package to add or remove a feature, or use special configuration items, why not just by pass the port? I have been using ports and in some cases have been left wondering just how much configuration needs to be done after a port is installed, what and where was installed. But I probably am still missing something. Thanks for the suggestion. Jeff K > > > > > > On Dec 1, 2007 1:30 PM, Matthew Seaman > wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA256 >> >> jekillen wrote: >>> Hello: >>> I am looking for PHP ClamAV Lib >>> in ports and I do not know of hand >>> where to find it. I did not find it in >>> /usr/ports/security. And if it exists in >>> ports, what would it be called for a >>> find command? >>> My aim is to use it for scanning files >>> uploaded to web sites in php scripts. >>> I installed ClamAV, Amavisd-new, >>> and Cyrus-sasl-saslauthd >>> from /usr/ports/security. >>> FreeBSD v 6.2 >>> Thanks in advance >>> Jeff K