Christian Brauner
7414bc72c3
cgroups: s/cg_init()/__cgroup_init()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-16 10:55:38 +01:00
Stéphane Graber
136b349c94
Merge pull request #3674 from brauner/2021-02-15/nesting
...
cgroups: tighten cgroup config items
2021-02-15 12:56:52 -05:00
Christian Brauner
f63ef15527
confile: forbid absolute paths in config items that modify the cgroup layout
...
This is not a safety measure but merely is supposed to raise awareness that
these paths are always relative to the cgroup root as determined by
lxc.cgroup.relative.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
0a48ee66c6
confile: forbid walking upwards for confile items that modify cgroup layout
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
7d714159a3
confile_utils: normalize paths in config items
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:56 +01:00
Christian Brauner
ee94a8b5cf
confile: use set_config_path_item() for most cgroup layout modifiers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 18:08:54 +01:00
Stéphane Graber
7e925736c9
Merge pull request #3673 from brauner/2021-02-15/nesting
...
cgroups: first batch of cgroup mounting fixes
2021-02-15 12:08:01 -05:00
Christian Brauner
a3e5ec2657
cgroupfs: rework cgroup2 mounting
...
We now explicitly refuse to mount cgroups on pure unified layouts when the
container is not running in a separate cgroup namespace. This is not a
regression since we simply always failed before anyway. I will likely fix this
very soon though. But there are bigger fish to fry currently.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 16:25:38 +01:00
Christian Brauner
3a86fb378d
cgroups: log early return
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:58:10 +01:00
Christian Brauner
44234ae1e9
cgroups: s/__cg_mount_direct()/__cgroupfs_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:54:51 +01:00
Christian Brauner
6768700d24
cgroups: strip LXC_AUTO_CGROUP_MIXED and LXC_AUTO_CGROUP_FULL_MIXED when cgroup namespaces are supported and used
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:54:10 +01:00
Christian Brauner
80262447c9
cgroups: fix flag checking in legacy mount paths
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:45:45 +01:00
Christian Brauner
1411165033
cgroups: s/cg_mount_cgroup_full()/cgroupfs_bind_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:44:24 +01:00
Christian Brauner
074af8903c
cgroups: s/cg_mount_in_cgroup_namespace()/cgroupfs_mount()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:42:56 +01:00
Christian Brauner
6cc501f3e0
conf: remove wrong comment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:41:02 +01:00
Christian Brauner
c581c8a365
cgroups: switch to flag-based checking
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:36:49 +01:00
Christian Brauner
68599aab10
cgroups: don't strip LXC_AUTO_CGROUP_FORCE
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:25:00 +01:00
Christian Brauner
cdd3b77d0c
cgroups: make clear that a flag argument is passed to cgroup mount functions
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 13:23:51 +01:00
Christian Brauner
8cdbef77df
utils: add development helper to quickly dump a directories contents
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:29:47 +01:00
Christian Brauner
e7e45fdffc
cgroups: improve cgroup mounting
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:23:36 +01:00
Christian Brauner
937a3af94e
cgroups: verify that we are actually running in cgroup namespace
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 12:05:20 +01:00
Christian Brauner
ab8cd5d9e2
cgroups: pass handler to cgroup mount() method
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:57:31 +01:00
Christian Brauner
6d25a524d8
conf: don't pass conf separately to lxc_mount_auto_mounts()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:55:33 +01:00
Christian Brauner
c988c8b1ce
cgroups: move cgns_supported() to cgroup utilities
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-15 11:51:11 +01:00
Stéphane Graber
4b9467975c
Merge pull request #3672 from brauner/2021-02-14/fixes
...
start: small fixes
2021-02-14 15:38:58 -05:00
Christian Brauner
245066afbc
start: fix comment about time namespace preservation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:45:22 +01:00
Christian Brauner
3a89b0ab0a
start: improve comment in lxc_spawn()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:44:57 +01:00
Christian Brauner
9beaca55d7
start: improve comments
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:44:18 +01:00
Christian Brauner
857ba1f0c5
start: improve namespace preservation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:42:36 +01:00
Christian Brauner
cb3b010c16
start: fix error handling and improve comment
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 20:36:25 +01:00
Stéphane Graber
5fd0968304
Merge pull request #3671 from brauner/2021-02-14/namespace_hooks
...
hooks: rework exposing namespace information
2021-02-14 10:55:54 -05:00
Christian Brauner
37631ddbf8
network: expose namespace fd paths to network hooks
...
Closes : #3667
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 15:42:10 +01:00
Christian Brauner
8db6be1ba5
start: rework namespace preservation and path creation for hooks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-14 15:42:10 +01:00
Stéphane Graber
3bcf3ba0b4
Merge pull request #3670 from brauner/2021-02-13/fixes
...
tree-wide: convert to strequal() and strnequal()
2021-02-13 19:02:22 -05:00
Christian Brauner
a58b0754ab
utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
becc8d207c
seccomp: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
948fcf60b0
lxccontainer: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
12b902608a
lsm: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:25 +01:00
Christian Brauner
90d5fea581
freezer: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:24 +01:00
Christian Brauner
b3fde94479
file_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:24 +01:00
Christian Brauner
1c95f94c23
confile_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:19 +01:00
Christian Brauner
1af3044f0c
confile: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:41:15 +01:00
Christian Brauner
eed95eb005
conf: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
aa72fbe713
cgroups: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
6a6c7030d5
attach: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
f0fdcd893a
utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
5ef8637869
terminal: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
7ba62a5e87
string_utils: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:28 +01:00
Christian Brauner
d594790c82
state: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00
Christian Brauner
d0269705d2
start: convert to strequal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-13 21:40:27 +01:00