From a469cffafe23135da443b078bf82ad45833ff37a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 12 Jul 2020 18:52:28 +0200 Subject: cwfs: update mtime and qid.vers for directory on rename when wstating a file, its directory should be updated to reflect this change. here is what the manpage states: > The mtime field reflects the time of the last change of content > (except when later changed by wstat). For a directory it is the > time of the most recent remove, create, or wstat of a file in the > directory. --- sys/src/cmd/cwfs/9p2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/src/cmd/cwfs/9p2.c b/sys/src/cmd/cwfs/9p2.c index 1bf9b7fce..a4d129c97 100644 --- a/sys/src/cmd/cwfs/9p2.c +++ b/sys/src/cmd/cwfs/9p2.c @@ -1656,6 +1656,7 @@ fs_wstat(Chan* chan, Fcall* f, Fcall*, char* strs) * If the name is really to be changed check it's unique * and there is write permission in the parent. */ + d1 = nil; if(dir.name != d->name){ /* * First get parent. @@ -1786,6 +1787,9 @@ fs_wstat(Chan* chan, Fcall* f, Fcall*, char* strs) d->gid = gid; d->muid = muid; p->flags |= Bmod; + + if(p1 != nil) + accessdir(p1, d1, FWRITE, file->uid); } if(!tsync) accessdir(p, d, FREAD, file->uid); -- cgit v1.2.3