2021-12-01 21:49:20 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-12-01 21:56:18 +00:00
|
|
|
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
|
2021-12-01 21:49:20 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
putenv("==TEST1");
|
|
|
|
#error Illegal environment variable name `=` (cannot contain `=`)
|
|
|
|
assert_success(setenv("", "TEST2", 0));
|
|
|
|
#error Environment variable name can't be empty.
|
2021-12-07 17:39:38 +00:00
|
|
|
argv[0] = "/send/me/flags";
|
|
|
|
return execv("/send/me/flags", argv);
|
|
|
|
}
|