nuageinit: fix shell injection in power_state_change delay and add test

This commit is contained in:
Baptiste Daroussin
2026-06-09 16:19:56 +02:00
parent 0211c8722f
commit 09d068e527
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -748,7 +748,7 @@ local function power_state_change(obj)
end end
-- Build shutdown command -- Build shutdown command
local cmd = "shutdown -" .. flag .. " " .. delay local cmd = "shutdown -" .. flag .. " " .. nuage.shell_escape(delay)
if message then if message then
cmd = cmd .. " " .. nuage.shell_escape(message) cmd = cmd .. " " .. nuage.shell_escape(message)
end end
+1 -1
View File
@@ -1332,7 +1332,7 @@ power_state:
timeout: 30 timeout: 30
condition: true condition: true
EOF 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 /usr/libexec/nuageinit "${PWD}"/media/nuageinit postnet
true true
} }