Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

proposed patch

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


dale at daleenterprise

Nov 13, 2006, 4:23 PM

Post #1 of 3 (990 views)
Permalink
proposed patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tomasz, a patch is manually applied without exception when the ClamAV
software is built to work properly within the darwin environment and
there are several variation of the patch but the end changes are the
same, adding command-line options to manipulate the daemons.

I've updated the patch to work like other OS dependant code changes/
exceptions in the related files, can this be applied permanently so a
new patch doesn't have to be generated and applied whenever a new
ClamAV source becomes available please?

- -- Dale


diff -Naur clamd/clamd.c.orig clamd/clamd.c
- --- clamd/clamd.c.orig 2006-01-09 12:52:15.000000000 -0500
+++ clamd/clamd.c 2006-11-13 18:30:21.000000000 -0500
@@ -283,8 +283,15 @@
}
/* fork into background */
- - if(!cfgopt(copt, "Foreground"))
+#ifdef C_DARWIN
+ if(optc(opt, 'D') || cfgopt(copt, "Foreground")) {
+ logg("clamd running in foreground");
+ } else {
+#else
+ if(!cfgopt(copt, "Foreground")) {
+#endif
daemonize();
+ }
if(tcpsock)
ret = tcpserver(opt, copt, root);
diff -Naur clamd/options.c.orig clamd/options.c
- --- clamd/options.c.orig 2006-11-13 18:35:39.000000000 -0500
+++ clamd/options.c 2006-11-13 18:37:08.000000000 -0500
@@ -45,11 +45,18 @@
int ret, opt_index, i, len;
struct optstruct *opt;
+#ifdef C_DARWIN
+ const char *getopt_parameters = "hc:VD";
+#else
const char *getopt_parameters = "hc:V";
+#endif
static struct option long_options[] = {
{"help", 0, 0, 'h'},
{"config-file", 1, 0, 'c'},
+#ifdef C_DARWIN
+ {"foreground", 0, 0, 'D'},
+#endif
{"version", 0, 0, 'V'},
{"debug", 0, 0, 0},
{0, 0, 0, 0}
diff -Naur clamav/freshclam/freshclam.c.orig clamav/freshclam/
freshclam.c
- --- clamav/freshclam/freshclam.c.orig 2005-06-19 15:22:08.000000000
- -0400
+++ clamav/freshclam/freshclam.c 2005-06-23 08:20:47.000000000 -0400
@@ -286,8 +286,15 @@
bigsleep = 24 * 3600 / checks;
- - if(!cfgopt(copt, "Foreground"))
+#ifdef C_DARWIN
+ if(optc(opt, 'D') || cfgopt(copt, "Foreground")) {
+ logg("freshclam running in foreground");
+ } else {
+#else
+ if(!cfgopt(copt, "Foreground")) {
+#endif
daemonize();
+ }
if (optc(opt, 'p')) {
pidfile = getargc(opt, 'p');
diff -Naur clamav/freshclam/options.c.orig clamav/freshclam/options.c
- --- clamav/freshclam/options.c.orig 2005-06-19 15:22:08.000000000 -0400
+++ clamav/freshclam/options.c 2005-06-23 07:43:48.000000000 -0400
@@ -38,7 +38,11 @@
int ret, opt_index, i, len;
struct optstruct *opt;
+#ifdef C_DARWIN
+ const char *getopt_parameters = "hvdp:VDl:c:u:a:";
+#else
const char *getopt_parameters = "hvdp:Vl:c:u:a:";
+#endif
static struct option long_options[] = {
/*
@@ -55,6 +59,9 @@
{"log-verbose", 0, 0, 0}, /* not used */
{"stdout", 0, 0, 0},
{"daemon", 0, 0, 'd'},
+#ifdef C_DARWIN
+ {"foreground", 0, 0, 'D'},
+#endif
{"pid", 1, 0, 'p'},
{"user", 1, 0, 'u'}, /* not used */
{"config-file", 1, 0, 0},

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFFWQyZiD9DTPch4RQRAqnBAJ0WWt4szmjFgZv2iQkpk9wfJcUO/wCeJNwl
vbNisdnlgp96R9TkHlNMxdw=
=Bby9
-----END PGP SIGNATURE-----
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html


steve at lobefin

Nov 13, 2006, 5:20 PM

Post #2 of 3 (937 views)
Permalink
Re: proposed patch [In reply to]

On Mon, Nov 13, 2006 at 07:23:53PM -0500, Dale Walsh said:
> Tomasz, a patch is manually applied without exception when the ClamAV
> software is built to work properly within the darwin environment and
> there are several variation of the patch but the end changes are the
> same, adding command-line options to manipulate the daemons.
>
> I've updated the patch to work like other OS dependant code changes/
> exceptions in the related files, can this be applied permanently so a
> new patch doesn't have to be generated and applied whenever a new
> ClamAV source becomes available please?

Why does it have to be OS dependant? Can't the command line option be
available on all platforms?
--
--------------------------------------------------------------------------
| Stephen Gran | Heard that the next Space Shuttle is |
| steve [at] lobefin | supposed to carry several Guernsey |
| http://www.lobefin.net/~steve | cows? It's gonna be the herd shot |
| | 'round the world. |
--------------------------------------------------------------------------
Attachments: signature.asc (0.18 KB)


dale at daleenterprise

Nov 13, 2006, 5:39 PM

Post #3 of 3 (929 views)
Permalink
Re: proposed patch [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Nov 13, 2006, at 20:20:52, Stephen Gran wrote:

> On Mon, Nov 13, 2006 at 07:23:53PM -0500, Dale Walsh said:
>> Tomasz, a patch is manually applied without exception when the ClamAV
>> software is built to work properly within the darwin environment and
>> there are several variation of the patch but the end changes are the
>> same, adding command-line options to manipulate the daemons.
>>
>> I've updated the patch to work like other OS dependant code changes/
>> exceptions in the related files, can this be applied permanently so a
>> new patch doesn't have to be generated and applied whenever a new
>> ClamAV source becomes available please?
>
> Why does it have to be OS dependant? Can't the command line option be
> available on all platforms?
> --

Since the only interest is in changing things that darwin users have
to change before building the software I offered the patch as a
darwin related patch however, Tomasz and the rest of the devel team
may wish to incorporate the changes globally rather than for a single
OS.

I don't require any credit for the changes/patch, having it done at
the source level so no future patching is required is enough
gratification.

This would also mean that users wouldn't get frustrated when trying
to track down a new patch or people contacting me to generate one on
the fly because they can't figure out how to do it on their own.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)

iD8DBQFFWR5HiD9DTPch4RQRAuCgAJ4xnP+bBZDGSRpeFUX7XoGe5t28ogCgrAZh
wGPYvkJqOxg0k6ImumOvjOA=
=0ATf
-----END PGP SIGNATURE-----
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.