]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
4 years agotree-wide: s/__unused/__lxc_unused/g
Christian Brauner [Sat, 7 Dec 2019 22:47:16 +0000 (23:47 +0100)]
tree-wide: s/__unused/__lxc_unused/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgroup attach
Christian Brauner [Sat, 7 Dec 2019 21:19:20 +0000 (22:19 +0100)]
cgroups/cgfsng: rework cgroup attach

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: don't dereference NULL-pointer
Christian Brauner [Sat, 7 Dec 2019 21:12:00 +0000 (22:12 +0100)]
cgroups/cgfsng: don't dereference NULL-pointer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: log chown_cgroup_wrapper()
Christian Brauner [Sat, 7 Dec 2019 21:04:04 +0000 (22:04 +0100)]
cgroups/cgfsng: log chown_cgroup_wrapper()

It's becoming more important on cgroup2 to properly delegate cgroups.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgroup2 unprivileged delegation
Christian Brauner [Sat, 7 Dec 2019 20:51:58 +0000 (21:51 +0100)]
cgroups/cgfsng: rework cgroup2 unprivileged delegation

We accidently checked files to delegate for privileged container and not for
unprivileged containers in the pure unified case. Fix that and clean up the
delegation file parsing.

Closes #3206.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgfsng_{monitor,payload}_delegate_controllers()
Christian Brauner [Sat, 7 Dec 2019 17:17:48 +0000 (18:17 +0100)]
cgroups/cgfsng: rework cgfsng_{monitor,payload}_delegate_controllers()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgfsng_monitor_enter()
Christian Brauner [Sat, 7 Dec 2019 17:13:54 +0000 (18:13 +0100)]
cgroups/cgfsng: rework cgfsng_monitor_enter()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgfsng_monitor_create()
Christian Brauner [Sat, 7 Dec 2019 17:12:30 +0000 (18:12 +0100)]
cgroups/cgfsng: rework cgfsng_monitor_create()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgfsng_monitor_destroy()
Christian Brauner [Sat, 7 Dec 2019 17:08:25 +0000 (18:08 +0100)]
cgroups/cgfsng: rework cgfsng_monitor_destroy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: rework cgfsng_payload_destroy()
Christian Brauner [Sat, 7 Dec 2019 17:04:17 +0000 (18:04 +0100)]
cgroups/cgfsng: rework cgfsng_payload_destroy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolog: remove unused compiler attribute
Christian Brauner [Sat, 7 Dec 2019 16:40:32 +0000 (17:40 +0100)]
log: remove unused compiler attribute

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agostart: replace compiler attributes
Christian Brauner [Sat, 7 Dec 2019 16:40:05 +0000 (17:40 +0100)]
start: replace compiler attributes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolog: replace compiler attributes
Christian Brauner [Sat, 7 Dec 2019 16:39:49 +0000 (17:39 +0100)]
log: replace compiler attributes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: replace closing helpers
Christian Brauner [Sat, 7 Dec 2019 16:39:03 +0000 (17:39 +0100)]
attach: replace closing helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocompiler: add __unused attribute
Christian Brauner [Sat, 7 Dec 2019 16:38:42 +0000 (17:38 +0100)]
compiler: add __unused attribute

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years ago{log, macro}: remove unused logging functions
Christian Brauner [Sat, 7 Dec 2019 16:31:50 +0000 (17:31 +0100)]
{log, macro}: remove unused logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxccontainer: replace logging functions
Christian Brauner [Sat, 7 Dec 2019 16:31:36 +0000 (17:31 +0100)]
lxccontainer: replace logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile_utils: replace logging functions
Christian Brauner [Sat, 7 Dec 2019 16:31:21 +0000 (17:31 +0100)]
confile_utils: replace logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: rework return values of some functions
Christian Brauner [Sat, 7 Dec 2019 16:30:57 +0000 (17:30 +0100)]
cgroups: rework return values of some functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgroup2_devices: replace logging functions
Christian Brauner [Sat, 7 Dec 2019 16:30:07 +0000 (17:30 +0100)]
cgroups/cgroup2_devices: replace logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgroup: replace logging functions
Christian Brauner [Sat, 7 Dec 2019 16:29:12 +0000 (17:29 +0100)]
cgroups/cgroup: replace logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: replace logging functions
Christian Brauner [Sat, 7 Dec 2019 16:28:06 +0000 (17:28 +0100)]
cgroups/cgfsng: replace logging functions

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfile: replace logging helpers
Christian Brauner [Sat, 7 Dec 2019 16:25:28 +0000 (17:25 +0100)]
confile: replace logging helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agonetwork: replace logging helpers
Christian Brauner [Sat, 7 Dec 2019 16:24:29 +0000 (17:24 +0100)]
network: replace logging helpers

s/error_log_errno(/log_error_errno(-1, /g
s/minus_one_set_errno(/ret_set_errno(-1, /g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: replace logging helpers
Christian Brauner [Sat, 7 Dec 2019 16:23:24 +0000 (17:23 +0100)]
commands: replace logging helpers

s/error_log_errno(/log_error_errno(-1, /g
s/minus_one_set_errno(/ret_set_errno(-1, /g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoattach: s/minus_one_set_errno(/ret_set_errno(-1, /g
Christian Brauner [Sat, 7 Dec 2019 16:22:53 +0000 (17:22 +0100)]
attach: s/minus_one_set_errno(/ret_set_errno(-1, /g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoaf_unix: s/minus_one_set_errno(/ret_set_errno(-1, /g
Christian Brauner [Sat, 7 Dec 2019 16:22:14 +0000 (17:22 +0100)]
af_unix: s/minus_one_set_errno(/ret_set_errno(-1, /g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomacro: add ret_errno()
Christian Brauner [Sat, 7 Dec 2019 16:21:53 +0000 (17:21 +0100)]
macro: add ret_errno()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolog: rearrange
Christian Brauner [Sat, 7 Dec 2019 16:21:18 +0000 (17:21 +0100)]
log: rearrange

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3215 from brauner/cgroup2_controller_delegation
Stéphane Graber [Fri, 6 Dec 2019 14:54:57 +0000 (09:54 -0500)]
Merge pull request #3215 from brauner/cgroup2_controller_delegation

cgroup2: rework controller delegation

4 years agocgroup2: rework controller delegation
Christian Brauner [Fri, 6 Dec 2019 08:42:47 +0000 (09:42 +0100)]
cgroup2: rework controller delegation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3214 from Rachid-Koucha/patch-1
Christian Brauner [Fri, 6 Dec 2019 14:34:14 +0000 (15:34 +0100)]
Merge pull request #3214 from Rachid-Koucha/patch-1

"busy" field init to -1 instead of 0

4 years agoMerge pull request #3213 from blenk92/fix-mount-parsing
Christian Brauner [Fri, 6 Dec 2019 14:10:27 +0000 (15:10 +0100)]
Merge pull request #3213 from blenk92/fix-mount-parsing

config: Fix parsing of mount options

4 years ago"busy" field set to -1 instead of 0
Rachid Koucha [Fri, 6 Dec 2019 14:07:47 +0000 (15:07 +0100)]
"busy" field set to -1 instead of 0

"busy" field is assigned with the command socket descriptor when the terminal is in use. So, use "-1" to disable it.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
4 years ago"busy" field set to 1 instead of 0
Rachid Koucha [Fri, 6 Dec 2019 14:04:31 +0000 (15:04 +0100)]
"busy" field set to 1 instead of 0

"busy" field is assigned with the command socket descriptor when the terminal is in use. So, use "-1" to disable it.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
4 years agoInit "busy" field to -1 as 0 is valid fd
Rachid Koucha [Fri, 6 Dec 2019 13:59:52 +0000 (14:59 +0100)]
Init "busy" field to -1 as 0 is valid fd

"busy" field is assigned with the command socket descriptor when the terminal is in use. So, use "-1" to disable it.
Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
4 years agoconfig: Fix parsing of mount options
Maximilian Blenk [Thu, 5 Dec 2019 15:44:41 +0000 (16:44 +0100)]
config: Fix parsing of mount options

When parsing mount options e.g. from lxc.mount.entry the specified
options are mapped to the flags constants. To do so, the strings
are compared to the options contained in mount_opt. However,
when comparing the strings, the length of the string is not
checked. That entails that the option "rootcontext=selinux-context"
is mapped to the mount option read-only (ro). This commit fixes
this issue by checking if a '=' is contained in the specified option
and additionally comparing the length of the strings.

Signed-off-by: Maximilian Blenk <Maximilian.Blenk@bmw.de>
4 years agoMerge pull request #3204 from brauner/switch_to_spdx
Stéphane Graber [Wed, 4 Dec 2019 14:59:20 +0000 (09:59 -0500)]
Merge pull request #3204 from brauner/switch_to_spdx

lxc: switch to SPDX

4 years agoMerge pull request #3207 from brauner/cgroup2_improvements_2
Stéphane Graber [Wed, 4 Dec 2019 14:57:57 +0000 (09:57 -0500)]
Merge pull request #3207 from brauner/cgroup2_improvements_2

cgroups: improve container cgroup attaching

4 years agocgroups/devices: correctly verify bpf device useability in cgfsng_devices_activate()
Christian Brauner [Wed, 4 Dec 2019 13:03:48 +0000 (14:03 +0100)]
cgroups/devices: correctly verify bpf device useability in cgfsng_devices_activate()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: improve container cgroup attaching
Christian Brauner [Wed, 4 Dec 2019 12:26:54 +0000 (13:26 +0100)]
cgroups: improve container cgroup attaching

The current attach.c codepath which handles moving the attaching process into
the container's cgroups allocates a whole new struct cgroup_ops and goes
through the trouble of reparsing the whole cgroup layout.
That's costly and wasteful. My plan has always been to move this into the
command api by getting fds for attaching back but but it's not worth going
through that hazzle for non-unified hosts. On pure unified hosts however -
being the future - we can just attach through a single fd so there's no need to
allocate and setup struct cgroup_ops.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agolxc: switch to SPDX
Christian Brauner [Tue, 3 Dec 2019 21:04:14 +0000 (22:04 +0100)]
lxc: switch to SPDX

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocommands: use logging return helpers
Christian Brauner [Wed, 4 Dec 2019 12:26:23 +0000 (13:26 +0100)]
commands: use logging return helpers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3205 from brauner/cgroup2_improvements
Stéphane Graber [Wed, 4 Dec 2019 03:57:08 +0000 (22:57 -0500)]
Merge pull request #3205 from brauner/cgroup2_improvements

cgroup: add command to retrieve cgroup2 fd and rework cgroup2 attach

4 years agocgfsng: rework cgroup2 attach
Christian Brauner [Wed, 4 Dec 2019 00:39:20 +0000 (01:39 +0100)]
cgfsng: rework cgroup2 attach

On pure unified systemd we can use a single file descriptor to interact with
the cgroup filesystem. Add a method to retrieve it and as a start use it in our
unified attach codepath.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/devices: do not log error when bpf device feature is not available
Christian Brauner [Tue, 3 Dec 2019 23:55:42 +0000 (00:55 +0100)]
cgroups/devices: do not log error when bpf device feature is not available

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3203 from brauner/freezer_fixes
Stéphane Graber [Tue, 3 Dec 2019 22:41:11 +0000 (17:41 -0500)]
Merge pull request #3203 from brauner/freezer_fixes

freezer: cleanup

4 years agoMerge pull request #2842 from brauner/2019-02-11/fix_licensing
Christian Brauner [Tue, 3 Dec 2019 19:39:25 +0000 (20:39 +0100)]
Merge pull request #2842 from brauner/2019-02-11/fix_licensing

tree-wide: Fix inconsistent license headers

4 years agofreezer: cleanup
Christian Brauner [Tue, 3 Dec 2019 16:33:11 +0000 (17:33 +0100)]
freezer: cleanup

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3178 from xinhua9569/master
Christian Brauner [Tue, 3 Dec 2019 19:25:18 +0000 (20:25 +0100)]
Merge pull request #3178 from xinhua9569/master

conf: fix memory leak for set config rootfs options

4 years agoMerge pull request #3202 from brauner/cgroup2_freezer_fixes
Stéphane Graber [Tue, 3 Dec 2019 15:34:49 +0000 (10:34 -0500)]
Merge pull request #3202 from brauner/cgroup2_freezer_fixes

cgroups/freezer: rework cgroup2 freezer feature usage

4 years agocgroups/freezer: fix and improve cgroup2 freezer implementation
Christian Brauner [Tue, 3 Dec 2019 01:23:34 +0000 (02:23 +0100)]
cgroups/freezer: fix and improve cgroup2 freezer implementation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups: add DEFAULT_MOUNTPOINT #define
Christian Brauner [Tue, 3 Dec 2019 00:24:55 +0000 (01:24 +0100)]
cgroups: add DEFAULT_MOUNTPOINT #define

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3196 from brauner/cgroup2_devices_fixes_2
Stéphane Graber [Mon, 2 Dec 2019 01:52:08 +0000 (20:52 -0500)]
Merge pull request #3196 from brauner/cgroup2_devices_fixes_2

cgroups/devices: use dedicated enums

4 years agocgroups/devices: use dedicated enums
Christian Brauner [Sun, 1 Dec 2019 23:50:06 +0000 (00:50 +0100)]
cgroups/devices: use dedicated enums

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3195 from brauner/cgroup2_devices_fixes
Stéphane Graber [Sun, 1 Dec 2019 20:17:34 +0000 (15:17 -0500)]
Merge pull request #3195 from brauner/cgroup2_devices_fixes

cgroup2: add bpf device controller live update

4 years agocgroups/devices: introduce ebpf device cgroup global rule types
Christian Brauner [Sun, 1 Dec 2019 18:39:48 +0000 (19:39 +0100)]
cgroups/devices: introduce ebpf device cgroup global rule types

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/devices: handle NULL
Christian Brauner [Sun, 1 Dec 2019 17:25:00 +0000 (18:25 +0100)]
cgroups/devices: handle NULL

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconfigure: enable -Wunused-but-set-variable
Christian Brauner [Sun, 1 Dec 2019 16:04:43 +0000 (17:04 +0100)]
configure: enable -Wunused-but-set-variable

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: implement cgroup2 device controller live update
Christian Brauner [Sat, 30 Nov 2019 18:33:19 +0000 (19:33 +0100)]
cgroups/cgfsng: implement cgroup2 device controller live update

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoconf: record cgroup2 devices in parsed format
Christian Brauner [Sat, 30 Nov 2019 15:05:44 +0000 (16:05 +0100)]
conf: record cgroup2 devices in parsed format

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agocgroups/cgfsng: "atomically" replace bpf device programs
Christian Brauner [Sat, 30 Nov 2019 14:21:00 +0000 (15:21 +0100)]
cgroups/cgfsng: "atomically" replace bpf device programs

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agomacro: remove unused macros
Christian Brauner [Sat, 30 Nov 2019 14:00:29 +0000 (15:00 +0100)]
macro: remove unused macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoapi_extension: add cgroup2_devices api extension
Christian Brauner [Sun, 1 Dec 2019 10:55:19 +0000 (11:55 +0100)]
api_extension: add cgroup2_devices api extension

This will only be defined if liblxc was even compiled with bpf supported.
Support itself will be determined at runtime by liblxc itself.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3194 from brauner/cgroup2_devices
Stéphane Graber [Fri, 29 Nov 2019 19:28:27 +0000 (14:28 -0500)]
Merge pull request #3194 from brauner/cgroup2_devices

cgroups: add cgroup2 device controller support

4 years agocgroups: add cgroup2 device controller support
Christian Brauner [Thu, 28 Nov 2019 15:22:36 +0000 (16:22 +0100)]
cgroups: add cgroup2 device controller support

Add a bpf-based device controller implementation.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3193 from lifeng68/master
Christian Brauner [Wed, 27 Nov 2019 08:17:37 +0000 (09:17 +0100)]
Merge pull request #3193 from lifeng68/master

cgfsng: return attach fail if container stopped

4 years agocgfsng: return attach fail if container stopped
LiFeng [Wed, 27 Nov 2019 08:59:23 +0000 (03:59 -0500)]
cgfsng: return attach fail if container stopped

Signed-off-by: LiFeng <lifeng68@huawei.com>
4 years agoconf: fix memory leak for set config rootfs options
dongxinhua [Thu, 21 Nov 2019 14:20:20 +0000 (22:20 +0800)]
conf: fix memory leak for set config rootfs options

Signed-off-by: dongxinhua <dongxinhua@huawei.com>
4 years agoMerge pull request #3190 from idatahu/fix_ovs_log
Stéphane Graber [Wed, 20 Nov 2019 21:44:06 +0000 (16:44 -0500)]
Merge pull request #3190 from idatahu/fix_ovs_log

fix wrong order of bridge/nic in error message

4 years agofix wrong order of bridge/nic in error message
Balázs Póka [Wed, 20 Nov 2019 19:57:28 +0000 (20:57 +0100)]
fix wrong order of bridge/nic in error message

Signed-off-by: Balázs Póka <poka@idata.hu>
4 years agoMerge pull request #3189 from Rachid-Koucha/patch-2
Christian Brauner [Wed, 20 Nov 2019 12:05:46 +0000 (13:05 +0100)]
Merge pull request #3189 from Rachid-Koucha/patch-2

Typo in a comment

4 years agoTypo in a comment
Rachid Koucha [Wed, 20 Nov 2019 12:03:47 +0000 (13:03 +0100)]
Typo in a comment

"above" was used instead of "below"

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
4 years agoMerge pull request #3187 from brauner/launchpad_bug_1848587
Stéphane Graber [Tue, 19 Nov 2019 17:29:58 +0000 (12:29 -0500)]
Merge pull request #3187 from brauner/launchpad_bug_1848587

tests: use /dev/null instead of /dev/network_latency

4 years agotests: use /dev/loop-control instead of /dev/network_latency
Christian Brauner [Mon, 18 Nov 2019 14:08:22 +0000 (15:08 +0100)]
tests: use /dev/loop-control instead of /dev/network_latency

BugLink: https://bugs.launchpad.net/bugs/1848587
The latter device has been removed apparently.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3184 from ffontaine/master
Christian Brauner [Mon, 11 Nov 2019 22:22:19 +0000 (23:22 +0100)]
Merge pull request #3184 from ffontaine/master

configure.ac: fix build on toolchain without SSP

4 years agoconfigure.ac: fix build on toolchain without SSP
Fabrice Fontaine [Mon, 11 Nov 2019 21:55:36 +0000 (22:55 +0100)]
configure.ac: fix build on toolchain without SSP

Commit 3b5a0eebd4d2efdaa03c6fb11950abfcf081fab8 reverted
3aa7271157d3c815a4426c1f8eaea2f3b6dafa6a resulting in lxc being unable
to be built on toolchain without SSP support

Fixes:
 - http://autobuild.buildroot.org/results/57945f54ffbc5c8764b6891a4516c4907e56ab97

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years agoMerge pull request #3182 from aadi123/master
Stéphane Graber [Sat, 9 Nov 2019 18:49:27 +0000 (13:49 -0500)]
Merge pull request #3182 from aadi123/master

Update cgroup.h

4 years agoUpdate cgroup.h
Aaditya Murthy [Sat, 9 Nov 2019 18:17:08 +0000 (12:17 -0600)]
Update cgroup.h

Fixed the documentation to say that cgroupv2 uses a unified hierarchy
Signed-off-by: Aaditya Murthy <amurthy123@utexas.edu>
4 years agoMerge pull request #3180 from brauner/2019-11-06/terminal_fixes
Stéphane Graber [Wed, 6 Nov 2019 13:39:10 +0000 (08:39 -0500)]
Merge pull request #3180 from brauner/2019-11-06/terminal_fixes

terminal: bugfixes

4 years agoterminal: prevent returning invalid pointer
Christian Brauner [Wed, 6 Nov 2019 13:08:55 +0000 (14:08 +0100)]
terminal: prevent returning invalid pointer

Closes: https://github.com/lxc/lxd/issues/6408
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoterminal: make lxc_terminal_signal_fini() static
Christian Brauner [Wed, 6 Nov 2019 13:03:43 +0000 (14:03 +0100)]
terminal: make lxc_terminal_signal_fini() static

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3177 from hallyn/2019-11-01/mapself
Christian Brauner [Mon, 4 Nov 2019 14:44:11 +0000 (15:44 +0100)]
Merge pull request #3177 from hallyn/2019-11-01/mapself

lxc-usernsexec: support easily mapping own uid

4 years agolxc-usernsexec: support easily mapping own uid
Serge Hallyn [Fri, 1 Nov 2019 05:34:02 +0000 (00:34 -0500)]
lxc-usernsexec: support easily mapping own uid

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
4 years agoMerge pull request #3175 from ralt/pr/execute-attach-exit-code-tests
Christian Brauner [Wed, 30 Oct 2019 11:10:00 +0000 (12:10 +0100)]
Merge pull request #3175 from ralt/pr/execute-attach-exit-code-tests

tests: add tests making sure the exit code is appropriate.

4 years agotests: add tests making sure the exit code is appropriate.
Florian Margaine [Tue, 29 Oct 2019 09:53:17 +0000 (10:53 +0100)]
tests: add tests making sure the exit code is appropriate.

lxc2 broke this feature for lxc-execute, and lxc3 broke it for
lxc-attach. This adds a test making sure we don't do the same mistake
a third time.

Signed-off-by: Florian Margaine <florian@platform.sh>
4 years agoMerge pull request #3174 from Blub/2019-10-29/terminal-init-null-on-error
Stéphane Graber [Tue, 29 Oct 2019 08:29:17 +0000 (09:29 +0100)]
Merge pull request #3174 from Blub/2019-10-29/terminal-init-null-on-error

terminal: return NULL on error in terminal_signal_init

4 years agoterminal: return NULL on error in terminal_signal_init
Wolfgang Bumiller [Tue, 29 Oct 2019 07:42:59 +0000 (08:42 +0100)]
terminal: return NULL on error in terminal_signal_init

Callers expect a NULL on error, and with PR #3171 marking
the pointer as __do_free, we now return a pointer to freed
memory here otherwise.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoMerge pull request #3171 from brauner/bugfixes
Stéphane Graber [Fri, 25 Oct 2019 13:38:25 +0000 (09:38 -0400)]
Merge pull request #3171 from brauner/bugfixes

terminal: prevent memory leak for lxc_terminal_state

4 years agoterminal: prevent memory leak for lxc_terminal_state
Christian Brauner [Fri, 25 Oct 2019 09:45:55 +0000 (11:45 +0200)]
terminal: prevent memory leak for lxc_terminal_state

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
4 years agoMerge pull request #3169 from Blub/2019-10-23/aa_prevent_proc-acpi
Christian Brauner [Wed, 23 Oct 2019 09:02:37 +0000 (11:02 +0200)]
Merge pull request #3169 from Blub/2019-10-23/aa_prevent_proc-acpi

apparmor: Prevent writes to /proc/acpi/**

4 years agoapparmor: Prevent writes to /proc/acpi/**
Wolfgang Bumiller [Wed, 23 Oct 2019 08:53:21 +0000 (10:53 +0200)]
apparmor: Prevent writes to /proc/acpi/**

Same as #3117.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agoMerge pull request #3168 from havmind/memfd_create_powerpc
Christian Brauner [Tue, 22 Oct 2019 12:09:47 +0000 (14:09 +0200)]
Merge pull request #3168 from havmind/memfd_create_powerpc

syscall_wrappers: rename internal memfd_create to memfd_create_lxc

4 years agosyscall_wrappers: rename internal memfd_create to memfd_create_lxc
Patrick Havelange [Tue, 22 Oct 2019 10:29:54 +0000 (12:29 +0200)]
syscall_wrappers: rename internal memfd_create to memfd_create_lxc

In case the internal memfd_create has to be used, make sure we don't
clash with the already existing memfd_create function from glibc.

This can happen if this glibc function is a stub. In this case, at
./configure time, the test for this function will return false, however
the declaration of that function is still available. This leads to
compilation errors.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
4 years agoMerge pull request #3161 from tomponline/tp-lxc-destroy
Christian Brauner [Mon, 14 Oct 2019 09:21:01 +0000 (11:21 +0200)]
Merge pull request #3161 from tomponline/tp-lxc-destroy

lxc/tools/lxc/destroy: Restores error message on container destroy

4 years agolxc/tools/lxc/destroy: Restores error message on container destroy
Thomas Parrott [Mon, 14 Oct 2019 09:10:21 +0000 (10:10 +0100)]
lxc/tools/lxc/destroy: Restores error message on container destroy

Partially reverts 65b92ea5fcab559fd21be2685bd2f15ef6d33532 so that trying to destroy a non-existent container gives an error message.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
4 years agoMerge pull request #3160 from tenforward/japanese
Stéphane Graber [Sat, 12 Oct 2019 16:49:52 +0000 (12:49 -0400)]
Merge pull request #3160 from tenforward/japanese

Update lxc.containers.conf(5) in Japanese

4 years agoUpdate lxc.containers.conf(5) in Japanese
KATOH Yasufumi [Sat, 12 Oct 2019 16:39:52 +0000 (01:39 +0900)]
Update lxc.containers.conf(5) in Japanese

Update for commit 767bd70

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
4 years agoMerge pull request #3159 from Rachid-Koucha/patch-1
Stéphane Graber [Sat, 12 Oct 2019 16:29:31 +0000 (12:29 -0400)]
Merge pull request #3159 from Rachid-Koucha/patch-1

Bad sgml/man translation

4 years agoBad sgml/man translation
Rachid Koucha [Sat, 12 Oct 2019 11:05:50 +0000 (13:05 +0200)]
Bad sgml/man translation

When calling "man lxc.container.conf", an internal "man" keyword is displayed :

$ man lxc.container.conf
[...]
lxc.mount.entry
              Specify a mount point corresponding to a line in the fstab format.  Moreover lxc supports mount  propagation,  such  as
              rslave  or  rprivate, and adds three additional mount options.  optional don't fail if mount does not work.  create=dir
              or create=file to create dir (or file) when the point will be mounted.  relative source path is taken to be relative to
              the mounted container root. For instance,

dev/null proc/kcore none bind,relative 0 0
              .fi     <-----------------------------------UNEXPECTED KEYWORD !!!!

The problem seems to come from the missing blanks before "dev/null proc/kcore none bind,relative 0 0"

Moreover, for homogeneity purposes, it is better to use the "programlisting" tag used in the rest of the text instead of  "screen".

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>