summaryrefslogtreecommitdiffstats
path: root/zebra-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-21 22:04:37 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-21 22:04:37 +0000
commite1a5549dad48fab1823dc02c9235880c153d36f5 (patch)
tree2f0a51bce7a93193fb9e02c6ff07de8d37a79641 /zebra-model.lua
parent1ec8b95259b01c7657e740f070813c77bcdb7bd1 (diff)
downloadacf-quagga-e1a5549dad48fab1823dc02c9235880c153d36f5.tar.bz2
acf-quagga-e1a5549dad48fab1823dc02c9235880c153d36f5.tar.xz
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
Diffstat (limited to 'zebra-model.lua')
-rw-r--r--zebra-model.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/zebra-model.lua b/zebra-model.lua
index 170d545..de0edd4 100644
--- a/zebra-model.lua
+++ b/zebra-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 telnetshowip()
local output = {}
local configfile = parseconfigfile() or {}
- local cmd = path .. "echo -e '" .. (configfile.password or "") .. "\nshow ip route\nquit\n' | nc localhost zebra 2>/dev/null"
+ local cmd = path .. "echo -e '" .. format.escapespecialcharacters(configfile.password) .. "\nshow ip route\nquit\n' | nc localhost zebra 2>/dev/null"
local f = io.popen( cmd )
local result = f:read("*a") or ""
local validoutput