Blame SOURCES/arpwatch-2.1a15-dropgroup.patch

1c6a1b
diff -up arpwatch-2.1a15/arpwatch.c.dropgroup arpwatch-2.1a15/arpwatch.c
1c6a1b
--- arpwatch-2.1a15/arpwatch.c.dropgroup	2012-05-31 11:47:13.327901902 +0200
1c6a1b
+++ arpwatch-2.1a15/arpwatch.c	2012-05-31 11:48:04.859900061 +0200
1c6a1b
@@ -147,7 +147,7 @@ void dropprivileges(const char* user)
1c6a1b
 	struct passwd* pw;
1c6a1b
 	pw = getpwnam( user );
1c6a1b
 	if ( pw ) {
1c6a1b
-		if ( initgroups(pw->pw_name, NULL) != 0 || setgid(pw->pw_gid) != 0 ||
1c6a1b
+		if ( setgid(pw->pw_gid) != 0 || setgroups(0, NULL) != 0 ||
1c6a1b
 				 setuid(pw->pw_uid) != 0 ) {
1c6a1b
 			syslog(LOG_ERR, "Couldn't change to '%.32s' uid=%d gid=%d", user,
1c6a1b
 						 pw->pw_uid, pw->pw_gid);