diff options
author | Alex Musolino <alex@musolino.id.au> | 2022-03-08 13:25:52 +0000 |
---|---|---|
committer | Alex Musolino <alex@musolino.id.au> | 2022-03-08 13:25:52 +0000 |
commit | af6f03e52829a571f1fa3d61c0bfa09a1c89ea36 (patch) | |
tree | 7ec16dab84d435672aba83d82b6577b8913bc914 /sys | |
parent | 21b501c27faa36e413b09b594717f8669ce4183e (diff) |
hjfs: fix group ownership of home dirs created by newuser command
Diffstat (limited to 'sys')
-rw-r--r-- | sys/src/cmd/hjfs/auth.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/cmd/hjfs/auth.c b/sys/src/cmd/hjfs/auth.c index ec9c5e00b..ece37c6b6 100644 --- a/sys/src/cmd/hjfs/auth.c +++ b/sys/src/cmd/hjfs/auth.c @@ -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); } |