Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Dec 2015 09:52:56 -0500
From:      "Michael B. Eichorn" <ike@michaeleichorn.com>
To:        mexas@bris.ac.uk, freebsd-questions@freebsd.org, lists@bertram-scharpf.de
Subject:   Re: adduser - gid error?
Message-ID:  <1449240776.992.17.camel@michaeleichorn.com>
In-Reply-To: <201512041331.tB4DVKsK092105@mech-as222.men.bris.ac.uk>
References:  <201512041331.tB4DVKsK092105@mech-as222.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1449240776.992.17.camel>