]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1425771
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Jun 2018 09:35:10 +0000 (11:35 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 10 Dec 2018 08:20:01 +0000 (09:20 +0100)
Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/tests/lxc-test-utils.c

index caed4b5a7efd5142db8c890866e68a8ff6a5ccec..9a6f0d0672cd1f8626edb9e6df7c234121eb6f33 100644 (file)
@@ -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;