Skip to content

Commit

Permalink
Merge pull request #28 from millerthomasj/modprobeCheck
Browse files Browse the repository at this point in the history
Adjust modprobe check to remove false positives.
  • Loading branch information
rarenerd authored Apr 23, 2018
2 parents e9b4698 + de71381 commit 09aa3ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/linux_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def version
end

def command
modinfo_cmd = "/sbin/modprobe -n -v #{@module} | awk '{$1=$1;print}'"
# Lets just ensure the last line in the kernel module's configuration is 'install /bin/true'
# this is enough to be sure the module will not be loaded on next reboot or run of modprobe
modinfo_cmd = "/sbin/modprobe -n -v #{@module} | tail -n 1 | awk '{$1=$1;print}'"

cmd = inspec.command(modinfo_cmd)
cmd.exit_status.zero? ? cmd.stdout.delete("\n") : nil
Expand Down

0 comments on commit 09aa3ca

Please sign in to comment.