summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-12-19 08:53:32 +0000
committerErmal <eri@pfsense.org>2013-12-19 08:53:32 +0000
commit5e28dad4a34bc3b8da8134b23c85a8f922ebb401 (patch)
treea307678a095f3044ee0b7149e5bea3df9ea18515 /usr/local/sbin
parent00e8315b3d5db09870ca93f380f7ba577e90be88 (diff)
downloadpfsense-5e28dad4a34bc3b8da8134b23c85a8f922ebb401.zip
pfsense-5e28dad4a34bc3b8da8134b23c85a8f922ebb401.tar.gz
Migrate openvpn authentication to use fcgicli rather than forking a php process. Maybe should could consider to write a short library todo this
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/ovpn_auth_verify9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr/local/sbin/ovpn_auth_verify b/usr/local/sbin/ovpn_auth_verify
new file mode 100755
index 0000000..b109e7b
--- /dev/null
+++ b/usr/local/sbin/ovpn_auth_verify
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+password = $(echo '$password' | /usr/bin/sed 's/&/%26/g')
+RESULT = $(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&password=$password&cn=$common_name&strictcn=$2&authcfg=$1&modeid=$3")
+if [ "${RESULT} = "OK" ]; then
+ exit 0
+fi
+
+exit 1
OpenPOWER on IntegriCloud