mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
misc-progs: mpfirectrl: Use new run() function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -5,35 +5,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
#include "setuid.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int i;
|
||||
char command[1024];
|
||||
char add[STRING_SIZE];
|
||||
|
||||
if (!(initsetuid()))
|
||||
int main(int argc, char** argv) {
|
||||
if (!initsetuid())
|
||||
exit(1);
|
||||
|
||||
snprintf(command, STRING_SIZE, "/var/ipfire/mpfire/bin/mpfire.pl");
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strstr(argv[i], "&&")){
|
||||
fprintf (stderr, "Bad Argument!\n");
|
||||
exit (1);
|
||||
}
|
||||
else if (strstr(argv[i], "|")){
|
||||
fprintf (stderr, "Bad Argument!\n");
|
||||
exit (1);
|
||||
}
|
||||
sprintf(add, " %s", argv[i]);
|
||||
strcat(command, add);
|
||||
}
|
||||
return safe_system(command);
|
||||
return run("/var/ipfire/mpfire/bin/mpfire.pl", argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user