Skip to content

Commit

Permalink
Ensure we also recalculate te checksum of the config file when in rea…
Browse files Browse the repository at this point in the history
…d-only mode

Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Jun 6, 2024
1 parent 85fdaff commit f9eea51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/config/toml_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ bool writeFTLtoml(const bool verbose)
if(config.misc.readOnly.v.b)
{
log_debug(DEBUG_CONFIG, "Config file is read-only, not writing");

// We need to (re-)calculate the checksum here as it'd otherwise
// be outdated (in non-read-only mode, it's calculated at the
// end of this function)
if(!sha256sum(GLOBALTOMLPATH, last_checksum))
log_err("Unable to create checksum of %s", GLOBALTOMLPATH);
return true;
}

Expand Down

0 comments on commit f9eea51

Please sign in to comment.