The Story of a Rust Bug
thesquareplanet.com
thesquareplanet.com
[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=984 ; from the Reddit thread kibwen linked to[2]
It seems like it would be better to have some kind of dns proxy daemon running that libc talks to that can pick up these changes immediately but I guess that is out of the scope of libc :)
I wonder if modularizing libc is at all feasible. Linux lets you use multiple libcs, so (at the expense of a more complex build) it should be possible there, at least?
Linux lets you use no libc if you want, too. I suspect the reason this kind of change doesn't happen is, if you want to make breaking changes like splitting libc, then you might as well fix all the crap APIs, at which point you might as well fix the crap language choice (and use say Rust instead) at which point libc is a low level abstraction that you hardly care about.
(I've also imagined a similar set up w/ ping, i.e., a pingd, so that local monitoring stuff could ping things without needing to parse ping output or require the ability to open raw sockets.)
I agree that ping should probably not use setuid. Setuid seems like a hack to me though I am sure it is a necessary one.
UNIX-derived systems tend to have a habit of requiring root for anything that even remotely might want to be restricted: the example that comes to mind is reserving ports 0-1024 for root, thus requiring that most daemons to start as root instead of an unprivileged user.
I'm not sure if that means it means that musl doesn't provide the workaround or if musl doesn't have the bug at all.