First off, I want to give a +1 vote for Stephen Gran's patch with the minor exception that he commented out a #if SENDMAIL_VERSION in two places of clamav-milter (he did this when testing, and forgot to remove the comments before publishing the patch). I know my vote doesn't count for much, but I feel partly responsible for the hours he put into it (I convinced him that he should write the patch instead of me) and his patch will definitely make the ClamAV codebase easier to maintain, and ensure no more messages get lost for those of us who run headless servers.

Now for my suggestions for trivial cleanups to clamav-milter.c:

I think there is an extraneous "continue" statement:
   line 4582 of 0.85g, 4430 after Steve's output patch

Also, I'm attaching a patch that makes the definition of the long_options struct a bit easier on the eyes. It will apply cleanly either before or after applying Stephen's patch (I'd recommend applying it after, since it will change line numbering a lot and can more easily find its offset).

Finally, I'm interested in removing some of the code duplication (specifically in the watchdog() function) caused by the SESSION #ifdefs. Before I attempt that, though, is the SESSION/!SESSION #define something that's expected to stay in both forms? Or is that code that will be removed soon anyway?

Damian Menscher
--
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-
--- clamav-milter.c     2005-05-27 10:16:30.000000000 -0500
+++ /home/menscher/0.85e.clean  2005-05-28 10:26:49.704399016 -0500
@@ -573,113 +573,43 @@
 #endif
 
                static struct option long_options[] = {
-                       {
-                               "from", 2, NULL, 'a'
-                       },
-                       {
-                               "advisory", 0, NULL, 'A'
-                       },
-                       {
-                               "bounce", 0, NULL, 'b'
-                       },
-                       {
-                               "broadcast", 2, NULL, 'B'
-                       },
-                       {
-                               "config-file", 1, NULL, 'c'
-                       },
-                       {
-                               "detect-forged-local-address", 0, NULL, 'L'
-                       },
-                       {
-                               "dont-log-clean", 0, NULL, 'C'
-                       },
-                       {
-                               "dont-scan-on-error", 0, NULL, 'd'
-                       },
-                       {
-                               "dont-wait", 0, NULL, 'w'
-                       },
-                       {
-                               "debug", 0, NULL, 'D'
-                       },
-                       {
-                               "external", 0, NULL, 'e'
-                       },
-                       {
-                               "force-scan", 0, NULL, 'f'
-                       },
-                       {
-                               "headers", 0, NULL, 'H'
-                       },
-                       {
-                               "help", 0, NULL, 'h'
-                       },
-                       {
-                               "pidfile", 1, NULL, 'i'
-                       },
-                       {
-                               "local", 0, NULL, 'l'
-                       },
-                       {
-                               "noreject", 0, NULL, 'N'
-                       },
-                       {
-                               "noxheader", 0, NULL, 'n'
-                       },
-                       {
-                               "outgoing", 0, NULL, 'o'
-                       },
-                       {
-                               "postmaster", 1, NULL, 'p'
-                       },
-                       {
-                               "postmaster-only", 0, NULL, 'P',
-                       },
-                       {
-                               "quiet", 0, NULL, 'q'
-                       },
-                       {
-                               "quarantine", 1, NULL, 'Q',
-                       },
-                       {
-                               "quarantine-dir", 1, NULL, 'U',
-                       },
-                       {
-                               "max-children", 1, NULL, 'm'
-                       },
-                       {
-                               "server", 1, NULL, 's'
-                       },
-                       {
-                               "sign", 0, NULL, 'S'
-                       },
-                       {
-                               "signature-file", 1, NULL, 'F'
-                       },
-                       {
-                               "template-file", 1, NULL, 't'
-                       },
-                       {
-                               "timeout", 1, NULL, 'T'
-                       },
-                       {
-                               "whitelist-file", 1, NULL, 'W'
-                       },
-                       {
-                               "version", 0, NULL, 'V'
-                       },
-                       {
-                               "sendmail-cf", 1, NULL, '0'
-                       },
+                       { "from",                               2,      NULL,   
'a' },
+                       { "advisory",                           0,      NULL,   
'A' },
+                       { "bounce",                             0,      NULL,   
'b' },
+                       { "broadcast",                          2,      NULL,   
'B' },
+                       { "config-file",                        1,      NULL,   
'c' },
+                       { "detect-forged-local-address",        0,      NULL,   
'L' },
+                       { "dont-log-clean",                     0,      NULL,   
'C' },
+                       { "dont-scan-on-error",                 0,      NULL,   
'd' },
+                       { "dont-wait",                          0,      NULL,   
'w' },
+                       { "debug",                              0,      NULL,   
'D' },
+                       { "external",                           0,      NULL,   
'e' },
+                       { "force-scan",                         0,      NULL,   
'f' },
+                       { "headers",                            0,      NULL,   
'H' },
+                       { "help",                               0,      NULL,   
'h' },
+                       { "pidfile",                            1,      NULL,   
'i' },
+                       { "local",                              0,      NULL,   
'l' },
+                       { "noreject",                           0,      NULL,   
'N' },
+                       { "noxheader",                          0,      NULL,   
'n' },
+                       { "outgoing",                           0,      NULL,   
'o' },
+                       { "postmaster",                         1,      NULL,   
'p' },
+                       { "postmaster-only",                    0,      NULL,   
'P' },
+                       { "quiet",                              0,      NULL,   
'q' },
+                       { "quarantine",                         1,      NULL,   
'Q' },
+                       { "quarantine-dir",                     1,      NULL,   
'U' },
+                       { "max-children",                       1,      NULL,   
'm' },
+                       { "server",                             1,      NULL,   
's' },
+                       { "sign",                               0,      NULL,   
'S' },
+                       { "signature-file",                     1,      NULL,   
'F' },
+                       { "template-file",                      1,      NULL,   
't' },
+                       { "timeout",                            1,      NULL,   
'T' },
+                       { "whitelist-file",                     1,      NULL,   
'W' },
+                       { "version",                            0,      NULL,   
'V' },
+                       { "sendmail-cf",                        1,      NULL,   
'0' },
 #ifdef CL_DEBUG
-                       {
-                               "debug-level", 1, NULL, 'x'
-                       },
+                       { "debug-level",                        1,      NULL,   
'x' },
 #endif
-                       {
-                               NULL, 0, NULL, '\0'
-                       }
+                       { NULL,                                 0,      NULL,   
'\0' }
                };
 
                int ret = getopt_long(argc, argv, args, long_options, 
&opt_index);
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to