From owner-freebsd-questions@freebsd.org Fri Dec 4 14:59:42 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066F4A40855 for ; Fri, 4 Dec 2015 14:59:42 +0000 (UTC) (envelope-from ike@michaeleichorn.com) Received: from mx1.eichornenterprises.com (mx1.eichornenterprises.com [104.236.13.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.eichornenterprises.com", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AE7F71313 for ; Fri, 4 Dec 2015 14:59:40 +0000 (UTC) (envelope-from ike@michaeleichorn.com) Received: from mail.eichornenterprises.com (cpe-184-59-147-149.neo.res.rr.com [184.59.147.149]) by mx1.eichornenterprises.com (OpenSMTPD) with ESMTP id 2b382e08; Fri, 4 Dec 2015 09:52:57 -0500 (EST) Received: by mail.eichornenterprises.com (OpenSMTPD) with ESMTPSA id a3483b0c TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Fri, 4 Dec 2015 09:52:56 -0500 (EST) Message-ID: <1449240776.992.17.camel@michaeleichorn.com> Subject: Re: adduser - gid error? From: "Michael B. Eichorn" To: mexas@bris.ac.uk, freebsd-questions@freebsd.org, lists@bertram-scharpf.de Date: Fri, 04 Dec 2015 09:52:56 -0500 In-Reply-To: <201512041331.tB4DVKsK092105@mech-as222.men.bris.ac.uk> References: <201512041331.tB4DVKsK092105@mech-as222.men.bris.ac.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 14:59:42 -0000 On Fri, 2015-12-04 at 05:31 -0800, Anton Shterenlikht wrote: > > On Friday, 04. Dec 2015, 03:04:55 -0800, Anton Shterenlikht wrote: > > > For the user I added today I got: > > > > > > newuser:*:1004:4294967295: ... > > > > > > Does this look right? > > > > 4294967295 is obviously 0xffffffff in hexadecimal and -1 if > > seen as a signed value what is commonly used in C as a > > return value to indicate an error. > > > > > pw: gid `4294967295' has already been allocated > > > adduser: ERROR: There was an error adding user (newuser). > > > > "adduser" is a shell script. I had a look at it but I don't > > know how you managed to generate that number. The script > > calls "pw", that is written in C and probably cannot > > increment the maximum 32-bit value. > > # pw useradd newuser > pw: gid `4294967295' has already been allocated > # > > Now I'm worried... I can replicate your problem, there is a bug in pw. What is happening is that you already have a group that has a gid equal to the next availible uid. Go ahead and use the adduser script, but you will need to specify a uid that does not correspond to an existing uid or gid. (You can safely cat /etc/group and /etc/passwd to find what has been used already). I will file a PR.