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

No way to ignore invalid directives #17

Open
philgebhardt opened this issue Nov 21, 2019 · 1 comment
Open

No way to ignore invalid directives #17

philgebhardt opened this issue Nov 21, 2019 · 1 comment

Comments

@philgebhardt
Copy link

Background
It's not ideal, but sometimes linux systems have invalid directives in their resolv.conf. Often (perhaps always) this is due to typos. Utilities like curl, dig, host, are resilient to these invalid directives in that if they fail to parse them, they are ignored, allowing for effective resolution in spite of them.

Problem
This crate is used by common utilities for making http requests. As such, when an invalid directive is found in resolv.conf, all http requests stop working.

Reproduce
Withthe contents of a resolv.conf configuration

nope
nameserver 192.168.65.1

try to execute grammar::parse with it's contents, this yields an Err(InvalidDirective(line))

Solution
Provide a way to ignore these invalid directives, perhaps via a feature flag like #[cfg(feature="no-strict")]

philgebhardt added a commit to gremlin/resolv-conf that referenced this issue Nov 21, 2019
Fix for hickory-dns#17

It's sometimes desireable to ignore invalid directives so that the
supplied configuration can still be used. This change adds a feature
flag `no-strict` that when enabled, does not return an
`Err(InvalidDirective(_))` when a directive isn't valid. Instead, it
skips over it, allowing the configuration to be used.
@philgebhardt
Copy link
Author

I've supplied a solution for this: #18

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

1 participant