Browse code

Added sanity check

git-svn: trunk@2118

Nigel Horne authored on 2006/07/25 16:31:07
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Jul 25 08:30:12 BST 2006 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Mention Castlecops in report-phish
4
+			Added sanity checks
5
+
1 6
 Mon Jul 24 21:05:20 CEST 2006 (tk)
2 7
 ----------------------------------
3 8
   * shared/cdiff.c: add missing fclose() in cdiff_cmd_close()
... ...
@@ -23,9 +23,9 @@
23 23
  *
24 24
  * For installation instructions see the file INSTALL that came with this file
25 25
  */
26
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.270 2006/07/23 19:13:10 njh Exp $";
26
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.271 2006/07/25 07:29:39 njh Exp $";
27 27
 
28
-#define	CM_VERSION	"devel-230706"
28
+#define	CM_VERSION	"devel-250706"
29 29
 
30 30
 #if HAVE_CONFIG_H
31 31
 #include "clamav-config.h"
... ...
@@ -1527,6 +1527,27 @@ main(int argc, char **argv)
1527 1527
 	} else
1528 1528
 		tmpdir = NULL;
1529 1529
 
1530
+	if(report) {
1531
+		if((quarantine_dir == NULL) && (tmpdir == NULL)) {
1532
+			/*
1533
+			 * Limitation: doesn't store message in a temporary
1534
+			 * file, so we won't be able to use mail < file
1535
+			 */
1536
+			fprintf(stderr, "%s: when using --external, --report-phish cannot be used without either LocalSocket or --quarantine\n",
1537
+				argv[0]);
1538
+			return EX_USAGE;
1539
+		}
1540
+		if(lflag) {
1541
+			/*
1542
+			 * Naturally, if you attempt to scan the phish you've
1543
+			 * just reported, it'll be blocked!
1544
+			 */
1545
+			fprintf(stderr, "%s: --report-phish cannot be used with --local\n",
1546
+				argv[0]);
1547
+			return EX_USAGE;
1548
+		}
1549
+	}
1550
+
1530 1551
 	if(cfgopt(copt, "Foreground")->enabled)
1531 1552
 		logg_foreground = 1;
1532 1553
 	else {