For example, Interix is missing this function, which prevented
ngIRCd to build on this platform. When setgroups(3) isn't available,
a warning message is issued when ngIRCd starts up.
# 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
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!",
if (real_errno != EPERM)
goto out;
}
+#else
+ Log(LOG_WARNING,
+ "Can't drop supplementary group IDs: setgroups(3) missing!");
+#endif
}
#endif