]> git.proxmox.com Git - lxc.git/blob - debian/patches/fixes/0010-ringbuf-fix-temporary-file-creation.patch
bump version to 3.0.0-3
[lxc.git] / debian / patches / fixes / 0010-ringbuf-fix-temporary-file-creation.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Christian Brauner <christian.brauner@ubuntu.com>
3 Date: Fri, 6 Apr 2018 10:54:41 +0200
4 Subject: [PATCH] ringbuf: fix temporary file creation
5
6 lxc_make_tmpfile() uses mkstemp() internally, and thus expects the
7 template to contain 'XXXXXX' and be writable.
8
9 Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
10 Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
11 ---
12 src/lxc/ringbuf.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15 diff --git a/src/lxc/ringbuf.c b/src/lxc/ringbuf.c
16 index 1299fe70..7aa2e631 100644
17 --- a/src/lxc/ringbuf.c
18 +++ b/src/lxc/ringbuf.c
19 @@ -52,10 +52,12 @@ int lxc_ringbuf_create(struct lxc_ringbuf *buf, size_t size)
20
21 memfd = memfd_create(".lxc_ringbuf", MFD_CLOEXEC);
22 if (memfd < 0) {
23 + char template[] = P_tmpdir "/.lxc_ringbuf_XXXXXX";
24 +
25 if (errno != ENOSYS)
26 goto on_error;
27
28 - memfd = lxc_make_tmpfile((char *){P_tmpdir"/.lxc_ringbuf_XXXXXX"}, true);
29 + memfd = lxc_make_tmpfile(template, true);
30 }
31 if (memfd < 0)
32 goto on_error;
33 --
34 2.11.0
35