summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/cmd/cwfs/9p2.c14
-rw-r--r--sys/src/cmd/cwfs/all.h7
-rw-r--r--sys/src/cmd/cwfs/con.c8
3 files changed, 13 insertions, 16 deletions
diff --git a/sys/src/cmd/cwfs/9p2.c b/sys/src/cmd/cwfs/9p2.c
index 1c51fe03a..9f5d27c57 100644
--- a/sys/src/cmd/cwfs/9p2.c
+++ b/sys/src/cmd/cwfs/9p2.c
@@ -894,8 +894,8 @@ fs_create(Chan* chan, Fcall* f, Fcall* r)
error = Emode;
goto out;
}
- if(f->perm & PDIR)
- if((f->mode & OTRUNC) || (f->perm & PAPND) || (fmod & FWRITE))
+ if(f->perm & DMDIR)
+ if((f->mode & OTRUNC) || (f->perm & DMAPPEND) || (fmod & FWRITE))
goto badaccess;
/*
* do it
@@ -921,20 +921,22 @@ fs_create(Chan* chan, Fcall* f, Fcall* r)
d1->uid = file->uid;
d1->gid = d->gid;
f->perm &= d->mode | ~0666;
- if(f->perm & PDIR)
+ if(f->perm & DMDIR)
f->perm &= d->mode | ~0777;
}
d1->qid.path = path;
d1->qid.version = 0;
d1->mode = DALLOC | (f->perm & 0777);
- if(f->perm & PDIR) {
+ if(f->perm & DMDIR) {
d1->mode |= DDIR;
d1->qid.path |= QPDIR;
}
- if(f->perm & PAPND)
+ if(f->perm & DMAPPEND)
d1->mode |= DAPND;
+ if(f->perm & DMTMP)
+ d1->mode |= DTMP;
t = nil;
- if(f->perm & PLOCK){
+ if(f->perm & DMEXCL){
d1->mode |= DLOCK;
t = tlocked(p1, d1);
/* if nil, out of tlock structures */
diff --git a/sys/src/cmd/cwfs/all.h b/sys/src/cmd/cwfs/all.h
index 4c358ba78..418d15f55 100644
--- a/sys/src/cmd/cwfs/all.h
+++ b/sys/src/cmd/cwfs/all.h
@@ -25,13 +25,6 @@ enum {
QPROOT = 1,
QPSUPER = 2,
- /*
- * perm argument in 9P create
- */
- PDIR = 1L<<31, /* is a directory */
- PAPND = 1L<<30, /* is append only */
- PLOCK = 1L<<29, /* is locked on open */
-
FID1 = 1,
FID2 = 2,
diff --git a/sys/src/cmd/cwfs/con.c b/sys/src/cmd/cwfs/con.c
index 9e1e7bc05..fa4d42a90 100644
--- a/sys/src/cmd/cwfs/con.c
+++ b/sys/src/cmd/cwfs/con.c
@@ -435,11 +435,13 @@ cmd_create(int argc, char *argv[])
if(argc > 5) {
if(strchr(argv[5], 'l'))
- perm |= PLOCK;
+ perm |= DMEXCL;
if(strchr(argv[5], 'a'))
- perm |= PAPND;
+ perm |= DMAPPEND;
if(strchr(argv[5], 'd'))
- perm |= PDIR;
+ perm |= DMDIR;
+ if(strchr(argv[5], 't'))
+ perm |= DMTMP;
}
if(con_create(FID2, elem, uid, gid, perm, 0))