* [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid
@ 2011-06-01 18:57 Pavel Shilovsky
2011-06-07 20:21 ` Steve Dickson
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Shilovsky @ 2011-06-01 18:57 UTC (permalink / raw)
To: linux-nfs
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;
--
1.7.4.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid
2011-06-01 18:57 [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid Pavel Shilovsky
@ 2011-06-07 20:21 ` Steve Dickson
[not found] ` <4DEE8846.3010009-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Steve Dickson @ 2011-06-07 20:21 UTC (permalink / raw)
To: Pavel Shilovsky; +Cc: linux-nfs
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid
[not found] ` <4DEE8846.3010009-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2011-06-08 5:51 ` Pavel Shilovsky
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Shilovsky @ 2011-06-08 5:51 UTC (permalink / raw)
To: Steve Dickson; +Cc: linux-nfs
2011/6/8 Steve Dickson <SteveD@redhat.com>:
>
>
> 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>
>> ---
>> =A0utils/mountd/cache.c | =A0 =A06 ++++--
>> =A01 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)
>> =A0 =A0 =A0 static gid_t *groups =3D NULL;
>> =A0 =A0 =A0 static int groups_len =3D 0;
>> =A0 =A0 =A0 gid_t *more_groups;
>> - =A0 =A0 int ngroups =3D 0;
>> + =A0 =A0 int ngroups;
>> =A0 =A0 =A0 int rv, i;
>> =A0 =A0 =A0 char *cp;
>>
>> @@ -147,9 +147,11 @@ static void auth_unix_gid(FILE *f)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!groups)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return;
>>
>> - =A0 =A0 =A0 =A0 =A0 =A0 groups_len =3D ngroups =3D INITIAL_MANAGED=
_GROUPS;
>> + =A0 =A0 =A0 =A0 =A0 =A0 groups_len =3D INITIAL_MANAGED_GROUPS;
>> =A0 =A0 =A0 }
>>
>> + =A0 =A0 ngroups =3D groups_len;
>> +
>> =A0 =A0 =A0 if (readline(fileno(f), &lbuf, &lbuflen) !=3D 1)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return;
>>
> Committed...
>
> steved.
>
See it, thanks!
--=20
Best regards,
Pavel Shilovsky.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-08 5:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 18:57 [PATCH] mountd: Fix missing varialble assignment in auth_unix_gid Pavel Shilovsky
2011-06-07 20:21 ` Steve Dickson
[not found] ` <4DEE8846.3010009-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2011-06-08 5:51 ` Pavel Shilovsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.