coverity: #1425792

Insecure temporary file Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 094c8a06
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "confile_utils.h" #include "confile_utils.h"
#include "lxc/state.h" #include "lxc/state.h"
#include "lxctest.h" #include "lxctest.h"
#include "utils.h"
static int set_get_compare_clear_save_load(struct lxc_container *c, static int set_get_compare_clear_save_load(struct lxc_container *c,
const char *key, const char *value, const char *key, const char *value,
...@@ -170,7 +171,7 @@ int main(int argc, char *argv[]) ...@@ -170,7 +171,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
fd = mkstemp(tmpf); fd = lxc_make_tmpfile(tmpf, false);
if (fd < 0) { if (fd < 0) {
lxc_error("%s\n", "Could not create temporary file"); lxc_error("%s\n", "Could not create temporary file");
goto non_test_error; goto non_test_error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment