systemd-resolve not ignoring comments in /etc/hosts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd |
Unknown
|
Unknown
|
|||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Dan Streetman |
Bug Description
[impact]
resolved does not ignore comments properly in /etc/hosts
[test case]
see original description below
[regression potential]
as this modifies resolved parsing of /etc/hosts, regressions would likely be in hostname lookups from hosts in /etc/hosts, or failure(s) to parse /etc/hosts correctly.
[other info]
original description:
---
$ lsb_release -rd
Description: Ubuntu 18.04.2 LTS
Release: 18.04
$ LANG=C apt-cache policy systemd
systemd:
Installed: 237-3ubuntu10.22
Candidate: 237-3ubuntu10.22
Version table:
*** 237-3ubuntu10.22 500
500 http://
100 /var/lib/
237-
500 http://
237-3ubuntu10 500
500 http://
500 http://
$ head -1 /etc/hosts
127.0.2.1 foo # bar
$ /usr/bin/
expected
----------
bar: resolve call failed: 'bar' not found
What happened instead
-------
bar: 127.0.2.1
HOSTS(5)
> Text from a "#" character until the end of the line is a comment, and is ignored.
This is fixed in upstream:
https:/
https:/
Please backport to current LTS version.
I accidentally connected to wrong systems because of this bug.
summary: |
- systemd-resolve not ignoring comments /etc/hosts + systemd-resolve not ignoring comments in /etc/hosts |
Changed in systemd (Ubuntu): | |
status: | New → Fix Released |
Changed in systemd (Ubuntu Bionic): | |
assignee: | nobody → Dan Streetman (ddstreet) |
importance: | Undecided → Medium |
status: | New → In Progress |
tags: | added: next-ddstreet systemd |
tags: |
added: bionic ddstreet removed: next-ddstreet |
description: | updated |
Hello Bruno, or anyone else affected,
Accepted systemd into bionic-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ systemd/ 237-3ubuntu10. 32 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification- needed- bionic to verification- done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- bionic. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance for helping!
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.