3 ms·
A proper fix is not to shell out to a command at all; use getpwnam(3) or similar.
by valleyer 3mo ago
A proper fix is not to shell out to a command at all; use getpwnam(3) or similar.
- cyphar 3mo agoThey actually do use "os/user".Lookup() as a fallback if fetching via getent(1) fails, so they might be using NSS modules to dynamically define users and then not linking their binaries with glibc (musl and the opt-in pure-Go implementation of "os/user".Lookup() do not support NSS). Still, requesting the information from systemd-userdb would be a better way of doing this if it's really necessary. EDIT: Yeah, some older comments confirm that was their reasoning. https://github.com/tailscale/tailscale/commit/1fc1077052dfa77e0efc7b5b308ead5e5e3e1965 https://github.com/tailscale/tailscale/commit/1fc1077052dfa7...