Repository navigation
resolved domain routing tweaks and /etc/resolv.conf handling improvements - #7588
Merged
Merged
Conversation
The user might replace a foreign /etc/resolv.conf with a symlink to one of ours between the time we did stat() and open the file. Hence, let's check the fstat() data right after opening the file, a second time.
Let's make sure we use the mtime of the current fstat() data, rather than the mtime of the old stat(), fixing a theoretical race.
Let's also check for the static resolv.conf, so that we filter all three of our own files out.
…les we provide Let's use the same wording and same contents in all three versions.
This makes sure that a classic DNS scope that has no DNS servers assigned is never considered for routing requests to even if it has matching search/routing domains associated. This is inspired by systemd#7544, where lookup requests are refused since a scope with no DNS server is configured. This change does not deliver what the reporter intended, but is generally useful in general, as it makes us mor robust to misconfiguration.
keszybz
approved these changes
Dec 8, 2017
keszybz
left a comment
Member
There was a problem hiding this comment.
I had one comment, but you replaced that part of the code in a later patch anyway, so it's moot. LGTM, but I'll leave it open for other people to have a look.
| if (stat(PRIVATE_UPLINK_RESOLV_CONF, &own1) >= 0 && | ||
| st->st_dev == own1.st_dev && | ||
| st->st_ino == own1.st_ino) | ||
| return true; |
Member
There was a problem hiding this comment.
Any particular reason to use two struct stats?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mostly inspired by #7544, though not delivering what the reporter probably is looking for.