23 lines
400 B
C
23 lines
400 B
C
|
#define _POSIX_C_SOURCE 200112L
|
||
|
#include <sys/types.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <stdio.h>
|
||
|
#include <unistd.h>
|
||
|
|
||
|
|
||
|
int main(int argc, char* argv[]) {
|
||
|
char *args[argc+3];
|
||
|
args[0] = "fw-ectool";
|
||
|
args[1] = "led";
|
||
|
|
||
|
for (int i=0; i < argc; i++) {
|
||
|
args[i+2] = argv[i+1];
|
||
|
}
|
||
|
args[argc+2] = NULL;
|
||
|
|
||
|
seteuid(0);
|
||
|
setuid(0);
|
||
|
execvp("fw-ectool", args);
|
||
|
|
||
|
return 0;
|
||
|
}
|