Menu

#477 Ignore empty lines in accounts

None
closed
None
5
2026-05-26
2026-05-22
No

I was looking in my var/crossfire/accounts file and saw a lot of lines without an account name at the end of the file. It turned out the accounts reading didn't filter out the empty line at the end of the file, instead reusing the last line's value. So every time the server was restarted another invalid line was added to the accounts.

This fixes the direct issue and also makes sure it gets at least three fields when parsing a line. The old invalid entries are removed, logging when it happens.

I guess another question is if bufferreader_next_line really should return two empty strings for a file containing a single linefeed character. Personally I wouldn't expect it, the documentation isn't clear.

1 Attachments

Discussion

  • Kevin Zheng

    Kevin Zheng - 2026-05-26
    • status: open --> closed
    • assigned_to: Kevin Zheng
    • Group: -->
     
  • Kevin Zheng

    Kevin Zheng - 2026-05-26

    Thanks for the investigation and fix. I adjusted the incorrect indentation and updated a comment. Committed, with changes, in 2f3c503af.

     

Log in to post a comment.

Monday.com Logo