Christian Brauner
|
f740bc6343
|
cgroups: make use of ERRNO_IS_NOT_SUPPORTED()
This will hopefully prevent backwards compatibility fallback errors.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 09:37:13 +01:00 |
|
Christian Brauner
|
7924f36a15
|
error_utils: copy over Lennart's IN_SET()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 09:37:01 +01:00 |
|
Christian Brauner
|
5dc24a8c28
|
commands: tweak return values
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 09:37:01 +01:00 |
|
Christian Brauner
|
38fa7e479c
|
error_utils: move error helper to separate header
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 09:37:00 +01:00 |
|
Christian Brauner
|
9d3480dab4
|
cgroups: simple variable reordering
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 08:58:56 +01:00 |
|
Stéphane Graber
|
5dc90afd49
|
Merge pull request #3692 from brauner/2021-02-23/fixes
build fix & cgroup braino
|
2021-02-23 20:17:52 -05:00 |
|
Christian Brauner
|
6ee13f5be7
|
attach: be paranoid about file descriptors
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 01:53:05 +01:00 |
|
Christian Brauner
|
327baffea3
|
cgroups: fix braino during controller list creation
Co-mounted controllers are conventionally separated by ",".
Fixes: https://jenkins.linuxcontainers.org/job/lxd-github-commit/1905/arch=amd64,backend=dir,compiler=golang-1.15/consoleFull
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 01:37:54 +01:00 |
|
Christian Brauner
|
70ba94fb0a
|
commands: remove faulty use of access attribute
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-24 01:01:17 +01:00 |
|
Stéphane Graber
|
162402ccc1
|
Merge pull request #3691 from brauner/2021-02-23/fixes
Fix issues reported by Coverity
|
2021-02-23 16:53:23 -05:00 |
|
Christian Brauner
|
2d8b9ab865
|
cgroups: fix error checking
Fixes: Coverity 1473310
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 22:11:22 +01:00 |
|
Christian Brauner
|
92fea74bfe
|
af_unix: prevent oob writes
Fixes: Coverity 1473309
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 22:08:48 +01:00 |
|
Christian Brauner
|
1454e5d9a0
|
commands: only deref once
Fixes: Coverity 1473308
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 22:07:11 +01:00 |
|
Stéphane Graber
|
be7715476f
|
Merge pull request #3690 from brauner/2021-02-21/fixes
attach: improve attaching of new clients to old servers
|
2021-02-23 15:49:38 -05:00 |
|
Christian Brauner
|
7ec5eee4f0
|
commands: handle old clients for LXC_CMD_GET_CGROUP_CTX
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 21:11:10 +01:00 |
|
Christian Brauner
|
bef8f78473
|
attach: handle new and old clients
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 21:11:09 +01:00 |
|
Christian Brauner
|
8723f88e9a
|
attach: make fd sending more uniform
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 21:11:09 +01:00 |
|
Christian Brauner
|
550ede0a94
|
terminal: dumb logging down
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 21:11:07 +01:00 |
|
Stéphane Graber
|
b6f4863739
|
Merge pull request #3689 from brauner/2021-02-21/fixes
cgroups: introduce fd-only cgroup attach via LXC_CMD_GET_CGROUP_CTX
|
2021-02-23 15:08:04 -05:00 |
|
Christian Brauner
|
3a6678c7fb
|
attach: fix namespace preservation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 20:36:29 +01:00 |
|
Christian Brauner
|
00df53300b
|
commands: verify expected file descriptors were sent
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 19:39:36 +01:00 |
|
Christian Brauner
|
8a95cd8271
|
commands: handle older clients gracefully
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 19:20:21 +01:00 |
|
Christian Brauner
|
7184e9d280
|
attach: remove additional newline
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 19:05:09 +01:00 |
|
Christian Brauner
|
8af9b5dadb
|
af_unix: add comment about cast
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 19:00:42 +01:00 |
|
Christian Brauner
|
fb54db2c34
|
attach: fix unsupported namespaces
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 18:59:07 +01:00 |
|
Christian Brauner
|
254a22e17f
|
commands: lxc_cmd_add_state_client_callback()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 18:45:22 +01:00 |
|
Christian Brauner
|
d3be623e3c
|
commands: handle older clients elegantly
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 18:45:19 +01:00 |
|
Christian Brauner
|
ebc548a1ef
|
commands: send ENOSYS response
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:32 +01:00 |
|
Christian Brauner
|
c071c112d3
|
cgroups: introduce fd-only cgroup attach
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:32 +01:00 |
|
Christian Brauner
|
ef6e048a03
|
commands: introduce LXC_CMD_GET_CGROUP_CTX
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:32 +01:00 |
|
Christian Brauner
|
9ec1d9db36
|
utils: add copy_struct_to_client()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:32 +01:00 |
|
Christian Brauner
|
c965e8015f
|
log: add syswarn_set()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:31 +01:00 |
|
Christian Brauner
|
d329cda71b
|
utils: add copy_struct_from_client()
Which is our variant of copy_struct_from_user() that Aleksa and I added to the
kernel.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:31 +01:00 |
|
Christian Brauner
|
a1feaf2944
|
macro: add min() macro
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:31 +01:00 |
|
Christian Brauner
|
2092492ca6
|
cgroups: allow cgroup fd batch retrieval
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:31 +01:00 |
|
Christian Brauner
|
f8cc4ae8be
|
commands: add LXC_CMD_GET_CGROUP_FD
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:30 +01:00 |
|
Christian Brauner
|
9c3eb8d525
|
commands: introduce rsp_many_fds()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:30 +01:00 |
|
Christian Brauner
|
c2f4008889
|
commands: introduce rsp_one_fd()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:30 +01:00 |
|
Christian Brauner
|
4b5f4bdcde
|
commands: introduce lxc_cmd_rsp_send_reap()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 16:15:28 +01:00 |
|
Christian Brauner
|
32fd8d4f85
|
commands: be more explicit during command processing
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 13:57:45 +01:00 |
|
Christian Brauner
|
89420aff36
|
state: _never_ return NULL from lxc_state2str()
Cc: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 13:57:44 +01:00 |
|
Christian Brauner
|
c674e0f6e7
|
cgroups: add cgroup_fds() helper
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 13:57:44 +01:00 |
|
Christian Brauner
|
d17c815ded
|
af_unix: improve SCM_RIGHTS file descriptor retrieval
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-23 13:57:42 +01:00 |
|
Christian Brauner
|
da63ea6b4d
|
commands: tweak validate_string_request()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:02 +01:00 |
|
Christian Brauner
|
61cebd7a1b
|
commands: explicitly number enums
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:02 +01:00 |
|
Christian Brauner
|
840eec19c3
|
cgroups: close dfd_mon but keep dfd_con and dfd_lim open for all cgroup hierarchies
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:02 +01:00 |
|
Christian Brauner
|
d39f72b8b6
|
cgroups: start stashing all fds
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:02 +01:00 |
|
Christian Brauner
|
7f02fd24f7
|
cgroups: skip and warn about invalid file descriptors
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:02 +01:00 |
|
Christian Brauner
|
1d5446120b
|
memory_utils: fix close_equal()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
|
2021-02-22 21:40:00 +01:00 |
|
Stéphane Graber
|
793996583c
|
Merge pull request #3688 from brauner/2021-02-19/fixes_2
cgroups: rework cgroup initialization
|
2021-02-22 14:52:25 -05:00 |
|