Christian Brauner
6d95e0b7e9
tree-wide: use new logging helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:42:09 +01:00
Christian Brauner
81d90ee560
log: mark logging helpers to use
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:39:35 +01:00
Christian Brauner
9fc21b2d84
tree-wide: replace remaining instances of syserrno() with syserror_ret()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
2d7b089590
tree-wide: start replacing instances of syserrno() with syserror()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
060aaa395a
tree-wide: s/syerrno_set()/syserror_set()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
6d829cd2da
commands: unify fd retrieval commands
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
89d51b22cc
commands: fix indentation
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
46b576e56d
commands: rsp_one_fd_{reap,keep}() and rsp_many_fds_reap()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Christian Brauner
5f241268dc
commands: cleanup error handling and variable naming
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 00:37:50 +01:00
Stéphane Graber
cca31bf0ac
Merge pull request #3697 from brauner/2021-02-25/fixes
...
commands: improvements and fixes
2021-02-25 18:24:07 -05:00
Christian Brauner
885bb002a5
commands: port misnamed functions to general style
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:20 +01:00
Christian Brauner
daad4f954c
commands: use debug logging
...
It is fine to fail these commands when a new client talks to an old server or
the kernel doesn't support the necessary features.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:20 +01:00
Christian Brauner
8aa82616b1
log: add some more log and return helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 23:37:14 +01:00
Christian Brauner
161e4bef90
tests: add logging to lxc-test-lxc-attach
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:45 +01:00
Christian Brauner
d2560c4e21
commands: improve lxc_cmd_get_tty_fd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:45 +01:00
Christian Brauner
3a9daa046c
commands: rework lxc_cmd_rsp_recv() to make it more obvious
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 21:28:44 +01:00
Christian Brauner
780215cf0d
af_unix: allow caller and callee to negotiate expectations and reality
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 16:05:06 +01:00
Christian Brauner
265dc73af6
macro: add hweight*() helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 13:49:29 +01:00
Christian Brauner
57fc2dd7e6
commands: let lxc_cmd() return ssize_t to indicate that it returns not just 0 on success
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
962c70c562
commands: port lxc_cmd_get_limit_cgroup2_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
dab4f69fe0
commands: port lxc_cmd_get_cgroup2_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
3d7661aa67
commands: port lxc_cmd_get_limit_cgroup_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
e83494bb56
commands: port lxc_cmd_get_cgroup_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
558cb2b58d
commands: port lxc_cmd_unfreeze() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:28 +01:00
Christian Brauner
ac91e5151b
commands: port lxc_cmd_freeze() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
6e66211771
commands: port lxc_cmd_seccomp_notify_add_listener() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
c58b63fe12
commands: port lxc_cmd_serve_state_clients() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
dda7dc08f5
commands: port lxc_cmd_console_log() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
9338a6f341
commands: port lxc_cmd_add_bpf_device_cgropu() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
3de3c9e365
commands: port lxc_cmd_add_state_client() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
9dca720777
commands: port lxc_cmd_get_lxcpath() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
16fcb1fed0
commands: port lxc_cmd_get_name() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:27 +01:00
Christian Brauner
1a37ba9d55
commands: port lxc_get_tty_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
dbdd56c120
commands: port lxc_cmd_stop() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
1b08494ee5
commands: port lxc_cmd_get_state() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
187e46ab32
commands: port lxc_cmd_get_config_item() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f85d2385c0
commands: portlxc_cmd_get_cgroup_path_do() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
b4e1a2e8e7
commands: port lxc_cmd_get_clone_flags() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
19d141f686
commands: port lxc_cmd_get_cgroup_ctx() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f0af908257
commands: port lxc_cmd_get_seccomp_notify_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
f7a7b0955a
commands: port lxc_cmd_get_devpts_fd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:26 +01:00
Christian Brauner
7208e700bb
commands: port lxc_cmd_get_init_pidfd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
22642823ac
commands: port lxc_cmd_get_init_pid() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
38d14ebda6
commands: port lxc_try_cmd() to new helpers
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
58a8d1f07d
commands: add lxc_cmd_init() and lxc_cmd_data()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 12:03:25 +01:00
Christian Brauner
6834acfffb
commands: s/lxc_cmd_init()/lxc_server_init()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:55:22 +01:00
Christian Brauner
8a598112dd
commands: switch to bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:32:19 +01:00
Christian Brauner
0437eac569
commands: use IN_SET() in lxc_cmd()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-25 09:23:27 +01:00
Stéphane Graber
2be31fed40
Merge pull request #3695 from brauner/2021-02-24/fixes_3
...
commands: array hardening
2021-02-24 11:32:07 -05:00
Christian Brauner
3d97131917
commands: ensure that non-NULL and MAX_STATE is always passed
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-24 16:58:21 +01:00