28 lines
518 B
C
28 lines
518 B
C
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <unistd.h>
|
||
|
#include <errno.h>
|
||
|
#define _MUSUID_C
|
||
|
#include "config.h"
|
||
|
|
||
|
const char *progs[] = {"su", "ping"};
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
|
if (argc == 1) {
|
||
|
fputs("musuid: missing operand\n", stderr);
|
||
|
return 1;
|
||
|
}
|
||
|
|
||
|
argc--;
|
||
|
argv++;
|
||
|
|
||
|
/* RUN */
|
||
|
for (size_t i = 0; i < sizeof(progs) / sizeof(char *); i++)
|
||
|
if (!strcmp(argv[0], progs[i]))
|
||
|
execv(MUTILS_PATH, argv);
|
||
|
|
||
|
fprintf(stderr, "musuid: unknown command: %s\n", argv[0]);
|
||
|
return 1;
|
||
|
}
|