2021-10-04 22:35:09 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
2021-12-01 22:49:20 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2021-12-01 22:56:18 +01:00
|
|
|
#define assert_success(e) do { if ((e) < 0) { perror(#e); abort(); } } while (0)
|
2021-10-04 22:35:09 +02:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
putenv("PART1=HELLO");
|
2021-12-01 22:49:20 +01:00
|
|
|
assert_success(setenv("PART2", "WORLD", 0));
|
|
|
|
assert_success(unsetenv("SOME_OTHER_VARIABLE"));
|
2021-10-04 22:35:09 +02:00
|
|
|
putenv("PART3=\"!!\n\"");
|
2021-12-07 18:39:38 +01:00
|
|
|
argv[0] = "/send/me/flags";
|
|
|
|
return execv("/send/me/flags", argv);
|
|
|
|
}
|