adduser - gid error?
Michael B. Eichorn
ike at michaeleichorn.com
Fri Dec 4 14:59:42 UTC 2015
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.
More information about the freebsd-questions
mailing list