diff -ru -x '*.o' coreutils-8.12.178-df9cd.orig/configure.ac coreutils-8.12.178-df9cd/configure.ac --- coreutils-8.12.178-df9cd.orig/configure.ac 2011-09-01 10:31:45 +0200 +++ coreutils-8.12.178-df9cd/configure.ac 2011-09-01 10:32:07 +0200 @@ -199,7 +199,7 @@ fi # SCO-ODT-3.0 is reported to need -los to link programs using initgroups -AC_CHECK_FUNCS([initgroups]) +AC_CHECK_FUNCS([initgroups setgroups]) if test $ac_cv_func_initgroups = no; then AC_CHECK_LIB([os], [initgroups]) fi diff -ru -x '*.o' coreutils-8.12.178-df9cd.orig/src/chroot.c coreutils-8.12.178-df9cd/src/chroot.c --- coreutils-8.12.178-df9cd.orig/src/chroot.c 2011-09-01 10:31:48 +0200 +++ coreutils-8.12.178-df9cd/src/chroot.c 2011-09-01 10:39:56 +0200 @@ -52,6 +52,7 @@ {NULL, 0, NULL, 0} }; +#ifdef HAVE_SETGROUPS /* Call setgroups to set the supplementary groups to those listed in GROUPS. GROUPS is a comma separated list of supplementary groups (names or numbers). Parse that list, converting any names to numbers, and call setgroups on the @@ -110,6 +111,7 @@ free (gids); return ret; } +#endif void usage (int status) @@ -229,8 +231,10 @@ free (user); free (group); +#ifdef HAVE_SETGROUPS if (groups && set_additional_groups (groups)) fail = true; +#endif if (gid != (gid_t) -1 && setgid (gid)) { @@ -244,6 +248,7 @@ fail = true; } } +#ifdef HAVE_SETGROUPS else { /* Yes, this call is identical to the one above. @@ -253,6 +258,7 @@ if (groups && set_additional_groups (groups)) fail = true; } +#endif if (fail) exit (EXIT_CANCELED);