From e1a5549dad48fab1823dc02c9235880c153d36f5 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 21 Jan 2009 22:04:37 +0000 Subject: Added escapespecialcharacters to format.lua to escape shell special characters. Reviewed all calls to io.popen and os.execute to escape special characters. Fixed file uploads in openssl and ipsectools with viewfunctions.lua. Tried to fix openssl renew when subject contains special characters, but not done yet. git-svn-id: svn://svn.alpinelinux.org/acf/quagga/trunk@1687 ab2d0c66-481e-0410-8bed-d214d4d58bed --- bgp-model.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bgp-model.lua') diff --git a/bgp-model.lua b/bgp-model.lua index f54c12a..db6fb2c 100644 --- a/bgp-model.lua +++ b/bgp-model.lua @@ -2,6 +2,7 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") +require("format") -- Set variables local path="PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " @@ -35,7 +36,7 @@ end local function telnetshowipbgp() local output = {} local configfile = parseconfigfile() or {} - local cmd = path .. "echo -e '" .. (configfile.password or "") .. "\nshow ip bgp\nquit\n' | nc localhost bgpd 2>/dev/null" + local cmd = path .. "echo -e '" .. format.escapespecialcharacters(configfile.password) .. "\nshow ip bgp\nquit\n' | nc localhost bgpd 2>/dev/null" local f = io.popen( cmd ) local result = f:read("*a") or "" f:close() -- cgit v1.2.3