From owner-freebsd-current Sun Mar 12 19:41: 7 2000 Delivered-To: freebsd-current@freebsd.org Received: from alcanet.com.au (mail.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id 652BE37B573 for ; Sun, 12 Mar 2000 19:41:03 -0800 (PST) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <115209>; Mon, 13 Mar 2000 14:41:49 +1100 Content-return: prohibited From: Peter Jeremy Subject: Re: MAX_UID ? In-reply-to: <38CC4ECA.68AA4B78@originative.co.uk>; from paul@originative.co.uk on Mon, Mar 13, 2000 at 01:14:40PM +1100 To: Paul Richards Cc: current@FreeBSD.ORG Message-Id: <00Mar13.144149est.115209@border.alcanet.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0i Content-type: text/plain; charset=us-ascii 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> Date: Mon, 13 Mar 2000 14:41:48 +1100 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 13 Mar 2000 13:07:47 +1100, Paul Richards 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 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 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