Skip to content

Commit

Permalink
Merge pull request #107 from voxpupuli/fix-null-value
Browse files Browse the repository at this point in the history
Strip null bytes in kmods fact
  • Loading branch information
kenyon authored Oct 2, 2023
2 parents e44dbc9 + 3086622 commit ca6dd2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/facter/kmod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
next unless File.readable?("/sys/module/#{directory}/parameters/#{param}")

begin
kmod[directory]['parameters'][param] = File.read("/sys/module/#{directory}/parameters/#{param}").chomp
kmod[directory]['parameters'][param] = File.read("/sys/module/#{directory}/parameters/#{param}").chomp.delete("\u0000")
rescue StandardError
# some kernel parameters are write only
# even though they have the read bit set
Expand Down

0 comments on commit ca6dd2f

Please sign in to comment.