diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-03-04 12:41:56 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-03-04 12:41:56 +0000 |
commit | 3d80e66c8f8b734208d0eed314b406f309173286 (patch) | |
tree | 9cc4aa138e5f5c512cca1675c50265fbcd2ca5ef | |
parent | f6dce922295bf141608c2509502615a36df6c960 (diff) | |
download | rspamd-3d80e66c8f8b734208d0eed314b406f309173286.tar.gz rspamd-3d80e66c8f8b734208d0eed314b406f309173286.zip |
[Minor] Use `mkstemp` in one more place
-rw-r--r-- | src/libserver/re_cache.c | 4 |
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, |