Browse code

include database info in version string

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

Tomasz Kojm authored on 2004/08/24 05:38:10
Showing 20 changed files
... ...
@@ -1,3 +1,8 @@
1
+Mon Aug 23 22:32:02 CEST 2004 (tk)
2
+----------------------------------
3
+  * include database info in version string (requested by Jason Haar
4
+    <Jason.Haar*trimble.co.nz>)
5
+
1 6
 Mon Aug 23 14:15:42 BST 2004 (njh)
2 7
 ----------------------------------
3 8
   * libclamav:		Some emails included within the body of other emails
... ...
@@ -28,6 +28,8 @@ clamd_SOURCES = \
28 28
     $(top_srcdir)/shared/getopt.h \
29 29
     $(top_srcdir)/shared/memory.c \
30 30
     $(top_srcdir)/shared/memory.h \
31
+    $(top_srcdir)/shared/misc.c \
32
+    $(top_srcdir)/shared/misc.h \
31 33
     options.c \
32 34
     options.h \
33 35
     clamd.c \
... ...
@@ -74,7 +74,8 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
74 74
 	$(top_srcdir)/shared/output.h $(top_srcdir)/shared/cfgparser.c \
75 75
 	$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/getopt.c \
76 76
 	$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/memory.c \
77
-	$(top_srcdir)/shared/memory.h options.c options.h clamd.c \
77
+	$(top_srcdir)/shared/memory.h $(top_srcdir)/shared/misc.c \
78
+	$(top_srcdir)/shared/misc.h options.c options.h clamd.c \
78 79
 	defaults.h tcpserver.c tcpserver.h localserver.c localserver.h \
79 80
 	session.c session.h thrmgr.c thrmgr.h server-th.c server.h \
80 81
 	scanner.c scanner.h others.c others.h clamuko.c clamuko.h \
... ...
@@ -82,12 +83,12 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
82 82
 	dazuko_xp.h dazukoio_xp.h tests.c tests.h shared.h
83 83
 @BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \
84 84
 @BUILD_CLAMD_TRUE@	cfgparser.$(OBJEXT) getopt.$(OBJEXT) \
85
-@BUILD_CLAMD_TRUE@	memory.$(OBJEXT) options.$(OBJEXT) \
86
-@BUILD_CLAMD_TRUE@	clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
87
-@BUILD_CLAMD_TRUE@	localserver.$(OBJEXT) session.$(OBJEXT) \
88
-@BUILD_CLAMD_TRUE@	thrmgr.$(OBJEXT) server-th.$(OBJEXT) \
89
-@BUILD_CLAMD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT) \
90
-@BUILD_CLAMD_TRUE@	clamuko.$(OBJEXT) \
85
+@BUILD_CLAMD_TRUE@	memory.$(OBJEXT) misc.$(OBJEXT) \
86
+@BUILD_CLAMD_TRUE@	options.$(OBJEXT) clamd.$(OBJEXT) \
87
+@BUILD_CLAMD_TRUE@	tcpserver.$(OBJEXT) localserver.$(OBJEXT) \
88
+@BUILD_CLAMD_TRUE@	session.$(OBJEXT) thrmgr.$(OBJEXT) \
89
+@BUILD_CLAMD_TRUE@	server-th.$(OBJEXT) scanner.$(OBJEXT) \
90
+@BUILD_CLAMD_TRUE@	others.$(OBJEXT) clamuko.$(OBJEXT) \
91 91
 @BUILD_CLAMD_TRUE@	dazukoio_compat12.$(OBJEXT) \
92 92
 @BUILD_CLAMD_TRUE@	dazukoio.$(OBJEXT) tests.$(OBJEXT)
93 93
 clamd_OBJECTS = $(am_clamd_OBJECTS)
... ...
@@ -99,11 +100,12 @@ am__depfiles_maybe = depfiles
99 99
 @AMDEP_TRUE@	./$(DEPDIR)/clamuko.Po ./$(DEPDIR)/dazukoio.Po \
100 100
 @AMDEP_TRUE@	./$(DEPDIR)/dazukoio_compat12.Po \
101 101
 @AMDEP_TRUE@	./$(DEPDIR)/getopt.Po ./$(DEPDIR)/localserver.Po \
102
-@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/options.Po \
103
-@AMDEP_TRUE@	./$(DEPDIR)/others.Po ./$(DEPDIR)/output.Po \
104
-@AMDEP_TRUE@	./$(DEPDIR)/scanner.Po ./$(DEPDIR)/server-th.Po \
105
-@AMDEP_TRUE@	./$(DEPDIR)/session.Po ./$(DEPDIR)/tcpserver.Po \
106
-@AMDEP_TRUE@	./$(DEPDIR)/tests.Po ./$(DEPDIR)/thrmgr.Po
102
+@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/misc.Po \
103
+@AMDEP_TRUE@	./$(DEPDIR)/options.Po ./$(DEPDIR)/others.Po \
104
+@AMDEP_TRUE@	./$(DEPDIR)/output.Po ./$(DEPDIR)/scanner.Po \
105
+@AMDEP_TRUE@	./$(DEPDIR)/server-th.Po ./$(DEPDIR)/session.Po \
106
+@AMDEP_TRUE@	./$(DEPDIR)/tcpserver.Po ./$(DEPDIR)/tests.Po \
107
+@AMDEP_TRUE@	./$(DEPDIR)/thrmgr.Po
107 108
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
108 109
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
109 110
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
... ...
@@ -233,6 +235,8 @@ target_vendor = @target_vendor@
233 233
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/getopt.h \
234 234
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/memory.c \
235 235
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/memory.h \
236
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.c \
237
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.h \
236 238
 @BUILD_CLAMD_TRUE@    options.c \
237 239
 @BUILD_CLAMD_TRUE@    options.h \
238 240
 @BUILD_CLAMD_TRUE@    clamd.c \
... ...
@@ -343,6 +347,7 @@ distclean-compile:
343 343
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
344 344
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localserver.Po@am__quote@
345 345
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
346
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
346 347
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
347 348
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@
348 349
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
... ...
@@ -473,6 +478,30 @@ memory.lo: $(top_srcdir)/shared/memory.c
473 473
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
474 474
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
475 475
 
476
+misc.o: $(top_srcdir)/shared/misc.c
477
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
478
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
479
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.o' libtool=no @AMDEPBACKSLASH@
480
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
481
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
482
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
483
+
484
+misc.obj: $(top_srcdir)/shared/misc.c
485
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.obj -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`; \
486
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
487
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.obj' libtool=no @AMDEPBACKSLASH@
488
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
489
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
490
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
491
+
492
+misc.lo: $(top_srcdir)/shared/misc.c
493
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.lo -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
494
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Plo"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
495
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.lo' libtool=yes @AMDEPBACKSLASH@
496
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Plo' tmpdepfile='$(DEPDIR)/misc.TPlo' @AMDEPBACKSLASH@
497
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
498
+@am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
499
+
476 500
 mostlyclean-libtool:
477 501
 	-rm -f *.lo
478 502
 
... ...
@@ -54,6 +54,7 @@
54 54
 #include "output.h"
55 55
 #include "shared.h"
56 56
 #include "target.h"
57
+#include "misc.h"
57 58
 
58 59
 void help(void);
59 60
 void daemonize(void);
... ...
@@ -75,7 +76,7 @@ void clamd(struct optstruct *opt)
75 75
     /* initialize some important variables */
76 76
 
77 77
     if(optc(opt, 'V')) {
78
-	printf("clamd / ClamAV version "VERSION"\n");
78
+	print_version();
79 79
 	exit(0);
80 80
     }
81 81
 
... ...
@@ -26,6 +26,8 @@ clamdscan_SOURCES = \
26 26
     $(top_srcdir)/shared/cfgparser.h \
27 27
     $(top_srcdir)/shared/memory.c \
28 28
     $(top_srcdir)/shared/memory.h \
29
+    $(top_srcdir)/shared/misc.c \
30
+    $(top_srcdir)/shared/misc.h \
29 31
     clamdscan.c \
30 32
     client.c \
31 33
     client.h \
... ...
@@ -73,11 +73,13 @@ PROGRAMS = $(bin_PROGRAMS)
73 73
 am__clamdscan_SOURCES_DIST = $(top_srcdir)/shared/output.c \
74 74
 	$(top_srcdir)/shared/output.h $(top_srcdir)/shared/cfgparser.c \
75 75
 	$(top_srcdir)/shared/cfgparser.h $(top_srcdir)/shared/memory.c \
76
-	$(top_srcdir)/shared/memory.h clamdscan.c client.c client.h \
76
+	$(top_srcdir)/shared/memory.h $(top_srcdir)/shared/misc.c \
77
+	$(top_srcdir)/shared/misc.h clamdscan.c client.c client.h \
77 78
 	defaults.h
78 79
 @BUILD_CLAMD_TRUE@am_clamdscan_OBJECTS = output.$(OBJEXT) \
79 80
 @BUILD_CLAMD_TRUE@	cfgparser.$(OBJEXT) memory.$(OBJEXT) \
80
-@BUILD_CLAMD_TRUE@	clamdscan.$(OBJEXT) client.$(OBJEXT)
81
+@BUILD_CLAMD_TRUE@	misc.$(OBJEXT) clamdscan.$(OBJEXT) \
82
+@BUILD_CLAMD_TRUE@	client.$(OBJEXT)
81 83
 clamdscan_OBJECTS = $(am_clamdscan_OBJECTS)
82 84
 @BUILD_CLAMD_TRUE@clamdscan_DEPENDENCIES =  \
83 85
 @BUILD_CLAMD_TRUE@	$(top_builddir)/clamscan/options.o \
... ...
@@ -87,7 +89,8 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
87 87
 am__depfiles_maybe = depfiles
88 88
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \
89 89
 @AMDEP_TRUE@	./$(DEPDIR)/clamdscan.Po ./$(DEPDIR)/client.Po \
90
-@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/output.Po
90
+@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/misc.Po \
91
+@AMDEP_TRUE@	./$(DEPDIR)/output.Po
91 92
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
92 93
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
93 94
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
... ...
@@ -215,6 +218,8 @@ target_vendor = @target_vendor@
215 215
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/cfgparser.h \
216 216
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/memory.c \
217 217
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/memory.h \
218
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.c \
219
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.h \
218 220
 @BUILD_CLAMD_TRUE@    clamdscan.c \
219 221
 @BUILD_CLAMD_TRUE@    client.c \
220 222
 @BUILD_CLAMD_TRUE@    client.h \
... ...
@@ -297,6 +302,7 @@ distclean-compile:
297 297
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamdscan.Po@am__quote@
298 298
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
299 299
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
300
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
300 301
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
301 302
 
302 303
 .c.o:
... ...
@@ -395,6 +401,30 @@ memory.lo: $(top_srcdir)/shared/memory.c
395 395
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
396 396
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
397 397
 
398
+misc.o: $(top_srcdir)/shared/misc.c
399
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
400
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
401
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.o' libtool=no @AMDEPBACKSLASH@
402
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
403
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
404
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
405
+
406
+misc.obj: $(top_srcdir)/shared/misc.c
407
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.obj -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`; \
408
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
409
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.obj' libtool=no @AMDEPBACKSLASH@
410
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
411
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
412
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
413
+
414
+misc.lo: $(top_srcdir)/shared/misc.c
415
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.lo -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
416
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Plo"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
417
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.lo' libtool=yes @AMDEPBACKSLASH@
418
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Plo' tmpdepfile='$(DEPDIR)/misc.TPlo' @AMDEPBACKSLASH@
419
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
420
+@am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
421
+
398 422
 mostlyclean-libtool:
399 423
 	-rm -f *.lo
400 424
 
... ...
@@ -34,6 +34,7 @@
34 34
 #include "defaults.h"
35 35
 #include "client.h"
36 36
 #include "output.h"
37
+#include "misc.h"
37 38
 
38 39
 void help(void);
39 40
 
... ...
@@ -61,7 +62,7 @@ void clamscan(struct optstruct *opt)
61 61
 	mprintf_stdout = 1;
62 62
 
63 63
     if(optc(opt, 'V')) {
64
-	mprintf("clamdscan / ClamAV version "VERSION"\n");
64
+	print_version();
65 65
 	exit(0);
66 66
     }
67 67
 
... ...
@@ -27,6 +27,8 @@ clamscan_SOURCES = \
27 27
     $(top_srcdir)/shared/memory.h \
28 28
     $(top_srcdir)/shared/cfgparser.c \
29 29
     $(top_srcdir)/shared/cfgparser.h \
30
+    $(top_srcdir)/shared/misc.c \
31
+    $(top_srcdir)/shared/misc.h \
30 32
     clamscan.c \
31 33
     options.c \
32 34
     options.h \
... ...
@@ -72,9 +72,9 @@ am__installdirs = "$(DESTDIR)$(bindir)"
72 72
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
73 73
 PROGRAMS = $(bin_PROGRAMS)
74 74
 am_clamscan_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) \
75
-	memory.$(OBJEXT) cfgparser.$(OBJEXT) clamscan.$(OBJEXT) \
76
-	options.$(OBJEXT) others.$(OBJEXT) manager.$(OBJEXT) \
77
-	treewalk.$(OBJEXT)
75
+	memory.$(OBJEXT) cfgparser.$(OBJEXT) misc.$(OBJEXT) \
76
+	clamscan.$(OBJEXT) options.$(OBJEXT) others.$(OBJEXT) \
77
+	manager.$(OBJEXT) treewalk.$(OBJEXT)
78 78
 clamscan_OBJECTS = $(am_clamscan_OBJECTS)
79 79
 clamscan_LDADD = $(LDADD)
80 80
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
... ...
@@ -83,8 +83,9 @@ am__depfiles_maybe = depfiles
83 83
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po \
84 84
 @AMDEP_TRUE@	./$(DEPDIR)/clamscan.Po ./$(DEPDIR)/getopt.Po \
85 85
 @AMDEP_TRUE@	./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \
86
-@AMDEP_TRUE@	./$(DEPDIR)/options.Po ./$(DEPDIR)/others.Po \
87
-@AMDEP_TRUE@	./$(DEPDIR)/output.Po ./$(DEPDIR)/treewalk.Po
86
+@AMDEP_TRUE@	./$(DEPDIR)/misc.Po ./$(DEPDIR)/options.Po \
87
+@AMDEP_TRUE@	./$(DEPDIR)/others.Po ./$(DEPDIR)/output.Po \
88
+@AMDEP_TRUE@	./$(DEPDIR)/treewalk.Po
88 89
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
89 90
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
90 91
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
... ...
@@ -214,6 +215,8 @@ clamscan_SOURCES = \
214 214
     $(top_srcdir)/shared/memory.h \
215 215
     $(top_srcdir)/shared/cfgparser.c \
216 216
     $(top_srcdir)/shared/cfgparser.h \
217
+    $(top_srcdir)/shared/misc.c \
218
+    $(top_srcdir)/shared/misc.h \
217 219
     clamscan.c \
218 220
     options.c \
219 221
     options.h \
... ...
@@ -303,6 +306,7 @@ distclean-compile:
303 303
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
304 304
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Po@am__quote@
305 305
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
306
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
306 307
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
307 308
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@
308 309
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
... ...
@@ -428,6 +432,30 @@ cfgparser.lo: $(top_srcdir)/shared/cfgparser.c
428 428
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
429 429
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfgparser.lo `test -f '$(top_srcdir)/shared/cfgparser.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/cfgparser.c
430 430
 
431
+misc.o: $(top_srcdir)/shared/misc.c
432
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
433
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
434
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.o' libtool=no @AMDEPBACKSLASH@
435
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
436
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
437
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
438
+
439
+misc.obj: $(top_srcdir)/shared/misc.c
440
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.obj -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`; \
441
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
442
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.obj' libtool=no @AMDEPBACKSLASH@
443
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
444
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
445
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
446
+
447
+misc.lo: $(top_srcdir)/shared/misc.c
448
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.lo -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
449
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Plo"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
450
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.lo' libtool=yes @AMDEPBACKSLASH@
451
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Plo' tmpdepfile='$(DEPDIR)/misc.TPlo' @AMDEPBACKSLASH@
452
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
453
+@am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
454
+
431 455
 mostlyclean-libtool:
432 456
 	-rm -f *.lo
433 457
 
... ...
@@ -33,6 +33,7 @@
33 33
 #include "manager.h"
34 34
 #include "defaults.h"
35 35
 #include "treewalk.h"
36
+#include "misc.h"
36 37
 
37 38
 #include "output.h"
38 39
 
... ...
@@ -79,7 +80,7 @@ int clamscan(struct optstruct *opt)
79 79
     }
80 80
 
81 81
     if(optc(opt, 'V')) {
82
-	mprintf("clamscan / ClamAV version "VERSION"\n");
82
+	print_version();
83 83
 	return 0;
84 84
     }
85 85
 
... ...
@@ -52,7 +52,7 @@
52 52
 #include "strrcpy.h"
53 53
 #include "memory.h"
54 54
 #include "output.h"
55
-#include "cfgparser.h"
55
+#include "misc.h"
56 56
 #include "../libclamav/others.h"
57 57
 
58 58
 #ifdef C_LINUX
... ...
@@ -69,9 +69,7 @@ int scanmanager(const struct optstruct *opt)
69 69
 	struct passwd *user = NULL;
70 70
 	struct stat sb;
71 71
 	char *fullpath = NULL, cwd[1024];
72
-	struct cfgstruct *copt, *cpt;
73
-	struct cl_cvd *d1, *d2;
74
-	const char *dbdir;
72
+
75 73
 
76 74
 /* njh@bandsman.co.uk: BeOS */
77 75
 #if !defined(C_CYGWIN) && !defined(C_BEOS)
... ...
@@ -111,42 +109,12 @@ int scanmanager(const struct optstruct *opt)
111 111
 	}
112 112
 
113 113
     } else {
114
-	/* try to find fresh directory */
115
-	dbdir = cl_retdbdir();
116
-	if((copt = parsecfg(CONFDIR"/clamav.conf", 0))) {
117
-	    if((cpt = cfgopt(copt, "DatabaseDirectory")) || (cpt = cfgopt(copt, "DataDirectory"))) {
118
-		if(strcmp(cl_retdbdir(), cpt->strarg)) {
119
-			char *daily = (char *) mmalloc(strlen(cpt->strarg) + strlen(cl_retdbdir()) + 15);
120
-		    sprintf(daily, "%s/daily.cvd", cpt->strarg);
121
-		    if((d1 = cl_cvdhead(daily))) {
122
-			sprintf(daily, "%s/daily.cvd", cl_retdbdir());
123
-			if((d2 = cl_cvdhead(daily))) {
124
-			    free(daily);
125
-			    if(d1->version > d2->version)
126
-				dbdir = cpt->strarg;
127
-			    else
128
-				dbdir = cl_retdbdir();
129
-			    cl_cvdfree(d2);
130
-			} else {
131
-			    free(daily);
132
-			    dbdir = cpt->strarg;
133
-			}
134
-			cl_cvdfree(d1);
135
-		    } else {
136
-			free(daily);
137
-			dbdir = cl_retdbdir();
138
-		    }
139
-		}
140
-	    }
141
-	}
142 114
 
143
-	if((ret = cl_loaddbdir(dbdir, &trie, &claminfo.signs))) {
115
+	if((ret = cl_loaddbdir(freshdbdir(), &trie, &claminfo.signs))) {
144 116
 	    mprintf("@%s\n", cl_strerror(ret));
145 117
 	    return 50;
146 118
 	}
147 119
 
148
-	if(copt)
149
-	    freecfg(copt);
150 120
     }
151 121
 
152 122
 
... ...
@@ -27,6 +27,8 @@ freshclam_SOURCES = \
27 27
     $(top_srcdir)/shared/getopt.h \
28 28
     $(top_srcdir)/shared/memory.c \
29 29
     $(top_srcdir)/shared/memory.h \
30
+    $(top_srcdir)/shared/misc.c \
31
+    $(top_srcdir)/shared/misc.h \
30 32
     freshclam.c \
31 33
     freshclam.h \
32 34
     options.c \
... ...
@@ -72,9 +72,9 @@ am__installdirs = "$(DESTDIR)$(bindir)"
72 72
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
73 73
 PROGRAMS = $(bin_PROGRAMS)
74 74
 am_freshclam_OBJECTS = output.$(OBJEXT) cfgparser.$(OBJEXT) \
75
-	getopt.$(OBJEXT) memory.$(OBJEXT) freshclam.$(OBJEXT) \
76
-	options.$(OBJEXT) manager.$(OBJEXT) notify.$(OBJEXT) \
77
-	dns.$(OBJEXT)
75
+	getopt.$(OBJEXT) memory.$(OBJEXT) misc.$(OBJEXT) \
76
+	freshclam.$(OBJEXT) options.$(OBJEXT) manager.$(OBJEXT) \
77
+	notify.$(OBJEXT) dns.$(OBJEXT)
78 78
 freshclam_OBJECTS = $(am_freshclam_OBJECTS)
79 79
 freshclam_LDADD = $(LDADD)
80 80
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
... ...
@@ -83,8 +83,8 @@ am__depfiles_maybe = depfiles
83 83
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po ./$(DEPDIR)/dns.Po \
84 84
 @AMDEP_TRUE@	./$(DEPDIR)/freshclam.Po ./$(DEPDIR)/getopt.Po \
85 85
 @AMDEP_TRUE@	./$(DEPDIR)/manager.Po ./$(DEPDIR)/memory.Po \
86
-@AMDEP_TRUE@	./$(DEPDIR)/notify.Po ./$(DEPDIR)/options.Po \
87
-@AMDEP_TRUE@	./$(DEPDIR)/output.Po
86
+@AMDEP_TRUE@	./$(DEPDIR)/misc.Po ./$(DEPDIR)/notify.Po \
87
+@AMDEP_TRUE@	./$(DEPDIR)/options.Po ./$(DEPDIR)/output.Po
88 88
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
89 89
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
90 90
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
... ...
@@ -214,6 +214,8 @@ freshclam_SOURCES = \
214 214
     $(top_srcdir)/shared/getopt.h \
215 215
     $(top_srcdir)/shared/memory.c \
216 216
     $(top_srcdir)/shared/memory.h \
217
+    $(top_srcdir)/shared/misc.c \
218
+    $(top_srcdir)/shared/misc.h \
217 219
     freshclam.c \
218 220
     freshclam.h \
219 221
     options.c \
... ...
@@ -304,6 +306,7 @@ distclean-compile:
304 304
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
305 305
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/manager.Po@am__quote@
306 306
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
307
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
307 308
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@
308 309
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
309 310
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
... ...
@@ -428,6 +431,30 @@ memory.lo: $(top_srcdir)/shared/memory.c
428 428
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
429 429
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o memory.lo `test -f '$(top_srcdir)/shared/memory.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/memory.c
430 430
 
431
+misc.o: $(top_srcdir)/shared/misc.c
432
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
433
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
434
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.o' libtool=no @AMDEPBACKSLASH@
435
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
436
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
437
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
438
+
439
+misc.obj: $(top_srcdir)/shared/misc.c
440
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.obj -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`; \
441
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
442
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.obj' libtool=no @AMDEPBACKSLASH@
443
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
444
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
445
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
446
+
447
+misc.lo: $(top_srcdir)/shared/misc.c
448
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.lo -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
449
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Plo"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
450
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.lo' libtool=yes @AMDEPBACKSLASH@
451
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Plo' tmpdepfile='$(DEPDIR)/misc.TPlo' @AMDEPBACKSLASH@
452
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
453
+@am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
454
+
431 455
 mostlyclean-libtool:
432 456
 	-rm -f *.lo
433 457
 
... ...
@@ -45,6 +45,7 @@
45 45
 #include "freshclam.h"
46 46
 #include "output.h"
47 47
 #include "target.h"
48
+#include "misc.h"
48 49
 
49 50
 static short terminate = 0;
50 51
 
... ...
@@ -188,7 +189,7 @@ int freshclam(struct optstruct *opt)
188 188
 	mprintf_stdout = 1;
189 189
 
190 190
     if(optc(opt, 'V')) {
191
-	mprintf("freshclam / ClamAV version "VERSION"\n");
191
+	print_version();
192 192
 	exit(0);
193 193
     }
194 194
 
... ...
@@ -816,6 +816,7 @@ static char *ppt_stream_iter(int fd)
816 816
 	out_dir = cli_gentemp(tmpdir);
817 817
 	if(mkdir(out_dir, 0700)) {
818 818
 	    printf("ScanOLE2 -> Can't create temporary directory %s\n", out_dir);
819
+	    free(out_dir);
819 820
 	    close(fd);
820 821
 	    return NULL;
821 822
 	}
822 823
new file mode 100644
... ...
@@ -0,0 +1,92 @@
0
+/*
1
+ *  Copyright (C) 2004 Tomasz Kojm <tkojm@clamav.net>
2
+ *
3
+ *  This program is free software; you can redistribute it and/or modify
4
+ *  it under the terms of the GNU General Public License as published by
5
+ *  the Free Software Foundation; either version 2 of the License, or
6
+ *  (at your option) any later version.
7
+ *
8
+ *  This program is distributed in the hope that it will be useful,
9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+ *  GNU General Public License for more details.
12
+ *
13
+ *  You should have received a copy of the GNU General Public License
14
+ *  along with this program; if not, write to the Free Software
15
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
+ */
17
+
18
+#if HAVE_CONFIG_H
19
+#include "clamav-config.h"
20
+#endif
21
+
22
+#include <stdio.h>
23
+#include <string.h>
24
+
25
+#include "clamav.h"
26
+#include "cfgparser.h"
27
+#include "memory.h"
28
+
29
+const char *freshdbdir(void)
30
+{
31
+	struct cl_cvd *d1, *d2;
32
+	struct cfgstruct *copt, *cpt;
33
+	const char *dbdir;
34
+
35
+    /* try to find fresh directory */
36
+    dbdir = cl_retdbdir();
37
+    if((copt = parsecfg(CONFDIR"/clamav.conf", 0))) {
38
+	if((cpt = cfgopt(copt, "DatabaseDirectory")) || (cpt = cfgopt(copt, "DataDirectory"))) {
39
+	    if(strcmp(cl_retdbdir(), cpt->strarg)) {
40
+		    char *daily = (char *) mmalloc(strlen(cpt->strarg) + strlen(cl_retdbdir()) + 15);
41
+		sprintf(daily, "%s/daily.cvd", cpt->strarg);
42
+		if((d1 = cl_cvdhead(daily))) {
43
+		    sprintf(daily, "%s/daily.cvd", cl_retdbdir());
44
+		    if((d2 = cl_cvdhead(daily))) {
45
+			free(daily);
46
+			if(d1->version > d2->version)
47
+			    dbdir = cpt->strarg;
48
+			else
49
+			    dbdir = cl_retdbdir();
50
+			cl_cvdfree(d2);
51
+		    } else {
52
+			free(daily);
53
+			dbdir = cpt->strarg;
54
+		    }
55
+		    cl_cvdfree(d1);
56
+		} else {
57
+		    free(daily);
58
+		    dbdir = cl_retdbdir();
59
+		}
60
+	    }
61
+	}
62
+	freecfg(copt);
63
+    }
64
+
65
+    return dbdir;
66
+}
67
+
68
+void print_version(void)
69
+{
70
+	const char *dbdir;
71
+	char *path, *timecpy;
72
+	struct cl_cvd *daily;
73
+
74
+
75
+    dbdir = freshdbdir();
76
+    if(!(path = mmalloc(strlen(dbdir) + 11)))
77
+	return;
78
+
79
+    sprintf(path, "%s/daily.cvd", dbdir);
80
+
81
+    if((daily = cl_cvdhead(path))) {
82
+	timecpy = strdup(daily->time);
83
+	timecpy[14] = ':';
84
+	mprintf("ClamAV "VERSION"/%d/%s\n", daily->version, timecpy);
85
+	free(timecpy);
86
+    } else {
87
+	mprintf("ClamAV "VERSION"\n");
88
+    }
89
+
90
+    free(path);
91
+}
0 92
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+/*
1
+ *  Copyright (C) 2004 Tomasz Kojm <tkojm@clamav.net>
2
+ *
3
+ *  This program is free software; you can redistribute it and/or modify
4
+ *  it under the terms of the GNU General Public License as published by
5
+ *  the Free Software Foundation; either version 2 of the License, or
6
+ *  (at your option) any later version.
7
+ *
8
+ *  This program is distributed in the hope that it will be useful,
9
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
+ *  GNU General Public License for more details.
12
+ *
13
+ *  You should have received a copy of the GNU General Public License
14
+ *  along with this program; if not, write to the Free Software
15
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16
+ */
17
+
18
+#ifndef __MISC_H
19
+#define __MISC_H
20
+
21
+#include "cfgparser.h"
22
+
23
+const char *freshdbdir(void);
24
+void print_version(void);
25
+
26
+#endif
... ...
@@ -26,6 +26,8 @@ sigtool_SOURCES = \
26 26
     $(top_srcdir)/shared/memory.h \
27 27
     $(top_srcdir)/shared/cfgparser.c \
28 28
     $(top_srcdir)/shared/cfgparser.h \
29
+    $(top_srcdir)/shared/misc.c \
30
+    $(top_srcdir)/shared/misc.h \
29 31
     options.c \
30 32
     options.h \
31 33
     sigtool.c
... ...
@@ -71,16 +71,17 @@ am__installdirs = "$(DESTDIR)$(bindir)"
71 71
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
72 72
 PROGRAMS = $(bin_PROGRAMS)
73 73
 am_sigtool_OBJECTS = output.$(OBJEXT) getopt.$(OBJEXT) \
74
-	memory.$(OBJEXT) cfgparser.$(OBJEXT) options.$(OBJEXT) \
75
-	sigtool.$(OBJEXT)
74
+	memory.$(OBJEXT) cfgparser.$(OBJEXT) misc.$(OBJEXT) \
75
+	options.$(OBJEXT) sigtool.$(OBJEXT)
76 76
 sigtool_OBJECTS = $(am_sigtool_OBJECTS)
77 77
 sigtool_DEPENDENCIES = $(top_builddir)/clamscan/others.o
78 78
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
79 79
 depcomp = $(SHELL) $(top_srcdir)/depcomp
80 80
 am__depfiles_maybe = depfiles
81 81
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cfgparser.Po ./$(DEPDIR)/getopt.Po \
82
-@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/options.Po \
83
-@AMDEP_TRUE@	./$(DEPDIR)/output.Po ./$(DEPDIR)/sigtool.Po
82
+@AMDEP_TRUE@	./$(DEPDIR)/memory.Po ./$(DEPDIR)/misc.Po \
83
+@AMDEP_TRUE@	./$(DEPDIR)/options.Po ./$(DEPDIR)/output.Po \
84
+@AMDEP_TRUE@	./$(DEPDIR)/sigtool.Po
84 85
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
85 86
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
86 87
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
... ...
@@ -210,6 +211,8 @@ sigtool_SOURCES = \
210 210
     $(top_srcdir)/shared/memory.h \
211 211
     $(top_srcdir)/shared/cfgparser.c \
212 212
     $(top_srcdir)/shared/cfgparser.h \
213
+    $(top_srcdir)/shared/misc.c \
214
+    $(top_srcdir)/shared/misc.h \
213 215
     options.c \
214 216
     options.h \
215 217
     sigtool.c
... ...
@@ -290,6 +293,7 @@ distclean-compile:
290 290
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cfgparser.Po@am__quote@
291 291
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
292 292
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
293
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
293 294
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
294 295
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
295 296
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigtool.Po@am__quote@
... ...
@@ -414,6 +418,30 @@ cfgparser.lo: $(top_srcdir)/shared/cfgparser.c
414 414
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
415 415
 @am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cfgparser.lo `test -f '$(top_srcdir)/shared/cfgparser.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/cfgparser.c
416 416
 
417
+misc.o: $(top_srcdir)/shared/misc.c
418
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.o -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
419
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
420
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.o' libtool=no @AMDEPBACKSLASH@
421
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
422
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
423
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.o `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
424
+
425
+misc.obj: $(top_srcdir)/shared/misc.c
426
+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.obj -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`; \
427
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Po"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
428
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.obj' libtool=no @AMDEPBACKSLASH@
429
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Po' tmpdepfile='$(DEPDIR)/misc.TPo' @AMDEPBACKSLASH@
430
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
431
+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
432
+
433
+misc.lo: $(top_srcdir)/shared/misc.c
434
+@am__fastdepCC_TRUE@	if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT misc.lo -MD -MP -MF "$(DEPDIR)/misc.Tpo" -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c; \
435
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/misc.Tpo" "$(DEPDIR)/misc.Plo"; else rm -f "$(DEPDIR)/misc.Tpo"; exit 1; fi
436
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/misc.c' object='misc.lo' libtool=yes @AMDEPBACKSLASH@
437
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/misc.Plo' tmpdepfile='$(DEPDIR)/misc.TPlo' @AMDEPBACKSLASH@
438
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
439
+@am__fastdepCC_FALSE@	$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.lo `test -f '$(top_srcdir)/shared/misc.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/misc.c
440
+
417 441
 mostlyclean-libtool:
418 442
 	-rm -f *.lo
419 443
 
... ...
@@ -47,6 +47,7 @@
47 47
 #include "memory.h"
48 48
 #include "output.h"
49 49
 #include "cfgparser.h"
50
+#include "misc.h"
50 51
 #include "../clamscan/others.h"
51 52
 #include "../libclamav/others.h"
52 53
 #include "../libclamav/str.h"
... ...
@@ -84,7 +85,7 @@ void sigtool(struct optstruct *opt)
84 84
 	cl_debug();
85 85
 
86 86
     if(optc(opt, 'V')) {
87
-	mprintf("sigtool / ClamAV version "VERSION"\n");
87
+	print_version();
88 88
 	exit(0);
89 89
     }
90 90