Commit Diff


commit - 5c48d7e9c7f0181772c14b133030a3c0e978fdc5
commit + 2fc61ce8a6a6c2ac8652b8cea33d57acd50681c2
blob - bd40694f3ccdef563aefa32803a2941b4cab1564
blob + 34094a485180cc9874085daf4d45a2b8ae31aefb
--- configure.ng
+++ configure.ng
@@ -221,8 +221,8 @@ AC_CHECK_FUNCS([ \
 # Optional functions
 AC_CHECK_FUNCS_ONCE([
 	arc4random arc4random_stir gai_strerror getnameinfo inet_aton \
-	sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \
-	strtok_r unsetenv waitpid])
+	setgroups sigaction sigprocmask snprintf strdup strlcat strlcpy \
+	strndup strtok_r unsetenv vsnprintf waitpid])
 
 WORKING_GETADDRINFO
 
blob - 1b20597d8aa26cf7dbd0c2e490786ea910bab8d5
blob + 0e8acb54213e3a3c6e54e99affdf0b9bfed22871
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
@@ -724,6 +724,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM) 
 				goto out;
 		}
+#ifdef HAVE_SETGROUPS
 		if (setgroups(0, NULL) != 0) {
 			real_errno = errno;
 			Log(LOG_ERR, "Can't drop supplementary group IDs: %s!",
@@ -731,6 +732,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM)
 				goto out;
 		}
+#else
+		Log(LOG_WARNING,
+		    "Can't drop supplementary group IDs: setgroups(3) missing!");
+#endif
 	}
 #endif