From af6f03e52829a571f1fa3d61c0bfa09a1c89ea36 Mon Sep 17 00:00:00 2001 From: Alex Musolino Date: Tue, 8 Mar 2022 13:25:52 +0000 Subject: hjfs: fix group ownership of home dirs created by newuser command --- sys/src/cmd/hjfs/auth.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys') 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); } -- cgit v1.2.3