Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
69c29673
Unverified
Commit
69c29673
authored
Feb 17, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: validate that only a single cgroup mount type is set
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
8186eb8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
cgfsng.c
src/lxc/cgroups/cgfsng.c
+26
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
69c29673
...
...
@@ -1951,8 +1951,33 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
if
((
cg_flags
&
LXC_AUTO_CGROUP_MASK
)
==
0
)
return
log_trace
(
true
,
"No cgroup mounts requested"
);
if
(
cg_flags
&
LXC_AUTO_CGROUP_FORCE
)
if
(
cg_flags
&
LXC_AUTO_CGROUP_FORCE
)
{
cg_flags
&=
~
LXC_AUTO_CGROUP_FORCE
;
wants_force_mount
=
true
;
}
switch
(
cg_flags
)
{
case
LXC_AUTO_CGROUP_RO
:
TRACE
(
"Read-only cgroup mounts requested"
);
break
;
case
LXC_AUTO_CGROUP_RW
:
TRACE
(
"Read-write cgroup mounts requested"
);
break
;
case
LXC_AUTO_CGROUP_MIXED
:
TRACE
(
"Mixed cgroup mounts requested"
);
break
;
case
LXC_AUTO_CGROUP_FULL_RO
:
TRACE
(
"Full read-only cgroup mounts requested"
);
break
;
case
LXC_AUTO_CGROUP_FULL_RW
:
TRACE
(
"Full read-write cgroup mounts requested"
);
break
;
case
LXC_AUTO_CGROUP_FULL_MIXED
:
TRACE
(
"Full mixed cgroup mounts requested"
);
break
;
default:
return
log_error_errno
(
false
,
EINVAL
,
"Invalid cgroup mount options specified"
);
}
if
(
!
wants_force_mount
)
{
wants_force_mount
=
!
lxc_wants_cap
(
CAP_SYS_ADMIN
,
conf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment