mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
conf: fix temporary file creation
lxc_make_tmpfile() uses mkstemp() internally, and thus expects the template to contain 'XXXXXX' and be writable. Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
83ffaa1d39
commit
a324e7eba0
@ -2286,9 +2286,12 @@ FILE *make_anonymous_mount_file(struct lxc_list *mount)
|
|||||||
|
|
||||||
fd = memfd_create(".lxc_mount_file", MFD_CLOEXEC);
|
fd = memfd_create(".lxc_mount_file", MFD_CLOEXEC);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
char template[] = P_tmpdir "/.lxc_mount_file_XXXXXX";
|
||||||
|
|
||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
return NULL;
|
return NULL;
|
||||||
fd = lxc_make_tmpfile((char *){P_tmpdir "/.lxc_mount_file"}, true);
|
|
||||||
|
fd = lxc_make_tmpfile(template, true);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
SYSERROR("Could not create temporary mount file");
|
SYSERROR("Could not create temporary mount file");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user