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
Malformed label: --
when parsing resolv.conf
#1985
Comments
Oh and as a workaround, one can just edit |
Took a look at my laptop running PopOS instead of Fedora, but still using systemd, and sure enough the resolv.conf just has |
Still, the double dashes are valid config options for /etc/resolv.conf . This bug also impacts the MongoDB Rust driver on Linux. |
Do you have a reference for it in a spec? I tried and failed to find what - - even means. |
… On Sun, 23 Jul 2023, 12:07 Jake Shadle, ***@***.***> wrote:
Do you have a reference for it in a spec? I tried and failed to find what
- - even means.
—
Reply to this email directly, view it on GitHub
<#1985 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4J3UW6YBUNPJBSP2JRUBDXRTZWLANCNFSM6AAAAAA2AEI7DQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have no idea what I think one option would be for us to change the resolve.conf parsing to be lossy and ignore illegal input? My guess is this is some awkward default based on other configurations in the system, like no hostname? |
It would mean nothing. This is because of faulty hostnames for example or faulty network managers adding things that make no sense. If only double dashes are present, double dashes in the search can be ignored. |
@CodeDead how do you conclude that from those docs? I didn't see anything relevant in that man page? Maybe we should look at the code (presumably in libc implementations) that parses |
Because If I, for example do a
You could either panic and fail, which is now the case for both dig and trust-dns repo or ignore the search domain because it is invalid. Whether this is a systemd bug is hard to tell, because it might be intended behavior to ignore double dashes when using systemd because systems with systemd running still work when search is set to the double dashes. It is still valid to place double dashes in the search field because there are no standards or restrictions listed in the manual that prevent you from doing that but it will not form a valid domain according to the domain standards. The question is how to handle that; to fail or to ignore the dashes. Journaling systemd-resolved (with google dns) and no domain name set in the system will give me something like this:
Which stems from a 'faulty' connection profile. The best (read: fastest) way to solve this problem for systemd, is to re-create the connection profile (delete the connection profile and create a new one) in systemd devices if the double dashes are present (probably stemming from faulty router / DHCP setup) in the hopes that the search field will then be retrieved and set correctly. Whether or not to fail for invalid domains is another matter (because most of systemd will absolutely work and just ignore the problem) whereas some tools (like Ignoring the double dashes might be the way to go for systemd because it is not a valid domain and perhaps trust-dns should ignore invalid search domains too, but that is a decision to make and take for the maintainers. Either way, |
Describe the bug
My local
/etc/resolv.conf
triggers this error, due to the presence of the linesearch -- lan
.To Reproduce
Attemp to parse this file:
Expected behavior
I would expect this file to be parsed, if it is actually valid, which I'm assuming it is since my system works, but I honestly have no clue if trust-dns or systemd is in the wrong here since my efforts to figure out what the valid form(s) of the search entry in the resolv.conf is/are was met with defeat.
After playing around with my
/etc/systemd/resolved.conf
I'm becoming more convinced that this is a systemd bug, as doing any changes to theDomains=
field (which controls the search field in resolv.conf) will always result in--
being appended or prepended to whatever entries I make.System:
Version:
Crate: proto
Version: 0.22.0
Additional context
I didn't configure this myself and since I've never had this issue in the past, I'm assuming a recent system update added/changed the
search -- lan
entry in the resolv.conf, so I'm assuming other people will start hitting this issue if this is a general update to Fedora 38/systemd-resolv, but that's just a guess.That being said, I'm not certain this is a bug in trust-dns, but more likely systemd, but figured I would open this issue just in case that is not the case, or at least have a record of this issue if others hit it, as I was unable to find much info elsewhere about this.
The text was updated successfully, but these errors were encountered: