nuageinit: fix shell injection in power_state_change delay and add test
This commit is contained in:
@@ -748,7 +748,7 @@ local function power_state_change(obj)
|
||||
end
|
||||
|
||||
-- Build shutdown command
|
||||
local cmd = "shutdown -" .. flag .. " " .. delay
|
||||
local cmd = "shutdown -" .. flag .. " " .. nuage.shell_escape(delay)
|
||||
if message then
|
||||
cmd = cmd .. " " .. nuage.shell_escape(message)
|
||||
end
|
||||
|
||||
@@ -1332,7 +1332,7 @@ power_state:
|
||||
timeout: 30
|
||||
condition: true
|
||||
EOF
|
||||
atf_check -o inline:"shutdown -r +5 'Rebooting after configuration is complete'\n" \
|
||||
atf_check -o inline:"shutdown -r '+5' 'Rebooting after configuration is complete'\n" \
|
||||
/usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user