summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/portfns.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-08-11 22:36:59 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-08-11 22:36:59 +0200
commit427e925eea1ea4ca9a5308b7b08af01785389991 (patch)
treeec23e79aea9861e9945ae05cfffc62b87e497655 /sys/src/cmd/cwfs/portfns.h
parent30d4d8984bfc64e971bfbb3b913c37ed8a8da17b (diff)
cwfs: add optional uid argument to allow command, unify permission override code
the allow command now takes an optional uid argument for the user to be granted temporary god status on the fileserver for maintenance. this was kenji okomotos idea, so thanks :) remove wstatallow and writeallow flags. instead, we have global: int allowed; that contains the uid of the currently allowed user id or -1 if permission checking is globally disabled for the fileserver. when zero, normal permission checking takes place. added int isallowed(File*) function that returns non-zero when the context is the console, or the allowed user. this is also used internally by iaccess(), so all the extra code of in the callers of iaccess() is gone now. dont conflate allowed user with noauth flag and auto-allow on ream. the installer already knows about noauth and allow flags so theres no problem with bootstraping.
Diffstat (limited to 'sys/src/cmd/cwfs/portfns.h')
-rw-r--r--sys/src/cmd/cwfs/portfns.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/cmd/cwfs/portfns.h b/sys/src/cmd/cwfs/portfns.h
index ba584caf0..d6628c640 100644
--- a/sys/src/cmd/cwfs/portfns.h
+++ b/sys/src/cmd/cwfs/portfns.h
@@ -66,7 +66,7 @@ Devsize devsize(Device*);
int devwrite(Device*, Off, void*);
Iobuf* dnodebuf(Iobuf*, Dentry*, Off, int, int);
Iobuf* dnodebuf1(Iobuf*, Dentry*, Off, int, int);
-int doremove(File*, int);
+int doremove(File*);
void dtrunc(Iobuf*, Dentry*, int);
int dtrunclen(Iobuf *p, Dentry *, Off newsize, int uid);
int dumpblock(Device*);
@@ -107,6 +107,7 @@ void iobufinit(void);
void* iobufmap(Iobuf*);
void iobufunmap(Iobuf*);
int iobufql(QLock*);
+int isallowed(File*);
int jukeread(Device*, Off, void*);
int jukewrite(Device*, Off, void*);
void jukeinit(Device*);