librpc/ndr use hyper for uid_t/gid_t rather than udlong

Andrew Bartlett abartlet at samba.org
Wed Mar 9 13:53:34 MST 2011


On Wed, 2011-03-09 at 08:13 -0500, simo wrote:
> On Wed, 2011-03-09 at 09:04 +0100, Andrew Bartlett wrote:
> > The branch, master has been updated
> >        via  9728b5a librpc/ndr use hyper for uid_t/gid_t rather than udlong
> >       from  c4b52fb s3: Use talloc_tos() in idmap_nss_sids_to_unixids
> > 
> > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
> > 
> > 
> > - Log -----------------------------------------------------------------
> > commit 9728b5a0d5a5c09615a09a97bf217bcacb773579
> > Author: Andrew Bartlett <abartlet at samba.org>
> > Date:   Wed Mar 2 19:06:15 2011 +1100
> > 
> >     librpc/ndr use hyper for uid_t/gid_t rather than udlong
> >     
> >     This has 8 byte alignment, which is what was specified in pidl for
> >     these types.
> 
> I am puzzled, uid_t and gid_t are 32 bit quantitiers on all platforms I
> know, do you know of platforms that use 64 bit uid/gid types ?
> 
> If not, why do you use a 64 bit type for them ?
> 
> Also uid_t and gid_t are signed in many platforms while here you seem to
> be casting to uint64_t, and that doesn't look right to me.

I chose 64 bit because I didn't see a benefit in baking into stone a 32
bit assumption that might not hold into the future, if this was ever
used on a real (ie, not internal) protocol.  I originally chose signed,
but unsigned because after talking with tridge, we thought that uid_t
was always unsigned.  

Do you have a counter-example I should be aware of?  I'm happy to change
this (again) if required. 

Andrew Bartlett
-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.



More information about the samba-technical mailing list