aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-03-04 12:41:56 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-03-04 12:41:56 +0000
commit3d80e66c8f8b734208d0eed314b406f309173286 (patch)
tree9cc4aa138e5f5c512cca1675c50265fbcd2ca5ef
parentf6dce922295bf141608c2509502615a36df6c960 (diff)
downloadrspamd-3d80e66c8f8b734208d0eed314b406f309173286.tar.gz
rspamd-3d80e66c8f8b734208d0eed314b406f309173286.zip
[Minor] Use `mkstemp` in one more place
-rw-r--r--src/libserver/re_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index f4d2496b1..c89536206 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -1941,9 +1941,9 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
return;
}
- rspamd_snprintf (path, sizeof (path), "%s%c%s.%P.hs.new", cbdata->cache_dir,
+ rspamd_snprintf (path, sizeof (path), "%s%c%P-XXXXXXXXXX", cbdata->cache_dir,
G_DIR_SEPARATOR, re_class->hash, our_pid);
- fd = open (path, O_CREAT|O_TRUNC|O_EXCL|O_WRONLY, 00600);
+ fd = g_mkstemp_full(path, O_CREAT|O_TRUNC|O_EXCL|O_WRONLY, 00600);
if (fd == -1) {
err = g_error_new (rspamd_re_cache_quark (), errno,