Symlink Attack
cCopy codeint fd = open("/tmp/myfile", O_RDWR);
write(fd, "data", strlen("data"));
close(fd);cCopy codeint fd = open("/tmp/myfile", O_RDWR | O_NOFOLLOW);
if (fd == -1) {
perror("open");
exit(EXIT_FAILURE);
}
write(fd, "data", strlen("data"));
close(fd);pythonCopy codewith open('/tmp/myfile', 'w') as f:
f.write('data')Last updated