Browse code

Added support for Windows SFU 3.5

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

Nigel Horne authored on 2004/06/14 23:35:50
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Jun 14 15:35:04 BST 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Added support for Windows SFU, patch by TK
4
+
1 5
 Mon Jun 14 10:07:24 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Some spam generates very broken headers, added fix
... ...
@@ -403,6 +403,7 @@ Changes
403 403
 0.72	3/6/04	Up-issued
404 404
 0.72a	8/6/04	--from didn't take an option (fix to 0.71a)
405 405
 0.73	14/6/04	Up-issued
406
+0.73a	14/6/04	Added support for Windows SFU 3.5
406 407
 
407 408
 BUG REPORTS
408 409
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.96  2004/06/14 14:34:15  nigelhorne
30
+ * Added support for Windows SFU 3.5
31
+ *
29 32
  * Revision 1.95  2004/06/14 09:05:49  nigelhorne
30 33
  * Up-issued
31 34
  *
... ...
@@ -296,9 +299,9 @@
296 296
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
297 297
  * Added -f flag use MaxThreads if --max-children not set
298 298
  */
299
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.95 2004/06/14 09:05:49 nigelhorne Exp $";
299
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.96 2004/06/14 14:34:15 nigelhorne Exp $";
300 300
 
301
-#define	CM_VERSION	"0.73"
301
+#define	CM_VERSION	"0.73a"
302 302
 
303 303
 /*#define	CONFDIR	"/usr/local/etc"*/
304 304
 
... ...
@@ -842,10 +845,25 @@ main(int argc, char **argv)
842 842
 				return EX_CONFIG;
843 843
 			}
844 844
 
845
-			if(cfgopt(copt, "AllowSupplementaryGroups"))
846
-				initgroups(cpt->strarg, user->pw_gid);
847
-			else
848
-				setgroups(1, &user->pw_gid);
845
+			if(cfgopt(copt, "AllowSupplementaryGroups")) {
846
+#ifdef HAVE_INITGROUPS
847
+				if(initgroups(cpt->strarg, user->pw_gid) < 0) {
848
+					perror(cpt->strarg);
849
+					return EX_CONFIG;
850
+				}
851
+#else
852
+				fprintf(stderr, "%s: AllowSupplementaryGroups: initgroups not supported.\n",
853
+					argv[0]);
854
+				return EX_CONFIG;
855
+#endif
856
+			} else {
857
+#ifdef	HAVE_SETGROUPS
858
+				if(setgroups(1, &user->pw_gid) < 0) {
859
+					perror(cpt->strarg);
860
+					return EX_CONFIG;
861
+				}
862
+#endif
863
+			}
849 864
 
850 865
 			setgid(user->pw_gid);
851 866
 			if(setuid(user->pw_uid) < 0)