From: thebomani at hotmail dot com Operating system: Red Hat Fedora 3 PHP version: 5.0.4 PHP Bug Type: *Directory/Filesystem functions Bug description: Antivirus Detection and Delettion of Virus Infected Files
Description: ------------ I am writting because I am working on a script that uses CLAMAV to scan uploaded files for viruses. I have noticed that when I upload a file that is infected with test virus such a "eicar.com.txt" the file gets deleted even if I rename or move the file or get a chance to scan it for viruses. If PHP is deleting the file is there any way to stop the file from being deleted or output the reason why the file was deleted. Reproduce code: --------------- <? chmod ("$img", 0775); $tmp_file = "/tmp/". md5(uniqid(rand(), true)); rename("$img", $tmp_file); $clamscan_prog = "/usr/local/bin/clamscan"; $data_input = "-v --stdout $tmp_file"; $data_size = strlen("$data_input"); $scan_result = passthru("$clamscan_prog $data_input"); //unlink("$img"); die("$tmp_file <br> $scan_result"); ?> -- Edit bug report at http://bugs.php.net/?id=34327&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34327&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34327&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34327&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34327&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34327&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34327&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34327&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34327&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34327&r=support Expected behavior: http://bugs.php.net/fix.php?id=34327&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34327&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34327&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34327&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34327&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34327&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34327&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34327&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34327&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34327&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34327&r=mysqlcfg