If resolvconf returns an error condition then NM overwrites /run/resolvconf/resolv.conf
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
network-manager (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
(Arises from discussion here: https:/
The code in src/dns-
success = dispatch_resolvconf (domain, searches, nameservers, iface, error);
if (success == FALSE)
When resolvconf runs if may or may not return an error. For example, if some /etc/resolvconf
I mentioned this issue ten months ago in comment #30 on bug #324233.
https:/
Although the most serious of the several problems I discussed there have been fixed in Quantal, the problem remains that NetworkManager does not correctly handle a nonzero exit status returned by resolvconf.
The NM behavior in question dates from the time that resolvconf was an optional package in universe which returned nonzero status when /etc/resolv.conf failed to be a symbolic link. In Quantal resolvconf does not return nonzero status when /etc/resolv.conf fails to be a symbolic link. It returns nonzero only when there is some problem, e.g., non-writeable filesystem or whatever. NetworkManager should probably just report this failure and not immediately proceed to overwrite resolvconf's output.
Instead of the code quoted above, nm-dns-manager.c should implement the following logic.
IF resolvconf is installed as evidenced by the presence of executable file /sbin/resolvconf
THEN dispatch_resolvconf () # Send info to /sbin/resolvconf
ELSE update_resolv_conf () # Write info directly to (the target of) /etc/resolv.conf
Here is a tested patch which implements the requested change.