Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-10-11 Thread Mark Allan
D'oh!  I didn't realise .80rc4 was out.  I wrote that email a couple of 
days ago and only just got round to sending it!

Sorry.
On 11 Oct 2004, at 11:35 pm, Tomasz Kojm wrote:
On Mon, 11 Oct 2004 23:32:12 +0100
Mark Allan <[EMAIL PROTECTED]> wrote:
Hi guys,
With the release of 8.0 imminent, can I ask again why the OS X
resource fork patch has not made it in yet?
We know it works, so I'm a bit confused.  I don't mean to moan, I'm
just surprised not to see it accepted yet.
The change has been included in 0.80rc4.
--
   oo. Tomasz Kojm <[EMAIL PROTECTED]>
  (\/)\. http://www.ClamAV.net/gpg/tkojm.gpg
 \..._ 0DCA5A08407D5288279DB43454822DC8985A444B
   //\   /\  Tue Oct 12 00:35:00 CEST 2004
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-10-11 Thread Tomasz Kojm
On Mon, 11 Oct 2004 23:32:12 +0100
Mark Allan <[EMAIL PROTECTED]> wrote:

> Hi guys,
> 
> With the release of 8.0 imminent, can I ask again why the OS X
> resource fork patch has not made it in yet?
> 
> We know it works, so I'm a bit confused.  I don't mean to moan, I'm 
> just surprised not to see it accepted yet.

The change has been included in 0.80rc4.

-- 
   oo. Tomasz Kojm <[EMAIL PROTECTED]>
  (\/)\. http://www.ClamAV.net/gpg/tkojm.gpg
 \..._ 0DCA5A08407D5288279DB43454822DC8985A444B
   //\   /\  Tue Oct 12 00:35:00 CEST 2004


pgpGcEooegqEN.pgp
Description: PGP signature
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-10-11 Thread Mark Allan
Hi guys,
With the release of 8.0 imminent, can I ask again why the OS X resource 
fork patch has not made it in yet?

We know it works, so I'm a bit confused.  I don't mean to moan, I'm 
just surprised not to see it accepted yet.

Thanks
Mark
On 1 Oct 2004, at 1:40 am, Remi Mommsen wrote:
On Sep 30, 2004, at 5:32 PM, Tomasz Kojm wrote:
On Mon, 27 Sep 2004 22:10:24 -0700
Remi Mommsen <[EMAIL PROTECTED]> wrote:
+
+#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;
+}
Don't forget to free(ditto)! BTW: Is the dummy statement really 
needed?
Right, stupid mistake. Can you (or whoever will eventually commit the 
patch) add it, please?

The dummy statement is unfortunately needed. Maybe it will be solved 
by one of the next gcc versions, but Xtools 1.3 and 1.5 both optimize 
it such that 'if( system(ditto) )' always evaluates to true, i.e. the 
copy fails. I guess I should submit a bug report, but haven't had time 
yet )-;

Cheers,
Remi
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-10-01 Thread Maxim Dounin
Hello!

On Thu, 30 Sep 2004, Remi Mommsen wrote:

[...]
> >> +sprintf(ditto,"/usr/bin/ditto --rsrc %s %s",src,dest);
[...]

Please also make shure that src & dest properly escaped when used in
system(). And don't forget to terminate options ('--') to avoid problems
with files starting with '-'.

Maxim Dounin
Rambler
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


RE: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-09-30 Thread Nigel Horne
> >> +#ifdef __APPLE_CC__


>   Remi

-Nigel
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-09-30 Thread Remi Mommsen
Hi,
On Sep 30, 2004, at 5:32 PM, Tomasz Kojm wrote:
On Mon, 27 Sep 2004 22:10:24 -0700
Remi Mommsen <[EMAIL PROTECTED]> wrote:
+
+#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;
+}
Don't forget to free(ditto)! BTW: Is the dummy statement really needed?
Right, stupid mistake. Can you (or whoever will eventually commit the 
patch) add it, please?

The dummy statement is unfortunately needed. Maybe it will be solved by 
one of the next gcc versions, but Xtools 1.3 and 1.5 both optimize it 
such that 'if( system(ditto) )' always evaluates to true, i.e. the copy 
fails. I guess I should submit a bug report, but haven't had time yet 
)-;

Cheers,
Remi
-
Failure is not an option.
It comes bundled with your Microsoft product.   (Ferenc Mantfeld)
*
Remigius K. Mommsen e-mail: [EMAIL PROTECTED]
University of California, Irvine   URL:http://cern.ch/mommsen
c/o SLAC voice:++1 (650) 926-3595
2575 Sand Hill Road #35fax:++1 (650) 926-3882
Menlo Park, CA 94025, US  home:++1 (650) 233-9041
*
___
http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel


Re: [Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-09-30 Thread Tomasz Kojm
On Mon, 27 Sep 2004 22:10:24 -0700
Remi Mommsen <[EMAIL PROTECTED]> wrote:

> +
> +#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;
> +}

Don't forget to free(ditto)! BTW: Is the dummy statement really needed?

-- 
   oo. Tomasz Kojm <[EMAIL PROTECTED]>
  (\/)\. http://www.ClamAV.net/gpg/tkojm.gpg
 \..._ 0DCA5A08407D5288279DB43454822DC8985A444B
   //\   /\  Fri Oct  1 02:31:30 CEST 2004



pgpamoQSn1miA.pgp
Description: PGP signature


[Clamav-devel] PATCH: improvements for Mac OS X/clamXav

2004-09-27 Thread Remi Mommsen
[Resend as first message never made it to the list]
Hi,
I'm maintaining the fink (http://fink.sourceforge.net) package of 
clamav for Mac OS X. The recent release of the GUI clamXav by Mark 
Allen (see 
http://article.gmane.org/gmane.comp.security.virus.clamav.devel/1194) 
triggered 2 fixes/extensions which are applied to the fink package 
since clamav version 0.75. I think it would be worthwhile to include 
them in the official source tree.

(1) Files on Mac OS X may have a so called resource forks where meta 
data to the file is stored. They generic way how clamscan copies 
infected files does not preserve the resource fork, i.e. destroys files 
which rely on the meta data. I resorted to a system call to 'ditto', an 
utility provided by Apple to copy files preserving the resource fork.

(2) In order to provide some progress information in clamXav while the 
scan is in progress, Mark asked to have a print-out of the scanned 
file. I added such a print statement which is printed if clamscan is 
called with the verbose option.

Please find a patch with these 2 changes attached to the mail.
Cheers,
Remi



clamav.patch
Description: Binary data

-
Progress in high energy physics: particles discovered yesterday are
used for calibration today, and will be the background tomorrow.
*
Remigius K. Mommsen e-mail: [EMAIL PROTECTED]
University of California, Irvine   URL:http://cern.ch/mommsen
c/o SLAC voice:++1 (650) 926-3595
2575 Sand Hill Road #35fax:++1 (650) 926-3882
Menlo Park, CA 94025, US  home:++1 (650) 233-9041
*