Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com May 19 '12 at 0:59

This question came from our site for professional and enthusiast programmers.

1 Answer 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.

share|improve this answer
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 6:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.