summaryrefslogtreecommitdiffstats
path: root/bgp-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'bgp-model.lua')
-rw-r--r--bgp-model.lua3
1 files changed, 2 insertions, 1 deletions
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()