I noticed that by default, clamav does not build with -Wall.  So, today,
I gave it a run with CFLAGS="-Wall -Werror" to see how things went.
Below is patch based on several build failures.

Please note, most of it is trivial.  The only part that really looks like
it might take some thought are the additions to the switch statements:
they could probably just be handled with a default block, but I made it
explicit so that you could eyeball it and decide how you want to handle
them.

Thanks,


Index: clamav-milter/clamav-milter.c
===================================================================
--- clamav-milter/clamav-milter.c       (revision 44)
+++ clamav-milter/clamav-milter.c       (working copy)
@@ -128,7 +128,7 @@

 #define        VERSION_LENGTH  128

-/*#define      SESSION /*
+/*#define      SESSION */ /*
                 * Keep one command connection open to clamd, otherwise a new
                 * command connection is created for each new email
                 *
@@ -186,7 +186,7 @@
        uint32_t        base;
        uint32_t        mask;
 } localNets[] = {
-       /*{ PACKADDR(127,   0,   0,   0), MAKEMASK(24) },       /*   
127.0.0.0/24 */
+       /*{ PACKADDR(127,   0,   0,   0), MAKEMASK(24) },*/     /*   
127.0.0.0/24 */
        { PACKADDR(192, 168,   0,   0), MAKEMASK(16) }, /* 192.168.0.0/16 */
        { PACKADDR( 10,   0,   0,   0), MAKEMASK(24) }, /*    10.0.0.0/24 */
        { PACKADDR(172,  16,   0,   0), MAKEMASK(20) }, /*  172.16.0.0/20 */
@@ -281,7 +281,7 @@
 static int     fflag = 0;      /* force a scan, whatever */
 static int     oflag = 0;      /* scan messages from our machine? */
 static int     lflag = 0;      /* scan messages from our site? */
-static const   char    *progname;      /* our name - usually clamav-milter */
+static char    *progname;      /* our name - usually clamav-milter */

 /* Variables for --external */
 static int     external = 0;   /* scan messages ourself or use clamd? */
Index: freshclam/manager.c
===================================================================
--- freshclam/manager.c (revision 44)
+++ freshclam/manager.c (working copy)
@@ -50,6 +50,7 @@
 #include "../libclamav/others.h"
 #include "../libclamav/str.h" /* cli_strtok */
 #include "dns.h"
+#include "execute.h"


 int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, 
const char *hostname)
Index: shared/misc.c
===================================================================
--- shared/misc.c       (revision 44)
+++ shared/misc.c       (working copy)
@@ -28,6 +28,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <ctype.h>

 #include "clamav.h"
 #include "cfgparser.h"
Index: clamd/others.c
===================================================================
--- clamd/others.c      (revision 44)
+++ clamd/others.c      (working copy)
@@ -20,6 +20,7 @@
 #include "clamav-config.h"
 #endif

+#include <sys/wait.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
@@ -68,6 +69,8 @@
 #include "memory.h"
 #include "cfgparser.h"
 #include "session.h"
+#include "others.h"
+#include "../shared/output.h"

 #define ENV_FILE  "CLAM_VIRUSEVENT_FILENAME"
 #define ENV_VIRUS "CLAM_VIRUSEVENT_VIRUSNAME"
Index: libclamav/ole2_extract.c
===================================================================
--- libclamav/ole2_extract.c    (revision 44)
+++ libclamav/ole2_extract.c    (working copy)
@@ -405,8 +405,9 @@
        return(ole2_read_block(fd, hdr, buff, current_block));
 }

-/* Read the property tree.
-   It is read as just an array rather than a tree */
+/*
+// Read the property tree.
+//   It is read as just an array rather than a tree
 static void ole2_read_property_tree(int fd, ole2_header_t *hdr, const char 
*dir,
                                int (*handler)(int fd, ole2_header_t *hdr, 
property_t *prop, const char *dir))
 {
@@ -448,7 +449,7 @@
                        }
                }
                current_block = ole2_get_next_block_number(fd, hdr, 
current_block);
-               /* Loop detection */
+               // Loop detection
                if (++count > 100000) {
                        cli_dbgmsg("ERROR: loop detected\n");
                        return;
@@ -456,6 +457,7 @@
        }
        return;
 }
+*/

 static void ole2_walk_property_tree(int fd, ole2_header_t *hdr, const char 
*dir, int32_t prop_index,
                                int (*handler)(int fd, ole2_header_t *hdr, 
property_t *prop, const char *dir),
@@ -686,6 +688,7 @@
        return TRUE;
 }

+/*
 static int ole2_read_header(int fd, ole2_header_t *hdr)
 {
        int i;
@@ -745,6 +748,7 @@
        }
        return TRUE;
 }
+*/

 int cli_ole2_extract(int fd, const char *dirname, const struct cl_limits 
*limits)
 {
Index: libclamav/scanners.c
===================================================================
--- libclamav/scanners.c        (revision 44)
+++ libclamav/scanners.c        (working copy)
@@ -69,6 +69,7 @@
 #include "untar.h"
 #include "special.h"
 #include "binhex.h"
+#include "tnef.h"

 #ifdef HAVE_ZLIB_H
 #include <zlib.h>
@@ -378,7 +379,7 @@
         * Bit 6: Strong encryption was used
         * Bit 13: Encrypted central directory
         */
-       encrypted = (zdirent.d_flags & 0x2041 != 0);
+       encrypted = ((zdirent.d_flags & 0x2041) != 0);

        cli_dbgmsg("Zip: %s, crc32: 0x%x, offset: %d, encrypted: %d, 
compressed: %u, normal: %u, method: %d, ratio: %d (max: %d)\n", zdirent.d_name, 
zdirent.d_crc32, zdirent.d_off, encrypted, zdirent.d_csize, zdirent.st_size, 
zdirent.d_compr, zdirent.d_csize ? (zdirent.st_size / zdirent.d_csize) : 0, 
limits ? limits->maxratio : 0);

@@ -1394,8 +1395,7 @@

 int cli_magic_scandesc(int desc, const char **virname, unsigned long int 
*scanned, const struct cl_node *root, const struct cl_limits *limits, unsigned 
int options, unsigned int arec, unsigned int mrec)
 {
-       int ret = CL_CLEAN, nret;
-       int bread = 0;
+       int ret = CL_CLEAN;
        cli_file_t type;
        struct stat sb;

Index: libclamav/special.c
===================================================================
--- libclamav/special.c (revision 44)
+++ libclamav/special.c (working copy)
@@ -28,6 +28,7 @@
 #include "clamav.h"
 #include "others.h"
 #include "cltypes.h"
+#include "special.h"

 #define FALSE (0)
 #define TRUE (1)
Index: libclamav/mbox.c
===================================================================
--- libclamav/mbox.c    (revision 44)
+++ libclamav/mbox.c    (working copy)
@@ -2329,6 +2329,12 @@
                                                
switch(messageGetEncoding(aMessage)) {
                                                        case NOENCODING:
                                                        case EIGHTBIT:
+                                                       case QUOTEDPRINTABLE:
+                                                       case BASE64:
+                                                       case UUENCODE:
+                                                       case YENCODE:
+                                                       case EEXTENSION:
+                                                       case BINHEX:
                                                        case BINARY:
                                                                
if(encodingLine(aMessage) == NULL) {
                                                                        /*
Index: libclamav/htmlnorm.c
===================================================================
--- libclamav/htmlnorm.c        (revision 44)
+++ libclamav/htmlnorm.c        (working copy)
@@ -1138,6 +1138,8 @@
                                }
                                state = HTML_RFC2397_DATA;
                                break;
+                       case HTML_SPECIAL_CHAR:
+                               break;
                        case HTML_ESCAPE_CHAR:
                                value *= 16;
                                length++;
Index: libclamav/zziplib/zzip-zip.c
===================================================================
--- libclamav/zziplib/zzip-zip.c        (revision 44)
+++ libclamav/zziplib/zzip-zip.c        (working copy)
@@ -16,6 +16,7 @@
 #endif

 #include "target.h"
+#include "others.h"

 #include <zzip.h>                                  /* archive handling */
 #include <zzip-file.h>

-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | Is knowledge knowable?  If not, how do  |
|  [EMAIL PROTECTED]             | we know that?                           |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html

Reply via email to