cybersecurity · intermediate · ~15 min · safe pentest lab
Test a permission bit with a mask.
The setuid bit is octal 04000 in a Unix mode. Implement int is_setuid(int mode) returning 1 if that bit is set, else 0.
int is_setuid(int mode) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.