nuageinit: fix shell injection in power_state_change delay and add test

This commit is contained in:
Baptiste Daroussin committed 2026-06-09 18:04:25 +02:00
1 parent 0211c8722f
commit 09d068e527
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
}