From: Daniel Golle Date: Wed, 28 Oct 2020 13:06:07 +0000 (+0000) Subject: jail: cgroup hack: rewrite cgroup -> cgroup2 X-Git-Url: http://git.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=b22e6254df3a3502cc62154ae8e54fce7e3fa48b jail: cgroup hack: rewrite cgroup -> cgroup2 "I'm sure you said cgroup2" Signed-off-by: Daniel Golle --- diff --git a/jail/fs.c b/jail/fs.c index 4cc273e..d240daf 100644 --- a/jail/fs.c +++ b/jail/fs.c @@ -149,7 +149,8 @@ static int do_mount(const char *root, const char *orig_source, const char *targe mountflags |= MS_REMOUNT; } - if (mount(source?:(is_bind?new:NULL), new, filesystemtype, mountflags, optstr)) { + const char *hack_fstype = ((!filesystemtype || strcmp(filesystemtype, "cgroup"))?filesystemtype:"cgroup2"); + if (mount(source?:(is_bind?new:NULL), new, hack_fstype, mountflags, optstr)) { if (error) ERROR("failed to mount %s %s: %m\n", source, new);