[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] chroot: always diagnose failure to set supplemental groups
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] chroot: always diagnose failure to set supplemental groups |
Date: |
Wed, 19 Mar 2014 02:43:18 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 03/13/2014 01:47 AM, Pádraig Brady wrote:
> * 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.
> ---
> src/chroot.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/src/chroot.c b/src/chroot.c
> index 7545f83..8044e5b 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
>
>
I've pushed this one as it seemed uncontentious.
thanks,
Pádraig