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

Andrew Bartlett abartlet at samba.org
Thu Mar 10 00:46:12 MST 2011


On Thu, 2011-03-10 at 08:10 +0100, Volker Lendecke wrote:
> On Thu, Mar 10, 2011 at 07:53:34AM +1100, Andrew Bartlett wrote:
> > Do you have a counter-example I should be aware of?  I'm happy to change
> > this (again) if required. 
> 
> "man 2 chown":
> 
> If the owner or group is specified as -1, then that ID is
> not changed.

I'm quite aware of that, but as far as I can tell this is done by
implicit casting of the unsigned value, because every header file I've
found in /usr/include on my Fedora 14 system refers to an unsigned
quantity:

/usr/include/asm/posix_types_64.h:typedef unsigned int __kernel_uid_t;
/usr/include/bits/typesizes.h:#define __UID_T_TYPE __U32_TYPE
/usr/include/bits/types.h:__STD_TYPE __UID_T_TYPE __uid_t;	/* Type of
user identifications.  */
/usr/include/sys/ipc.h:typedef __uid_t uid_t;

and for chown specifically:
/usr/include/unistd.h:extern int chown (__const char *__file, __uid_t
__owner, __gid_t __group)

Now, the level of indirection here is shocking, but as far as I read it
these are unsigned quantities at all times.

Isn't POSIX grand?

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