From: David Dykstra Date: Wed, 27 Feb 2002 23:15:55 +0000 (+0000) Subject: Cygwin doesn't have setgroups() so probe for the function in configure X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/e3bdb76326a4a06023bc1f24e5e0dd271df87825 Cygwin doesn't have setgroups() so probe for the function in configure and don't try to call it if it doesn't exist. --- diff --git a/clientserver.c b/clientserver.c index 1a638db5..50203350 100644 --- a/clientserver.c +++ b/clientserver.c @@ -287,6 +287,7 @@ static int rsync_module(int fd, int i) } if (am_root) { +#ifdef HAVE_SETGROUPS /* Get rid of any supplementary groups this process * might have inheristed. */ if (setgroups(0, NULL)) { @@ -294,6 +295,7 @@ static int rsync_module(int fd, int i) 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 diff --git a/configure.in b/configure.in index 2722eb71..b3d799c1 100644 --- a/configure.in +++ b/configure.in @@ -351,7 +351,7 @@ AC_FUNC_UTIME_NULL 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([