Cygwin doesn't have setgroups() so probe for the function in configure
authorDavid Dykstra <dwd@samba.org>
Wed, 27 Feb 2002 23:15:55 +0000 (23:15 +0000)
committerDavid Dykstra <dwd@samba.org>
Wed, 27 Feb 2002 23:15:55 +0000 (23:15 +0000)
and don't try to call it if it doesn't exist.

clientserver.c
configure.in

index 1a638db..5020335 100644 (file)
@@ -287,6 +287,7 @@ static int rsync_module(int fd, int i)
        }
 
        if (am_root) {
        }
 
        if (am_root) {
+#ifdef HAVE_SETGROUPS
                /* Get rid of any supplementary groups this process
                 * might have inheristed. */
                if (setgroups(0, NULL)) {
                /* 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;
                }
                        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
 
                /* XXXX: You could argue that if the daemon is started
                 * by a non-root user and they explicitly specify a
index 2722eb7..b3d799c 100644 (file)
@@ -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(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([
 
 AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[
 AC_TRY_RUN([