Browse code

fix some error messages

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

Tomasz Kojm authored on 2006/10/16 08:10:21
Showing 1 changed files
... ...
@@ -74,7 +74,7 @@ int scanmanager(const struct optstruct *opt)
74 74
 #if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_BEOS)
75 75
     if(!geteuid()) {
76 76
 	if((user = getpwnam(UNPUSER)) == NULL) {
77
-	    logg("^Can't get information about user "UNPUSER"\n");
77
+	    logg("!Can't get information about user "UNPUSER"\n");
78 78
 	    exit(60); /* this is critical problem, so we just exit here */
79 79
 	}
80 80
     }
... ...
@@ -108,7 +108,7 @@ int scanmanager(const struct optstruct *opt)
108 108
 
109 109
     if(opt_check(opt, "database")) {
110 110
 	if((ret = cl_load(opt_arg(opt, "database"), &trie, &claminfo.signs, dboptions))) {
111
-	    logg("^%s\n", cl_strerror(ret));
111
+	    logg("!%s\n", cl_strerror(ret));
112 112
 	    return 50;
113 113
 	}
114 114
 
... ...
@@ -116,7 +116,7 @@ int scanmanager(const struct optstruct *opt)
116 116
 	    char *dbdir = freshdbdir();
117 117
 
118 118
 	if((ret = cl_load(dbdir, &trie, &claminfo.signs, dboptions))) {
119
-	    logg("^%s\n", cl_strerror(ret));
119
+	    logg("!%s\n", cl_strerror(ret));
120 120
 	    free(dbdir);
121 121
 	    return 50;
122 122
 	}
... ...
@@ -124,12 +124,12 @@ int scanmanager(const struct optstruct *opt)
124 124
     }
125 125
 
126 126
     if(!trie) {
127
-	logg("^Can't initialize the virus database\n");
127
+	logg("!Can't initialize the virus database\n");
128 128
 	return 50;
129 129
     }
130 130
 
131 131
     if((ret = cl_build(trie)) != 0) {
132
-	logg("^Database initialization error: %s\n", cl_strerror(ret));;
132
+	logg("!Database initialization error: %s\n", cl_strerror(ret));;
133 133
 	return 50;
134 134
     }
135 135
 
... ...
@@ -225,7 +225,7 @@ int scanmanager(const struct optstruct *opt)
225 225
 
226 226
 	/* we need full path for some reasons (eg. archive handling) */
227 227
 	if(!getcwd(cwd, sizeof(cwd))) {
228
-	    logg("^Can't get absolute pathname of current working directory\n");
228
+	    logg("!Can't get absolute pathname of current working directory\n");
229 229
 	    ret = 57;
230 230
 	} else
231 231
 	    ret = scandirs(cwd, trie, user, opt, limits, options);
... ...
@@ -254,7 +254,7 @@ int scanmanager(const struct optstruct *opt)
254 254
 		if(compression && (thefilename[0] != '/' && thefilename[0] != '\\' && thefilename[1] != ':')) {
255 255
 		    /* we need to complete the path */
256 256
 		    if(!getcwd(cwd, sizeof(cwd))) {
257
-			logg("^Can't get absolute pathname of current working directory\n");
257
+			logg("!Can't get absolute pathname of current working directory\n");
258 258
 			free(limits);
259 259
 			return 57;
260 260
 		    } else {
... ...
@@ -279,7 +279,7 @@ int scanmanager(const struct optstruct *opt)
279 279
 			break;
280 280
 
281 281
 		    default:
282
-			logg("^Not supported file type (%s)\n", thefilename);
282
+			logg("!Not supported file type (%s)\n", thefilename);
283 283
 			ret = 52;
284 284
 		}
285 285
 
... ...
@@ -381,7 +381,7 @@ int scanfile(const char *filename, struct cl_node *root, const struct passwd *us
381 381
 	if((ret = checkfile(filename, root, limits, options, 1)) == CL_VIRUS) {
382 382
 	    if(opt_check(opt, "remove")) {
383 383
 		if(unlink(filename)) {
384
-		    logg("%s: Can't remove\n", filename);
384
+		    logg("^%s: Can't remove\n", filename);
385 385
 		    claminfo.notremoved++;
386 386
 		} else {
387 387
 		    logg("%s: Removed\n", filename);
... ...
@@ -424,13 +424,13 @@ int scanfile(const char *filename, struct cl_node *root, const struct passwd *us
424 424
 	    case 0: /* read access denied */
425 425
 		if(geteuid()) {
426 426
 		    if(!printinfected)
427
-			logg("%s: Access denied to archive\n", filename);
427
+			logg("^%s: Access denied to archive\n", filename);
428 428
 		} else {
429 429
 
430 430
 		    if(limits && limits->maxfilesize)
431 431
 			if(fileinfo(filename, 1) / 1024 > limits->maxfilesize) {
432 432
 			    if(!printinfected)
433
-				logg("%s: Archive too big\n", filename);
433
+				logg("^%s: Archive too big\n", filename);
434 434
 			    return 0;
435 435
 			}
436 436
 
... ...
@@ -445,7 +445,7 @@ int scanfile(const char *filename, struct cl_node *root, const struct passwd *us
445 445
     if((ret = checkfile(filename, root, limits, options, printclean)) == CL_VIRUS) {
446 446
 	if(opt_check(opt, "remove")) {
447 447
 	    if(unlink(filename)) {
448
-		logg("%s: Can't remove\n", filename);
448
+		logg("^%s: Can't remove\n", filename);
449 449
 		claminfo.notremoved++;
450 450
 	    } else {
451 451
 		logg("%s: Removed\n", filename);
... ...
@@ -467,7 +467,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
467 467
     stat(filename, &statbuf);
468 468
 
469 469
     if(!S_ISREG(statbuf.st_mode)) {
470
-	logg("^Suspected archive %s is not a regular file\n", filename);
470
+	logg("^Suspect archive %s (not a regular file)\n", filename);
471 471
 	return 0; /* hmm ? */
472 472
     }
473 473
 
... ...
@@ -483,7 +483,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
483 483
 #endif
484 484
 
485 485
     if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) {
486
-	logg("^Can't write to the temporary directory\n");
486
+	logg("!Can't write to the temporary directory\n");
487 487
 	exit(64);
488 488
     }
489 489
 
... ...
@@ -491,7 +491,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
491 491
 
492 492
     gendir = cli_gentemp(tmpdir);
493 493
     if(mkdir(gendir, 0700)) {
494
-	logg("^Can't create the temporary directory %s\n", gendir);
494
+	logg("!Can't create the temporary directory %s\n", gendir);
495 495
 	exit(63); /* critical */
496 496
     }
497 497
 
... ...
@@ -598,7 +598,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
598 598
 
599 599
     switch(ret) {
600 600
 	case -1:
601
-	    logg("^Can't fork()\n");
601
+	    logg("!Can't fork()\n");
602 602
 	    exit(61); /* this is critical problem, so we just exit here */
603 603
 	case -2:
604 604
 	    logg("^Can't execute some unpacker. Check paths and permissions on the temporary directory\n");
... ...
@@ -608,7 +608,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
608 608
 	    if((ret = checkfile(filename, root, limits, 0, 0)) == CL_VIRUS) {
609 609
 		if(opt_check(opt, "remove")) {
610 610
 		    if(unlink(filename)) {
611
-			logg("%s: Can't remove\n", filename);
611
+			logg("^%s: Can't remove\n", filename);
612 612
 			claminfo.notremoved++;
613 613
 		    } else {
614 614
 			logg("%s: Removed\n", filename);
... ...
@@ -625,7 +625,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
625 625
 	    if((ret = checkfile(filename, root, limits, 0, 1)) == CL_VIRUS) {
626 626
 		if(opt_check(opt, "remove")) {
627 627
 		    if(unlink(filename)) {
628
-			logg("%s: Can't remove\n", filename);
628
+			logg("^%s: Can't remove\n", filename);
629 629
 			claminfo.notremoved++;
630 630
 		    } else {
631 631
 			logg("%s: Removed\n", filename);
... ...
@@ -642,7 +642,7 @@ int scancompressed(const char *filename, struct cl_node *root, const struct pass
642 642
 
643 643
 	    if(opt_check(opt, "remove")) {
644 644
 		if(unlink(filename)) {
645
-		    logg("%s: Can't remove\n", filename);
645
+		    logg("^%s: Can't remove\n", filename);
646 646
 		    claminfo.notremoved++;
647 647
 		} else {
648 648
 		    logg("%s: Removed\n", filename);
... ...
@@ -665,7 +665,7 @@ int scandenied(const char *filename, struct cl_node *root, const struct passwd *
665 665
 
666 666
     stat(filename, &statbuf);
667 667
     if(!S_ISREG(statbuf.st_mode)) {
668
-	logg("^Suspected archive %s is not a regular file\n", filename);
668
+	logg("^Suspect archive %s (not a regular file)\n", filename);
669 669
 	return 0;
670 670
     }
671 671
 
... ...
@@ -682,7 +682,7 @@ int scandenied(const char *filename, struct cl_node *root, const struct passwd *
682 682
 
683 683
 
684 684
     if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) {
685
-	logg("^Can't write to the temporary directory %s\n", tmpdir);
685
+	logg("!Can't write to the temporary directory %s\n", tmpdir);
686 686
 	exit(64);
687 687
     }
688 688
 
... ...
@@ -722,7 +722,7 @@ int scandenied(const char *filename, struct cl_node *root, const struct passwd *
722 722
 
723 723
 	if(opt_check(opt, "remove")) {
724 724
 	    if(unlink(filename)) {
725
-		logg("%s: Can't remove\n", filename);
725
+		logg("^%s: Can't remove\n", filename);
726 726
 		claminfo.notremoved++;
727 727
 	    } else {
728 728
 	        logg("%s: Removed\n", filename);
... ...
@@ -795,14 +795,14 @@ int checkstdin(const struct cl_node *root, const struct cl_limits *limits, int o
795 795
 #endif
796 796
 
797 797
     if(checkaccess(tmpdir, UNPUSER, W_OK) != 1) {
798
-	logg("^Can't write to temporary directory\n");
798
+	logg("!Can't write to temporary directory\n");
799 799
 	return 64;
800 800
     }
801 801
 
802 802
     file = cli_gentemp(tmpdir);
803 803
 
804 804
     if(!(fs = fopen(file, "wb"))) {
805
-	logg("^Can't open %s for writing\n", file);
805
+	logg("!Can't open %s for writing\n", file);
806 806
 	return 63;
807 807
     }
808 808