pass all tests in a kata with execlp
wizardling1 opened this issue · comments
Describe the bug
I'm not sure if this has already been found or if anyone cares, but I've found a simple way to pass all tests in any exercise if it's a C program. You simply include <unistd.h> and run execlp("ls", "", (char*) 0), then the tester will think the program passed all tests.
To Reproduce
Here is an example of code that can pass the "Regular Expression for Binary Numbers Divisible by n" 1 kyu kata.
#include <unistd.h>
char regex_divisible_by (int n) {
execlp("ls", "", (char)0);
return 0;
}
Expected behavior
The program passes all tests.
Browser
- OS: macOS
- Browser: Chrome
Hello,
Yes, there are numerous ways to bypass the tests like this. It's actually strongly tide to how codewars works and to the general setup needed to provide the intended user-experience. So, it's a "won't fix" thing.
Please note that using this kind of things is considered cheating and penalties may be applied to users utilizing this.
There are a lot of issues talking already about this. See for example here (comment).
Cheers