git: 9front

Download patch

ref: be55ed165ab510f3740a88dd06cea3e4053c4630
parent: b437b2f4a08d69d6bd618e488f1b35c2ca0198d5
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);
 }
 
--