Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2015 14:05:18 +0100
From:      Bertram Scharpf <lists@bertram-scharpf.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: adduser - gid error?
Message-ID:  <20151204130518.GA8421@becker.bs.l>
In-Reply-To: <201512041104.tB4B4s5Z091536@mech-as222.men.bris.ac.uk>
References:  <201512041104.tB4B4s5Z091536@mech-as222.men.bris.ac.uk>

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

> What shall I do?

Untested: You should be save by editing /etc/groups and change
the value by hand. Then call "vipw" to edit /etc/passwd.
After that you need to find files on disk with the wrong
group id. You can do something like

  # find /home /var -group 4294967295 -exec ls -l '{}' \; 
  # find /home /var -group 4294967295 -exec chgrp 1004 '{}' \; 

Did I forget anything?

Good luck!

Bertram


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de



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