From d685f6ddf20644c5f7cf564d4f07a169cd2aa9f3 Mon Sep 17 00:00:00 2001 From: Tomasz Kojm Date: Sat, 21 Feb 2004 15:08:40 +0000 Subject: [PATCH] freshclam bugfix (-c, -u) git-svn: trunk@322 --- clamav-devel/AUTHORS | 1 + clamav-devel/ChangeLog | 9 ++++++++- clamav-devel/Makefile.in | 1 + clamav-devel/aclocal.m4 | 4 ++-- clamav-devel/clamav-milter/Makefile.am | 2 +- clamav-devel/clamav-milter/Makefile.in | 3 ++- clamav-devel/clamd/Makefile.in | 1 + clamav-devel/clamdscan/Makefile.in | 1 + clamav-devel/clamscan/Makefile.in | 1 + clamav-devel/configure | 14 +++++++++++++- clamav-devel/configure.in | 13 ++++++++++++- clamav-devel/database/Makefile.in | 1 + clamav-devel/docs/Makefile.in | 1 + clamav-devel/etc/Makefile.in | 1 + clamav-devel/freshclam/Makefile.in | 1 + clamav-devel/freshclam/freshclam.c | 4 ++-- clamav-devel/libclamav/Makefile.in | 1 + clamav-devel/sigtool/Makefile.in | 1 + 18 files changed, 51 insertions(+), 9 deletions(-) diff --git a/clamav-devel/AUTHORS b/clamav-devel/AUTHORS index 5ed49902e..55c7dd7fa 100644 --- a/clamav-devel/AUTHORS +++ b/clamav-devel/AUTHORS @@ -63,6 +63,7 @@ Alejandro Dubrovsky Magnus Ekdahl Jason Englander David Ford +Michel Gaudet Luca 'NERvOus' Gibelli Nigel Horne Hrvoje Habjanic diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index fe04fed23..ba5e30ca3 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,10 @@ +Sat Feb 21 16:05:42 CET 2004 (tk) +--------------------------------- + * freshclam: fixed problem with -u handling (missing `else' in logical block) + Thanks to Michel GAUDET . The same bug + (copy & paste) existed in -c mode. + * configure: added CLAMAV_MILTER_LIBS + Sat Feb 21 13:38:23 CET 2004 (tk) --------------------------------- * libclamav: fixed various segmentation faults introduced by a small bug @@ -52,7 +59,7 @@ Thu Feb 19 12:16:33 CET 2004 (tl) Thu Feb 19 10:05:39 GMT 2004 (njh) ---------------------------------- * clamav-milter: Reworked TCPwrappers code thanks to - "Hector M. Rulot Segovia" + "Hector M. Rulot Segovia" Changed some printf/puts to cli_dbgmsg Wed Feb 18 13:35:59 GMT 2004 (njh) diff --git a/clamav-devel/Makefile.in b/clamav-devel/Makefile.in index 4fb318c5c..e1eab3c84 100644 --- a/clamav-devel/Makefile.in +++ b/clamav-devel/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/aclocal.m4 b/clamav-devel/aclocal.m4 index 4440fcf02..49cff8588 100644 --- a/clamav-devel/aclocal.m4 +++ b/clamav-devel/aclocal.m4 @@ -81,7 +81,7 @@ dnl there is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for dnl PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever created dnl (the prefix is a bit different, since we add an extra -target- and -host-) dnl -dnl @version: $Id: aclocal.m4,v 1.21 2004/02/20 22:29:45 kojm Exp $ +dnl @version: $Id: aclocal.m4,v 1.22 2004/02/21 15:08:38 kojm Exp $ dnl @author Guido Draheim STATUS: used often AC_DEFUN([AC_CREATE_TARGET_H], @@ -4041,7 +4041,7 @@ dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers) dnl dnl @author Kaveh Ghazi -dnl @version $Id: aclocal.m4,v 1.21 2004/02/20 22:29:45 kojm Exp $ +dnl @version $Id: aclocal.m4,v 1.22 2004/02/21 15:08:38 kojm Exp $ dnl AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], [changequote(<<, >>)dnl diff --git a/clamav-devel/clamav-milter/Makefile.am b/clamav-devel/clamav-milter/Makefile.am index 600fd4bb8..6bafd0f18 100644 --- a/clamav-devel/clamav-milter/Makefile.am +++ b/clamav-devel/clamav-milter/Makefile.am @@ -32,6 +32,6 @@ endif DEFS = @DEFS@ -DSENDMAIL_BIN=\"@SENDMAIL@\" # CLAMD_LIBS is used, because clamav-milter requires the same libraries as clamd -LIBS = -L../libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMD_LIBS@ +LIBS = -L../libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMAV_MILTER_LIBS@ INCLUDES = -I../clamd -I../libclamav -I../clamscan EXTRA_DIST = clamav-milter.c clamd.sh clamav-milter.sh INSTALL diff --git a/clamav-devel/clamav-milter/Makefile.in b/clamav-devel/clamav-milter/Makefile.in index 4738c02ae..10574c496 100644 --- a/clamav-devel/clamav-milter/Makefile.in +++ b/clamav-devel/clamav-milter/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ @@ -127,7 +128,7 @@ install_sh = @install_sh@ DEFS = @DEFS@ -DSENDMAIL_BIN=\"@SENDMAIL@\" # CLAMD_LIBS is used, because clamav-milter requires the same libraries as clamd -LIBS = -L../libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMD_LIBS@ +LIBS = -L../libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMAV_MILTER_LIBS@ INCLUDES = -I../clamd -I../libclamav -I../clamscan EXTRA_DIST = clamav-milter.c clamd.sh clamav-milter.sh INSTALL subdir = clamav-milter diff --git a/clamav-devel/clamd/Makefile.in b/clamav-devel/clamd/Makefile.in index 4e930b5e9..5b99337a8 100644 --- a/clamav-devel/clamd/Makefile.in +++ b/clamav-devel/clamd/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/clamdscan/Makefile.in b/clamav-devel/clamdscan/Makefile.in index 721a0d248..8f84f47f0 100644 --- a/clamav-devel/clamdscan/Makefile.in +++ b/clamav-devel/clamdscan/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/clamscan/Makefile.in b/clamav-devel/clamscan/Makefile.in index c30a4233c..9700ddeac 100644 --- a/clamav-devel/clamscan/Makefile.in +++ b/clamav-devel/clamscan/Makefile.in @@ -93,6 +93,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/configure b/clamav-devel/configure index caf581833..a6f8a1cf0 100755 --- a/clamav-devel/configure +++ b/clamav-devel/configure @@ -9560,7 +9560,7 @@ cat >>confdefs.h <<\_ACEOF #define WITH_TCPWRAP 1 _ACEOF - LIBS="$LIBS -lwrap" + CLAMAV_MILTER_LIBS="-lwrap" fi fi @@ -9626,6 +9626,7 @@ cat >>confdefs.h <<\_ACEOF _ACEOF CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" if test "$want_clamuko" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -9667,6 +9668,7 @@ solaris*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lsocket -lnsl -lresolv" TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9689,6 +9691,7 @@ freebsd*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r" CLAMD_LIBS="-pthread -lc_r" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r" TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9712,6 +9715,7 @@ openbsd3.3*) LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread" if test "$disable_cr" = "yes"; then CLAMD_LIBS="-pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" fi TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9733,8 +9737,10 @@ openbsd*) LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread" if test "$disable_cr" = "yes"; then CLAMD_LIBS="-pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" else CLAMD_LIBS="-pthread -lc_r" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r" fi TH_SAFE="-thread-safe" @@ -9800,11 +9806,13 @@ _ACEOF sco*) FRESHCLAM_LIBS="-lsocket" CLAMD_LIBS="-lsocket" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket" ;; hpux*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9827,6 +9835,7 @@ aix*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9849,6 +9858,7 @@ irix*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" cat >>confdefs.h <<\_ACEOF @@ -9879,6 +9889,7 @@ esac + if test "$have_pthreads" = "yes"; then BUILD_CLAMD_TRUE= BUILD_CLAMD_FALSE='#' @@ -11237,6 +11248,7 @@ s,@INSTALL_FRESHCLAM_CONF_TRUE@,$INSTALL_FRESHCLAM_CONF_TRUE,;t t s,@INSTALL_FRESHCLAM_CONF_FALSE@,$INSTALL_FRESHCLAM_CONF_FALSE,;t t s,@LIBCLAMAV_LIBS@,$LIBCLAMAV_LIBS,;t t s,@CLAMD_LIBS@,$CLAMD_LIBS,;t t +s,@CLAMAV_MILTER_LIBS@,$CLAMAV_MILTER_LIBS,;t t s,@FRESHCLAM_LIBS@,$FRESHCLAM_LIBS,;t t s,@TH_SAFE@,$TH_SAFE,;t t s,@BUILD_CLAMD_TRUE@,$BUILD_CLAMD_TRUE,;t t diff --git a/clamav-devel/configure.in b/clamav-devel/configure.in index 794cc7004..dc9e6b1f3 100644 --- a/clamav-devel/configure.in +++ b/clamav-devel/configure.in @@ -233,7 +233,7 @@ if test x"$tcpw" != xno; then fi else AC_DEFINE(WITH_TCPWRAP,1,[tcpwrappers support]) - LIBS="$LIBS -lwrap" + CLAMAV_MILTER_LIBS="-lwrap" fi fi @@ -257,6 +257,7 @@ linux*) AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" if test "$want_clamuko" = "yes"; then AC_DEFINE(CLAMUKO,1,[enable clamuko]) fi @@ -283,6 +284,7 @@ solaris*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread -lsocket -lnsl -lresolv" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread -lsocket -lnsl -lresolv" TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) @@ -293,6 +295,7 @@ freebsd*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r" CLAMD_LIBS="-pthread -lc_r" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r" TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) @@ -304,6 +307,7 @@ openbsd3.3*) LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread" if test "$disable_cr" = "yes"; then CLAMD_LIBS="-pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" fi TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE) @@ -316,8 +320,10 @@ openbsd*) LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread" if test "$disable_cr" = "yes"; then CLAMD_LIBS="-pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" else CLAMD_LIBS="-pthread -lc_r" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread -lc_r" fi TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) @@ -351,12 +357,14 @@ sco*) dnl njh@bandsman.sco.uk: SCO Unix port FRESHCLAM_LIBS="-lsocket" CLAMD_LIBS="-lsocket" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket" dnl AC_DEFINE(NO_SNPRINTF) ;; hpux*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) @@ -367,6 +375,7 @@ aix*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) @@ -377,6 +386,7 @@ irix*) if test "$have_pthreads" = "yes"; then LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread" CLAMD_LIBS="-lpthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" TH_SAFE="-thread-safe" AC_DEFINE(CL_THREAD_SAFE,1,[thread safe]) AC_DEFINE(_REENTRANT,1,[thread safe]) @@ -391,6 +401,7 @@ esac AC_SUBST(LIBCLAMAV_LIBS) AC_SUBST(CLAMD_LIBS) +AC_SUBST(CLAMAV_MILTER_LIBS) AC_SUBST(FRESHCLAM_LIBS) AC_SUBST(TH_SAFE) diff --git a/clamav-devel/database/Makefile.in b/clamav-devel/database/Makefile.in index fa999fd39..598d8ce35 100644 --- a/clamav-devel/database/Makefile.in +++ b/clamav-devel/database/Makefile.in @@ -94,6 +94,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/docs/Makefile.in b/clamav-devel/docs/Makefile.in index d5da9da1a..92738f9d8 100644 --- a/clamav-devel/docs/Makefile.in +++ b/clamav-devel/docs/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/etc/Makefile.in b/clamav-devel/etc/Makefile.in index b855caf34..656fa0b98 100644 --- a/clamav-devel/etc/Makefile.in +++ b/clamav-devel/etc/Makefile.in @@ -94,6 +94,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/freshclam/Makefile.in b/clamav-devel/freshclam/Makefile.in index 2f243728d..394bb2c0c 100644 --- a/clamav-devel/freshclam/Makefile.in +++ b/clamav-devel/freshclam/Makefile.in @@ -93,6 +93,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/freshclam/freshclam.c b/clamav-devel/freshclam/freshclam.c index 614c09a6a..50a0935a3 100644 --- a/clamav-devel/freshclam/freshclam.c +++ b/clamav-devel/freshclam/freshclam.c @@ -127,7 +127,7 @@ int freshclam(struct optstruct *opt) /* freshclam shouldn't work with root priviledges */ if(optc(opt, 'u')) { unpuser = getargc(opt, 'u'); - } if((cpt = cfgopt(copt, "DatabaseOwner"))) { + } else if((cpt = cfgopt(copt, "DatabaseOwner"))) { unpuser = cpt->strarg; } else { unpuser = UNPUSER; @@ -209,7 +209,7 @@ int freshclam(struct optstruct *opt) if(optc(opt, 'c')) { checks = atoi(getargc(opt, 'c')); - } if((cpt = cfgopt(copt, "Checks"))) { + } else if((cpt = cfgopt(copt, "Checks"))) { checks = cpt->numarg; } else { checks = CL_DEFAULT_CHECKS; diff --git a/clamav-devel/libclamav/Makefile.in b/clamav-devel/libclamav/Makefile.in index c8fd1180d..9db11f3af 100644 --- a/clamav-devel/libclamav/Makefile.in +++ b/clamav-devel/libclamav/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@ diff --git a/clamav-devel/sigtool/Makefile.in b/clamav-devel/sigtool/Makefile.in index 34643ce1b..c35466c2f 100644 --- a/clamav-devel/sigtool/Makefile.in +++ b/clamav-devel/sigtool/Makefile.in @@ -92,6 +92,7 @@ CC = @CC@ CFGDIR = @CFGDIR@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ CLAMD_LIBS = @CLAMD_LIBS@ DBDIR = @DBDIR@ DEPDIR = @DEPDIR@