Bug 1374228
Summary: | glibc: Not possible for nss modules to say "not authoritative for this name" (new glibc API for NSS) | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Carlos O'Donell <codonell> |
Component: | glibc | Assignee: | glibc team <glibc-bugzilla> |
Status: | NEW --- | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | ashankar, codonell, dj, fweimer, jakub, jscotka, ksrot, law, lmiksik, lnykryn, mcermak, mfabian, pfrankli, sipoyare, spoyarek, zbyszek |
Target Milestone: | --- | Keywords: | FutureFeature, Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1319285 | Environment: | |
Last Closed: | 2018-11-30 17:46:35 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1238628 |
Comment 1
Carlos O'Donell
2016-09-08 09:55:17 UTC
I don't think glibc changes are required if nss_myhostname is moved to the front and nss_myhostname uses _gateway instead of gateway for the name it injects. _gateway is not in the IANA namespace for host names, so collisions with DNS are not possible, and no public names can be shadowed. This needs to be fixed in systemd. This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle. Changing version to '26'. I *really* let the ball drop here... Sorry for that. Anyway, I filed a pull-request in systemd to rename to _gateway. Hopefully it go in soon. But I don't think this actually solves the problem. The issue is that glibc does not provide support for nss modules which only are authoritative only for a subset of names, unless they are at the beginning of the "hosts:". Carlos explains it better than I could in https://www.sourceware.org/ml/libc-alpha/2016-05/msg00554.html, so let me just add an example: Let's say I want to use "files" as a backup, letting "sss" and "dns" take precedence. If I put "hosts: sss dns files", and the first two modules return NSS_STATUS_UNAVAIL/EAGAIN, the last one returns NSS_STATUS_NOTFOUND/ENOENT, and the user sees "No such host" even though "Temporary failure in name resolution" would be more appropriate (and would not poison nscd cache). A module like "files" knows that it is only authoritative for the few names which are listed in /etc/hosts, and cannot say anything useful about other names. So it should be able to make itself ignored, and let the return value from previous modules propagate. (So this is independent from any _gateway vs gateway considerations.) In https://bugzilla.redhat.com/show_bug.cgi?id=1238628#c13 Carlos proposes to add __nss_last_service_result(), to allow the modules to "propagate" the return value from preceding modules. I can also see an alternative solution: adding a new return code, that would tell the resolver function that this module cannot provide an authoritative answer. If any other module provides an authoritative answer, that answer it returned. In no other module provides an authoritative answer, EAI_NONAME is returned. This could be implemented as either a new NSS_STATUS code (NSS_STATUS_NONAUTHORITATIVE without *errnop and *h_errnop being set). The advantage of a new return code is that it puts the logic in glibc, and allows the modules to be kept simple. But either option would work from nss-myhostname's point of view, so I'd defer to glibc maintainers to decide what is easier/more backwards compatible/etc. This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle. Changing version to '27'. This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. FWIW, systemd in F28+ uses _gateway. But the more general issue still exists for nss-resolve and other modules. I'll retitle the bug accordingly. DJ published a blog post asking for developer feedback about improving nsswicth.conf, and it is directly related to this issue and how to handle the description of what a service is authoritative for: https://developers.redhat.com/blog/2018/11/26/etc-nsswitch-conf-non-complexity/ |