and don't try to call it if it doesn't exist.
}
if (am_root) {
+#ifdef HAVE_SETGROUPS
/* Get rid of any supplementary groups this process
* might have inheristed. */
if (setgroups(0, NULL)) {
io_printf(fd, "@ERROR: setgroups failed\n");
return -1;
}
+#endif
/* XXXX: You could argue that if the daemon is started
* by a non-root user and they explicitly specify a
AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod)
AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf asprintf setsid glob strpbrk)
-AC_CHECK_FUNCS(strlcat strlcpy mtrace mallinfo)
+AC_CHECK_FUNCS(strlcat strlcpy mtrace mallinfo setgroups)
AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[
AC_TRY_RUN([