]> git.proxmox.com Git - mirror_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>
Fri, 15 Jun 2018 09:39:40 +0000 (11:39 +0200)
Insecure temporary file

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

index 0da2011a4600a3c647b474f1f1634843ddc54098..4c628b063ea082bff659ce7d11f87b16a42d03d7 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;