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:
parent
8b37056294
commit
01d53a783c
1 changed files with 5 additions and 1 deletions
|
@ -22,7 +22,11 @@ class Whitelist
|
||||||
command, args = `which #{argv.shift}`.chomp, argv || []
|
command, args = `which #{argv.shift}`.chomp, argv || []
|
||||||
check!(command, args)
|
check!(command, args)
|
||||||
puts `#{command} #{args.join(" ")}`
|
puts `#{command} #{args.join(" ")}`
|
||||||
exit $?.to_i
|
|
||||||
|
exit_code = $?.to_i
|
||||||
|
exit_code = 1 if exit_code == 256
|
||||||
|
|
||||||
|
exit exit_code
|
||||||
rescue => e
|
rescue => e
|
||||||
STDERR.puts e.message
|
STDERR.puts e.message
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue