linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: "Finney, Sean" <Sean.Finney@sonyericsson.com>
Cc: "rees@umich.edu" <rees@umich.edu>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"bfields@fieldses.org" <bfields@fieldses.org>
Subject: Re: [PATCH v2 1/2] nfs-utils: mountd: Use a dynamic buffer for storing lists of gid's
Date: Thu, 7 Apr 2011 10:29:39 -0400	[thread overview]
Message-ID: <5964B39E-ADFD-496C-98BE-D77920239E1B@oracle.com> (raw)
In-Reply-To: <A50602A820F61543B29992A418BB321B66E18F8A5E@seldmbx01.corpusers.net>


On Apr 7, 2011, at 10:15 AM, Finney, Sean wrote:

> Hi Jim,
> 
> On Thu, 2011-04-07 at 08:22 -0400, Jim Rees wrote:
> 
>> I was going to suggest you first call getgrouplist with groups set to 0 so
>> you can always alloc() the correct size list, but then I found this in the
>> man page:
>> 
>> BUGS
>>       In  glibc  versions  before  2.3.3, the implementation of this function
>>       contains a buffer-overrun bug: it returns the complete list  of  groups
>>       for  user  in  the array groups, even when the number of groups exceeds
>>       *ngroups.
> 
> Yuck.  The function is also not in POSIX or any other standards, so
> maybe it's worth discussing at a later point whether getgroups(2) would
> be a better interface to use, even if it means an extra step or two.

The standard RPC library function authunix_create_default() uses getgroups(2).  Take a look at the glibc version of this function to see the preferred method for using getgroups(2).

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





  reply	other threads:[~2011-04-07 14:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04  8:02 Fixes for NFS in environments with large group memberships Finney, Sean
     [not found] ` <A50602A820F61543B29992A418BB321B66E18F8A4A-g6SuDuYnGwoBLpZRX7oUTsm4BeyDBExM@public.gmane.org>
2011-04-05 23:35   ` J. Bruce Fields
2011-04-07  5:53     ` Finney, Sean
2011-04-07  7:22     ` [PATCH v2 1/2] nfs-utils: mountd: Use a dynamic buffer for storing lists of gid's Sean Finney
2011-04-07  7:22       ` [PATCH v2 2/2] nfs-utils: Increase the stdio file buffer size for procfs files Sean Finney
2011-04-07 12:22       ` [PATCH v2 1/2] nfs-utils: mountd: Use a dynamic buffer for storing lists of gid's Jim Rees
2011-04-07 14:15         ` Finney, Sean
2011-04-07 14:29           ` Chuck Lever [this message]
2011-04-07 15:01           ` Jim Rees

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=5964B39E-ADFD-496C-98BE-D77920239E1B@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Sean.Finney@sonyericsson.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=rees@umich.edu \
    /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).