Project

General

Profile

« Previous | Next » 

Revision 1bfdb794

Added by Jim Pingle over 4 years ago

Change OpenVPN auth to php-cgi for the time being. Fixes #4521

View differences:

src/usr/local/sbin/ovpn_auth_verify
24 24
	for check_depth in $(/usr/bin/seq ${3} -1 0)
25 25
	do
26 26
		eval serial="\$tls_serial_${check_depth}"
27
		RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
27
		RESULT=$(/usr/local/bin/php-cgi -q /etc/inc/openvpn.tls-verify.php "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
28 28
	done
29 29
else
30 30
	# Single quoting $password breaks getting the value from the variable.
31 31
	# Base64 and urlEncode usernames and passwords
32 32
	password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
33 33
	username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
34
	RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
34
	RESULT=$(/usr/local/bin/php-cgi -q /etc/inc/openvpn.auth-user.php "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
35 35
fi
36 36

  
37 37
if [ "${RESULT}" = "OK" ]; then
src/usr/local/sbin/ovpn_auth_verify_async
35 35
# nas_port          - $5
36 36

  
37 37
# ---------- Command Definitions
38
fcgicli="/usr/local/sbin/fcgicli"
38
phpcgi="/usr/local/bin/php-cgi"
39 39
openssl="/usr/bin/openssl"
40 40
sed="/usr/bin/sed"
41 41
auth_user_php="/etc/inc/openvpn.auth-user.php"
......
66 66
auth_server_2="modeid=${modeid}&nas_port=${nas_port}"
67 67
auth_args="${auth_credentials}&${auth_server_1}&${auth_server_2}"
68 68

  
69
result=$("${fcgicli}" -f "${auth_user_php}" -d "${auth_args}")
69
result=$("${phpcgi}" -f "${auth_user_php}" "${auth_args}")
70 70

  
71 71
# ---------- Write the Result
72 72

  

Also available in: Unified diff