treewide: filter shell arguments through shellquote() where applicable
[project/luci.git] / modules / luci-base / luasrc / tools / status.lua
index 1c40387..06a9ad4 100644 (file)
@@ -187,7 +187,9 @@ function switch_status(devs)
        local switches = { }
        for dev in devs:gmatch("[^%s,]+") do
                local ports = { }
-               local swc = io.popen("swconfig dev '%s' show" % dev:gsub("'", ""), "r")
+               local swc = io.popen("swconfig dev %s show"
+                       % luci.util.shellquote(dev), "r")
+
                if swc then
                        local l
                        repeat