lib9p: prevent files from being created in deleted directories (thanks BurnZeZ)

This commit is contained in:
cinap_lenrek 2014-10-23 00:43:27 +02:00
parent 89e6315699
commit 3bb7ad61aa

View file

@ -191,6 +191,12 @@ createfile(File *fp, char *name, char *uid, ulong perm, void *aux)
}
wlock(fp);
if(fp->parent == nil){
wunlock(fp);
werrstr("create in deleted directory");
return nil;
}
/*
* We might encounter blank spots along the
* way due to deleted files that have not yet