lib9p: prevent files from being created in deleted directories (thanks BurnZeZ)
This commit is contained in:
parent
89e6315699
commit
3bb7ad61aa
|
@ -191,6 +191,12 @@ createfile(File *fp, char *name, char *uid, ulong perm, void *aux)
|
||||||
}
|
}
|
||||||
|
|
||||||
wlock(fp);
|
wlock(fp);
|
||||||
|
if(fp->parent == nil){
|
||||||
|
wunlock(fp);
|
||||||
|
werrstr("create in deleted directory");
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We might encounter blank spots along the
|
* We might encounter blank spots along the
|
||||||
* way due to deleted files that have not yet
|
* way due to deleted files that have not yet
|
||||||
|
|
Loading…
Reference in a new issue