diff --git a/src/modules/channeldb.c b/src/modules/channeldb.c index 425180bdb..442ce00b4 100644 --- a/src/modules/channeldb.c +++ b/src/modules/channeldb.c @@ -216,7 +216,7 @@ int write_channeldb(void) #endif // Write to a tempfile first, then rename it if everything succeeded - snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database); + snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32()); fd = fopen(tmpfname, "wb"); if (!fd) { diff --git a/src/modules/reputation.c b/src/modules/reputation.c index 19418a75f..50c238f60 100644 --- a/src/modules/reputation.c +++ b/src/modules/reputation.c @@ -401,7 +401,7 @@ void save_db(void) #endif /* We write to a temporary file. Only to rename it later if everything was ok */ - snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database); + snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32()); fd = fopen(tmpfname, "w"); if (!fd) diff --git a/src/modules/tkldb.c b/src/modules/tkldb.c index 83a3e48eb..7cfdcd4f4 100644 --- a/src/modules/tkldb.c +++ b/src/modules/tkldb.c @@ -255,7 +255,7 @@ int write_tkldb(void) #endif // Write to a tempfile first, then rename it if everything succeeded - snprintf(tmpfname, sizeof(tmpfname), "%s.tmp", cfg.database); + snprintf(tmpfname, sizeof(tmpfname), "%s.%x.tmp", cfg.database, getrandom32()); fd = fopen(tmpfname, "wb"); if (!fd) {