Commit 0181bb7
networking: Workaround 2693 by ignoring resolv.conf entries starting with dot
Currently, systems without a FQDN can be mishandled by facter for certain `/etc/resolv.conf` content.
This was initially noticed when systemd-resolved was installed on a host without domain.
systemd-resolved stub resolver sets 'search .' as a search domain, which results in the
following hostname/domain/fqdn triplet: foo, ., foo...
See: https://github.com/systemd/systemd/blob/v255/src/resolve/resolv.conf#L19
This is wrong on multiple levels: first, facter does not seem to handle '.' (the root level)
well, and there have been PRs to remove the trailing dot in FQDN as far back as 2012 (PR 200),
leaving user with a convenient, but sometimes ambiguous string that is not fully qualified.
This commit implements a a middle ground solution to support top-level/domainless servers
without making a breaking change. Additionally, it adds more coverage for various search
cases.1 parent 92a6484 commit 0181bb7
File tree
3 files changed
+28
-4
lines changed- lib/facter/resolvers
- linux
- spec/facter/resolvers/linux
3 files changed
+28
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
82 | 106 | | |
83 | 107 | | |
84 | 108 | | |
| |||
0 commit comments