Hi,

I have a patch here which adds support for moving Mac files containing resource forks. It came from Remi Mommsen who is the fink maintainer for the Mac OS X version of clamav but I've tested it extensively and can fairly safely say it works properly on Mac OS X. I can not, however, vouch for how it affects other build targets.

In its current incarnation, clamscan will strip out the Mac OS resource fork from an infected file which can cause many many problems on a Mac. This patch will use 'ditto' to copy the entire file including resource forks.

Mark

--- clamav-0.80rc2/clamscan/others.c Tue Jun 15 21:45:28 2004
+++ clamav-0.80rc2-patched/clamscan/others.c Sun Sep 26 17:39:54 2004
@@ -115,6 +115,15 @@


int filecopy(const char *src, const char *dest)
{
+ #ifdef __APPLE_CC__
+ /* On Mac OS X use ditto and copy resource fork, too. */
+ char *ditto = (char *) mcalloc(strlen(src) + strlen(dest) + 30, sizeof(char));
+ sprintf(ditto,"/usr/bin/ditto --rsrc \"%s\" \"%s\"",src,dest);
+ if( system(ditto) ) {
+ mprintf(""); // dummy statement to work around gcc optimizer bug
+ return -1;
+ }
+ #else
char buffer[FILEBUFF];
int s, d, bytes;


@@ -133,6 +142,7 @@

     /* [EMAIL PROTECTED]: check result of close for NFS file */
     return close(d);
+    #endif //__APPLE_CC__
 }

 int isnumb(const char *str)



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Clamav-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-devel

Reply via email to