Browse code

cosmetic fixes

git-svn: trunk@1014

Tomasz Kojm authored on 2004/10/17 09:48:02
Showing 5 changed files
... ...
@@ -1,6 +1,10 @@
1
+Sun Oct 17 02:42:10 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav, freshclam: cosmetic fixes
4
+
1 5
 Sun Oct 17 01:28:48 CEST 2004 (tk)
2 6
 ----------------------------------
3
-  * libclamav: count unpacked data scanned with cl_scanbuff()
7
+  * libclamav: count unpacked data scanned by cl_scanbuff()
4 8
 
5 9
 Sat Oct 16 20:11:15 BST 2004 (njh)
6 10
 ----------------------------------
... ...
@@ -195,10 +195,10 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
195 195
 		mprintf("*Software version from DNS: %s\n", pt);
196 196
 		if(!strstr(cl_retver(), "devel")) {
197 197
 		    if(strcmp(cl_retver(), pt)) {
198
-			mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
199
-			mprintf("WARNING: Local version: %s, Recommended version: %s\n", cl_retver(), pt);
200
-			logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
201
-			logg("WARNING: Local version: %s, Recommended version: %s\n", cl_retver(), pt);
198
+			mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
199
+			mprintf("WARNING: Local version: %s Recommended version: %sin", cl_retver(), pt);
200
+			logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
201
+			logg("WARNING: Local version: %s Recommended version: %sin", cl_retver(), pt);
202 202
 		    }
203 203
 		}
204 204
 		free(pt);
... ...
@@ -271,9 +271,9 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
271 271
 
272 272
 	if(flevel < current->fl) {
273 273
 	    /* display warning even for already installed database */
274
-	    mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
274
+	    mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
275 275
 	    mprintf("WARNING: Current functionality level = %d, required = %d\n", flevel, current->fl);
276
-	    logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
276
+	    logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
277 277
 	    logg("WARNING: Current functionality level = %d, required = %d\n", flevel, current->fl);
278 278
 	}
279 279
 
... ...
@@ -302,8 +302,8 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
302 302
 	return 52;
303 303
     };
304 304
 
305
-    /* the temporary file is created in a directory owned by clamav so a race
306
-     * condition is not possible
305
+    /* the temporary file is created in a directory owned by clamav so race
306
+     * conditions are not possible
307 307
      */
308 308
     tempname = cli_gentemp(".");
309 309
 
... ...
@@ -353,9 +353,9 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
353 353
     logg("%s updated (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder);
354 354
 
355 355
     if(flevel < current->fl) {
356
-	mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
356
+	mprintf("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
357 357
 	mprintf("WARNING: Current functionality level = %d, required = %d\n", flevel, current->fl);
358
-	logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately !\n");
358
+	logg("WARNING: Your ClamAV installation is OUTDATED - please update immediately!\n");
359 359
 	logg("WARNING: Current functionality level = %d, required = %d\n", flevel, current->fl);
360 360
     }
361 361
 
... ...
@@ -576,8 +576,11 @@ int get_database(const char *dbfile, int socketfd, const char *file, const char
576 576
 #else
577 577
     if((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0644)) == -1) {
578 578
 #endif
579
-	mprintf("@Can't open new file %s to write\n", file);
580
-	perror("open");
579
+	    char currdir[512];
580
+
581
+	getcwd(currdir, sizeof(currdir));
582
+	mprintf("@Can't create new file %s in %s\n", file, currdir);
583
+	mprintf("@The database directory must be writable for UID %d or GID %d\n", getuid(), getgid());
581 584
 	return 57;
582 585
     }
583 586
 
... ...
@@ -20,6 +20,7 @@
20 20
 #include <sys/stat.h>
21 21
 #include <fcntl.h>
22 22
 #include <unistd.h>
23
+#include <netinet/in.h>
23 24
 
24 25
 #include "clamav.h"
25 26
 #include "others.h"
... ...
@@ -344,7 +344,7 @@ static int ReadHeader(int BlockType);
344 344
 static BOOL ExtrFile(int desc);
345 345
 static int tread(void *stream,void *buf,unsigned len);
346 346
 static int tseek(void *stream,long offset,int fromwhere);
347
-static BOOL UnstoreFile(void);
347
+/* static BOOL UnstoreFile(void); */
348 348
 static int IsArchive(void);
349 349
 static int ReadBlock(int BlockType);
350 350
 static unsigned int UnpRead(unsigned char *Addr,unsigned int Count);
... ...
@@ -1250,6 +1250,7 @@ int stricomp(char *Str1,char *Str2)
1250 1250
  * ** unpack stored RAR files **
1251 1251
  * *****************************/
1252 1252
 
1253
+/*
1253 1254
 BOOL UnstoreFile(void)
1254 1255
 {
1255 1256
   if ((long)(*temp_output_buffer_offset=UnpRead(temp_output_buffer,
... ...
@@ -1260,8 +1261,7 @@ BOOL UnstoreFile(void)
1260 1260
   }
1261 1261
   return TRUE;
1262 1262
 }
1263
-
1264
-
1263
+*/
1265 1264
 
1266 1265
 
1267 1266
 /* ****************************************
... ...
@@ -122,7 +122,7 @@ int logg(const char *str, ...)
122 122
 #ifdef CL_THREAD_SAFE
123 123
 		pthread_mutex_unlock(&logg_mutex);
124 124
 #endif
125
-		printf("ERROR: Can't open %s in append mode.\n", logg_file);
125
+		printf("ERROR: Can't open %s in append mode (check permissions!).\n", logg_file);
126 126
 		return -1;
127 127
 	    } else umask(old_umask);
128 128