[Gllug] Problem with users (authing over Active Directory) not being about to run software, but local users can.

John Edwards john at cornerstonelinux.co.uk
Thu Oct 15 14:27:25 UTC 2009


On Thu, Oct 15, 2009 at 02:50:04PM +0100, Bruce Richardson wrote:
> On Thu, Oct 15, 2009 at 02:46:15PM +0100, Peter wrote:
>> 2009/10/15 Matthew King <matthew.king at monnsta.net>:
>>> John Edwards <john at cornerstonelinux.co.uk> writes:
>>>
>>>> In the old days it used to be a 16 bit unsigned int, so 65535
>>>> (2^16 -1). Almost all modern UNIX-like systems now use a 32 bit
>>>> signed int, so 2147483647 (2^31 -1).
>>>
>>> Is there any reason why when this was implemented it was decided to use
>>> 31 instead of 32 bits? I know that 4 billion users is unlikely but it
>>> seems a bit odd to use an unsigned instead of a signed int.
>>>
>>> Assuming of course that negative UIDs are illegal.
>>>
>>> Matthew
>> 
>>  I suspect the reason was to keep it simple a signed integer was used
>> for every thing so you unsigned operators are not needed, one less
>> thing to break, one less thing to fix.
>> 
> 
> It's not a signed int; it's an unsigned int.  Go look at the include
> files on your Linux box to verify this.
> 
> There has traditionally been some confusion out there about whether Unix
> UUIDs are signed or unsigned types because of the way the max ID is
> tested in some code - since 65535 in a 16 bit unsigned integer is
> equivalent to -1 in a signed 16 bit integer, some coders would use -1
> because it's easier to remember and type (and potentially
> forwards-compatible, depending on how type macros are managed on your
> *nix of choice).


Hmmm, looks like you are right. The GNU C library docs also say the
user and group IDs are unsigned int values:
	http://www.gnu.org/s/libc/manual/html_node/Reading-Persona.html

Perhaps you would like to tell RedHat that their docs are wrong?
;)


It also looks like Solaris have moved to using unsigned int recently:
	http://www.opensolaris.org/os/community/on/flag-days/pages/2007052501/
	http://docs.sun.com/app/docs/doc/820-0543/gfraf?a=view


ps. For a bit of fun with UIDs, have a read of this old email from 1998:
	http://archives.neohapsis.com/archives/bugtraq/1998_2/0577.html


-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20091015/f25aa6ce/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list