summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-07-05 15:17:32 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-07-05 15:17:32 +0200
commitb76142bfef85987db05e2cf8a59939cd690960c5 (patch)
tree6fede9a2ae10acee347361498018ee0f1b17abde /sys
parent76677bb8f0d1b5f5dd620de995c0c27c6494e93b (diff)
hjfs: add users command, fix newuser ? documentation
Diffstat (limited to 'sys')
-rw-r--r--sys/man/8/hjfs12
-rw-r--r--sys/src/cmd/hjfs/auth.c1
-rw-r--r--sys/src/cmd/hjfs/cons.c8
-rw-r--r--sys/src/cmd/hjfs/fns.h1
-rw-r--r--sys/src/cmd/hjfs/fs1.c2
5 files changed, 19 insertions, 5 deletions
diff --git a/sys/man/8/hjfs b/sys/man/8/hjfs
index e7f84740c..49573fbb4 100644
--- a/sys/man/8/hjfs
+++ b/sys/man/8/hjfs
@@ -27,6 +27,8 @@ hjfs \- file server maintenance
.I name
.RI [ options ]
.PP
+.B users
+.PP
.B sync
.PP
.B debug-chdeind
@@ -113,10 +115,6 @@ owned by user and group
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
@@ -157,6 +155,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.
.PP
diff --git a/sys/src/cmd/hjfs/auth.c b/sys/src/cmd/hjfs/auth.c
index 1e032de25..ede0286e5 100644
--- a/sys/src/cmd/hjfs/auth.c
+++ b/sys/src/cmd/hjfs/auth.c
@@ -465,3 +465,4 @@ found:
createuserdir(fs, argv[1], uid);
return 1;
}
+
diff --git a/sys/src/cmd/hjfs/cons.c b/sys/src/cmd/hjfs/cons.c
index 688f31378..bfe6bf938 100644
--- a/sys/src/cmd/hjfs/cons.c
+++ b/sys/src/cmd/hjfs/cons.c
@@ -322,6 +322,13 @@ error:
return -1;
}
+int
+cmdusers(int, char**)
+{
+ readusers(fsmain);
+ return 0;
+}
+
extern int cmdnewuser(int, char **);
Cmd cmds[] = {
@@ -334,6 +341,7 @@ Cmd cmds[] = {
{"sync", 1, cmdsync},
{"halt", 1, cmdhalt},
{"newuser", 0, cmdnewuser},
+ {"users", 1, cmdusers},
{"echo", 2, cmdecho},
{"df", 1, cmddf},
{"debug-deind", 2, cmddebugdeind},
diff --git a/sys/src/cmd/hjfs/fns.h b/sys/src/cmd/hjfs/fns.h
index 24c48dffc..0a2cb8667 100644
--- a/sys/src/cmd/hjfs/fns.h
+++ b/sys/src/cmd/hjfs/fns.h
@@ -53,3 +53,4 @@ int userssave(Fs *, Chan *);
int ingroup(Fs *, short, short, int);
void workerinit(void);
void writeusers(Fs *);
+void readusers(Fs *);
diff --git a/sys/src/cmd/hjfs/fs1.c b/sys/src/cmd/hjfs/fs1.c
index ac37eefb0..b59d1e7f4 100644
--- a/sys/src/cmd/hjfs/fs1.c
+++ b/sys/src/cmd/hjfs/fs1.c
@@ -214,7 +214,7 @@ error:
dprint("writeusers: %r\n");
}
-static void
+void
readusers(Fs *fs)
{
Chan *ch;