summaryrefslogtreecommitdiff
path: root/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-08-18 18:22:54 +0200
committerParménides GV <parmegv@sdf.org>2014-08-18 18:22:54 +0200
commit31f6eab32a26a658cbfb2db0d457cc1f87d23f0f (patch)
tree75f372ff22a94102ef2f9bd163febf54ac45e9d6 /ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
parent6057466bc8b4475bf4564b9143c60753c90f9aaa (diff)
parent7d8cde4f7ae769a3b6a25483d8bd0bb6c1551af9 (diff)
Merge branch 'develop'
Diffstat (limited to 'ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl')
-rwxr-xr-xics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
new file mode 100755
index 00000000..6d708f82
--- /dev/null
+++ b/ics-openvpn-stripped/main/openvpn/sample/sample-scripts/ucn.pl
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -t
+
+# OpenVPN --auth-user-pass-verify script.
+# Only authenticate if username equals common_name.
+# In OpenVPN config file:
+# auth-user-pass-verify ./ucn.pl via-env
+
+$username = $ENV{'username'};
+$common_name = $ENV{'common_name'};
+
+exit !(length($username) > 0 && length($common_name) > 0 && $username eq $common_name);