Commit Graph

8686 Commits

Author SHA1 Message Date
Stéphane Graber
bbebc423bf
Merge pull request #2900 from brauner/2019-03-11/2826
btrfs: ensure \0 byte at end
2019-03-11 10:55:02 -04:00
Christian Brauner
317e6a8348
btrfs: ensure \0 byte at end
Apparently the name received from the tree walk is not guaranteed to have \0
byte at the end. So let's make sure we append one.
Note that this is only an issue if there are any subvolumes in the container's
rootfs.

Closes 2826.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-11 12:48:50 +01:00
Stéphane Graber
7f240f4756
Merge pull request #2898 from brauner/2019-03-10/fix_post_stop_hooks
hooks: drop namespace references before post-stop
2019-03-10 20:52:35 -04:00
Christian Brauner
048493a307
hooks: drop namespace references before post-stop
Callers such as LXD run post-stop hooks to perform cleanup operations on
shutdown. This can involve umount and other things. To avoid surprises with
lingering namespace references we should close all our namespace-preserving
file descriptors. We don't need them at this point anymore anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-10 11:46:18 +01:00
Christian Brauner
75df77797b
Merge pull request #2897 from TheSeven/master
Fix lxc.cgroup2.<controller> on cgroup2-only systems
2019-03-07 00:26:34 +01:00
Michael Sparmann
908e0ee512 Fix lxc.cgroup2.<controller> on cgroup2-only systems
Signed-off-by: Michael Sparmann <theseven@gmx.net>
2019-03-07 00:13:26 +01:00
Stéphane Graber
31d55f8ffb
Merge pull request #2896 from brauner/lxc/master
conf: avoid compiler warning
2019-03-05 13:42:54 -05:00
Christian Brauner
41e0074919
conf: avoid compiler warning
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-05 19:29:38 +01:00
Christian Brauner
1ae05901cc
Revert "conf: Fixes unitialised variable."
This reverts commit 912c4bb474.

I accidently merged this commit. The initialization is wrong.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-05 19:28:52 +01:00
Christian Brauner
b5bd9e1172
Merge pull request #2895 from tomponline/tp-2019-03-05/minor-fix
conf: Fixes uninitialised variable.

> @brauner clang is failing but gcc passes, would it be OK to initialise this to 0?

He, unfortunately not. :)
What would happen now is that you'd close `stdin` on a standard system. What you'd want is `= -EBADF`. :)
2019-03-05 19:27:32 +01:00
tomponline
912c4bb474 conf: Fixes unitialised variable.
Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-05 16:56:42 +00:00
Stéphane Graber
859ce01182
Merge pull request #2893 from brauner/2019-03-04/minor_tweaks
minor tweaks
2019-03-05 02:45:46 +01:00
Christian Brauner
f766251429
confile: make parse_limit_value() static
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-04 20:42:12 +01:00
Christian Brauner
5648fc191c
confile_utils: make update_hwaddr() static
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-04 20:42:11 +01:00
Christian Brauner
3db41a6cf0
confile_utils: lxc_config_net_is_hwaddr()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-04 20:42:11 +01:00
Stéphane Graber
8690bff178
Merge pull request #2891 from brauner/2019-03-03/update_license_headers
tree-wide: fix wrong licensing
2019-03-04 19:13:24 +01:00
Serge Hallyn
fff69e468f
Merge pull request #2884 from brauner/2019-03-01/kill_fgets
tree-wide: kill fgets()
2019-03-04 09:19:07 -06:00
Christian Brauner
84b31b36b1
Merge pull request #2889 from tomponline/tp-2019-03-02/bugfixes
gcc -Wall flag compat
2019-03-04 10:36:30 +01:00
tomponline
ea83b296ff cmd: shut up gcc.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:37:16 +00:00
tomponline
63fce0c117 storage: shut up gcc and remove unused variables.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:33:51 +00:00
tomponline
dcd9a847d6 start: shut up gcc.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:27:59 +00:00
tomponline
2db56bd695 monitor: shut up gcc.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:25:42 +00:00
tomponline
b029371090 network: shut up gcc.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:23:39 +00:00
tomponline
7a99b5a03a lxccontainer: shut up gcc and remove unused variables.
Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:20:59 +00:00
tomponline
8839610197 cgroups: shut up gcc
Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 08:09:57 +00:00
tomponline
7717e175f5 cgroups: remove unused variables
Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 07:59:33 +00:00
tomponline
7c737378f9 attacg: shut up gcc
Invalid warning but let's please the compiler.

Closes lxc#2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 07:59:33 +00:00
tomponline
aa26c8e2b5 attach: remove unused variable
Closes lxc#2885.

Signed-off-by: tomponline <tomp@tomp.uk>
2019-03-04 07:59:33 +00:00
Christian Brauner
601b35e7ac
string_utils.c: fix wrong licensing
liblxc has always been meant to be LGPLv2.1+ as reflected by the many
downstreams projects and bindings which are themselves under LGPLv2.1+ or other
licenses which would be incompatible with linking against a GPLv2+ library.

It's pretty normal for a library to be LGPL while binaries are GPL as a GPL
library would only ever be usable by other GPL-only projects, which isn't the
case for very many of the liblxc downstreams.

The issue here is really carelessness. None of those GPL headers were put there
intentionally, instead being wrongly copy/pasted from other parts of the
codebase which is indeed intended to be GPLv2+. This is also made clear in our
CONTRIBUTING file in this repository:

Licensing for new files:
------------------------

LXC is made of files shipped under a few different licenses.

Anything that ends up being part of the LXC library needs to be released
under LGPLv2.1+ or a license compatible with it (though the latter will
only be accepted for cases where the code originated elsewhere and was
imported into LXC).

Language bindings for the libraries need to be released under LGPLv2.1+.

Anything else (non-libraries) needs to be Free Software and needs to be
allowed to link with LGPLv2.1+ code (if needed). LXC upstream prefers
LGPLv2.1+ or GPLv2 for those.

When introducing a new file into the project, please make sure it has a
copyright header making clear under which license it's being released
and if it doesn't match the criteria described above, please explain
your decision on the lxc-devel mailing-list when submitting your patch.

This is intended to switch over files to LGPLv2.1+ to which end we have
collected ACKs from relevant people.
/* Affected People */
Christian Brauner <christian.brauner@ubuntu.com>
Donghwa Jeong <dh48.jeong@samsung.com>

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Donghwa Jeong <dh48.jeong@samsung.com>
2019-03-03 14:19:23 +01:00
Christian Brauner
8d01f531c2
file_utils.c: fix wrong licensing
liblxc has always been meant to be LGPLv2.1+ as reflected by the many
downstreams projects and bindings which are themselves under LGPLv2.1+ or other
licenses which would be incompatible with linking against a GPLv2+ library.

It's pretty normal for a library to be LGPL while binaries are GPL as a GPL
library would only ever be usable by other GPL-only projects, which isn't the
case for very many of the liblxc downstreams.

The issue here is really carelessness. None of those GPL headers were put there
intentionally, instead being wrongly copy/pasted from other parts of the
codebase which is indeed intended to be GPLv2+. This is also made clear in our
CONTRIBUTING file in this repository:

Licensing for new files:
------------------------

LXC is made of files shipped under a few different licenses.

Anything that ends up being part of the LXC library needs to be released
under LGPLv2.1+ or a license compatible with it (though the latter will
only be accepted for cases where the code originated elsewhere and was
imported into LXC).

Language bindings for the libraries need to be released under LGPLv2.1+.

Anything else (non-libraries) needs to be Free Software and needs to be
allowed to link with LGPLv2.1+ code (if needed). LXC upstream prefers
LGPLv2.1+ or GPLv2 for those.

When introducing a new file into the project, please make sure it has a
copyright header making clear under which license it's being released
and if it doesn't match the criteria described above, please explain
your decision on the lxc-devel mailing-list when submitting your patch.

This is intended to switch over files to LGPLv2.1+ to which end we have
collected ACKs from relevant people.
/* Affected People */
Christian Brauner <christian.brauner@ubuntu.com>
Donghwa Jeong <dh48.jeong@samsung.com>

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Donghwa Jeong <dh48.jeong@samsung.com>
2019-03-03 14:19:23 +01:00
Christian Brauner
0fb44ac949
commands_utils.h: fix wrong licensing
liblxc has always been meant to be LGPLv2.1+ as reflected by the many
downstreams projects and bindings which are themselves under LGPLv2.1+ or other
licenses which would be incompatible with linking against a GPLv2+ library.

It's pretty normal for a library to be LGPL while binaries are GPL as a GPL
library would only ever be usable by other GPL-only projects, which isn't the
case for very many of the liblxc downstreams.

The issue here is really carelessness. None of those GPL headers were put there
intentionally, instead being wrongly copy/pasted from other parts of the
codebase which is indeed intended to be GPLv2+. This is also made clear in our
CONTRIBUTING file in this repository:

Licensing for new files:
------------------------

LXC is made of files shipped under a few different licenses.

Anything that ends up being part of the LXC library needs to be released
under LGPLv2.1+ or a license compatible with it (though the latter will
only be accepted for cases where the code originated elsewhere and was
imported into LXC).

Language bindings for the libraries need to be released under LGPLv2.1+.

Anything else (non-libraries) needs to be Free Software and needs to be
allowed to link with LGPLv2.1+ code (if needed). LXC upstream prefers
LGPLv2.1+ or GPLv2 for those.

When introducing a new file into the project, please make sure it has a
copyright header making clear under which license it's being released
and if it doesn't match the criteria described above, please explain
your decision on the lxc-devel mailing-list when submitting your patch.

This is intended to switch over files to LGPLv2.1+ to which end we have
collected ACKs from relevant people.
/* Affected People */
Christian Brauner <christian.brauner@ubuntu.com>
Donghwa Jeong <dh48.jeong@samsung.com>

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Donghwa Jeong <dh48.jeong@samsung.com>
2019-03-03 14:19:23 +01:00
Christian Brauner
ddaa52263a
commands_utils.c: fix wrong licensing
liblxc has always been meant to be LGPLv2.1+ as reflected by the many
downstreams projects and bindings which are themselves under LGPLv2.1+ or other
licenses which would be incompatible with linking against a GPLv2+ library.

It's pretty normal for a library to be LGPL while binaries are GPL as a GPL
library would only ever be usable by other GPL-only projects, which isn't the
case for very many of the liblxc downstreams.

The issue here is really carelessness. None of those GPL headers were put there
intentionally, instead being wrongly copy/pasted from other parts of the
codebase which is indeed intended to be GPLv2+. This is also made clear in our
CONTRIBUTING file in this repository:

Licensing for new files:
------------------------

LXC is made of files shipped under a few different licenses.

Anything that ends up being part of the LXC library needs to be released
under LGPLv2.1+ or a license compatible with it (though the latter will
only be accepted for cases where the code originated elsewhere and was
imported into LXC).

Language bindings for the libraries need to be released under LGPLv2.1+.

Anything else (non-libraries) needs to be Free Software and needs to be
allowed to link with LGPLv2.1+ code (if needed). LXC upstream prefers
LGPLv2.1+ or GPLv2 for those.

When introducing a new file into the project, please make sure it has a
copyright header making clear under which license it's being released
and if it doesn't match the criteria described above, please explain
your decision on the lxc-devel mailing-list when submitting your patch.

This is intended to switch over files to LGPLv2.1+ to which end we have
collected ACKs from relevant people.
/* Affected People */
Christian Brauner <christian.brauner@ubuntu.com>
Donghwa Jeong <dh48.jeong@samsung.com>

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: Donghwa Jeong <dh48.jeong@samsung.com>
2019-03-03 14:17:15 +01:00
Stéphane Graber
9fc7a50f8a
Merge pull request #2887 from brauner/2019-03-01/coding_style_updates
CODING_STYLE: update
2019-03-02 11:27:19 +01:00
Stéphane Graber
e096ae3c40
Merge pull request #2886 from brauner/2019-03-01/bugfixes
minor fixes
2019-03-02 11:26:54 +01:00
Christian Brauner
40f125b48d
Merge pull request #2888 from kubiko/fix-android-compile
Fix android compilation
2019-03-02 00:41:00 +01:00
Ondrej Kubik
dbcbf27055 Fix android compilation
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2019-03-01 23:19:29 +00:00
Christian Brauner
af32408ac1
CODING_STYLE: update
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 21:27:39 +01:00
Christian Brauner
0cacddda88
confile: shut up gcc
Invalid warning but let's please the compiler.

Closes #2885.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 21:15:49 +01:00
Christian Brauner
c1b07e059f
conf: remove unused variable
Closes #2885.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 21:15:20 +01:00
Christian Brauner
f1170ed236
initutils: remove fgets() from setproctitle()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 21:08:28 +01:00
Christian Brauner
55d830d816
initutils: remove fgets() from lxc_global_con[...]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 20:58:49 +01:00
Christian Brauner
c4382ee266
utils: remove fgets() from is_shared_mountpoint()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 20:58:49 +01:00
Christian Brauner
f3d38164ea
conf: remove fgets() from lxc_chroot()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 20:58:49 +01:00
Christian Brauner
ebf3a6af23
conf: remove fgets() from run_buffer()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-03-01 12:17:46 +01:00
Stéphane Graber
e613d684fa
Merge pull request #2882 from misterunknown/master
gpg: use proxy, if http_proxy is set
2019-02-28 10:34:13 +01:00
Marco Dickert
4144080156 gpg: use proxy, if http_proxy is set
Signed-off-by: Marco Dickert <marco@misterunknown.de>
2019-02-28 10:03:16 +01:00
Christian Brauner
1fe8dffad6
Merge pull request #2881 from Blub/2019-02-25/lxc-attach-move_fd
attach: use move_fd in lxc_proc_close_ns_fd
2019-02-25 17:19:15 +01:00
Wolfgang Bumiller
5f9facdac9 attach: use move_fd in lxc_proc_close_ns_fd
Previously this set `ctx->ns_fd[*]` to `-EBADF` until commit
fd2a88b190 ("attach: cleanup macros lxc_proc_close_ns_fd",
but there are some code paths where we call this before
later calling `lxc_proc_put_context_info` which would call
this function again with the file descriptors still
unchanged.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-02-25 17:05:24 +01:00
Stéphane Graber
de24eb5ba6
Merge pull request #2880 from brauner/2019-02-22/cleanup_macros
tree-wide: cleanup macros
2019-02-23 17:07:31 -05:00
Christian Brauner
4aae564fda
conf: cleanup macros suggest_default_idmap
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2019-02-22 22:15:09 +01:00