/[projects]/openvpn/openvpn-wrapper/openvpn-wrapper.cpp
ViewVC logotype

Annotation of /openvpn/openvpn-wrapper/openvpn-wrapper.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 113 - (hide annotations) (download)
Wed Oct 29 19:45:52 2008 UTC (15 years, 7 months ago) by torben
File size: 481 byte(s)
Added openvpn tools

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     }

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20