campaignd: Fix bug causing new uploads to replace server.cfg on disk

This was only temporary and would be later reverted by the periodic
server.cfg commit, but it's still a grave thing and resulted in add-on
packs not actually being written to the correct files, resulting in
missing or outdated contents for uploads performed since commit
ea4f9a4ba2 was pushed to mainline 1.12.

The cause is a trivial copy-paste error that shouldn't have happened.
This commit is contained in:
Ignacio R. Morelle 2017-09-18 19:39:13 -03:00
parent f4f9167644
commit 01062617a1

View file

@ -808,7 +808,7 @@ void server::handle_upload(const server::request& req)
add_license(data);
{
filesystem::atomic_commit campaign_file(cfg_file_);
filesystem::atomic_commit campaign_file(filename);
config_writer writer(*campaign_file.ostream(), true, compress_level_);
writer.write(data);
campaign_file.commit();