linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Pavel Shilovsky <piastry@etersoft.ru>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid
Date: Tue, 07 Jun 2011 16:21:26 -0400	[thread overview]
Message-ID: <4DEE8846.3010009@RedHat.com> (raw)
In-Reply-To: <1306954641-2560-1-git-send-email-piastry@etersoft.ru>



On 06/01/2011 02:57 PM, Pavel Shilovsky wrote:
> When we get into auth_unix_gid at the second time, groups_len
> is not 0 and ngroups variable leave as 0. Then we use ngroups
> in getgrouplist that fails in this case. This patch fixes it.
> 
> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
> ---
>  utils/mountd/cache.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
> index df6b38f..dbe20e9 100644
> --- a/utils/mountd/cache.c
> +++ b/utils/mountd/cache.c
> @@ -138,7 +138,7 @@ static void auth_unix_gid(FILE *f)
>  	static gid_t *groups = NULL;
>  	static int groups_len = 0;
>  	gid_t *more_groups;
> -	int ngroups = 0;
> +	int ngroups;
>  	int rv, i;
>  	char *cp;
>  
> @@ -147,9 +147,11 @@ static void auth_unix_gid(FILE *f)
>  		if (!groups)
>  			return;
>  
> -		groups_len = ngroups = INITIAL_MANAGED_GROUPS;
> +		groups_len = INITIAL_MANAGED_GROUPS;
>  	}
>  
> +	ngroups = groups_len;
> +
>  	if (readline(fileno(f), &lbuf, &lbuflen) != 1)
>  		return;
>  
Committed...

steved.

  reply	other threads:[~2011-06-07 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01 18:57 [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid Pavel Shilovsky
2011-06-07 20:21 ` Steve Dickson [this message]
     [not found]   ` <4DEE8846.3010009-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2011-06-08  5:51     ` Pavel Shilovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DEE8846.3010009@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=piastry@etersoft.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).