cybersecurity · intermediate · ~15 min · safe pentest lab
Read POSIX permission bits via stat.
Implement int is_secret_file_safe(const char *path) returning:
path is mode 600 (read+write owner only),Detects accidentally world-readable secret files — a common cause of credential leaks in misconfigured deployments.
#include <sys/stat.h>
#include <stdio.h>
int is_secret_file_safe(const char *path) {
/* TODO */
return -1;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.