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.
This commit is contained in:
cinap_lenrek 2020-07-12 18:52:28 +02:00
parent 1987cc69c8
commit a469cffafe

View file

@ -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);