From owner-freebsd-hackers Thu Dec 26 05:03:56 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id FAA19491 for hackers-outgoing; Thu, 26 Dec 1996 05:03:56 -0800 (PST) Received: from hda.hda.com (ip1-max1-fitch.ziplink.net [199.232.245.1]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id FAA19486 for ; Thu, 26 Dec 1996 05:03:53 -0800 (PST) Received: (from dufault@localhost) by hda.hda.com (8.6.12/8.6.12) id IAA07192; Thu, 26 Dec 1996 08:00:08 -0500 From: Peter Dufault Message-Id: <199612261300.IAA07192@hda.hda.com> Subject: Re: username lengths In-Reply-To: <199612241424.PAA05541@gvr.win.tue.nl> from Guido van Rooij at "Dec 24, 96 03:24:19 pm" To: guido@gvr.win.tue.nl (Guido van Rooij) Date: Thu, 26 Dec 1996 08:00:07 -0500 (EST) Cc: freebsd-hackers@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > What is the correct way to check what the max length of usernames on > a system is? Somehow I cannot find it... P1003.1b-1993 section B.9.1: "POSIX.1 is silent about the content of the strings containing user or group names. These could be digit strings..." and so on. I suppose this means it could be the user's uuencoded home directory. So the complete answer is that you can't have a max length; you must use getlogin() or getpwnam() and then allocate to the string length. -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936