Mapping of RIDs to uid_t and gid_t

David Collier-Brown davecb at Canada.Sun.COM
Mon Apr 6 14:26:23 GMT 1998


I wrote:
> 
>         If true, we have two number lines like this where the x's
> indicate unix uid's are (probabilistically) present
> 
> Uid     |xxxx  xxxxxxxxxxx  xx xx   |                     x   xx|
>         +---------------------------+---------------------------+
>         |     |     |                n-1                         n
>         0    100  1000              2                           2
> 
> NT RID
>         |                                                       |
>         +---------------------------+---------------------------+
>         |                            n-1                         n
>         0                           2                           2
> 
>         If we fold the negative numbers down adjacent to the uids,
> this only requires us to fold a smallish range plus four
> bits of attributes into a quite large range.

Concrete proposal A:
	1) treat -1, -2 and any friends as special cases
	   and map them to 1, 2, ...          
	2) treat all numbers in the range 0 to at least 6001, 
	   6002, 6003...   as positive numbers less than 2**28, 
	   and map then into a range above the previous numbers. 
	   In other words add at least 10 to them.
	3) optionally warn on encountering numbers above 2**16+1
	   (i.e., negative 32 bit numbers)
	4) treat 32 bit numbers above 2**28 as errors

Concrete proposal B:
	If and only if you don't need to know if the number
	represents user group or whatever, map groups into
	a range following the small negative numbers, and
	use 2**32 - n digits to represent 2*32 digits.  In
	this case n is (number of groups + number of negative
	uids).

--dave (my spell checker suggested ``IUD'' in place of uid)
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | davecb at hobbes.ss.org, canada.sun.com
M2N 1Y3. 416-223-8968 | http://java.science.yorku.ca/~davecb


More information about the samba-technical mailing list