Audit · 7 min
Asking about a moment that has passed
Generated when asked to read a file only if the user is allowed to.
int read_for_user(const char *path, char *buf, size_t n) {
if (access(path, R_OK) != 0) {
return -1;
}
int fd = open(path, O_RDONLY);
return read(fd, buf, n);
}Before it runs
This is in a setuid-root helper. What is the defect?