[Linux-Biella] PhpAntiVirus open source
abewayer
l.delvecchio a bilug.linux.it
Mar 24 Gen 2012 16:44:20 CET
Il giorno Tue, 24 Jan 2012 16:42:14 +0100
abewayer <l.delvecchio a bilug.linux.it> ha scritto:
>
> Ciao.
>
> Ho trovato un programmino open source che effettua lo scann dei file
> archiviati sul server.
>
> Molto funzionale.
>
> C'e' solo un problema.
>
> I file su cui esercita lo scann sono solo file php html txt piĆ¹ altri
> relativi agli script cgi.
> Ho provato a modificarlo per effettuare lo scann su altre tipologie di
> file ma mi da un errore relativo all'uso della memoria.
>
> Ecco l'errore:
>
> Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
> allocate 280 bytes)
> in /home/mhd-01/www.abelascimmia.org/htdocs/filesystem/av/index.php on
> line 94
>
>
> Ecco le linee di codice interessate (una funzione in particolare):
>
> function virus_check($file, $defs, $debug) {
> global $filecount, $infected, $report, $CONFIG;
>
> // find scannable files
> $scannable = 0;
> foreach ($CONFIG['extensions'] as $ext) {
> if (substr($file,-3)==$ext)
> $scannable = 1;
> }
>
> // compare against defs
> if ($scannable) {
> // affectable formats
> $filecount++;
> $data = file($file); <== Questa e' la linea
> 94 $data = implode('\r\n', $data);
> $clean = 1;
> foreach ($defs as $virus) {
> if (strpos($data, $virus[1])) {
> // file matches virus defs
> $report .= '<p class="r">Infected: ' .
> $file . ' (' . $virus[0] . ')</p>'; $infected++;
> $clean = 0;
> }
> }
> if (($debug)&&($clean))
> $report .= '<p class="g">Clean: ' . $file .
> '</p>'; }
> }
> L'unica alternativa alla memoria sono le periferiche di input output.
Scusate ho lanciato la mail per errore.
Qui si puo' scaricare lo script:
http://sourceforge.net/projects/phpantivirus/files/latest/download
Grazie a tutti per l'aiuto
Abe Wayer
--
L'unica alternativa alla memoria sono le periferiche di input output.
Abe the n00b cutting/pasting ape
Abe is the #484397 linux registered user
Mio blog: http://www.abelascimmia.org
Maggiori informazioni sulla lista
Linux