git: 9front

Download patch

ref: d0a5a262866e151de7955665bbfe2f83466ee4d2
parent: d18e81a650c38d36a41820a351d9585a4166e02d
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Fri Jul 5 11:17:32 EDT 2013

hjfs: add users command, fix newuser ? documentation

--- a/sys/man/8/hjfs
+++ b/sys/man/8/hjfs
@@ -27,6 +27,8 @@
 .I name
 .RI [ options ]
 .PP
+.B users
+.PP
 .B sync
 .PP
 .B debug-chdeind
@@ -113,10 +115,6 @@
 The options are
 .TF =leaderxx
 .TP
-.B ?
-Print the entry for
-.IR name .
-.TP
 .B :
 Add a group: add the name to
 .B /adm/users
@@ -156,6 +154,12 @@
 command the file server overwrites
 .B /adm/users
 to reflect the internal state of the user table.
+.PP
+.I Users
+reads the contents of file 
+.B /adm/users
+to initialize the file server's internal representation of the
+users structure.
 .PP
 .I Sync
 writes dirty blocks in memory to the magnetic disk cache.
--- a/sys/src/cmd/hjfs/auth.c
+++ b/sys/src/cmd/hjfs/auth.c
@@ -465,3 +465,4 @@
 		createuserdir(fs, argv[1], uid);
 	return 1;
 }
+
--- a/sys/src/cmd/hjfs/cons.c
+++ b/sys/src/cmd/hjfs/cons.c
@@ -322,6 +322,13 @@
 	return -1;
 }
 
+int
+cmdusers(int, char**)
+{
+	readusers(fsmain);
+	return 0;
+}
+
 extern int cmdnewuser(int, char **);
 
 Cmd cmds[] = {
@@ -334,6 +341,7 @@
 	{"sync", 1, cmdsync},
 	{"halt", 1, cmdhalt},
 	{"newuser", 0, cmdnewuser},
+	{"users", 1, cmdusers},
 	{"echo", 2, cmdecho},
 	{"df", 1, cmddf},
 	{"debug-deind", 2, cmddebugdeind},
--- a/sys/src/cmd/hjfs/fns.h
+++ b/sys/src/cmd/hjfs/fns.h
@@ -53,3 +53,4 @@
 int	ingroup(Fs *, short, short, int);
 void	workerinit(void);
 void	writeusers(Fs *);
+void	readusers(Fs *);
--- a/sys/src/cmd/hjfs/fs1.c
+++ b/sys/src/cmd/hjfs/fs1.c
@@ -214,7 +214,7 @@
 	dprint("writeusers: %r\n");
 }
 
-static void
+void
 readusers(Fs *fs)
 {
 	Chan *ch;
--