Commit Graph

9423 Commits

Author SHA1 Message Date
Thomas Parrott
26da53c3ac network: Adds check for bridge link interface existence in instantiate_veth
To avoid misleading errors about openvswitch when non-existent bridge link interface specified.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Thomas Parrott
372adece8b macro: Adds UINT_TO_PTR and PTR_TO_USHORT helpers
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-08 13:27:07 +01:00
Christian Brauner
bdf4616595
Merge pull request #3434 from tomponline/tp-copying
.gitignore: Ignores COPYING file created by make
2020-06-03 12:54:32 +02:00
Thomas Parrott
5d34397461 .gitignore: Ignores COPYING file created by make
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
2020-06-03 11:16:11 +01:00
Christian Brauner
a65e1458d2
Merge pull request #3432 from smoser/fix/lxc-usernsexec-test-do-create-user
lxc-test-usernsexec: If user is root, then create and use non-root user.
2020-06-02 15:03:36 +02:00
Scott Moser
4c93c06e9f lxc-test-usernsexec: If user is root, then create and use non-root user.
Previously if the user was root, then the test would just skip
running (and exit 0).  The lxc test environment is run as root.
So, instead of never doing anything there, we create a user,
make sure it is in /etc/sub{ug}id and then execute the test as that
user.

If user is already non-root, then just execute the tests as before.

Signed-off-by: Scott Moser <smoser@brickies.net>
2020-06-01 12:33:58 -04:00
Stéphane Graber
a3ab5b5d10
Merge pull request #3428 from smoser/test/add-usernsexec-test
Add test of lxc-usernsexec
2020-05-29 16:42:04 -04:00
Scott Moser
9026f5c25e Add test of lxc-usernsexec
The test executes lxc-usernsexec to create some files and chmod them.
Then makes assertions on the uid and gid of those files from outside.

Signed-off-by: Scott Moser <smoser@brickies.net>
2020-05-29 15:52:30 -04:00
Stéphane Graber
d4ff364247
Merge pull request #3424 from brauner/2020-05-25/fixes
api_extensions: add "pidfd"
2020-05-25 14:03:32 -04:00
Christian Brauner
71d53a5ca7
api_extensions: add "pidfd"
Somehow it's documented but wasn't ever added.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-25 19:49:10 +02:00
Stéphane Graber
445f47ead8
travis: Restrict coverity to gcc on bionic on amd64
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-05-22 13:28:24 -04:00
Stéphane Graber
fbe48de489
Merge pull request #3422 from brauner/2020-05-20/usernsexec_fixes
lxc-usernsexec: improvements
2020-05-20 08:54:42 -04:00
Christian Brauner
158d119f90
lxc-usernsexec: don't fail on setgroups()
We can fail to setgroups() when "deny" has been set which we need to set when
we are a fully unprivileged user.

Closes: 3420.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-20 12:15:02 +02:00
Christian Brauner
7cf6e24d07
lxc-usernsexec: dumb down from error to warning message
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-20 12:10:54 +02:00
Christian Brauner
2b5d8a439c
Merge pull request #3419 from brauner/2020-05-19/network_phys_fixes
network: use __instantiate_ns_common() in instantiate_ns_phys() too
2020-05-19 10:33:55 +02:00
Christian Brauner
9d0406c79d
network: use __instantiate_ns_common() in instantiate_ns_phys() too
Fixes: https://lists.linuxcontainers.org/pipermail/lxc-users/2020-May/015245.html
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-19 09:09:40 +02:00
Stéphane Graber
b23d806cb2
Merge pull request #3418 from brauner/2020-05-18/android_fixes
bionic: s/lxc_raw_execveat()/execveat()/g
2020-05-18 14:19:10 -04:00
Christian Brauner
b164903bcd
bionic: s/lxc_raw_execveat()/execveat()/g
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-18 20:02:37 +02:00
Stéphane Graber
fe2227c9fa
Merge pull request #3417 from brauner/2020-05-15/fixes
network: fix {mac,ip,v}lan device creation
2020-05-18 12:41:21 -04:00
Christian Brauner
9f8cf6e110
network: fix {mac,ip,v}lan device creation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-18 17:11:26 +02:00
Stéphane Graber
7c1970fa70
Merge pull request #3415 from brauner/2020-05-15/fixes
network: restore old behavior
2020-05-17 21:35:35 -04:00
Christian Brauner
717f77f2f3
network: restore old behavior
I introduced a regression: when users didn't specify a specific name via
lxc.net.<idx>.name then the device would retain the random name it received
when we created it. Before we would use the "eth%d" syntax to get the kernel to
assign a fixed name. Restore that behavior.

Closes: #3407.
Fixes: 8bf64b77ac ("network: rework network device creation")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 21:17:48 +02:00
Serge Hallyn
c0bdef23eb
Merge pull request #3412 from brauner/2020-05-15/clone3
clone3: add infrastructure and switch container creation to it
2020-05-15 14:01:35 -05:00
Christian Brauner
748166a39b
Merge pull request #3414 from Blub/get-cgroup-path-compat
improve LXC_CMD_GET_CGROUP compatibility
2020-05-15 19:14:11 +02:00
Wolfgang Bumiller
400d579e69 improve LXC_CMD_GET_CGROUP compatibility
When a newer lxc library communicates with an older one
(such as running an lxc 4.0 lxc-freeze on a longer running
container which was started while lxc was still at version
3), the LXC_CMD_GET_LIMITING_CGROUP command is not
available, causing the remote to just close the socket.
Catch this and try the previous command instead.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 16:33:34 +02:00
Christian Brauner
04a49a1452
cgroups: be less alarming when creating cgroups
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 16:08:31 +02:00
Christian Brauner
2f46fe6e7a
process_utils: make lxc use clone3() whenever possible
No more weird api quirks between architectures and cool new features.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 16:08:31 +02:00
Christian Brauner
6b641ce4f0
Merge pull request #3413 from Blub/dont-busy-loop-on-freeze
Don't busy loop on freeze with cgroupv2
2020-05-15 15:59:50 +02:00
Wolfgang Bumiller
385e58e8a8 cgfsng: use EPOLLPRI when polling cgroup.events
EPOLLIN will always be true and therefore end up
busy-looping

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:07:36 +02:00
Wolfgang Bumiller
443be56560 cgfsng: deduplicate freeze code
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:07:07 +02:00
Wolfgang Bumiller
9d1c51d19e mainloop: add lxc_mainloop_add_handler_events
in order to be able to listen for EPOLLPRI

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-15 15:06:39 +02:00
Christian Brauner
96086a6b7b
process_utils: add clone3() support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 13:42:56 +02:00
Christian Brauner
f40988c773
process_utils: introduce new process_utils.{c,h}
This will be the central place for all process management helpers. This also
removes raw_syscalls.{c,h}.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 12:32:28 +02:00
Christian Brauner
923d3a2dba
syscall_numbers: add clone3()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 11:48:25 +02:00
Christian Brauner
78ae61d86c
syscall_numbers: handle ia64 syscall numbers correctly
They are offset by 1024.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-15 11:44:46 +02:00
Stéphane Graber
94f544e445
Merge pull request #3411 from brauner/master
console: only create detached mount when a console is requested
2020-05-14 15:19:45 -04:00
Christian Brauner
efbfe93ff4
console: only create detached mount when a console is requested
otherwise weird things might happen.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-14 18:30:43 +02:00
Stéphane Graber
656335920f
Merge pull request #3410 from brauner/2020-05-13/fixes
reboot fixes
2020-05-13 15:23:45 -04:00
Christian Brauner
4e2d6b9a8d
log: cleanup syslog handling
Disable and enable syslog around lxc_check_inherited().

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 14:35:54 +02:00
Christian Brauner
85c279bbab
start: cleanup file descriptor inheritance
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 13:21:41 +02:00
Christian Brauner
a42abccecc
start: fix container reboot
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:59:59 +02:00
Christian Brauner
f1426d583c
lxccontainer: use close_prot_errno_disarm() on state_socket_pair
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:39:28 +02:00
Christian Brauner
824c5efae3
start: remove unused lxc_zero_handler()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:32:38 +02:00
Christian Brauner
fb1a080daf
lxccontainer: small cleanup to lxc_check_inherited() calls
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-13 12:25:25 +02:00
Stéphane Graber
bee9ba72b8
Merge pull request #3408 from brauner/2020-05-11/fixes
network: fix key ordering independence
2020-05-12 10:32:00 -04:00
Christian Brauner
756cadb6ab
confile: fix order independence of network keys
We need to make sure we don't overwrite values when they have already been set.

Closes: #3405.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-11 22:16:59 +02:00
Christian Brauner
598b35b421
tools/lxc-ls: shut up lgtm more
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-11 09:16:33 +02:00
Stéphane Graber
57140e5a34
Merge pull request #3403 from brauner/2020-05-07/fixes
fixes
2020-05-07 10:11:42 -04:00
Christian Brauner
a201349b34
tools/lxc-ls: shutup lgtm
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-07 15:01:30 +02:00
Christian Brauner
c89e6d5843
yum: remove unused module
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-07 14:56:26 +02:00