diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-06-18 22:09:40 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-06-18 22:09:40 +0200 |
commit | d7c7c7e4b37f764174c90939636880f80c8c8c8f (patch) | |
tree | 1184ab98da61733738dd603ae0fa03f9a4b3d7bd /sys/src/9/port/devshr.c | |
parent | 4b9845d942aa02b54751240ef50e479a370bb549 (diff) |
devsrv, devshr: wstat permissions
update permissions last in wstat so it will only get changed when there was
no error.
Diffstat (limited to 'sys/src/9/port/devshr.c')
-rw-r--r-- | sys/src/9/port/devshr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/port/devshr.c b/sys/src/9/port/devshr.c index 03739a31d..faac78574 100644 --- a/sys/src/9/port/devshr.c +++ b/sys/src/9/port/devshr.c @@ -654,8 +654,6 @@ shrwstat(Chan *c, uchar *dp, int n) if(strcmp(ent->owner, up->user) && !iseve()) error(Eperm); - if(d.mode != ~0UL) - ent->perm = d.mode & 0777; if(d.name != nil && *d.name && strcmp(ent->name, d.name) != 0) { if(strchr(d.name, '/') != nil) error(Ebadchar); @@ -665,6 +663,8 @@ shrwstat(Chan *c, uchar *dp, int n) } if(d.uid != nil && *d.uid) kstrdup(&ent->owner, d.uid); + if(d.mode != ~0UL) + ent->perm = d.mode & 0777; switch(sch->level){ case Qcshr: |