adduser - gid error?

Bertram Scharpf lists at bertram-scharpf.de
Fri Dec 4 13:05:28 UTC 2015


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


More information about the freebsd-questions mailing list