From owner-freebsd-questions Mon Aug 6 8: 9:27 2001 Delivered-To: freebsd-questions@freebsd.org Received: from gekko.ms-agentur.de (server.ms-agentur.de [62.153.134.194]) by hub.freebsd.org (Postfix) with ESMTP id 30FAC37B401 for ; Mon, 6 Aug 2001 08:09:23 -0700 (PDT) (envelope-from so@i-clue.de) Received: from i-clue.de (automatix.i-clue.de [192.168.0.112]) by gekko.ms-agentur.de (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA14667; Mon, 6 Aug 2001 17:16:56 +0200 Message-ID: <3B6EB389.97E0CFE3@i-clue.de> Date: Mon, 06 Aug 2001 17:11:05 +0200 From: Christoph Sold Reply-To: so@i-clue.de X-Mailer: Mozilla 4.78 [en] (WinNT; U) X-Accept-Language: de,en MIME-Version: 1.0 To: Joe McGuckin Cc: questions@FreeBSD.ORG Subject: Re: Largest UID value ? References: <200108042052.f74KqHM82410@monk.via.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Joe McGuckin wrote: > > What is the largest legitimate user id value? > > getpwent() returns a uid_t which is a 32 bit unsigned it. > > But, user 'nobody' (which historically had a user id of -1) has a > user id of 65534. This is because the 32 bit signed integer -1 has exactly the same bit pattern than 32 bit unsigned int 65534. It's only a different interpretation of that bit pattern. > Will it break things if I start adding users with uid's greater > than 65536 ? Even 65536 will break things, as this is greater than MAXINT for unsigned 32 bit integer values. For organizational reasons, small negative values (which translate to values betwenn 65k and MAXINT) should also be avoided. Thus, as a rule of thumb, UIDs should stay below 65500. HTH -Christoph Sold To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message