From f330d8ee264a25548b2527238c495ea4dbf8d434 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 15 Jun 2018 11:40:53 +0200 Subject: [PATCH] coverity: #1425792 Insecure temporary file Signed-off-by: Christian Brauner --- src/tests/parse_config_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index b61947a28..83d88fa13 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -32,6 +32,7 @@ #include "confile_utils.h" #include "lxc/state.h" #include "lxctest.h" +#include "utils.h" static int set_get_compare_clear_save_load(struct lxc_container *c, const char *key, const char *value, @@ -170,7 +171,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - fd = mkstemp(tmpf); + fd = lxc_make_tmpfile(tmpf, false); if (fd < 0) { lxc_error("%s\n", "Could not create temporary file"); goto non_test_error; -- 2.47.2