cybersecurity · intermediate · ~15 min · safe pentest lab

Is the file world-writable?

Detect a dangerous permission.

Challenge

Implement int world_writable(int mode) returning 1 if the other-write bit (octal 0002) is set, else 0.

Starter code

int world_writable(int mode) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.