From 0311439fad0123182fc9291124cc8e6aee2a6bd0 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 15 Jun 2018 11:35:10 +0200 Subject: [PATCH] coverity: #1425771 Insecure temporary file Signed-off-by: Christian Brauner --- src/tests/lxc-test-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/lxc-test-utils.c b/src/tests/lxc-test-utils.c index 0da2011a4..4c628b063 100644 --- a/src/tests/lxc-test-utils.c +++ b/src/tests/lxc-test-utils.c @@ -149,13 +149,13 @@ void test_detect_ramfs_rootfs(void) goto non_test_error; } - fd1 = mkstemp(tmpf1); + fd1 = lxc_make_tmpfile(tmpf1, false); if (fd1 < 0) { lxc_error("%s\n", "Could not create temporary file."); goto non_test_error; } - fd2 = mkstemp(tmpf2); + fd2 = lxc_make_tmpfile(tmpf2, false); if (fd2 < 0) { lxc_error("%s\n", "Could not create temporary file."); goto non_test_error; -- 2.47.2