aboutsummaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-01-21 19:34:13 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-01-21 19:34:13 +0000
commit0aee9ca7e76887fb5752c15ef63bfb7a356df06e (patch)
treebd7db9d2c4e4ef4d2cedfdef961208ebd680c2f0 /options.c
parentRewrote extract_x509_field and modified COMMON_NAME_CHAR_CLASS (diff)
downloadopenvpn-0aee9ca7e76887fb5752c15ef63bfb7a356df06e.tar.xz
Allow OpenVPN to run completely unprivileged under Linux
by allowing openvpn --mktun to be used with --user and --group to set the UID/GID of the tun device node. Also added --iproute option to allow an alternative command to be executed in place of the default iproute2 command (Alon Bar-Lev). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2639 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'options.c')
-rw-r--r--options.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/options.c b/options.c
index 8c5a268..a990fcd 100644
--- a/options.c
+++ b/options.c
@@ -156,6 +156,9 @@ static const char usage_message[] =
"--lladdr hw : Set the link layer address of the tap device.\n"
"--topology t : Set --dev tun topology: 'net30', 'p2p', or 'subnet'.\n"
"--tun-ipv6 : Build tun link capable of forwarding IPv6 traffic.\n"
+#ifdef CONFIG_FEATURE_IPROUTE
+ "--iproute cmd : Use this command instead of default " IPROUTE_PATH ".\n"
+#endif
"--ifconfig l rn : TUN: configure device to use IP address l as a local\n"
" endpoint and rn as a remote endpoint. l & rn should be\n"
" swapped on the other peer. l & rn must be private\n"
@@ -591,6 +594,8 @@ static const char usage_message[] =
"--rmtun : Remove a persistent tunnel.\n"
"--dev tunX|tapX : tun/tap device\n"
"--dev-type dt : Device type. See tunnel options above for details.\n"
+ "--user user : User to set privilege to.\n"
+ "--group group : Group to set privilege to.\n"
#endif
#ifdef ENABLE_PKCS11
"\n"
@@ -3225,6 +3230,13 @@ add_option (struct options *options,
VERIFY_PERMISSION (OPT_P_UP);
options->tun_ipv6 = true;
}
+#ifdef CONFIG_FEATURE_IPROUTE
+ else if (streq (p[0], "iproute") && p[1])
+ {
+ VERIFY_PERMISSION (OPT_P_UP);
+ iproute_path = p[1];
+ }
+#endif
else if (streq (p[0], "ifconfig") && p[1] && p[2])
{
VERIFY_PERMISSION (OPT_P_UP);