mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
bugfix: inspec archive for tgz files on windows (#1907)
On Windows, `inspec archive` would sometimes produce incorrect archive files. These would look fine, as tgz files, but would not execute correctly. This would lead to bewildering error messages like this one: ``` Unable to parse inspec.yml: line 1, control characters are not allowed ``` Fix it by treating the files as binary before writing them to get around any encoding issues, since the stream handler is a raw io object anyway. Closely related to https://github.com/chef/inspec/pull/1906 Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
ffdce8ab5f
commit
3c1df959c5
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ module Inspec::Archive
|
|||
tar.mkdir(input_filename, stat.mode)
|
||||
else
|
||||
tar.add_file_simple(input_filename, stat.mode, stat.size) do |io|
|
||||
io.write(File.read(path))
|
||||
io.write(File.binread(path))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue