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 <[email protected]> This closes #307 Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0c8c0891 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0c8c0891 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0c8c0891 Branch: refs/heads/master Commit: 0c8c0891775e77da2e98ab4392b9e126811c53ab Parents: 8625744 Author: David Bierce <[email protected]> Authored: Tue May 26 14:07:44 2015 -0500 Committer: Daan Hoogland <[email protected]> Committed: Thu May 28 15:06:56 2015 +0200 ---------------------------------------------------------------------- systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c8c0891/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh ---------------------------------------------------------------------- diff --git a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh index 7fb44e6..83cf4de 100755 --- a/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh +++ b/systemvm/patches/debian/vpn/opt/cloud/bin/vpn_l2tp.sh @@ -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 }
