Post #1945152
2026-01-08 00:40 UTC
Replies (19)
-
@oneiros@ruhr.social 2026-01-08 00:45
@nblr@chaos.social Which cron? Also, POSIX requires a terminating newline
-
@rose@snac.pinkro.se 2026-01-08 00:46
@nblr@chaos.social so many programs like to break from a missing newline it's just become a habit for me to always have one blank line in every config file never understood why though, must be about how the file is read
-
@satmd@brettvormkopf.de 2026-01-08 00:58
@nblr@chaos.social same with nrpe configs btw
-
@daarin@mastodon.social 2026-01-08 00:59
@nblr@chaos.social In fact it is an error, that IIRC happens with a few of the older Linux config files. Not that I remember which ones that were, but I normally end every one with a newline.
-
@gsuberland@chaos.social 2026-01-08 01:10
@nblr@chaos.social I can forgive the newline being required, but the failure being silent is unforgiveable.
-
@groxx@hachyderm.io 2026-01-08 01:20
@nblr@chaos.social that feels less like "refuse" and more like "ignore"
-
@timjclevenger@infosec.exchange 2026-01-08 01:59
@nblr@chaos.social sudoers has a similar bug. Can't remember what it is exactly but it's just as dumb and nobody could log in because of it.
-
@jhwgh1968@chaos.social 2026-01-08 02:21
@nblr@chaos.social found that one Yeah
-
@johntimaeus@infosec.exchange 2026-01-08 03:01
@nblr@chaos.social crontab -e Checks for breakage before writing.
-
@max_schmied@mastodon.berlin 2026-01-08 05:10
@nblr@chaos.social You Had me at "it does so silently" 🫣 thx for this Info 👍
-
@clarfonthey@toot.cat 2026-01-08 07:14
@nblr@chaos.social technically doing nothing is doing one thing, and you would also be doing nothing well
-
@duke_of_germany@mastodon.gamedev.place 2026-01-08 07:23
Things like this made me paranoid a long time ago. Since then I add an extra line to *every* file I create, no matter what it is. 😅 @nblr@chaos.social
-
@jjacobsson@mastodon.gamedev.place 2026-01-08 07:36
@nblr@chaos.social ”we can detect that it isn’t there, but we refuse to fucking add it for you.”
-
@david_chisnall@infosec.exchange 2026-01-08 08:21
@nblr@chaos.social The original yacc had a limitation that it couldn’t complete a parse if the last token was a valid token and required a white space character afterwards. This ended up being incorporated in specifications in a bunch of places. It’s undefined behaviour in C to not end a file with a new line because early C compilers couldn’t handle it. I presume the crontab rule in POSIX is the same. Modern yacc implementations don’t have this limitation and so there’s little reason not to accept things with missing terminating newlines (in both cases, the program is free to accept non-conforming inputs). At the very least, there’s no excuse for not raising an error.
-
@feld@friedcheese.us 2026-01-08 19:51
@nblr@chaos.social I had this same problem within the last year, brought it up to FreeBSD devs, and they were like "huh, yeah, that's a thing" lol I guess nobody wants to fix this
-
@nyquildotorg@gts.nyquil.org 2026-01-08 20:25
@nblr@chaos.social well that certainly solves a few mysteries I've encountered over the years 🤦
-
@robin@daugherty.nl 2026-01-09 07:36
@nblr@chaos.social @0xabad1dea@infosec.exchange POSIX standard says that a Text File is made up of 0 or more Lines, and a Line is a sequence of zero or more characters terminated with a newline character. https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html So this is true of many tools, and it’s why many tools such as GitHub warn you when a file is missing its last newline. And yet I still find projects and even whole engineering organizations that standardize on “no terminating newline”.
-
@henryk@chaos.social 2026-01-09 11:24
@nblr@chaos.social Files: Must have an additional separator (newline) at the end or will be refused. JSON arrays: Must not have an additional separator (comma) at the end or they will be refused.
-
@ForiamCJ@infosec.exchange 2026-01-10 08:19
@nblr@chaos.social Ugh.. early versions of Windows use to do this garbage if you imported .reg files that didn't have at least one newline after the last line of text too