Browse code

add support for new database names

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

Tomasz Kojm authored on 2004/09/17 04:16:38
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Sep 16 21:14:08 CEST 2004 (tk)
2
+----------------------------------
3
+  * sigtool: add support for new database names
4
+
1 5
 Thu Sep 16 19:02:38 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Handle RFC2047 encoded headers
... ...
@@ -665,7 +665,7 @@ int cl_loaddb(const char *filename, struct cl_node **root, unsigned int *signo)
665 665
 
666 666
 	ret = cli_cvdload(fd, root, signo, warn);
667 667
 
668
-    } else if(cli_strbcasestr(filename, ".hdb") || cli_strbcasestr(filename, ".hdb2")) {
668
+    } else if(cli_strbcasestr(filename, ".hdb")) {
669 669
 	ret = cli_loadhdb(fd, root, signo);
670 670
 
671 671
     } else if(cli_strbcasestr(filename, ".ndb")) {
... ...
@@ -708,7 +708,6 @@ int cl_loaddbdir(const char *dirname, struct cl_node **root, unsigned int *signo
708 708
 	     cli_strbcasestr(dent->d_name, ".db2")  ||
709 709
 	     cli_strbcasestr(dent->d_name, ".db3")  ||
710 710
 	     cli_strbcasestr(dent->d_name, ".hdb")  ||
711
-	     cli_strbcasestr(dent->d_name, ".hdb2") ||
712 711
 	     cli_strbcasestr(dent->d_name, ".ndb")  ||
713 712
 	     cli_strbcasestr(dent->d_name, ".cvd"))) {
714 713
 
... ...
@@ -773,7 +772,6 @@ int cl_statinidir(const char *dirname, struct cl_stat *dbstat)
773 773
 	    cli_strbcasestr(dent->d_name, ".db2")  || 
774 774
 	    cli_strbcasestr(dent->d_name, ".db3")  || 
775 775
 	    cli_strbcasestr(dent->d_name, ".hdb")  || 
776
-	    cli_strbcasestr(dent->d_name, ".hdb2") || 
777 776
 	    cli_strbcasestr(dent->d_name, ".ndb")  || 
778 777
 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
779 778
 
... ...
@@ -822,7 +820,6 @@ int cl_statchkdir(const struct cl_stat *dbstat)
822 822
 	    cli_strbcasestr(dent->d_name, ".db2")  || 
823 823
 	    cli_strbcasestr(dent->d_name, ".db3")  || 
824 824
 	    cli_strbcasestr(dent->d_name, ".hdb")  || 
825
-	    cli_strbcasestr(dent->d_name, ".hdb2") || 
826 825
 	    cli_strbcasestr(dent->d_name, ".ndb")  || 
827 826
 	    cli_strbcasestr(dent->d_name, ".cvd"))) {
828 827
 
... ...
@@ -227,7 +227,7 @@ int build(struct optstruct *opt)
227 227
 	struct cl_cvd *oldcvd = NULL;
228 228
 
229 229
     /* build a tar.gz archive
230
-     * we need: COPYING and {viruses.db, viruses.db2}+
230
+     * we need: COPYING and {main.db, main.hdb, daily.db, daily.hdb}+
231 231
      * in current working directory
232 232
      */
233 233
 
... ...
@@ -236,7 +236,7 @@ int build(struct optstruct *opt)
236 236
 	exit(1);
237 237
     }
238 238
 
239
-    if(stat("viruses.db", &foo) == -1 && stat("viruses.db2", &foo) == -1 && stat("malware.hdb", &foo) == -1 && stat("malware.hdb2", &foo)) {
239
+    if(stat("main.db", &foo) == -1 && stat("daily.db", &foo) == -1 && stat("main.hdb", &foo) == -1 && stat("daily.hdb", &foo)) {
240 240
 	mprintf("Virus database not found in current working directory.\n");
241 241
 	exit(1);
242 242
     }
... ...
@@ -256,8 +256,7 @@ int build(struct optstruct *opt)
256 256
 	mprintf("WARNING: There are no signatures in the database(s).\n");
257 257
     } else {
258 258
 	mprintf("Signatures: %d\n", no);
259
-	realno = countlines("viruses.db") + countlines("viruses.db2") + countlines("malware.hdb") + countlines("malware.hdb2");
260
-
259
+	realno = countlines("main.db") + countlines("daily.db") + countlines("main.hdb") + countlines("daily.hdb");
261 260
 	if(realno != no) {
262 261
 	    mprintf("!Signatures in database: %d. Loaded: %d.\n", realno, no);
263 262
 	    mprintf("Please check the current directory and remove unnecessary databases\n");
... ...
@@ -274,7 +273,7 @@ int build(struct optstruct *opt)
274 274
 	    exit(1);
275 275
 	case 0:
276 276
 	    {
277
-		char *args[] = { "tar", "-cvf", NULL, "COPYING", "viruses.db", "viruses.db2", "Notes", "viruses.db3", "malware.hdb", "malware.hdb2", NULL };
277
+		char *args[] = { "tar", "-cvf", NULL, "COPYING", "main.db", "daily.db", "Notes", "viruses.db3", "main.hdb", "daily.hdb", NULL };
278 278
 		args[2] = tarfile;
279 279
 		execv("/bin/tar", args);
280 280
 		mprintf("!Can't execute tar\n");