You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xuname:
Void 4.18.1-arch1-1-ARCH x86_64-musl GenuineIntel notuptodate r
(I'm just using the voidlinux/voidlinux-musl docker image for testing)
package:
musl
Expected behavior
getent -s dns hosts eff.org
198.100.177.181 eff.org
getent -s files hosts localhost
127.0.0.1 localhost.localdomain localhost
Actual behavior
getent -s dns hosts eff.org
getent: Unknown database `-s': No error information
Usage: getent database [key ...]
database may be one of:
ethers group hosts networks passwd protocols services
shells
getent -s files hosts localhost
getent: Unknown database `-s': No error information
Usage: getent database [key ...]
database may be one of:
ethers group hosts networks passwd protocols services
shells
Steps to reproduce the behavior
See: above
Further explanation
Since there doesn't seem to be an upstream repo for musl getent, I opened an issue against Alpine and this one for Void. From the Alpine issue:
glibc getent supports a -s switch for choosing services - this feature is missing in the getent implementation from musl-utils.
I use getent to resolve host names in a script and use -s to query either the /etc/hosts file (getent -s files hosts <hosts>), or actual DNS (getent -s dns hosts <hosts>).
The former could be worked around by parsing the hosts file (at the cost of additional code), but there's no way to skip the hosts file lookup to cover the latter case.
Of course, I could use a tool like host/dig, but I intentionally chose getent, to avoid the additional dependency on bind-tools.
musl does not provide a way to select the sources of a host and I don't think it's feasable to implement a parser /etc/resolv.conf just to have such a switch.
System
Void 4.18.1-arch1-1-ARCH x86_64-musl GenuineIntel notuptodate r
(I'm just using the voidlinux/voidlinux-musl docker image for testing)
musl
Expected behavior
getent -s dns hosts eff.org
getent -s files hosts localhost
Actual behavior
getent -s dns hosts eff.org
getent -s files hosts localhost
Steps to reproduce the behavior
See: above
Further explanation
Since there doesn't seem to be an upstream repo for musl getent, I opened an issue against Alpine and this one for Void. From the Alpine issue:
Please see the Alpine issue for further discussion:
https://bugs.alpinelinux.org/issues/9278
PS. I believe this is even more relevant for Void, since it's available both in musl- and glibc-flavor.
The text was updated successfully, but these errors were encountered: