mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
16 lines
465 B
C
16 lines
465 B
C
/* Phase 19 (Track M.1) — class-method benign control for C. */
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
void UserService_run(const char *input, size_t len) {
|
|
(void)len;
|
|
/* Uses execve via fork; the shell never sees `input`. */
|
|
pid_t pid = fork();
|
|
if (pid == 0) {
|
|
char *argv[] = { (char*)"/bin/echo", (char*)(input ? input : ""), NULL };
|
|
execv("/bin/echo", argv);
|
|
_exit(127);
|
|
}
|
|
}
|