summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ratfs/proto.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-02-11 23:38:58 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-02-11 23:38:58 +0100
commit50e617f8b60b61e98538cb8ccb09958740defb9a (patch)
tree4b7c197d3a998a02fbf62370d5ce6e5ab1ccd5b1 /sys/src/cmd/ratfs/proto.c
parent168dabc142d40a1cdce87e836806a9913bb6534e (diff)
ratfs: implement ipv6 support, replace v4parsecidr() with parseipandmask()
Diffstat (limited to 'sys/src/cmd/ratfs/proto.c')
-rw-r--r--sys/src/cmd/ratfs/proto.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/src/cmd/ratfs/proto.c b/sys/src/cmd/ratfs/proto.c
index 2613ab5b1..8ca76ef40 100644
--- a/sys/src/cmd/ratfs/proto.c
+++ b/sys/src/cmd/ratfs/proto.c
@@ -302,6 +302,7 @@ rcreate(Fcall *f)
{
Fid *fidp;
Node *np;
+ Cidraddr ip;
fidp = newfid(f->fid);
np = fidp->node;
@@ -315,12 +316,16 @@ rcreate(Fcall *f)
return;
}
- /* Ignore the supplied mode and force it to be non-writable */
+ if(cidrparse(&ip, f->name) == -1){
+ reply(f, "bad cidr in filename");
+ return;
+ }
+ /* Ignore the supplied mode and force it to be non-writable */
np = newnode(np, f->name, Trustedtemp, 0444, trustedqid++);
+ np->ip = ip;
if(trustedqid >= Qaddrfile) /* wrap QIDs */
trustedqid = Qtrustedfile;
- cidrparse(&np->ip, f->name);
f->qid = np->d.qid;
np->d.uid = fidp->uid;
np->d.gid = np->d.uid;