opnsense-src/tests/sys/kern/execve/execve_argc_helper.c
Kyle Evans d352fa2627 tests: add a basic test for argc == 0
The kernel should reject such exec()s now, early on. Instead of adding
the needed boilerplate to write a test in C, just add an -n argument for
"(n)ull argv" to the execve helper and exec this other helper that just
exits silently with argv count.

(cherry picked from commit e5b431fc0c)
2022-02-10 14:21:59 -06:00

15 lines
172 B
C

/*
* This file is in the public domain.
*/
#include <sys/cdefs.h>
#include <stdio.h>
int
main(int argc, char **argv __unused)
{
printf("%d\n", argc);
return (0);
}