cybersecurity · intermediate · ~15 min
Recognise the atomic-create defence.
Implement int uses_excl(const char *flags) returning 1 if the open-flags string contains "O_EXCL" (atomic create that fails if the file exists), else 0.
#include <string.h>
int uses_excl(const char *flags) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.