cybersecurity · beginner · ~15 min · safe pentest lab
Encode the authorization precondition for any test.
Implement int authorized(int has_written_permission, int target_in_scope) returning 1 only if BOTH conditions hold (written permission AND the target is in scope).
int authorized(int has_written_permission, int target_in_scope) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.