]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
5 years agoraw_syscalls: define __NR_pidfd_send_signal if missing 3303/head
Christian Brauner [Tue, 17 Mar 2020 20:55:38 +0000 (21:55 +0100)] 
raw_syscalls: define __NR_pidfd_send_signal if missing

On all architectures we care about it's 424.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotools: fix -g -u parameters for lxc-execute and lxc-attach
Christian Brauner [Tue, 17 Mar 2020 17:07:50 +0000 (18:07 +0100)] 
tools: fix -g -u parameters for lxc-execute and lxc-attach

Closes #3188.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxc_user_nic: don't depend on MAP_FIXED 3301/head
Christian Brauner [Tue, 17 Mar 2020 13:55:45 +0000 (14:55 +0100)] 
lxc_user_nic: don't depend on MAP_FIXED

as this breaks on sparc.

Closes #3262.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3295 from brauner/2020-03-15/fixes
Stéphane Graber [Sun, 15 Mar 2020 17:13:39 +0000 (13:13 -0400)] 
Merge pull request #3295 from brauner/2020-03-15/fixes

smaller cleanups and simplifications

5 years agotree-wide: s/lxc_fini()/lxc_end()/g 3295/head
Christian Brauner [Sun, 15 Mar 2020 14:52:30 +0000 (15:52 +0100)] 
tree-wide: s/lxc_fini()/lxc_end()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotree-wide: remove "name" argument from lxc_{fini,abort}()
Christian Brauner [Sun, 15 Mar 2020 14:50:34 +0000 (15:50 +0100)] 
tree-wide: remove "name" argument from lxc_{fini,abort}()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years ago{_}lxc_start: remove "name" argument
Christian Brauner [Sun, 15 Mar 2020 14:45:54 +0000 (15:45 +0100)] 
{_}lxc_start: remove "name" argument

as it's directly available in the handler itself.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: add missing TRACE() call
Christian Brauner [Sun, 15 Mar 2020 14:38:49 +0000 (15:38 +0100)] 
start: add missing TRACE() call

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: better goto target naming in __lxc_start()
Christian Brauner [Sun, 15 Mar 2020 14:37:00 +0000 (15:37 +0100)] 
start: better goto target naming in __lxc_start()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: rework cleanup code in __lxc_start()
Christian Brauner [Sun, 15 Mar 2020 14:26:47 +0000 (15:26 +0100)] 
start: rework cleanup code in __lxc_start()

This makes the goto labels slightly more convoluted but allows us to further
simplify the cleanup in lxc_init().

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: simplify lxc_init()
Christian Brauner [Sun, 15 Mar 2020 13:56:21 +0000 (14:56 +0100)] 
start: simplify lxc_init()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconf: don't wrap strings
Christian Brauner [Sun, 15 Mar 2020 13:37:42 +0000 (14:37 +0100)] 
conf: don't wrap strings

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3294 from brauner/2020-03-15/fixes
Stéphane Graber [Sun, 15 Mar 2020 06:16:14 +0000 (02:16 -0400)] 
Merge pull request #3294 from brauner/2020-03-15/fixes

memory_utils: improvements

5 years agotree-wide: remove last -1 fd initialization with cleanup macros in favor of -EBADF 3294/head
Christian Brauner [Sun, 15 Mar 2020 01:40:13 +0000 (02:40 +0100)] 
tree-wide: remove last -1 fd initialization with cleanup macros in favor of -EBADF

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotree-wide: s/__do_close_prot_errno/__do_close/g
Christian Brauner [Sun, 15 Mar 2020 01:38:36 +0000 (02:38 +0100)] 
tree-wide: s/__do_close_prot_errno/__do_close/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomemory_utils: adapt to new infrastructure
Christian Brauner [Sun, 15 Mar 2020 01:34:20 +0000 (02:34 +0100)] 
memory_utils: adapt to new infrastructure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotree-wide: port cgroup cleanup to call_cleaner(cgroup_exit)
Christian Brauner [Sun, 15 Mar 2020 00:55:24 +0000 (01:55 +0100)] 
tree-wide: port cgroup cleanup to call_cleaner(cgroup_exit)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocaps: port to call_cleaner() based cleanup
Christian Brauner [Sun, 15 Mar 2020 00:37:32 +0000 (01:37 +0100)] 
caps: port to call_cleaner() based cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomemory_utils: add call_cleaner() helper
Christian Brauner [Sun, 15 Mar 2020 00:28:22 +0000 (01:28 +0100)] 
memory_utils: add call_cleaner() helper

This allows to trivially declare cleanup attributes on the fly.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3293 from brauner/2020-03-14/travis_enable_arches
Stéphane Graber [Sat, 14 Mar 2020 14:18:25 +0000 (10:18 -0400)] 
Merge pull request #3293 from brauner/2020-03-14/travis_enable_arches

travis: enable all architectures

5 years agotravis: enable all architectures 3293/head
Christian Brauner [Sat, 14 Mar 2020 12:07:39 +0000 (13:07 +0100)] 
travis: enable all architectures

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotravis: remove libgnutls-dev
Christian Brauner [Sat, 14 Mar 2020 12:13:37 +0000 (13:13 +0100)] 
travis: remove libgnutls-dev

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3291 from brauner/2020-03-11/fixes
Stéphane Graber [Wed, 11 Mar 2020 21:05:57 +0000 (17:05 -0400)] 
Merge pull request #3291 from brauner/2020-03-11/fixes

bugfixes

5 years agoutils: cleanup 3291/head
Christian Brauner [Wed, 11 Mar 2020 18:24:02 +0000 (19:24 +0100)] 
utils: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agofile_utils: cleanup macros and improvements
Christian Brauner [Wed, 11 Mar 2020 17:56:54 +0000 (18:56 +0100)] 
file_utils: cleanup macros and improvements

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3290 from brauner/2020-03-11/fixes
Stéphane Graber [Wed, 11 Mar 2020 15:34:34 +0000 (11:34 -0400)] 
Merge pull request #3290 from brauner/2020-03-11/fixes

pidfds: switch infrastructure to rely on pidfds whenever possible

5 years agoapi-extensions: use correct headings 3290/head
Christian Brauner [Wed, 11 Mar 2020 15:05:13 +0000 (16:05 +0100)] 
api-extensions: use correct headings

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: document "network_veth_router" api extension
Christian Brauner [Wed, 11 Mar 2020 15:03:09 +0000 (16:03 +0100)] 
api-extensions: document "network_veth_router" api extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: reflow "seccomp_allow_nesting" api extension
Christian Brauner [Wed, 11 Mar 2020 15:02:14 +0000 (16:02 +0100)] 
api-extensions: reflow "seccomp_allow_nesting" api extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: reflow "seccomp_notify" api extension
Christian Brauner [Wed, 11 Mar 2020 15:01:01 +0000 (16:01 +0100)] 
api-extensions: reflow "seccomp_notify" api extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: reflow "cgroup2_devices" extensions
Christian Brauner [Wed, 11 Mar 2020 15:00:34 +0000 (16:00 +0100)] 
api-extensions: reflow "cgroup2_devices" extensions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: reflow "cgroup2" api extension
Christian Brauner [Wed, 11 Mar 2020 15:00:11 +0000 (16:00 +0100)] 
api-extensions: reflow "cgroup2" api extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoapi-extensions: add "pidfd" api extension
Christian Brauner [Wed, 11 Mar 2020 14:13:33 +0000 (15:13 +0100)] 
api-extensions: add "pidfd" api extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer: switch to pidfd polling when shutting down containers
Christian Brauner [Wed, 11 Mar 2020 14:05:45 +0000 (15:05 +0100)] 
lxccontainer: switch to pidfd polling when shutting down containers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer: switch to pidfds whenever possible
Christian Brauner [Wed, 11 Mar 2020 13:36:58 +0000 (14:36 +0100)] 
lxccontainer: switch to pidfds whenever possible

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: add ability to detect whether kernel supports pidfds
Christian Brauner [Wed, 11 Mar 2020 13:02:40 +0000 (14:02 +0100)] 
start: add ability to detect whether kernel supports pidfds

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer: add init_pidfd() API extension
Christian Brauner [Wed, 11 Mar 2020 12:11:07 +0000 (13:11 +0100)] 
lxccontainer: add init_pidfd() API extension

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: LXC_CMD_GET_INIT_PIDFD
Christian Brauner [Wed, 11 Mar 2020 12:01:17 +0000 (13:01 +0100)] 
commands: LXC_CMD_GET_INIT_PIDFD

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer.h: document seccomp_notify_fd()
Christian Brauner [Wed, 11 Mar 2020 12:04:18 +0000 (13:04 +0100)] 
lxccontainer.h: document seccomp_notify_fd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3289 from tenforward/japanese
Stéphane Graber [Wed, 11 Mar 2020 13:37:13 +0000 (09:37 -0400)] 
Merge pull request #3289 from tenforward/japanese

doc: Add keyring options to Japanese lxc.containers.conf(5)

5 years agocommands: use LXC_CMD_REAP_CLIENT_FD in lxc_cmd_get_cgroup2_fd_callback()
Christian Brauner [Wed, 11 Mar 2020 11:57:22 +0000 (12:57 +0100)] 
commands: use LXC_CMD_REAP_CLIENT_FD in lxc_cmd_get_cgroup2_fd_callback()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: add ability to audit fd connection and cleanup path
Christian Brauner [Wed, 11 Mar 2020 11:02:10 +0000 (12:02 +0100)] 
commands: add ability to audit fd connection and cleanup path

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agodoc: Fix typo 3289/head
KATOH Yasufumi [Wed, 11 Mar 2020 06:56:35 +0000 (15:56 +0900)] 
doc: Fix typo

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
5 years agoMerge branch 'master' into japanese
KATOH Yasufumi [Wed, 11 Mar 2020 06:25:00 +0000 (15:25 +0900)] 
Merge branch 'master' into japanese

5 years agodoc: Add keyring options to Japanese lxc.containers.conf(5)
KATOH Yasufumi [Wed, 11 Mar 2020 06:21:36 +0000 (15:21 +0900)] 
doc: Add keyring options to Japanese lxc.containers.conf(5)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
5 years agoMerge pull request #3288 from brauner/2020-03-11/fixes
Stéphane Graber [Wed, 11 Mar 2020 02:47:25 +0000 (22:47 -0400)] 
Merge pull request #3288 from brauner/2020-03-11/fixes

commands: simplify lxc_cmd_fd_cleanup()

5 years agocommands: simplify lxc_cmd_fd_cleanup() 3288/head
Christian Brauner [Wed, 11 Mar 2020 02:33:16 +0000 (03:33 +0100)] 
commands: simplify lxc_cmd_fd_cleanup()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3287 from brauner/2020-03-11/fixes
Stéphane Graber [Wed, 11 Mar 2020 02:23:35 +0000 (22:23 -0400)] 
Merge pull request #3287 from brauner/2020-03-11/fixes

fixes

5 years agocommands_utils: fix command socket hashing 3287/head
Christian Brauner [Wed, 11 Mar 2020 01:59:36 +0000 (02:59 +0100)] 
commands_utils: fix command socket hashing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoaf_unix: fix return value
Christian Brauner [Wed, 11 Mar 2020 01:35:51 +0000 (02:35 +0100)] 
af_unix: fix return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: cleanup file descriptor closing
Christian Brauner [Wed, 11 Mar 2020 00:56:44 +0000 (01:56 +0100)] 
start: cleanup file descriptor closing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3286 from brauner/2020-03-10/fixes
Stéphane Graber [Tue, 10 Mar 2020 22:03:17 +0000 (18:03 -0400)] 
Merge pull request #3286 from brauner/2020-03-10/fixes

commands: make sure to always close the client fd

5 years agocommands: make sure to always close the client fd 3286/head
Christian Brauner [Tue, 10 Mar 2020 21:33:00 +0000 (22:33 +0100)] 
commands: make sure to always close the client fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3285 from brauner/2020-03-10/fixes
Stéphane Graber [Tue, 10 Mar 2020 21:05:00 +0000 (17:05 -0400)] 
Merge pull request #3285 from brauner/2020-03-10/fixes

bugfixes

5 years agocommands: improve state client cleanup 3285/head
Christian Brauner [Tue, 10 Mar 2020 20:46:25 +0000 (21:46 +0100)] 
commands: improve state client cleanup

Improves: ebbca8529732 ("commands_utils: fix socket leak when adding state client")
Cc: Matthias Hardt <matthias.hardt@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: switch to pid_t to send around pid
Christian Brauner [Tue, 10 Mar 2020 20:35:25 +0000 (21:35 +0100)] 
commands: switch to pid_t to send around pid

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3283 from brauner/2020-03-10/fixes
Stéphane Graber [Tue, 10 Mar 2020 19:21:09 +0000 (15:21 -0400)] 
Merge pull request #3283 from brauner/2020-03-10/fixes

bugfixes

5 years agoshare_ns: improve error handling
Christian Brauner [Tue, 10 Mar 2020 16:52:35 +0000 (17:52 +0100)] 
share_ns: improve error handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoshare_ns: improve error handling 3283/head
Christian Brauner [Tue, 10 Mar 2020 16:52:35 +0000 (17:52 +0100)] 
share_ns: improve error handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agofile_utils: handle libcs without fmemopen()
Christian Brauner [Tue, 10 Mar 2020 16:41:50 +0000 (17:41 +0100)] 
file_utils: handle libcs without fmemopen()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroups: cleanup
Christian Brauner [Tue, 10 Mar 2020 16:07:33 +0000 (17:07 +0100)] 
cgroups: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgfsng: use __do_free_string_list all over
Christian Brauner [Tue, 10 Mar 2020 15:33:15 +0000 (16:33 +0100)] 
cgfsng: use __do_free_string_list all over

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agofile_utils: include stdio.h for fmemopen()
Christian Brauner [Tue, 10 Mar 2020 15:23:27 +0000 (16:23 +0100)] 
file_utils: include stdio.h for fmemopen()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotests/share_ns: always call pthread_exit()
Christian Brauner [Tue, 10 Mar 2020 15:23:11 +0000 (16:23 +0100)] 
tests/share_ns: always call pthread_exit()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3282 from brauner/2020-03-10/fixes
Stéphane Graber [Tue, 10 Mar 2020 15:23:36 +0000 (11:23 -0400)] 
Merge pull request #3282 from brauner/2020-03-10/fixes

memory_utils: remove unneeded inclusion of mntent.h

5 years agomemory_utils: remove unneeded inclusion of mntent.h 3282/head
Christian Brauner [Tue, 10 Mar 2020 15:08:06 +0000 (16:08 +0100)] 
memory_utils: remove unneeded inclusion of mntent.h

Fixes: Android
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3281 from brauner/2020-03-10/fixes
Stéphane Graber [Tue, 10 Mar 2020 14:03:06 +0000 (10:03 -0400)] 
Merge pull request #3281 from brauner/2020-03-10/fixes

tree-wide: cleanup

5 years agocgroups: fix memory leak and simplify code 3281/head
Christian Brauner [Tue, 10 Mar 2020 13:44:59 +0000 (14:44 +0100)] 
cgroups: fix memory leak and simplify code

Closes #3252.
Reported-by: LiFeng <lifeng68@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotests/share_ns: bugfixes
Christian Brauner [Tue, 10 Mar 2020 12:11:00 +0000 (13:11 +0100)] 
tests/share_ns: bugfixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconf: cleanup
Christian Brauner [Tue, 10 Mar 2020 11:57:00 +0000 (12:57 +0100)] 
conf: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands_utils: cleanup
Christian Brauner [Tue, 10 Mar 2020 10:36:04 +0000 (11:36 +0100)] 
commands_utils: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: cleanup
Christian Brauner [Tue, 10 Mar 2020 10:31:07 +0000 (11:31 +0100)] 
commands: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3279 from brauner/2020-03-04/improvements
Stéphane Graber [Tue, 10 Mar 2020 03:38:53 +0000 (23:38 -0400)] 
Merge pull request #3279 from brauner/2020-03-04/improvements

bugfixes

5 years agotree-wide: more cleanup macros 3279/head
Christian Brauner [Mon, 9 Mar 2020 09:59:14 +0000 (10:59 +0100)] 
tree-wide: more cleanup macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer: increase cleanup macro usage
Christian Brauner [Mon, 9 Mar 2020 13:55:12 +0000 (14:55 +0100)] 
lxccontainer: increase cleanup macro usage

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoautotools: fix lxc-init build with clang-10
Christian Brauner [Mon, 9 Mar 2020 13:38:46 +0000 (14:38 +0100)] 
autotools: fix lxc-init build with clang-10

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotree-wide: improve logging
Christian Brauner [Mon, 9 Mar 2020 09:59:14 +0000 (10:59 +0100)] 
tree-wide: improve logging

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotree-wide: make files cloexec whenever possible
Christian Brauner [Mon, 9 Mar 2020 09:18:55 +0000 (10:18 +0100)] 
tree-wide: make files cloexec whenever possible

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: cleanup various helpers
Christian Brauner [Mon, 9 Mar 2020 09:17:55 +0000 (10:17 +0100)] 
attach: cleanup various helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: use logging helpers when handling no new privileges
Christian Brauner [Mon, 9 Mar 2020 09:14:34 +0000 (10:14 +0100)] 
attach: use logging helpers when handling no new privileges

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: use cleanup macros and logging helpers when fetching seccomp
Christian Brauner [Mon, 9 Mar 2020 09:12:44 +0000 (10:12 +0100)] 
attach: use cleanup macros and logging helpers when fetching seccomp

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: use LXC_INVALID_{G,U}ID macros
Christian Brauner [Mon, 9 Mar 2020 09:08:37 +0000 (10:08 +0100)] 
attach: use LXC_INVALID_{G,U}ID macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: use cleanup macros in lxc_attach_getpwshell()
Christian Brauner [Mon, 9 Mar 2020 09:06:50 +0000 (10:06 +0100)] 
attach: use cleanup macros in lxc_attach_getpwshell()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: fix fd leak
Christian Brauner [Mon, 9 Mar 2020 09:05:25 +0000 (10:05 +0100)] 
attach: fix fd leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: cleanup
Christian Brauner [Thu, 5 Mar 2020 09:03:38 +0000 (10:03 +0100)] 
attach: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgroup2_devices: fix logic error
Christian Brauner [Mon, 9 Mar 2020 13:33:16 +0000 (14:33 +0100)] 
cgroup2_devices: fix logic error

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: remove unused variables
Christian Brauner [Mon, 9 Mar 2020 13:33:04 +0000 (14:33 +0100)] 
commands: remove unused variables

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3280 from Piscolero/state_client_socket_leak_fix
Christian Brauner [Mon, 9 Mar 2020 20:02:26 +0000 (21:02 +0100)] 
Merge pull request #3280 from Piscolero/state_client_socket_leak_fix

commands_utils: fix socket leak when adding state client

5 years agocommands_utils: fix socket leak when adding state client 3280/head
Matthias Hardt [Mon, 9 Mar 2020 18:58:22 +0000 (19:58 +0100)] 
commands_utils: fix socket leak when adding state client

If lxc_add_state_client() is called with the container already being in the desired state the client fd will never be closed and is leaking. This is due to setting stay_connected in lxc_cmd for LXC_CMD_ADD_STATE_CLIENT. If the desired state isn't already achieved the client fd will later be closed by calling lxc_cmd_fd_cleanup() but in the other case the client configuration isn't added to the handlers
state clients. So the client fd has to be closed explicitely.

This is simply tested by starting container A and calling lxc-wait -n A -s RUNNING.

Signed-off-by: Matthias Hardt <matthias.hardt@gmail.com>
5 years agoRevert "commands_utils: fix socket leak in when adding state client"
Matthias Hardt [Mon, 9 Mar 2020 18:42:55 +0000 (19:42 +0100)] 
Revert "commands_utils: fix socket leak in when adding state client"

This reverts commit d7aa5552448680c8ff7c4af8c19ea5dbd678e946.

Signed-off-by: Matthias Hardt <matthias.hardt@gmail.com>
5 years agoRevert "commands_utils: indicate taking ownership of state_client_fd in"
Matthias Hardt [Mon, 9 Mar 2020 18:42:53 +0000 (19:42 +0100)] 
Revert "commands_utils: indicate taking ownership of state_client_fd in"

This reverts commit cd0dc360ce740ba302dacc3dc70c6b20b2a5f794.

Signed-off-by: Matthias Hardt <matthias.hardt@gmail.com>
5 years agocommands_utils: indicate taking ownership of state_client_fd in
Matthias Hardt [Mon, 9 Mar 2020 15:12:28 +0000 (16:12 +0100)] 
commands_utils: indicate taking ownership of state_client_fd in
lxc_add_state_client()

Signed-off-by: Matthias Hardt <matthias.hardt@gmail.com>
5 years agocommands_utils: fix socket leak in when adding state client
Matthias Hardt [Mon, 9 Mar 2020 14:53:11 +0000 (15:53 +0100)] 
commands_utils: fix socket leak in when adding state client

If lxc_add_state_client() is called with the container already being in
the desired state the client fd will never be closed and is leaking.
This due to setting stay_connected in lxc_cmd for
LXC_CMD_ADD_STATE_CLIENT. If the desired state isn't already achieved
the client fd will later be closed by calling lxc_cmd_fd_cleanup() but
in the other case the client configuration isn't added to the handlers
state clients. So the client fd has to be closed explicitely.

This is simply tested by starting container A and calling lxc-wait -n A
-s RUNNING.

Signed-off-by: Matthias Hardt <matthias.hardt@gmail.com>
5 years agoaf_unix: cleanup
Christian Brauner [Wed, 4 Mar 2020 14:21:18 +0000 (15:21 +0100)] 
af_unix: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #3278 from tomponline/tp-proxy-sleep
Christian Brauner [Sun, 8 Mar 2020 19:43:09 +0000 (20:43 +0100)] 
Merge pull request #3278 from tomponline/tp-proxy-sleep

network: Adds short sleep between veth setup and neighbour proxy add

5 years agoMerge pull request #3277 from tomponline/tp-router-netlink
Christian Brauner [Sun, 8 Mar 2020 19:31:43 +0000 (20:31 +0100)] 
Merge pull request #3277 from tomponline/tp-router-netlink

network: Uses netlink for IP neighbour proxy management

5 years agonetwork: Adds short sleep between veth setup and neighbour proxy add 3278/head
Thomas Parrott [Sun, 8 Mar 2020 18:28:44 +0000 (18:28 +0000)] 
network: Adds short sleep between veth setup and neighbour proxy add

There is an intermittent issue, experienced on at least Ubuntu 18.04 (5.3.0-40-generic) and Alpine 3.11 (5.4.12-1-virt) when using the router network interface type that causes the IP proxy neighbour entries on the host side of the veth pair to not be created.

The `ip neigh add proxy` command returns without an error, however by the time the network up hook has started the IP neighbour proxy entries are no longer there (if they ever were).

I've also tested this using netlink rather than the ip command to add and both are equally affected.

Adding a short sleep between setting up the veth pair and adding the proxy entries appears to fix it.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
5 years agonetwork: Uses netlink for IP neighbour proxy management 3277/head
Thomas Parrott [Sun, 8 Mar 2020 17:48:01 +0000 (17:48 +0000)] 
network: Uses netlink for IP neighbour proxy management

Removes need for ip command when managing IP neighbour proxies.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
5 years agoMerge pull request #3275 from brauner/2020-03-05/api_extension
Stéphane Graber [Thu, 5 Mar 2020 10:36:38 +0000 (11:36 +0100)] 
Merge pull request #3275 from brauner/2020-03-05/api_extension

utils: only move_fd() when fdopen() has been successful

5 years agoutils: only move_fd() when fdopen() has been successful 3275/head
Christian Brauner [Thu, 5 Mar 2020 10:14:24 +0000 (11:14 +0100)] 
utils: only move_fd() when fdopen() has been successful

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>