sudoers: Treat 256 exit codes as errors

I ran into an issue locally where I didnt have lxc installed and some
commands were giving me back some false positives. Weird but this fixes
the problem I was facing.
This commit is contained in:
Fabio Rehm 2015-01-08 02:18:34 -02:00
parent 8b37056294
commit 01d53a783c

View file

@ -22,7 +22,11 @@ class Whitelist
command, args = `which #{argv.shift}`.chomp, argv || []
check!(command, args)
puts `#{command} #{args.join(" ")}`
exit $?.to_i
exit_code = $?.to_i
exit_code = 1 if exit_code == 256
exit exit_code
rescue => e
STDERR.puts e.message
exit 1