ref: af6f03e52829a571f1fa3d61c0bfa09a1c89ea36
parent: 21b501c27faa36e413b09b594717f8669ce4183e
author: Alex Musolino <alex@musolino.id.au>
date: Tue Mar 8 08:25:52 EST 2022
hjfs: fix group ownership of home dirs created by newuser command
--- a/sys/src/cmd/hjfs/auth.c
+++ b/sys/src/cmd/hjfs/auth.c
@@ -366,13 +366,18 @@
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);
}