Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt resource fails corner cases with optional second column #1261

Closed
grimm26 opened this issue Oct 27, 2016 · 1 comment
Closed

apt resource fails corner cases with optional second column #1261

grimm26 opened this issue Oct 27, 2016 · 1 comment

Comments

@grimm26
Copy link
Contributor

grimm26 commented Oct 27, 2016

Description

If a deb source line is something like:
deb [arch=amd64] "http://apt.somewhere.com" trusty default
or
deb [trusted=yes] "https://packages.chef.io/stable-apt" trusty main
the read_debs method is thrown off and puts arch=amd64 or trusted=yes as the url, etc etc.

InSpec and Platform Version

inspec 1.2.0 on OSX El Capitan (running with kitchen-inspec on various debian platforms).

Replication Case

Have an entry in an apt source list like the one I describe above.

Possible Solutions

Have the parser handle something in the "second column" that is not a URL and drop it if so.

Stacktrace

Please include the stacktrace output or link to a gist of it, if there is one.

@chris-rock
Copy link
Contributor

@grimm26 Great finding. We need to adapt this regular expression then https://github.com/chef/inspec/blob/master/lib/resources/apt.rb#L92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants