mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
Previously this API would return an InodeIdentifier, which meant that there was a race in path resolution where an inode could be unlinked in between finding the InodeIdentifier for a path component, and actually resolving that to an Inode object. Attaching a test that would quickly trip an assertion before. Test: Kernel/path-resolution-race.cpp
16 lines
236 B
C++
16 lines
236 B
C++
#include <unistd.h>
|
|
#include <sys/stat.h>
|
|
|
|
int main()
|
|
{
|
|
if (!fork()) {
|
|
for (;;) {
|
|
mkdir("/tmp/x", 0666);
|
|
rmdir("/tmp/x");
|
|
}
|
|
}
|
|
for (;;) {
|
|
chdir("/tmp/x");
|
|
}
|
|
return 0;
|
|
}
|