Always enter chap-secrets as a quoted field. In the event of special characters it creates and deletes the entry properly, in the event there are not special characters there is no change behavior.

Signed-off-by: Remi Bergsma <apache@remi.nl>

This closes #307
This commit is contained in:
David Bierce 2015-05-26 14:07:44 -05:00 committed by Daan Hoogland
parent 8625744142
commit 0c8c089177

View File

@ -170,11 +170,11 @@ add_l2tp_ipsec_user() {
local u=$1
local passwd=$2
uptodate=$(grep "^$u \* $passwd \*$" /etc/ppp/chap-secrets)
uptodate=$(grep "^$u \* \"$passwd\" \*$" /etc/ppp/chap-secrets)
if [ "$uptodate" == "" ]
then
remove_l2tp_ipsec_user $u
echo "$u * $passwd *" >> /etc/ppp/chap-secrets
echo "$u * \"$passwd\" *" >> /etc/ppp/chap-secrets
fi
}