summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-03-13 01:32:46 +0000
committerPádraig Brady <P@draigBrady.com>2014-03-19 02:41:24 +0000
commit137a4239751802b7d59ac3ef9c42fbe03547b2bc (patch)
tree1f26ec539520b1dfbafdc7821a372bfe4a5bada3
parent09eda9ed9d386f3aa84bfff1699cc4cfcec8647e (diff)
downloadcoreutils-137a4239751802b7d59ac3ef9c42fbe03547b2bc.tar.xz
chroot: always diagnose failure to set supplemental groups
* src/chroot.c (setgroups): Change this replacement to fail when called so that platforms like Interix without support for supplemental groups don't silently ignore a --groups option.
-rw-r--r--src/chroot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/chroot.c b/src/chroot.c
index 36912a5d3..8b08b84ea 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -54,13 +54,12 @@ static struct option const long_opts[] =
};
#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. */
+/* At least Interix lacks supplemental group support. */
static int
setgroups (size_t size _GL_UNUSED, gid_t const *list _GL_UNUSED)
{
- return 0;
+ errno = ENOTSUP;
+ return -1;
}
#endif