>From 87c5bf012268222808aee3a9d9ce5729be46828a Mon Sep 17 00:00:00 2001 From: Markus Duft Date: Thu, 8 Sep 2011 11:18:17 +0200 Subject: [PATCH 1/2] build: accommodate missing setgroups on Interix this adds the check plus a dummy, non-functional, always-successful replacement function, to keep the original code untouched and simple. * src/chroot.c (setgroups) [! HAVE_SETGROUPS]: Define. --- src/chroot.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/chroot.c b/src/chroot.c index 95c227b..4c56bf3 100644 --- a/src/chroot.c +++ b/src/chroot.c @@ -52,6 +52,19 @@ static struct option const long_opts[] = {NULL, 0, NULL, 0} }; +#if ! HAVE_SETGROUPS +/* At least Interix lacks supplemental group support. Define an + always-successful replacement to avoid checking for setgroups + availability everywhere, just to support broken platforms. */ +static int +setgroups(size_t size, gid_t const *list) +{ + (void)size; + (void)list; + return 0; +} +#endif + /* 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 -- 1.7.6.1