Browse code

--list-sigs now supports incremental directories

git-svn: trunk@2182

Tomasz Kojm authored on 2006/08/09 21:11:11
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Aug  9 14:09:34 CEST 2006 (tk)
2
+----------------------------------
3
+  * sigtool/sigtool.c: --list-sigs now supports incremental directories
4
+
1 5
 Mon Aug  7 17:06:41 CEST 2006 (acab)
2 6
 ------------------------------------
3 7
   * libclamav/upx.c:    Fix heap overflow in pefromupx()
... ...
@@ -809,6 +809,7 @@ static int listdir(const char *dirname)
809 809
 	     cli_strbcasestr(dent->d_name, ".sdb") ||
810 810
 	     cli_strbcasestr(dent->d_name, ".zmd") ||
811 811
 	     cli_strbcasestr(dent->d_name, ".rmd") ||
812
+	     cli_strbcasestr(dent->d_name, ".inc") ||
812 813
 	     cli_strbcasestr(dent->d_name, ".cvd"))) {
813 814
 
814 815
 		dbfile = (char *) mcalloc(strlen(dent->d_name) + strlen(dirname) + 2, sizeof(char));
... ...
@@ -843,6 +844,14 @@ static int listdb(const char *filename)
843 843
 	const char *tmpdir;
844 844
 
845 845
 
846
+    if(cli_strbcasestr(filename, ".inc")) { /* incremental directory */
847
+	if(listdir(filename) == -1) {
848
+	    mprintf("!listdb: Can't list incremental directory %s\n", filename);
849
+	    return -1;
850
+	}
851
+	return 0;
852
+    }
853
+
846 854
     if((fd = fopen(filename, "rb")) == NULL) {
847 855
 	mprintf("!listdb: Can't open file %s\n", filename);
848 856
 	return -1;
... ...
@@ -890,7 +899,7 @@ static int listdb(const char *filename)
890 890
 
891 891
 	/* list extracted directory */
892 892
 	if(listdir(dir) == -1) {
893
-	    mprintf("!listdb: Can't unpack CVD file %s\n", filename);
893
+	    mprintf("!listdb: Can't list directory %s\n", filename);
894 894
 	    rmdirs(dir);
895 895
 	    free(dir);
896 896
 	    return -1;