Browse code

Update

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@84 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2003/10/17 12:16:14
Showing 31 changed files
... ...
@@ -6,5 +6,3 @@ Known bugs:
6 6
 -----------
7 7
 
8 8
 -) unrarlib doesn't work on 64-bit systems
9
--) clamd stability problems on BSD
10
--) clamav-milter stability problems
... ...
@@ -1,3 +1,16 @@
1
+Fri Oct 17 05:08:22 CEST 2003 (tk)
2
+----------------------------------
3
+  * new Spanish documentation on ClamAV + Sendmail integration by
4
+    Erick Ivaan Lopez Carreon
5
+  * freshclam: share cfgfile.o with clamd. Makefile conditions allow building
6
+	       without clamd (if pthread library is not available). The problem
7
+	       with outdated cfgfile.c in freshclam was reported by Jim C.
8
+  * clamd: fixed a segmentation fault with TCPAddr. Problem reported by
9
+	   Stefan Kaltenbrunner and fixed by Damien Curtain.
10
+  * libclamav: zziplib downgroaded to 0.10.81 with Martin Schitter's hardening
11
+	       patches
12
+  * sigtool: major stability fixes
13
+
1 14
 Sun Oct 12 21:14:21 BST 2003 (njh)
2 15
 ---------------------------------
3 16
   * libclamav: mbox.c now uses NO_STRTOK_R consistently with message.c
... ...
@@ -15,5 +15,5 @@
15 15
 #  along with this program; if not, write to the Free Software
16 16
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
 
18
-SUBDIRS = libclamav clamscan freshclam database docs sigtool clamd clamdscan clamav-milter etc
18
+SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs etc clamav-milter
19 19
 EXTRA_DIST = FAQ contrib test examples BUGS
... ...
@@ -114,7 +114,7 @@ am__include = @am__include@
114 114
 am__quote = @am__quote@
115 115
 install_sh = @install_sh@
116 116
 
117
-SUBDIRS = libclamav clamscan freshclam database docs sigtool clamd clamdscan clamav-milter etc
117
+SUBDIRS = libclamav clamscan clamd clamdscan freshclam sigtool database docs etc clamav-milter
118 118
 EXTRA_DIST = FAQ contrib test examples BUGS
119 119
 subdir = .
120 120
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
... ...
@@ -81,7 +81,7 @@ dnl there is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for
81 81
 dnl PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever created
82 82
 dnl (the prefix is a bit different, since we add an extra -target- and -host-)
83 83
 dnl 
84
-dnl @version: $Id: aclocal.m4,v 1.6 2003/10/12 17:51:08 kojm Exp $
84
+dnl @version: $Id: aclocal.m4,v 1.7 2003/10/17 03:16:14 kojm Exp $
85 85
 dnl @author Guido Draheim <guidod@gmx.de>                 STATUS: used often
86 86
 
87 87
 AC_DEFUN([AC_CREATE_TARGET_H],
... ...
@@ -4041,7 +4041,7 @@ dnl      AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers)
4041 4041
 dnl      AC_COMPILE_CHECK_SIZEOF(off_t, $headers)
4042 4042
 dnl
4043 4043
 dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu>
4044
-dnl @version $Id: aclocal.m4,v 1.6 2003/10/12 17:51:08 kojm Exp $
4044
+dnl @version $Id: aclocal.m4,v 1.7 2003/10/17 03:16:14 kojm Exp $
4045 4045
 dnl
4046 4046
 AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
4047 4047
 [changequote(<<, >>)dnl
... ...
@@ -16,7 +16,7 @@
16 16
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
 
18 18
 # FIXME: check automake for 'and' (&&)
19
-if USE_PTHREAD
19
+if BUILD_CLAMD
20 20
 if HAVE_MILTER
21 21
 
22 22
 sbin_PROGRAMS = clamav-milter
... ...
@@ -116,13 +116,13 @@ install_sh = @install_sh@
116 116
 
117 117
 
118 118
 # FIXME: check automake for 'and' (&&)
119
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@sbin_PROGRAMS = clamav-milter
119
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@sbin_PROGRAMS = clamav-milter
120 120
 
121
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@clamav_milter_SOURCES = clamav-milter.c
121
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_SOURCES = clamav-milter.c
122 122
 
123
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@clamav_milter_LDADD = ../clamd/cfgfile.o ../clamd/others.o ../clamscan/getopt.o
123
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_LDADD = ../clamd/cfgfile.o ../clamd/others.o ../clamscan/getopt.o
124 124
 
125
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@man_MANS = ../docs/clamav-milter.1
125
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@man_MANS = ../docs/clamav-milter.1
126 126
 
127 127
 DEFS = @DEFS@
128 128
 # CLAMD_LIBS is used, because clamav-milter requires the same libraries as clamd
... ...
@@ -132,23 +132,23 @@ EXTRA_DIST = clamav-milter.c clamd.sh clamav-milter.sh INSTALL
132 132
 subdir = clamav-milter
133 133
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
134 134
 CONFIG_CLEAN_FILES =
135
-@HAVE_MILTER_FALSE@@USE_PTHREAD_TRUE@sbin_PROGRAMS =
136
-@HAVE_MILTER_FALSE@@USE_PTHREAD_FALSE@sbin_PROGRAMS =
137
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@sbin_PROGRAMS = \
138
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@	clamav-milter$(EXEEXT)
139
-@HAVE_MILTER_TRUE@@USE_PTHREAD_FALSE@sbin_PROGRAMS =
135
+@BUILD_CLAMD_FALSE@@HAVE_MILTER_TRUE@sbin_PROGRAMS =
136
+@BUILD_CLAMD_FALSE@@HAVE_MILTER_FALSE@sbin_PROGRAMS =
137
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@sbin_PROGRAMS = \
138
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	clamav-milter$(EXEEXT)
139
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_FALSE@sbin_PROGRAMS =
140 140
 PROGRAMS = $(sbin_PROGRAMS)
141 141
 
142
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@am_clamav_milter_OBJECTS = \
143
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@	clamav-milter.$(OBJEXT)
142
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am_clamav_milter_OBJECTS = \
143
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	clamav-milter.$(OBJEXT)
144 144
 clamav_milter_OBJECTS = $(am_clamav_milter_OBJECTS)
145
-@HAVE_MILTER_FALSE@@USE_PTHREAD_TRUE@clamav_milter_DEPENDENCIES =
146
-@HAVE_MILTER_FALSE@@USE_PTHREAD_FALSE@clamav_milter_DEPENDENCIES =
147
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@clamav_milter_DEPENDENCIES = \
148
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@	../clamd/cfgfile.o \
149
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@	../clamd/others.o \
150
-@HAVE_MILTER_TRUE@@USE_PTHREAD_TRUE@	../clamscan/getopt.o
151
-@HAVE_MILTER_TRUE@@USE_PTHREAD_FALSE@clamav_milter_DEPENDENCIES =
145
+@BUILD_CLAMD_FALSE@@HAVE_MILTER_TRUE@clamav_milter_DEPENDENCIES =
146
+@BUILD_CLAMD_FALSE@@HAVE_MILTER_FALSE@clamav_milter_DEPENDENCIES =
147
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_DEPENDENCIES = \
148
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	../clamd/cfgfile.o \
149
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	../clamd/others.o \
150
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	../clamscan/getopt.o
151
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_FALSE@clamav_milter_DEPENDENCIES =
152 152
 clamav_milter_LDFLAGS =
153 153
 DEFAULT_INCLUDES =  -I. -I$(srcdir)
154 154
 CPPFLAGS = @CPPFLAGS@
... ...
@@ -15,7 +15,7 @@
15 15
 #  along with this program; if not, write to the Free Software
16 16
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
 
18
-if USE_PTHREAD
18
+if BUILD_CLAMD
19 19
 
20 20
 sbin_PROGRAMS = clamd
21 21
 
... ...
@@ -114,35 +114,35 @@ am__include = @am__include@
114 114
 am__quote = @am__quote@
115 115
 install_sh = @install_sh@
116 116
 
117
-@USE_PTHREAD_TRUE@sbin_PROGRAMS = clamd
118
-
119
-@USE_PTHREAD_TRUE@clamd_SOURCES = \
120
-@USE_PTHREAD_TRUE@    options.c \
121
-@USE_PTHREAD_TRUE@    options.h \
122
-@USE_PTHREAD_TRUE@    cfgfile.c \
123
-@USE_PTHREAD_TRUE@    cfgfile.h \
124
-@USE_PTHREAD_TRUE@    clamd.c \
125
-@USE_PTHREAD_TRUE@    defaults.h \
126
-@USE_PTHREAD_TRUE@    tcpserver.c \
127
-@USE_PTHREAD_TRUE@    tcpserver.h \
128
-@USE_PTHREAD_TRUE@    localserver.c \
129
-@USE_PTHREAD_TRUE@    localserver.h \
130
-@USE_PTHREAD_TRUE@    server.c \
131
-@USE_PTHREAD_TRUE@    server.h \
132
-@USE_PTHREAD_TRUE@    scanner.c \
133
-@USE_PTHREAD_TRUE@    scanner.h \
134
-@USE_PTHREAD_TRUE@    others.c \
135
-@USE_PTHREAD_TRUE@    others.h \
136
-@USE_PTHREAD_TRUE@    clamuko.c \
137
-@USE_PTHREAD_TRUE@    clamuko.h \
138
-@USE_PTHREAD_TRUE@    dazuko.h \
139
-@USE_PTHREAD_TRUE@    dazukoio.c \
140
-@USE_PTHREAD_TRUE@    dazukoio.h \
141
-@USE_PTHREAD_TRUE@    tests.c \
142
-@USE_PTHREAD_TRUE@    tests.h
143
-
144
-
145
-@USE_PTHREAD_TRUE@clamd_LDADD = ../clamscan/getopt.o
117
+@BUILD_CLAMD_TRUE@sbin_PROGRAMS = clamd
118
+
119
+@BUILD_CLAMD_TRUE@clamd_SOURCES = \
120
+@BUILD_CLAMD_TRUE@    options.c \
121
+@BUILD_CLAMD_TRUE@    options.h \
122
+@BUILD_CLAMD_TRUE@    cfgfile.c \
123
+@BUILD_CLAMD_TRUE@    cfgfile.h \
124
+@BUILD_CLAMD_TRUE@    clamd.c \
125
+@BUILD_CLAMD_TRUE@    defaults.h \
126
+@BUILD_CLAMD_TRUE@    tcpserver.c \
127
+@BUILD_CLAMD_TRUE@    tcpserver.h \
128
+@BUILD_CLAMD_TRUE@    localserver.c \
129
+@BUILD_CLAMD_TRUE@    localserver.h \
130
+@BUILD_CLAMD_TRUE@    server.c \
131
+@BUILD_CLAMD_TRUE@    server.h \
132
+@BUILD_CLAMD_TRUE@    scanner.c \
133
+@BUILD_CLAMD_TRUE@    scanner.h \
134
+@BUILD_CLAMD_TRUE@    others.c \
135
+@BUILD_CLAMD_TRUE@    others.h \
136
+@BUILD_CLAMD_TRUE@    clamuko.c \
137
+@BUILD_CLAMD_TRUE@    clamuko.h \
138
+@BUILD_CLAMD_TRUE@    dazuko.h \
139
+@BUILD_CLAMD_TRUE@    dazukoio.c \
140
+@BUILD_CLAMD_TRUE@    dazukoio.h \
141
+@BUILD_CLAMD_TRUE@    tests.c \
142
+@BUILD_CLAMD_TRUE@    tests.h
143
+
144
+
145
+@BUILD_CLAMD_TRUE@clamd_LDADD = ../clamscan/getopt.o
146 146
 
147 147
 DEFS = @DEFS@
148 148
 LIBS = -L../libclamav -lclamav @CLAMD_LIBS@
... ...
@@ -150,19 +150,19 @@ INCLUDES = -I../clamscan -I../libclamav
150 150
 subdir = clamd
151 151
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
152 152
 CONFIG_CLEAN_FILES =
153
-@USE_PTHREAD_TRUE@sbin_PROGRAMS = clamd$(EXEEXT)
154
-@USE_PTHREAD_FALSE@sbin_PROGRAMS =
153
+@BUILD_CLAMD_TRUE@sbin_PROGRAMS = clamd$(EXEEXT)
154
+@BUILD_CLAMD_FALSE@sbin_PROGRAMS =
155 155
 PROGRAMS = $(sbin_PROGRAMS)
156 156
 
157
-@USE_PTHREAD_TRUE@am_clamd_OBJECTS = options.$(OBJEXT) cfgfile.$(OBJEXT) \
158
-@USE_PTHREAD_TRUE@	clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
159
-@USE_PTHREAD_TRUE@	localserver.$(OBJEXT) server.$(OBJEXT) \
160
-@USE_PTHREAD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT) \
161
-@USE_PTHREAD_TRUE@	clamuko.$(OBJEXT) dazukoio.$(OBJEXT) \
162
-@USE_PTHREAD_TRUE@	tests.$(OBJEXT)
157
+@BUILD_CLAMD_TRUE@am_clamd_OBJECTS = options.$(OBJEXT) cfgfile.$(OBJEXT) \
158
+@BUILD_CLAMD_TRUE@	clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
159
+@BUILD_CLAMD_TRUE@	localserver.$(OBJEXT) server.$(OBJEXT) \
160
+@BUILD_CLAMD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT) \
161
+@BUILD_CLAMD_TRUE@	clamuko.$(OBJEXT) dazukoio.$(OBJEXT) \
162
+@BUILD_CLAMD_TRUE@	tests.$(OBJEXT)
163 163
 clamd_OBJECTS = $(am_clamd_OBJECTS)
164
-@USE_PTHREAD_TRUE@clamd_DEPENDENCIES = ../clamscan/getopt.o
165
-@USE_PTHREAD_FALSE@clamd_DEPENDENCIES =
164
+@BUILD_CLAMD_TRUE@clamd_DEPENDENCIES = ../clamscan/getopt.o
165
+@BUILD_CLAMD_FALSE@clamd_DEPENDENCIES =
166 166
 clamd_LDFLAGS =
167 167
 DEFAULT_INCLUDES =  -I. -I$(srcdir)
168 168
 CPPFLAGS = @CPPFLAGS@
... ...
@@ -35,16 +35,16 @@ int tcpserver(const struct optstruct *opt, const struct cfgstruct *copt, struct
35 35
 	struct sockaddr_in server;
36 36
 	int sockfd, backlog;
37 37
 	struct cfgstruct *cpt;
38
+	struct cfgstruct *taddr;
38 39
 	char *estr;
39
-	const char *taddr;
40 40
 
41 41
     memset((char *) &server, 0, sizeof(server));
42 42
     server.sin_family = AF_INET;
43 43
     server.sin_port = htons(cfgopt(copt, "TCPSocket")->numarg);
44
-    taddr = cfgopt(copt, "TCPAddr")->strarg;
45
-    if ( taddr != NULL && *taddr )
44
+
45
+    if (taddr = cfgopt(copt, "TCPAddr"))
46 46
     {
47
-	server.sin_addr.s_addr = inet_addr( taddr );
47
+	server.sin_addr.s_addr = inet_addr( taddr->strarg );
48 48
     }else
49 49
     {
50 50
 	server.sin_addr.s_addr = INADDR_ANY;
... ...
@@ -64,8 +64,8 @@ int tcpserver(const struct optstruct *opt, const struct cfgstruct *copt, struct
64 64
 	logg("!bind() error: %s\n", estr);
65 65
 	exit(1);
66 66
     } else {
67
-	if ( taddr != NULL && *taddr )
68
-	    logg("Bound to address %s on port %d\n", taddr, cfgopt(copt, "TCPSocket")->numarg);
67
+	if ( taddr != NULL && *taddr->strarg )
68
+	    logg("Bound to address %s on port %d\n", taddr->strarg, cfgopt(copt, "TCPSocket")->numarg);
69 69
 	else
70 70
 	    logg("Bound to port %d\n", cfgopt(copt, "TCPSocket")->numarg);
71 71
     }
... ...
@@ -15,7 +15,7 @@
15 15
 #  along with this program; if not, write to the Free Software
16 16
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
 
18
-if USE_PTHREAD
18
+if BUILD_CLAMD
19 19
 
20 20
 bin_PROGRAMS = clamdscan
21 21
 
... ...
@@ -114,34 +114,34 @@ am__include = @am__include@
114 114
 am__quote = @am__quote@
115 115
 install_sh = @install_sh@
116 116
 
117
-@USE_PTHREAD_TRUE@bin_PROGRAMS = clamdscan
117
+@BUILD_CLAMD_TRUE@bin_PROGRAMS = clamdscan
118 118
 
119
-@USE_PTHREAD_TRUE@clamdscan_SOURCES = \
120
-@USE_PTHREAD_TRUE@    options.c \
121
-@USE_PTHREAD_TRUE@    options.h \
122
-@USE_PTHREAD_TRUE@    clamdscan.c \
123
-@USE_PTHREAD_TRUE@    client.c \
124
-@USE_PTHREAD_TRUE@    client.h \
125
-@USE_PTHREAD_TRUE@    defaults.h
119
+@BUILD_CLAMD_TRUE@clamdscan_SOURCES = \
120
+@BUILD_CLAMD_TRUE@    options.c \
121
+@BUILD_CLAMD_TRUE@    options.h \
122
+@BUILD_CLAMD_TRUE@    clamdscan.c \
123
+@BUILD_CLAMD_TRUE@    client.c \
124
+@BUILD_CLAMD_TRUE@    client.h \
125
+@BUILD_CLAMD_TRUE@    defaults.h
126 126
 
127 127
 
128
-@USE_PTHREAD_TRUE@clamdscan_LDADD = ../clamscan/getopt.o ../clamscan/others.o ../clamd/cfgfile.o
128
+@BUILD_CLAMD_TRUE@clamdscan_LDADD = ../clamscan/getopt.o ../clamscan/others.o ../clamd/cfgfile.o
129 129
 
130 130
 INCLUDES = -I../clamscan -I../clamd -I../libclamav
131 131
 LIBS = -L../libclamav -lclamav @FRESHCLAM_LIBS@
132 132
 subdir = clamdscan
133 133
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
134 134
 CONFIG_CLEAN_FILES =
135
-@USE_PTHREAD_TRUE@bin_PROGRAMS = clamdscan$(EXEEXT)
136
-@USE_PTHREAD_FALSE@bin_PROGRAMS =
135
+@BUILD_CLAMD_TRUE@bin_PROGRAMS = clamdscan$(EXEEXT)
136
+@BUILD_CLAMD_FALSE@bin_PROGRAMS =
137 137
 PROGRAMS = $(bin_PROGRAMS)
138 138
 
139
-@USE_PTHREAD_TRUE@am_clamdscan_OBJECTS = options.$(OBJEXT) \
140
-@USE_PTHREAD_TRUE@	clamdscan.$(OBJEXT) client.$(OBJEXT)
139
+@BUILD_CLAMD_TRUE@am_clamdscan_OBJECTS = options.$(OBJEXT) \
140
+@BUILD_CLAMD_TRUE@	clamdscan.$(OBJEXT) client.$(OBJEXT)
141 141
 clamdscan_OBJECTS = $(am_clamdscan_OBJECTS)
142
-@USE_PTHREAD_TRUE@clamdscan_DEPENDENCIES = ../clamscan/getopt.o \
143
-@USE_PTHREAD_TRUE@	../clamscan/others.o ../clamd/cfgfile.o
144
-@USE_PTHREAD_FALSE@clamdscan_DEPENDENCIES =
142
+@BUILD_CLAMD_TRUE@clamdscan_DEPENDENCIES = ../clamscan/getopt.o \
143
+@BUILD_CLAMD_TRUE@	../clamscan/others.o ../clamd/cfgfile.o
144
+@BUILD_CLAMD_FALSE@clamdscan_DEPENDENCIES =
145 145
 clamdscan_LDFLAGS =
146 146
 
147 147
 DEFS = @DEFS@
... ...
@@ -9229,11 +9229,11 @@ esac
9229 9229
 
9230 9230
 
9231 9231
 if test "$have_pthreads" = "yes"; then
9232
-  USE_PTHREAD_TRUE=
9233
-  USE_PTHREAD_FALSE='#'
9232
+  BUILD_CLAMD_TRUE=
9233
+  BUILD_CLAMD_FALSE='#'
9234 9234
 else
9235
-  USE_PTHREAD_TRUE='#'
9236
-  USE_PTHREAD_FALSE=
9235
+  BUILD_CLAMD_TRUE='#'
9236
+  BUILD_CLAMD_FALSE=
9237 9237
 fi
9238 9238
 
9239 9239
 
... ...
@@ -9247,7 +9247,13 @@ else
9247 9247
 fi
9248 9248
 
9249 9249
 
9250
+if test "$have_pthreads" = "yes"
9251
+then
9252
+    cat >>confdefs.h <<\_ACEOF
9253
+#define BUILD_CLAMD 1
9254
+_ACEOF
9250 9255
 
9256
+fi
9251 9257
 
9252 9258
 
9253 9259
 if test "$test_clamav" = "yes"
... ...
@@ -9864,10 +9870,10 @@ echo "$as_me: error: conditional \"INSTALL_CONF\" was never defined.
9864 9864
 Usually this means the macro was only invoked conditionally." >&2;}
9865 9865
    { (exit 1); exit 1; }; }
9866 9866
 fi
9867
-if test -z "${USE_PTHREAD_TRUE}" && test -z "${USE_PTHREAD_FALSE}"; then
9868
-  { { echo "$as_me:$LINENO: error: conditional \"USE_PTHREAD\" was never defined.
9867
+if test -z "${BUILD_CLAMD_TRUE}" && test -z "${BUILD_CLAMD_FALSE}"; then
9868
+  { { echo "$as_me:$LINENO: error: conditional \"BUILD_CLAMD\" was never defined.
9869 9869
 Usually this means the macro was only invoked conditionally." >&5
9870
-echo "$as_me: error: conditional \"USE_PTHREAD\" was never defined.
9870
+echo "$as_me: error: conditional \"BUILD_CLAMD\" was never defined.
9871 9871
 Usually this means the macro was only invoked conditionally." >&2;}
9872 9872
    { (exit 1); exit 1; }; }
9873 9873
 fi
... ...
@@ -10429,8 +10435,8 @@ s,@LIBCLAMAV_LIBS@,$LIBCLAMAV_LIBS,;t t
10429 10429
 s,@CLAMD_LIBS@,$CLAMD_LIBS,;t t
10430 10430
 s,@FRESHCLAM_LIBS@,$FRESHCLAM_LIBS,;t t
10431 10431
 s,@TH_SAFE@,$TH_SAFE,;t t
10432
-s,@USE_PTHREAD_TRUE@,$USE_PTHREAD_TRUE,;t t
10433
-s,@USE_PTHREAD_FALSE@,$USE_PTHREAD_FALSE,;t t
10432
+s,@BUILD_CLAMD_TRUE@,$BUILD_CLAMD_TRUE,;t t
10433
+s,@BUILD_CLAMD_FALSE@,$BUILD_CLAMD_FALSE,;t t
10434 10434
 s,@HAVE_MILTER_TRUE@,$HAVE_MILTER_TRUE,;t t
10435 10435
 s,@HAVE_MILTER_FALSE@,$HAVE_MILTER_FALSE,;t t
10436 10436
 s,@GETENT@,$GETENT,;t t
... ...
@@ -320,10 +320,13 @@ AC_SUBST(CLAMD_LIBS)
320 320
 AC_SUBST(FRESHCLAM_LIBS)
321 321
 AC_SUBST(TH_SAFE)
322 322
 
323
-AM_CONDITIONAL(USE_PTHREAD, test "$have_pthreads" = "yes")
323
+AM_CONDITIONAL(BUILD_CLAMD, test "$have_pthreads" = "yes")
324 324
 AM_CONDITIONAL(HAVE_MILTER, test "$have_milter" = "yes")
325 325
 
326
-
326
+if test "$have_pthreads" = "yes"
327
+then
328
+    AC_DEFINE(BUILD_CLAMD)
329
+fi
327 330
 
328 331
 dnl Check for clamav in /etc/passwd
329 332
 
330 333
new file mode 100644
... ...
@@ -0,0 +1,478 @@
0
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1
+<html>
2
+<head>
3
+<title>Antivirus para Sendmail con clam</title>
4
+</head>
5
+<body>
6
+<h1 align="center">Antivirus para servidor de correo Sendmail con ClamAv</h1>
7
+<hr align="center" size="5" width="95%">
8
+<br>
9

                
10
+de virus para Sendmail, utilizando para esto el mejor antivirus del software libre "clamAv."
11
+</p>
12
+<a name="contenido">
13

                
14
+<ol>
15
+	<a href="#clamav">
16

                
17
+	<br>
18
+	<a href="#milter">
19
+	<li>- Instalacion del programa de enlace entre el antivirus y el servidor de correo sendmail</a></li>
20
+	<br>
21
+	<a href="#sendmail">
22

                
23
+	<br>
24
+	<a href="#pruebas">
25
+	<li>- Pruebas del sistema</a></li>
26
+	<br>
27
+</ol>
28
+
29
+
30
+
31

                
32
+<hr align="center" size="3" width="85%">
33

                
34
+<br>
35
+<p>Vamos a instalarlo desde las fuentes, por lo tanto debemos descargar dichas fuentes
36

                
37
+de <a href="http://download.sourceforge.net/clamav/">stable versions</a>(versiones estables).
38
+</p>
39
+ 
40

                
41

                
42
+
43

                
44

                
45

                
46
+descargar y descomprimir.</p>
47
+
48
+
49
+<br><br><br>
50
+
51

                
52
+
53

                
54
+<br>
55
+<ul>
56
+<li>groupadd clamav</li>
57
+<li>useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav</li>
58
+</ul>
59
+<br>
60

                
61
+<ul>
62
+<li>Descomprimir las fuentes:     <em>tar zxpvf clamav-x.yz.tar.gz</em></li><br>
63

                
64
+<em>./configure --sysconfdir=/etc</em></li>
65
+<li><em>make</em></li>
66
+<li><em>su -c 'make install'</em></li>
67
+</ul>
68
+Listo!! con eso tenemos instalado el clam.</p>
69
+
70
+<h4>Prueba:</h4>
71
+
72
+<p>Para probarlo ejecutemos una busqueda de virus a traves del directorio de las fuentes:
73
+<br><br>
74
+<em>clamscan -r -l scan.txt /usr/src/clamav-0.60/</em>
75
+<br><br>
76

                
77
+<em>--------------------------------------<br>
78
+Scan started: Thu Oct  2 18:42:28 2003<br>
79
+<br>
80
+/usr/src/clamav-0.60//test/test1: ClamAV-Test-Signature FOUND<br>
81
+/usr/src/clamav-0.60//test/test1.bz2: ClamAV-Test-Signature FOUND<br>
82
+/usr/src/clamav-0.60//test/test2.zip: ClamAV-Test-Signature FOUND<br>
83
+/usr/src/clamav-0.60//test/test3.rar: ClamAV-Test-Signature FOUND<br>
84
+/usr/src/clamav-0.60//test/test2.badext: ClamAV-Test-Signature FOUND<br>
85
+<br>
86
+-- summary --<br>
87
+Known viruses: 7846<br>
88
+Scanned directories: 38<br>
89
+Scanned files: 377<br>
90
+Infected files: 5<br>
91
+Data scanned: 6.19 Mb<br>
92
+I/O buffer size: 131072 bytes<br>
93
+Time: 9.945 sec (0 m 9 s)<br>
94
+<br><br>
95
+</em>
96
+<br>
97
+</p>
98
+
99
+<p>
100
+Si vamos a usar clam em modo demonio devemos editar /etc/clamav.conf, mas informacion:<br>
101
+<em>man 5 clamav.conf</em><br>
102
+<br>
103
+Mecesitaremos que corra como demonio si vamos a usar clamav-milter.<br>
104
+</p>
105
+
106
+<a href="#contenido">Volver</a>
107
+
108
+
109
+
110

                
111
+<hr align="center" size="3" width="85%">
112
+
113
+<h3><a name="milter">2.- Instalacion del programa de enlace entre 
114
+el antivirus y el servidor de correo sendmail</h3>
115
+<br>
116
+<p>Ahora que clam esta funcionando correctamente, procedemos a instalar el software 
117

                
118
+Tenemos varias opciones:<br>
119
+<br>
120
+<ul>
121
+<a href="#clamav-milter">
122

                
123

                
124
+<br>
125
+<a href="#nextg">
126

                
127
+amavis-perl/amavisd, desarrollado por Hilko Bengen</li>
128
+<br>
129
+<a href="#amavisnew">
130

                
131
+<br>
132
+</ul>
133
+</p>
134
+
135
+
136
+<strong>Nota sobre milter y sendmail:</strong><br>
137
+<br>
138
+<p>
139

                
140
+<br> Estos archivos de desarrollo 
141
+vienen con sendmail, pero sendmail debe estar compilado con soporte para milter.<br>
142

                
143
+<br>
144
+En caso de que sendmail lo construyamos nosotros mismos debemos crear un archivo <em>site.config.m4</em>
145
+ que contenga :<br><br>
146
+ <em>APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')</em>
147
+ <br><br>
148
+Y dicho archivo debe ir en: <em> ~/sendmail-x.xx.x/devtools/Site</em>
149
+<br><br>
150
+Los archivos de desarrollo tambien pueden existir como paquetes en rpm o dev, para 
151
+encontrar paquetes rpm podemos dar un vistazo en: <br>
152
+<a href="http://rpmfind.net">http://rpmfind.net</a> buscando sendmail-devel.<br>
153
+<br>
154
+Si usamos Debian tan facil como:<br>
155
+<em>apt-cache search libmilter</em><br>
156
+<br>
157
+Y sabremos que instalar.
158
+ <p>
159
+		<!--SUBSECCIONES DE MILTER-------------------------------------------  -->
160
+
161
+<a name="clamav-milter">
162
+<p>
163
+<strong>Clamav-milter:</strong><br><br>
164

                
165
+ para usarlo necesitamos reconfigurar ClamAv con:<br>
166
+<br>
167
+<em>./configure --enable-milter</em><br>
168
+<br>
169
+
170
+Ok, vamos al directorio de las fuentes de ClamAv.
171
+
172
+<br>
173
+<em>cd ~/lamav-x.yz/</em><br>
174
+<br>
175
+Y ejecutamos:<br>
176
+<br>
177
+<em>./configure --enable-milter --sysconfdir=/etc </em><br>
178
+<br>
179
+<em>make</em><br>
180
+<br>
181
+<em>make install</em><br>
182
+<br>
183

                
184

                
185

                
186
+<br>
187
+<br>
188
+Ya esta listo el milter, ahora vayamos a configurar <a href="#sendmail-clamav-milter">sendmail para clamav-milter.</a><br>
189
+<br>
190
+
191
+<!-- ----------------------------------------------------------------- -->
192
+
193
+<a name="nextg">
194
+<p><strong>AMaViS - "Next Generation":</strong><br><br>
195
+Lo podemos descargar desde :<br>
196
+<br>
197
+<a href="http://sourceforge.net/projects/amavis">http://sourceforge.net/projects/amavis</a><br>
198
+<br>
199
+Los descomprimimos: <em>tar zxpvf amavis-ng_0.1.6.4.orig.tar.gz</em><br>
200
+<br>
201

                
202
+<br>
203
+<em>make amavis-ng.info</em><br>
204
+<br>
205
+<br>
206
+O si tenemos instalado texi2html:<br>
207
+<br>
208
+<em>texi2html amavis-ng.texi</em><br>
209
+<br>
210

                
211
+<br>
212
+<br><br>
213
+
214
+<br><strong>Requisitos para amavis-ng:</strong><br>
215
+<br>
216
+Modulos Perl:<br>
217
+
218
+<ul>
219
+<li>File::MMagic</li>
220
+<li>Config::IniFiles</li>
221
+<li>MIME::Tools</li>
222
+</ul>
223
+Si se tiene instalado el modulo CPAN la cosa es tan facil como:<br>
224
+<br>
225
+<em>perl -MCPAN -e shell</em><br>
226
+<br>
227
+E irle indicando uno a uno:<br>
228
+<br>
229
+<em>install File::MMagic</em><br>
230
+<br>
231
+etc...<br>
232
+<br>
233
+</p>
234
+
235
+<p>
236
+<strong>Recomendados pero no indispensables:</strong><br>
237
+<br>
238
+Modulos perl:<br>
239
+<br>
240
+<ul>
241
+<li>Convert::TNEF</li>
242
+<li>Compress::Zlib</li>
243
+<li>Archive::Tar</li>
244
+<li>Archive::Zip</li>
245
+</ul>
246
+<br>
247
+<br>
248

                
249
+<br>
250
+<ul>
251
+<li>unrar</li>
252
+<li>Zoo</li>
253
+<li>Unzoo</li>
254
+<li>nomarch</li>
255
+<li>lha</li>
256
+<li>unarj</li>
257
+<li>zcat</li>
258
+<li>bunzip2</li>
259
+</ul>
260
+<br>
261
+Para verificar si los tenemos ya instalados:<br>
262
+<br>
263
+<em>-rpm -q paquete o -dpkg -s paquete, yast, linuxconf, etc.</em><br>
264
+<br>
265
+<br>
266
+Para instalar:<br>
267
+<br>
268
+<em>-rpm -i paquete o -dpkg -i paquete, yast, linuxconf, etc.</em><br>
269
+<br>
270
+</p>
271
+
272
+<strong>Instalando amavis-ng:</strong><br>
273
+<br>
274
+<em>perl Makefile.PL</em><br>
275
+<br>
276
+<em>make</em><br>
277
+<br>
278
+<em>su -c"make install"</em><br>
279
+<br>
280
+<br>
281
+<strong>Instalando amavis-milter:</strong><br>
282
+<br>
283

                
284
+programa milter, que permitira "conectar" sendmail y amavis.<br>
285

                
286
+<br>
287
+<em>make -C amavis-milter</em><br>
288
+<br>
289
+<em>$ su -c "make -C amavis-milter install"</em><br>
290
+<br>
291
+<br>
292
+<strong>configurando amavis-ng:</strong><br>
293
+<br>
294
+- Copiar el archivo de configuracion de ejemplo a <em>/etc/amavis-ng/</em>, editarlo y 
295
+modificar de la siguiente manera:<br>
296
+<ul>
297
+<li>mail-transfer-agent = Milter</li>
298
+<li>virus-scanner = CLAM (o CLAMD)</li>
299
+<li>notifiers=Sender, Recipients, Admin</li>
300
+</ul>
301
+<br>
302
+Y las secciones: <br>
303
+<em>[Milter]<br>
304
+<br>
305
+amavis socket = /var/run/amavis-ng/socket.amavis<br>
306
+<br>
307
+milter socket = /var/run/amavis-ng/socket.milter<br>
308
+<br>
309
+amavis-milter = /usr/sbin/amavis-milter<br>
310
+<br>
311
+amavis-milter pidfile = /var/run/amavis-ng/amavis-milter.pid</em><br>
312
+<br><br>
313
+Y <br>
314
+<em>[CLAM]<br>
315
+<br>
316
+clamscan = /usr/bin/clamscan</em><br>
317
+<br><br>
318
+o:<br>
319
+<em>[CLAMD]<br>
320
+socket = localhost:3310</em>
321
+<br><br>
322
+<BR>
323
+Ya esta listo el milter, ahora vayamos a configurar <a href="#sendmail-nextg">sendmail para amavis-ng.</a><br>
324
+<br>
325
+
326
+<!-- --------------------------------------------------------------------------- -->
327
+<a name="amavisnew">
328
+<p>
329
+<p><strong>AMaViS - New:</strong><br><br>
330

                
331
+
332
+</p>
333
+
334
+
335
+<a href="#contenido">Volver</a>
336
+
337
+
338
+
339
+<hr align="center" size="3" width="85%">
340

                
341
+<a name="sendmail">
342

                
343
+
344
+<a name="sendmail-clamav-milter">
345
+<strong>Sendmail y clamav-milter:</strong></a>
346
+<br>
347
+<br>
348
+Las siguientes instrucciones fueron tomasdas del archivo INSTALL de las fuentes:<br>
349
+<br>
350
+Agregar a /etc/mail/sendmail.mc:<br>
351
+<br>
352
+<em>INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav.sock, F=, T=S:4m;R:4m')dnl<br>
353
+        define(`confINPUT_MAIL_FILTERS', `clamav')<br></em>
354
+<br>
355
+<br>
356
+No olvidemos regenerar sendmail.cf<br>
357
+<br>
358
+<br>
359
+Verificar que existan en clamav.conf las siguientes entradas:<br>
360
+<br>
361
+<em>LocalSocket /var/run/clamd.sock<br>
362
+SaveStreamToDisk<br></em>
363
+<br>
364
+<br>
365
+Finalmente iniciar clamav-milter:<br>
366
+<br>
367
+<em>/usr/local/sbin/clamav-milter -blo /var/run/clamav.sock</em><br>
368
+<br>
369
+Y reiniciar sendmail<br>
370
+<br>
371
+****En el mismo directorio de las fuentes del clamav-milter viene un script <em>clamd.sh</em>
372
+Que podemos poner en /etc/init.d/ para iniciar el clamd.****<br>
373
+</p>        
374
+<br><br><br>
375
+Asi que si todo ha ido bien, ya hemos concluido y es hora de hacer alguna prueba.
376
+<br><br><br>
377
+
378
+<a name="sendmail-nextg">
379
+<strong>Sendmail y AMaViS - "Next Generation": </strong>
380
+<br>
381
+<br>
382
+Agregar lo siguiente al archvivo `sendmail.mc':<br>
383
+<br>
384
+<em>
385
+define(`MILTER', 1)<br>
386
+INPUT_MAIL_FILTER(`milter-amavis', \<br>
387
+  `S=local:/var/run/amavis-ng/socket.milter, F=T, T=S:10m;R:10m;E:10m')</em><br>
388
+<br><br>
389
+Rehacer el sendmail.cf y reiniciar sendmail.<br>
390

                
391
+<em>
392
+<br>
393
+Xmilter-amavis: local socket name /var/run/amavis-ng/socket.milter missing</em><br>
394
+<br>
395

                
396
+<br><br><br>
397
+
398
+
399
+		<!-- -------------------------------------------------------------- -->
400
+<a name="sendmail-amavisnew">
401
+<strong>sendmail y amavisd-new:</strong>
402
+<br>
403

                
404
+<br>
405
+
406
+
407
+
408
+<a href="#contenido">Volver</a>
409
+
410
+
411
+<!-- SECCION PRUEBAS----------------------------------------------------------- -->
412
+<hr align="center" size="3" width="85%">
413
+
414
+<a name="pruebas">
415
+<h3>Pruebas del sistema</h3>
416
+<p>Para probar el sistema solo hay que enviar algunos de los archivos con firmas de 
417
+viruas que vienen en las fuentes del clam, para checar si el sistema esta detectando los virus en los correos.</p>
418
+
419
+<a href="#contenido">Volver</a>
420
+
421
+
422
+
423
+
424
+
425
+<hr align="center" size="3" width="85%">
426
+
427
+
428
+
429

                
430
+<p>
431

                
432

                
433
+</p>
434
+<h4>Remover antiguo clam</h4>
435
+
436

                
437
+y simplemente hacer:<br><br>
438
+<em>make uninstall</em>
439
+<br><br>
440

                
441
+</p> 
442
+
443
+
444
+<h4>Remover amavis perl-11</h4>
445
+
446

                
447
+y simplemente hacer:<br><br>
448
+<em>make uninstall</em>
449
+<br><br>
450
+Con lo anterior tendriamos desinstalado amavis perl-11.
451
+<br>
452
+
453
+</p> 
454
+
455
+<h4>Deshacer cambios para amavis-perl en Sendmail</h4>
456
+<p>Como recordaran aquellos que usaron amavis perl, se requeria hacer algunos cambios 
457

                
458
+<br><br>
459
+<ul>
460

                
461
+<em> cp sendmail.cf sendmail.cf.amavisperl</em> </li>
462
+<br>
463
+<li>Devolver la version original de sendmail.cf :<br>
464
+<em>cp sendmail.orig.cf sendmail.cf</em></li>
465
+<br>
466
+<li>Reiniciar sendmail</li>
467
+<br>
468

                
469
+a la normalidad :)</li>
470
+</ul>
471
+</p>
472
+<a href="#contenido">Volver</a>
473
+
474
+<hr align="center" size="3" width="85%">
475
+
476
+</body>
477
+</html>
... ...
@@ -26,10 +26,14 @@ freshclam_SOURCES = \
26 26
     manager.h \
27 27
     defaults.h \
28 28
     notify.c \
29
-    notify.h \
30
-    cfgfile.c
29
+    notify.h
31 30
 
31
+if BUILD_CLAMD
32
+freshclam_LDADD = ../clamscan/getopt.o ../clamscan/others.o ../clamd/cfgfile.o
33
+else
32 34
 freshclam_LDADD = ../clamscan/getopt.o ../clamscan/others.o
35
+endif
36
+
33 37
 
34 38
 DEFS = @DEFS@
35 39
 INCLUDES = -I../clamscan -I../clamd -I../libclamav
... ...
@@ -125,11 +125,11 @@ freshclam_SOURCES = \
125 125
     manager.h \
126 126
     defaults.h \
127 127
     notify.c \
128
-    notify.h \
129
-    cfgfile.c
128
+    notify.h
130 129
 
131 130
 
132
-freshclam_LDADD = ../clamscan/getopt.o ../clamscan/others.o
131
+@BUILD_CLAMD_TRUE@freshclam_LDADD = ../clamscan/getopt.o ../clamscan/others.o ../clamd/cfgfile.o
132
+@BUILD_CLAMD_FALSE@freshclam_LDADD = ../clamscan/getopt.o ../clamscan/others.o
133 133
 
134 134
 DEFS = @DEFS@
135 135
 INCLUDES = -I../clamscan -I../clamd -I../libclamav
... ...
@@ -141,18 +141,20 @@ bin_PROGRAMS = freshclam$(EXEEXT)
141 141
 PROGRAMS = $(bin_PROGRAMS)
142 142
 
143 143
 am_freshclam_OBJECTS = freshclam.$(OBJEXT) options.$(OBJEXT) \
144
-	manager.$(OBJEXT) notify.$(OBJEXT) cfgfile.$(OBJEXT)
144
+	manager.$(OBJEXT) notify.$(OBJEXT)
145 145
 freshclam_OBJECTS = $(am_freshclam_OBJECTS)
146
-freshclam_DEPENDENCIES = ../clamscan/getopt.o ../clamscan/others.o
146
+@BUILD_CLAMD_TRUE@freshclam_DEPENDENCIES = ../clamscan/getopt.o \
147
+@BUILD_CLAMD_TRUE@	../clamscan/others.o ../clamd/cfgfile.o
148
+@BUILD_CLAMD_FALSE@freshclam_DEPENDENCIES = ../clamscan/getopt.o \
149
+@BUILD_CLAMD_FALSE@	../clamscan/others.o
147 150
 freshclam_LDFLAGS =
148 151
 DEFAULT_INCLUDES =  -I. -I$(srcdir)
149 152
 CPPFLAGS = @CPPFLAGS@
150 153
 LDFLAGS = @LDFLAGS@
151 154
 depcomp = $(SHELL) $(top_srcdir)/depcomp
152 155
 am__depfiles_maybe = depfiles
153
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgfile.Po ./$(DEPDIR)/freshclam.Po \
154
-@AMDEP_TRUE@	./$(DEPDIR)/manager.Po ./$(DEPDIR)/notify.Po \
155
-@AMDEP_TRUE@	./$(DEPDIR)/options.Po
156
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/freshclam.Po ./$(DEPDIR)/manager.Po \
157
+@AMDEP_TRUE@	./$(DEPDIR)/notify.Po ./$(DEPDIR)/options.Po
156 158
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
157 159
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
158 160
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
... ...
@@ -211,7 +213,6 @@ mostlyclean-compile:
211 211
 distclean-compile:
212 212
 	-rm -f *.tab.c
213 213
 
214
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfgfile.Po@am__quote@
215 214
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freshclam.Po@am__quote@
216 215
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Po@am__quote@
217 216
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@
... ...
@@ -522,7 +522,9 @@ void help(void)
522 522
     mprintf("    --log-verbose			save additional informations\n");
523 523
     mprintf("    --http-proxy=hostname[:port]	use proxy server hostname\n");
524 524
     mprintf("    --proxy-user=username:passwd	use username/password for proxy auth\n");
525
+#ifdef BUILD_CLAMD
525 526
     mprintf("    --daemon-notify[=/path/clamav.conf] send RELOAD command to clamd\n");
527
+#endif
526 528
     mprintf("    --on-update-execute=[COMMAND]	execute the COMMAND after successful update\n");
527 529
     mprintf("    --on-error-execute=[COMMAND]	execute the COMMAND if errors occured\n");
528 530
     mprintf("\n");
... ...
@@ -291,6 +291,7 @@ int downloadmanager(const struct optstruct *opt, const char *hostname)
291 291
     mprintf("Database updated (containing in total %d signatures).\n", vir);
292 292
     logg("Database updated (containing in total %d signatures).\n", vir);
293 293
 
294
+#ifdef BUILD_CLAMD
294 295
     if(optl(opt, "daemon-notify")) {
295 296
 	    const char *clamav_conf = getargl(opt, "daemon-notify");
296 297
 	if(!clamav_conf)
... ...
@@ -298,6 +299,7 @@ int downloadmanager(const struct optstruct *opt, const char *hostname)
298 298
 
299 299
 	notify(clamav_conf);
300 300
     }
301
+#endif
301 302
 
302 303
     if(optl(opt, "on-update-execute"))
303 304
 	system(getargl(opt, "on-update-execute"));
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2
- *  Copyright (C) 2002 Tomasz Kojm <zolw@konarski.edu.pl>
2
+ *  Copyright (C) 2002, 2003 Tomasz Kojm <zolw@konarski.edu.pl>
3 3
  *
4 4
  *  This program is free software; you can redistribute it and/or modify
5 5
  *  it under the terms of the GNU General Public License as published by
... ...
@@ -16,6 +16,8 @@
16 16
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
  */
18 18
 
19
+#ifdef BUILD_CLAMD
20
+
19 21
 #include <stdio.h>
20 22
 #include <unistd.h>
21 23
 #include <sys/types.h>
... ...
@@ -109,3 +111,5 @@ int notify(const char *cfgfile)
109 109
     logg("Clamd successfully notified about the update.\n");
110 110
     return 0;
111 111
 }
112
+
113
+#endif
... ...
@@ -2,7 +2,7 @@
2 2
  * Author: 
3 3
  *      Guido Draheim <guidod@gmx.de>
4 4
  *
5
- *      Copyright (c) 2001,2002,2003 Guido Draheim
5
+ *      Copyright (c) 2001 Guido Draheim
6 6
  *          All rights reserved,
7 7
  *          use under the restrictions of the
8 8
  *          Lesser GNU General Public License
... ...
@@ -53,34 +53,15 @@
53 53
 #define _zzip_inline inline
54 54
 #endif
55 55
 #endif
56
-#ifndef _zzip_size_t
57
-#ifdef   ZZIP_size_t
58
-#define _zzip_size_t ZZIP_size_t
59
-#else
60
-#define _zzip_size_t size_t
61
-#endif
62
-#endif
63
-#ifndef _zzip_ssize_t
64
-#ifdef   ZZIP_ssize_t
65
-#define _zzip_ssize_t ZZIP_ssize_t
66
-#else
67
-#define _zzip_ssize_t ssize_t
68
-#endif
69
-#endif
70 56
 
71 57
 /* whether this library shall use a 64bit off_t largefile variant in 64on32: */
72 58
 /* (some exported names must be renamed to avoid bad calls after linking) */
73
-#if defined ZZIP_LARGEFILE_SENSITIVE 
74
-# if _FILE_OFFSET_BITS+0 == 64
75
-# define  ZZIP_LARGEFILE_RENAME
76
-# elif defined  _LARGE_FILES    /* used on older AIX to get at 64bit off_t */
77
-# define  ZZIP_LARGEFILE_RENAME
78
-# elif defined  _ZZIP_LARGEFILE /* or simply use this one for zzip64 runs */
79
-# define  ZZIP_LARGEFILE_RENAME
80
-# endif
59
+#if defined ZZIP_LARGEFILE_SENSITIVE && _FILE_OFFSET_BITS+0 == 64
60
+#define  ZZIP_LARGEFILE_RENAME
61
+#elif defined  _LARGE_FILES /* on AIX */
62
+#define  ZZIP_LARGEFILE_RENAME
81 63
 #endif
82
-
83
-/* if the environment did not setup these for 64bit off_t largefile... */
64
+/* if some were forgotten but required to have 64bit off_t largefile.. */
84 65
 #ifdef   ZZIP_LARGEFILE_RENAME
85 66
 # ifndef      _FILE_OFFSET_BITS
86 67
 #  ifdef ZZIP__FILE_OFFSET_BITS /* == 64 */
... ...
@@ -89,12 +70,7 @@
89 89
 # endif
90 90
 # ifndef      _LARGE_FILES
91 91
 #  ifdef ZZIP__LARGE_FILES /* == 1 */
92
-#  define     _LARGE_FILES ZZIP__LARGE_FILES
93
-#  endif
94
-# endif
95
-# ifndef      _LARGEFILE_SOURCE
96
-#  ifdef ZZIP__LARGEFILE_SOURCE /* == 1 */
97
-#  define     _LARGEFILE_SOURCE ZZIP__LARGEFILE_SOURCE
92
+#  define     _LARGE_FILES 1
98 93
 #  endif
99 94
 # endif
100 95
 #endif
... ...
@@ -165,11 +141,6 @@
165 165
 #define __attribute__(X) 
166 166
 #endif
167 167
 
168
-#if defined ZZIP_EXPORTS || defined ZZIPLIB_EXPORTS
169
-# undef ZZIP_DLL
170
-#define ZZIP_DLL 1
171
-#endif
172
-
173 168
 /* based on zconf.h : */
174 169
 /* compile with -DZZIP_DLL for Windows DLL support */
175 170
 #if defined ZZIP_DLL
... ...
@@ -1,3 +1,4 @@
1
+#define USE_DIRENT 0
1 2
 /*
2 3
  * Author: 
3 4
  *	Guido Draheim <guidod@gmx.de>
... ...
@@ -23,8 +24,6 @@
23 23
 #include <stdio.h>
24 24
 #endif
25 25
 
26
-//#include "__dirent.h"
27
-
28 26
 #ifndef offsetof
29 27
 #pragma warning had to DEFINE offsetof as it was not in stddef.h
30 28
 #define offsetof(T,M) ((unsigned)(& ((T*)0)->M))
... ...
@@ -51,13 +50,11 @@ zzip_rewinddir(ZZIP_DIR * dir)
51 51
 {
52 52
     if (! dir) return;
53 53
 
54
-    /*
55 54
     if (USE_DIRENT && dir->realdir) 
56 55
     {
57 56
         _zzip_rewinddir(dir->realdir);
58 57
         return;
59 58
     }
60
-    */
61 59
 
62 60
     if (dir->hdr0)
63 61
         dir->hdr = dir->hdr0;
... ...
@@ -121,12 +118,11 @@ zzip_readdir(ZZIP_DIR * dir)
121 121
 {
122 122
     if (! dir) { errno=EBADF; return 0; }
123 123
 
124
-    /*
125 124
     if (USE_DIRENT && dir->realdir)
126 125
     {
127 126
         if (! real_readdir(dir))
128 127
             return 0;
129
-    }else */
128
+    }else
130 129
     {
131 130
         if (! dir->hdr) return 0;
132 131
 
... ...
@@ -151,10 +147,10 @@ zzip_telldir(ZZIP_DIR* dir)
151 151
 {
152 152
     if (! dir) { errno=EBADF; return -1; }
153 153
 
154
-    /* if (USE_DIRENT && dir->realdir)
154
+    if (USE_DIRENT && dir->realdir)
155 155
     {
156 156
         return _zzip_telldir(dir->realdir);
157
-    }else*/
157
+    }else
158 158
     {
159 159
     	return ((zzip_off_t) ((char*) dir->hdr - (char*) dir->hdr0));
160 160
     }
... ...
@@ -168,10 +164,10 @@ zzip_seekdir(ZZIP_DIR* dir, zzip_off_t offset)
168 168
 {
169 169
     if (! dir) return; 
170 170
     
171
-    /*if (USE_DIRENT && dir->realdir)
171
+    if (USE_DIRENT && dir->realdir)
172 172
     {
173 173
         _zzip_seekdir(dir->realdir, offset);
174
-    }else*/
174
+    }else
175 175
     {
176 176
 	dir->hdr = (struct zzip_dir_hdr*) 
177 177
 	    (dir->hdr0 ? (char*) dir->hdr0 + (size_t) offset : 0);
... ...
@@ -233,23 +229,6 @@ zzip_opendir_ext_io(zzip_char_t* filename, int o_modes,
233 233
 #  ifdef ZZIP_HAVE_SYS_STAT_H
234 234
     if (stat(filename, &st) >= 0 && S_ISDIR(st.st_mode)
235 235
     ){
236
-      	/* if (USE_DIRENT)
237
-	{
238
-	    _zzip_DIR* realdir = _zzip_opendir(filename);
239
-	    if (realdir)
240
-	    {
241
-		if (! (dir = (ZZIP_DIR *)calloc(1, sizeof (*dir))))
242
-		{ 
243
-		    _zzip_closedir(realdir); 
244
-		    return 0; 
245
-		}else
246
-		{ 
247
-		    dir->realdir = realdir; 
248
-		    dir->realname = strdup(filename);
249
-		    return dir; 
250
-		}
251
-	    }
252
-        } */
253 236
         return 0;
254 237
     }
255 238
 #  endif /* HAVE_SYS_STAT_H */
... ...
@@ -274,13 +253,13 @@ zzip_closedir(ZZIP_DIR* dir)
274 274
 {
275 275
     if (! dir) { errno = EBADF; return -1; }
276 276
 
277
-    /*if (USE_DIRENT && dir->realdir)
277
+    if (USE_DIRENT && dir->realdir)
278 278
     {
279 279
         _zzip_closedir(dir->realdir);
280 280
         free(dir->realname);
281 281
         free(dir);
282 282
         return 0;
283
-    }else*/
283
+    }else
284 284
     {
285 285
         zzip_dir_close(dir);
286 286
         return 0;
... ...
@@ -81,7 +81,6 @@ zzip_strerror(int errcode)
81 81
 zzip_char_t* 
82 82
 zzip_strerror_of(ZZIP_DIR* dir)
83 83
 {
84
-    if (! dir) return strerror (errno);
85 84
     return zzip_strerror(dir->errcode);
86 85
 }
87 86
 
... ...
@@ -16,7 +16,6 @@
16 16
 
17 17
 #include "strc.h"
18 18
 
19
-#include <sys/types.h>  /* njh@bandsman.co.uk: for icc7.0 */
20 19
 #include <string.h>
21 20
 #include <sys/stat.h>
22 21
 #include <errno.h>
... ...
@@ -24,7 +23,6 @@
24 24
 #include <ctype.h>
25 25
 
26 26
 #include <zzipformat.h>
27
-//#include "__debug.h"
28 27
 
29 28
 #if 0
30 29
 # if defined ZZIP_HAVE_IO_H
... ...
@@ -170,9 +168,6 @@ zzip_file_open(ZZIP_DIR * dir, zzip_char_t* name, int o_mode)
170 170
             if (n)  hdr_name = n + 1;
171 171
         }
172 172
 
173
-        //HINT4("name='%s', compr=%d, size=%d\n", 
174
-	  //    hdr->d_name, hdr->d_compr, hdr->d_usize);
175
-
176 173
         if (!cmp(hdr_name, name))
177 174
         {
178 175
             switch (hdr->d_compr)
... ...
@@ -223,11 +218,11 @@ zzip_file_open(ZZIP_DIR * dir, zzip_char_t* name, int o_mode)
223 223
 
224 224
             {   /* skip local header - should test tons of other info, 
225 225
 		 * but trust that those are correct */
226
-                zzip_ssize_t dataoff;
226
+                int dataoff;
227 227
                 struct zzip_file_header * p = (void*) fp->buf32k;
228 228
 
229 229
 		dataoff = dir->io->read(dir->fd, (void*)p, sizeof(*p));
230
-		if (dataoff < (zzip_ssize_t)sizeof(*p))
230
+		if (dataoff < (int) sizeof(*p))
231 231
 		{ err = ZZIP_DIR_READ;  goto error; }
232 232
                 if (! ZZIP_FILE_HEADER_CHECKMAGIC(p)) /* PK\3\4 */
233 233
 		{ err = ZZIP_CORRUPTED; goto error; }
... ...
@@ -324,12 +319,12 @@ zzip_close(ZZIP_FILE* fp)
324 324
  *       required just that but the latest zlib would work just fine with
325 325
  *       a smaller buffer.
326 326
  */
327
-zzip_ssize_t 
328
-zzip_file_read(ZZIP_FILE * fp, char * buf, zzip_size_t len)
327
+int 
328
+zzip_file_read(ZZIP_FILE * fp, char * buf, int len)
329 329
 {
330 330
     ZZIP_DIR * dir; 
331
-    zzip_size_t l;
332
-    zzip_ssize_t rv;
331
+    int l;
332
+    int rv;
333 333
     
334 334
     if (! fp || ! fp->dir) return 0;
335 335
 
... ...
@@ -359,15 +354,14 @@ zzip_file_read(ZZIP_FILE * fp, char * buf, zzip_size_t len)
359 359
 
360 360
          do {
361 361
              int err;
362
-             zzip_size_t startlen;
362
+             int startlen;
363 363
 
364 364
              if (fp->crestlen > 0 && fp->d_stream.avail_in == 0)
365 365
              {
366
-                 zzip_size_t cl = ( fp->crestlen < ZZIP_32K ?
367
-				    fp->crestlen : ZZIP_32K );
368
-             /*  zzip_size_t cl = fp->crestlen > 128 ? 128 : fp->crestlen; */
366
+                 int cl = fp->crestlen > ZZIP_32K ? ZZIP_32K : fp->crestlen;
367
+             /*  int cl = fp->crestlen > 128? 128: fp->crestlen; */
369 368
 
370
-                 zzip_ssize_t i = fp->io->read(dir->fd, fp->buf32k, cl);
369
+                 int i = fp->io->read(dir->fd, fp->buf32k, cl);
371 370
                  if (i <= 0)
372 371
                  {
373 372
                      dir->errcode = ZZIP_DIR_READ; /* or ZZIP_DIR_READ_EOF ? */
... ...
@@ -414,14 +408,14 @@ zzip_file_read(ZZIP_FILE * fp, char * buf, zzip_size_t len)
414 414
  * perform a normal => read(2)-call, otherwise => zzip_file_read is called
415 415
  * to decompress the data stream and any error is mapped to => errno(3).
416 416
  */
417
-zzip_ssize_t
418
-zzip_read(ZZIP_FILE * fp, char * buf, zzip_size_t len)
417
+int 
418
+zzip_read(ZZIP_FILE * fp, char * buf, int len)
419 419
 {
420 420
     if (! fp) return 0;
421 421
     if (! fp->dir) 
422 422
       { return fp->io->read(fp->fd, buf, len); } /* stat fd */
423 423
     else
424
-    {   register zzip_ssize_t v;
424
+    {   register int v;
425 425
         v = zzip_file_read(fp, buf, len);
426 426
         if (v == -1) { errno = zzip_errno(fp->dir->errcode); }
427 427
         return v;
... ...
@@ -430,8 +424,8 @@ zzip_read(ZZIP_FILE * fp, char * buf, zzip_size_t len)
430 430
 
431 431
 /** => zzip_read
432 432
  */
433
-zzip_size_t
434
-zzip_fread(void *ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE *file)
433
+int 
434
+zzip_fread(void *ptr, int size, int nmemb, ZZIP_FILE *file)
435 435
 {
436 436
     if (! size) size=1;
437 437
     return zzip_read (file, ptr, size*nmemb)/size;
... ...
@@ -716,7 +710,7 @@ zzip_open_shared_io (ZZIP_FILE* stream,
716 716
       /* see if we can share the same zip directory */
717 717
       if (stream && stream->dir && stream->dir->realname)
718 718
       {
719
-	  zzip_size_t len = strlen (stream->dir->realname);
719
+	  int len = strlen (stream->dir->realname);
720 720
 	  if (! memcmp (filename, stream->dir->realname, len) &&
721 721
 	      filename[len] == '/' && filename[len+1])
722 722
 	  {
... ...
@@ -866,10 +860,10 @@ zzip_rewind(ZZIP_FILE *fp)
866 866
  * how gzio implements it, so I'm not sure there is a better way
867 867
  * without using the internals of the algorithm.
868 868
  */
869
-zzip_off_t
870
-zzip_seek(ZZIP_FILE * fp, zzip_off_t offset, int whence)
869
+int
870
+zzip_seek(ZZIP_FILE * fp, int offset, int whence)
871 871
 {
872
-    zzip_off_t cur_pos, rel_ofs, read_size, ofs;
872
+    int cur_pos, rel_ofs, read_size, ofs;
873 873
     ZZIP_DIR *dir;
874 874
   
875 875
     if (! fp)
... ...
@@ -877,7 +871,7 @@ zzip_seek(ZZIP_FILE * fp, zzip_off_t offset, int whence)
877 877
 
878 878
     if (! fp->dir) 
879 879
     { /* stat fd */
880
-        return fp->io->seeks(fp->fd, offset, whence);
880
+        return fp->io->seeks(fp->fd,offset,whence);
881 881
     }
882 882
 
883 883
     cur_pos = zzip_tell(fp);
... ...
@@ -916,7 +910,7 @@ zzip_seek(ZZIP_FILE * fp, zzip_off_t offset, int whence)
916 916
     if (read_size < 0) /* bad offset, before beginning of file */
917 917
         return -1;
918 918
 
919
-    if (read_size + cur_pos > (zzip_off_t)fp->usize) /* bad offset, past EOF */
919
+    if (read_size + cur_pos > fp->usize) /* bad offset, past EOF */
920 920
         return -1;
921 921
 
922 922
     if (read_size == 0) /* nothing to read */
... ...
@@ -955,10 +949,10 @@ zzip_seek(ZZIP_FILE * fp, zzip_off_t offset, int whence)
955 955
         
956 956
         while (read_size > 0)  
957 957
         {
958
-            zzip_off_t size = ZZIP_32K;
959
-            if (read_size < size/*32K*/) size = read_size;
958
+            int size = ZZIP_32K;
959
+            if (read_size < ZZIP_32K) size = (int)read_size;
960 960
 
961
-            size = zzip_file_read(fp, buf, (zzip_size_t)size);
961
+            size = zzip_file_read(fp, buf, size);
962 962
             if (size <= 0) { free(buf); return -1; }
963 963
       
964 964
             read_size -= size;
... ...
@@ -981,7 +975,7 @@ zzip_seek(ZZIP_FILE * fp, zzip_off_t offset, int whence)
981 981
  * calculated from the amount of data left and the total uncompressed
982 982
  * size;
983 983
  */
984
-zzip_off_t
984
+int
985 985
 zzip_tell(ZZIP_FILE * fp)
986 986
 {
987 987
     if (! fp)
... ...
@@ -65,10 +65,10 @@ struct zzip_file
65 65
   struct zzip_dir* dir; 
66 66
   int fd;
67 67
   int method;
68
-  zzip_size_t restlen;
69
-  zzip_size_t crestlen;
70
-  zzip_size_t usize;
71
-  zzip_size_t csize;
68
+  int restlen;
69
+  int crestlen;
70
+  int usize;
71
+  int csize;
72 72
   /* added dataoffset member - data offset from start of zipfile*/
73 73
   zzip_off_t dataoffset;
74 74
   char* buf32k;
... ...
@@ -15,7 +15,6 @@
15 15
 #include <zzip-io.h>
16 16
 
17 17
 #include <string.h>
18
-#include <sys/types.h>  /* njh@bandsman.co.uk: for icc7.0 */
19 18
 #include <sys/stat.h>
20 19
 #include <errno.h>
21 20
 #include <stdlib.h>
... ...
@@ -26,11 +26,9 @@
26 26
 
27 27
 //#include "__mmap.h"
28 28
 //#include "__debug.h"
29
+//
29 30
 
30
-#define __sizeof(X) ((zzip_ssize_t)(sizeof(X)))
31
-
32
-/* per default, we use a little hack to correct bad z_rootseek parts */
33
-#define ZZIP_CORRECT_ROOTSEEK 1
31
+#include "others.h"
34 32
 
35 33
 /* ------------------------- fetch helpers --------------------------------- */
36 34
 
... ...
@@ -44,7 +42,7 @@ uint32_t __zzip_get32(unsigned char * s)
44 44
     |    ((uint32_t)s[1] << 8)  |  (uint32_t)s[0];
45 45
 }
46 46
 
47
-/** => __zzip_get32
47
+/** => __zzip_get16
48 48
  * This function does the same for a 16 bit value.
49 49
  */
50 50
 uint16_t __zzip_get16(unsigned char * s)
... ...
@@ -52,88 +50,6 @@ uint16_t __zzip_get16(unsigned char * s)
52 52
     return ((uint16_t)s[1] << 8) | (uint16_t)s[0];
53 53
 }
54 54
 
55
-/* ---------------------------  internals  -------------------------------- */
56
-/* internal functions of zziplib, avoid at all cost, changes w/o warning.
57
- * we do export them for debugging purpose and special external tools
58
- * which know what they do and which can adapt from version to version
59
- */
60
-
61
-int __zzip_find_disk_trailer( int fd, zzip_off_t filesize, 
62
-			      struct zzip_disk_trailer * trailer,
63
-			      zzip_plugin_io_t io);
64
-int __zzip_parse_root_directory( int fd, 
65
-				 struct zzip_disk_trailer * trailer, 
66
-				 struct zzip_dir_hdr ** hdr_return,
67
-				 zzip_plugin_io_t io);
68
-
69
-_zzip_inline char* __zzip_aligned4(char* p);
70
-
71
-/* ------------------------  harden routines ------------------------------ */
72
-
<