From owner-freebsd-questions@freebsd.org Fri Dec 4 15:20:17 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 41419A40FBB for ; Fri, 4 Dec 2015 15:20:17 +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 E483417A5 for ; Fri, 4 Dec 2015 15:20:16 +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 5a2f8f9e; Fri, 4 Dec 2015 10:20:13 -0500 (EST) Received: by mail.eichornenterprises.com (OpenSMTPD) with ESMTPSA id be780c08 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Fri, 4 Dec 2015 10:20:12 -0500 (EST) Message-ID: <1449242411.992.19.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 10:20:11 -0500 In-Reply-To: <1449240776.992.17.camel@michaeleichorn.com> References: <201512041331.tB4DVKsK092105@mech-as222.men.bris.ac.uk> <1449240776.992.17.camel@michaeleichorn.com> 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 15:20:17 -0000 On Fri, 2015-12-04 at 09:52 -0500, Michael B. Eichorn wrote: > 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. Filed as PR 205019 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205019