Date: Mon, 13 Mar 2000 14:41:48 +1100 From: Peter Jeremy <peter.jeremy@alcatel.com.au> To: Paul Richards <paul@originative.co.uk> Cc: current@FreeBSD.ORG Subject: Re: MAX_UID ? Message-ID: <00Mar13.144149est.115209@border.alcanet.com.au> In-Reply-To: <38CC4ECA.68AA4B78@originative.co.uk>; from paul@originative.co.uk on Mon, Mar 13, 2000 at 01:14:40PM %2B1100 References: <38CAD957.3C839375@originative.co.uk> <38CB322D.D12ED0B0@originative.co.uk> <200003130145.RAA51429@vashon.polstra.com> <38CC4AFD.7E649664@originative.co.uk> <200003130202.SAA51491@vashon.polstra.com> <38CC4ECA.68AA4B78@originative.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 13 Mar 2000 13:07:47 +1100, Paul Richards <paul@originative.co.uk> wrote: >Peter Jeremy wrote: >> You can do this now. Just add the following: >> pid_t UID_MAX = ~0; >> somewhere before the code. > >I assume you meant uid_t, Ooops, I did :-(. And this should probably be uid_t UID_MAX = ~0L; to avoid problems if int != long (as John mentioned in passing). >The actual limit is 4294967295, which is the largest number that will >fit into the the 32-bit uid_t. This does work, I had an idea that NFSv2 only allowed 16-bit UIDs, but I can't find any code in FreeBSD, or the relevant RFCs, to support this (possibly some NFS clients/servers ignore the top 16 bits). I did notice, however, that VNOVAL (-1) is used to mean the UID isn't present in some places - and (uid_t)2^32-1 == (uid_t)-1. On 2000-Mar-13 13:14:40 +1100, Paul Richards <paul@originative.co.uk> wrote: >#define UID_MAX ((uid_t)0-1) ... >I can see the flaw in that straight away in that uid_t isn't available >in <sys/syslimits.h> Not a problem. C macros are just text expansions. The `uid_t' isn't evaluated unless/until the macro is used - at which point uid_t must be available. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00Mar13.144149est.115209>