The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3335

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 275e8ef8aa86fb1d759412a0e1ddee8307093975 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Fri, 27 Mar 2020 22:22:05 +0100
Subject: [PATCH] cgroups: use hidden directory for attaching cgroup

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/cgroups/cgfsng.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c
index d326a87e21..effbf11a87 100644
--- a/src/lxc/cgroups/cgfsng.c
+++ b/src/lxc/cgroups/cgfsng.c
@@ -2065,12 +2065,12 @@ static int cgroup_attach_leaf(const struct lxc_conf 
*conf, int unified_fd, pid_t
        size_t pidstr_len;
 
        /* Create leaf cgroup. */
-       ret = mkdirat(unified_fd, "lxc", 0755);
+       ret = mkdirat(unified_fd, ".lxc", 0755);
        if (ret < 0 && errno != EEXIST)
-               return log_error_errno(-1, errno, "Failed to create leaf cgroup 
\"lxc\"");
+               return log_error_errno(-1, errno, "Failed to create leaf cgroup 
\".lxc\"");
 
        pidstr_len = sprintf(pidstr, INT64_FMT, (int64_t)pid);
-       ret = lxc_writeat(unified_fd, "lxc/cgroup.procs", pidstr, pidstr_len);
+       ret = lxc_writeat(unified_fd, ".lxc/cgroup.procs", pidstr, pidstr_len);
        if (ret < 0)
                ret = lxc_writeat(unified_fd, "cgroup.procs", pidstr, 
pidstr_len);
        if (ret == 0)
@@ -2082,10 +2082,11 @@ static int cgroup_attach_leaf(const struct lxc_conf 
*conf, int unified_fd, pid_t
 
        do {
                bool rm = false;
-               char attach_cgroup[STRLITERALLEN("lxc-1000/cgroup.procs") + 1];
+               char attach_cgroup[STRLITERALLEN(".lxc-1000/cgroup.procs") + 1];
                char *slash;
 
-               sprintf(attach_cgroup, "lxc-%d/cgroup.procs", idx);
+               snprintf(attach_cgroup, STRLITERALLEN(".lxc-%d/cgroup.procs"),
+                        ".lxc-%d/cgroup.procs", idx);
                slash = &attach_cgroup[ret] - STRLITERALLEN("/cgroup.procs");
                *slash = '\0';
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to