1 |
torben |
113 |
#include <sstream> |
2 |
|
|
#include <iostream> |
3 |
|
|
#include <stdlib.h> |
4 |
|
|
|
5 |
|
|
using namespace std; |
6 |
|
|
|
7 |
|
|
int main(int argc, char *argv[] ) |
8 |
|
|
{ |
9 |
|
|
if (setuid(0) == -1) { |
10 |
|
|
cout << "could not setuid(0)" << endl; |
11 |
|
|
return 1; |
12 |
|
|
} |
13 |
|
|
if (seteuid(0) == -1) { |
14 |
|
|
cout << "could not seteuid(0)" << endl; |
15 |
|
|
return 1; |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
stringstream cmd; |
19 |
|
|
cmd << "/usr/sbin/openvpn "; |
20 |
|
|
for (int i=1; i<argc; i++) { |
21 |
|
|
cmd << argv[i] << " "; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
cout << cmd.str() << endl; |
25 |
|
|
|
26 |
|
|
int retval = system( cmd.str().c_str() ); |
27 |
|
|
|
28 |
|
|
return retval; |
29 |
|
|
} |