4 ms·
they absolutely can. Glibc's NSS (https://venam.nixers.net/blog/unix/2020/11/01/resolving-a-hostname.html https://venam.nixers.net/blog/unix/2020/11/01/resolvin
by jcelerier 5y ago
they absolutely can. Glibc's NSS (https://venam.nixers.net/blog/unix/2020/11/01/resolving-a-hostname.html https://venam.nixers.net/blog/unix/2020/11/01/resolving-a-ho...) won't work and that's a good thing because putting domain name resolution in libc was a braindead idead from the very beginning.
Domain name resolution behaviour should be program-controllable, not system-controllable (and thankfully we are starting to see a bit of sanity with web browsers which do bypass libc's domain name resolution) and especially not plug-in based which causes BS like things working differently whether avahi is installed or not.
Note however that this will only work for simple non-gui apps. GUI apps generally need to load opengl drivers (which are shared objects) - thus you'd need to choose at link time which GL driver you want to use... which is not a practical thing to do.
- rfoo 5y agoI'd argue that libgcc is safe to statically link though. The only downside of statically linking libgcc, as long as you keep your symbol visibility sane, i.e. not re-exporting everything which is unfortunately the default :(, is C++ exception across shared library boundary is not guaranteed to work. But if you are trying to make your library portable across different distro, having C++ thing in your external interface is never a good idea. Especially when you statically link libstdc++.
- twic 5y ago> Domain name resolution behaviour should be program-controllable, not system-controllable This is pure insanity, of course, but i'm sure i'd be entertained by you trying to justify it, if you're inclined.
- nybble41 5y agoNot the GP, but I would at least agree that the C library should not be handling domain name resolution or requiring any dynamically-loaded plugins. However, I am strongly opposed to having each application implement its own resolver and ignoring system settings. There should be a single system resolver where applications submit their requests. Something like the DBUS API presented by systemd-resolved, for example. Or the older NSCD protocol which permits out-of-process implementation of the NSS APIs, ostensibly for caching. systemd-resolved offers a nice compromise since, in addition to the rich DBUS API, it also acts as a recursive resolver on 127.0.0.53. So any applications that do implement their own resolution can be pointed there.
- adev_ 5y ago> Domain name resolution behaviour should be program-controllable, not system-controllable I disagree, strongly. The last thing I want is to get every of my applications Avahi / Zeroconf aware for DNS or SSSD aware in enterprise environment for user authentication. Or worst, having to recompile them for that. System controllable for aspect like user authentication or service discovery makes perfect sense. What does not makes sense is to have it implemented as a glibc plugin system. This triggers a lot of problems for system that do not have the glibc (Golang / musl / statically linked binaries ) Ideally, that should be done through an IPC mechanism through to a local daemon to benefit of the best of both worlds.