From 01d53a783cfd263a733a02731fef2c455ce4084f Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Thu, 8 Jan 2015 02:18:34 -0200 Subject: [PATCH] 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. --- templates/sudoers.rb.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/sudoers.rb.erb b/templates/sudoers.rb.erb index 55cf5ca..b446531 100644 --- a/templates/sudoers.rb.erb +++ b/templates/sudoers.rb.erb @@ -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