Unverified Commit 2715bbf9 by Stéphane Graber Committed by GitHub

Merge pull request #2233 from brauner/2018-03-23/truncate_config_file

lxccontainer: truncate config file
parents cc8d4ec0 10034af5
......@@ -2500,11 +2500,10 @@ static bool do_lxcapi_save_config(struct lxc_container *c, const char *alt_file)
lret = container_disk_lock(c);
else
lret = container_mem_lock(c);
if (lret)
return false;
fd = open(alt_file, O_WRONLY | O_CREAT | O_CLOEXEC,
fd = open(alt_file, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0)
goto on_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