Skip to content

Audit · 7 min

Asking about a moment that has passed

Generated when asked to read a file only if the user is allowed to.

c
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?

Nothing has run

Read it first. Answer, and the same calls run here.

Everything you do here stays in this browser.Part of liter8.sh