2011-06-01 07:43:48

by Pavel Shilovsky

[permalink] [raw]
Subject: Regression in current master

Hi all!

Commit 9274e94db85bac04e170414cb8e0f4be271cde90
(http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=9274e94db85bac04e170414cb8e0f4be271cde90)
caused the regression when --manage-gids option is enabled: a user
doesn't get group list through getgrouplist when auth_unix_gid is
called twice. When I remove static attributes from gid_t *groups and
int groups_len, it works good.

--
Best regards,
Pavel Shilovsky.


2011-06-07 23:01:09

by J. Bruce Fields

[permalink] [raw]
Subject: Re: Regression in current master

On Wed, Jun 01, 2011 at 11:43:47AM +0400, Pavel Shilovsky wrote:
> Commit 9274e94db85bac04e170414cb8e0f4be271cde90
> (http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=9274e94db85bac04e170414cb8e0f4be271cde90)
> caused the regression when --manage-gids option is enabled: a user
> doesn't get group list through getgrouplist when auth_unix_gid is
> called twice. When I remove static attributes from gid_t *groups and
> int groups_len, it works good.

Looking at the patch....

Hm, I can't spot the bug. Sean?

(Also, not a correctness issue, but: shouldn't

if (rv == -1 && ngroups >= groups_len) {

be

if (rv == -1 && ngroups > groups_len) {

?

And, finally, why do we need the separate groups_len == 0 case at the
start at all? The realloc case should be able to handle the initial
case as well.

)

--b.

2011-06-07 23:03:11

by J. Bruce Fields

[permalink] [raw]
Subject: Re: Regression in current master

On Tue, Jun 07, 2011 at 07:01:07PM -0400, J. Bruce Fields wrote:
> On Wed, Jun 01, 2011 at 11:43:47AM +0400, Pavel Shilovsky wrote:
> > Commit 9274e94db85bac04e170414cb8e0f4be271cde90
> > (http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=9274e94db85bac04e170414cb8e0f4be271cde90)
> > caused the regression when --manage-gids option is enabled: a user
> > doesn't get group list through getgrouplist when auth_unix_gid is
> > called twice. When I remove static attributes from gid_t *groups and
> > int groups_len, it works good.
>
> Looking at the patch....
>
> Hm, I can't spot the bug. Sean?

Whoops, sorry, missed your later message!

--b.

>
> (Also, not a correctness issue, but: shouldn't
>
> if (rv == -1 && ngroups >= groups_len) {
>
> be
>
> if (rv == -1 && ngroups > groups_len) {
>
> ?
>
> And, finally, why do we need the separate groups_len == 0 case at the
> start at all? The realloc case should be able to handle the initial
> case as well.
>
> )
>
> --b.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html