3

Is a Unix group without an entry in /etc/group valid? A user had the group as his primary group and that entry was deleted from the /etc/group file.

rrevo
  • 131

1 Answers1

1

The system will be unable to resolve the group and when you list files that are owned by the group, you will only see its (old) numerical ID. In that sense it is valid. However, you can't set ownership to that group on any files.

Basically, your system won't crash and burn horribly, but some files might be inaccessible by some users until you fix their ownership.

  • 1
    In fact you can set ownership to an unnamed group. With GNU coreutils, chgrp +1234 foo sets the group ownership of FOO to the numeric gid 1234. Other versions of the chgrp command might not support this, but the chown system call takes a numeric gid_t argument. Group names are mainly for convenience. – Keith Thompson May 18 '12 at 22:53
  • This isn't GNU specific, most if not all chgrp implementations support a numeric group operand as it is mandated by POSIX. – jlliagre May 19 '12 at 06:01