hjfs: fix group ownership of home dirs created by newuser command

This commit is contained in:
Alex Musolino 2022-03-08 13:25:52 +00:00
parent 21b501c27f
commit af6f03e528

View file

@ -366,13 +366,18 @@ static void
createuserdir(Fs *fs, char *name, short uid)
{
Chan *ch;
Dir di;
ch = chanattach(fs, CHFNOPERM);
if(ch == nil)
return;
ch->uid = uid;
if(chanwalk(ch, "usr") > 0)
if(chanwalk(ch, "usr") > 0){
chancreat(ch, name, DMDIR | 0775, OREAD);
nulldir(&di);
di.gid = name;
chanwstat(ch, &di);
}
chanclunk(ch);
}