*screaming in the distance*
netbsd ignores the last line of /etc/hosts specifically
super cool and great; love it
*screaming in the distance*
netbsd ignores the last line of /etc/hosts specifically
super cool and great; love it
I found an existing netbsd bug report from 2014 about the bug parsing /etc/hosts: https://gnats.netbsd.org/48881
as I half expected, there's some asshole defending the buggy behavior:
That should not be "fixed" - unix lines are terminated by newlines, a "line" that has no terminating newline is not a line at all, and should be ignored in places like that
thankfully multiple other responders reply with some sense, but the bug remains unfixed
and the netbsd bug tracker doesn't actually explain how to reply to an existing bug, so I guess my first step should be to report that as an issue
@technomancy lolwut?
@jordan @EveHasWords yeah! any entries in the file will be used, unless they're on the last line
the last line is special for some reason, thrown away silently
I've actually run into this idiotic bug before! because crontabs are the same way (or they used to be at least); the last line is silently ignored
https://p.hagelb.org/intensifies.gif
this caused me several hours of production data loss in 2007! so I learned my lesson and added (setq require-final-newline t) to my emacs config, except it didn't get applied here because I was editing /etc/hosts as root and I hadn't set up my emacs config for root, just my main user
@technomancy @jordan @EveHasWords the og off by one error...
@technomancy Like ... what?! :blobcatflop:
@technomancy Does it ignore the final line, or require a newline to end every line? The Emacs setting you mentioned makes sure there's a trailing newline, so ex. catting the file in a shell doesn't intermix the file contents and the next shell prompt), but doesn't add a whole blank line, which would be \n\n.
I use the same setting, but just because I think it's polite.
@ieure yeah, if I had been editing this as my main user this would not have happened, but I was editing it as root where I didn't have my full emacs config there to save me
fucking garbage parser
@technomancy that's a bug and if anyone claims it's not, you should direct your internal screaming outward
@meena the most wild part is that if you ping the hostname, it will use the entire /etc/hosts file, but as far as I could tell every other program on the system uses the broken parser instead
@technomancy that's very weird/interesting