]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
6 years agoutils: improve switch_to_ns()
Christian Brauner [Tue, 12 Mar 2019 16:51:50 +0000 (17:51 +0100)] 
utils: improve switch_to_ns()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoDevices created in rootfs instead of rootfs/dev
Rachid Koucha [Tue, 7 May 2019 14:03:02 +0000 (16:03 +0200)] 
Devices created in rootfs instead of rootfs/dev

Added /dev in the mknod commands.

Signed-off-by: Rachid Koucha <rachid.koucha@gmail.com>
6 years agoraw_syscalls: add initial support for pidfd_send_signal()
Christian Brauner [Mon, 6 May 2019 08:49:31 +0000 (10:49 +0200)] 
raw_syscalls: add initial support for pidfd_send_signal()

Well, I added this syscall so we better use it. :)

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocompiler: add __returns_twice attribute
Christian Brauner [Sat, 4 May 2019 11:35:51 +0000 (13:35 +0200)] 
compiler: add __returns_twice attribute

The returns_twice attribute tells the compiler that a function may return more
than one time. The compiler will ensure that all registers are dead before
calling such a function and will emit a warning about the variables that may be
clobbered after the second return from the function. Examples of such functions
are setjmp and vfork. The longjmp-like counterpart of such function, if any,
might need to be marked with the noreturn attribute.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: make socket SOCK_CLOEXEC
Christian Brauner [Fri, 3 May 2019 18:35:02 +0000 (20:35 +0200)] 
tree-wide: make socket SOCK_CLOEXEC

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonamespaces: allow a pathname to a nsfd for namespace to share
Serge Hallyn [Thu, 2 May 2019 01:17:23 +0000 (18:17 -0700)] 
namespaces: allow a pathname to a nsfd for namespace to share

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
6 years agoseccomp: notifier fixes
Christian Brauner [Tue, 30 Apr 2019 22:36:41 +0000 (00:36 +0200)] 
seccomp: notifier fixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: Fixes bug in macvlan mode selection
tomponline [Mon, 29 Apr 2019 14:11:17 +0000 (15:11 +0100)] 
network: Fixes bug in macvlan mode selection

Signed-off-by: tomponline <thomas.parrott@canonical.com>
6 years agotests: Updates .gitignore to ignore test build artefacts
tomponline [Mon, 29 Apr 2019 08:49:07 +0000 (09:49 +0100)] 
tests: Updates .gitignore to ignore test build artefacts

Signed-off-by: tomponline <thomas.parrott@canonical.com>
6 years agonetwork: Fixes vlan hook script
tomponline [Mon, 29 Apr 2019 08:44:57 +0000 (09:44 +0100)] 
network: Fixes vlan hook script

Signed-off-by: tomponline <thomas.parrott@canonical.com>
6 years agonetwork: Adds upscript handling for vlan network type
tomponline [Fri, 26 Apr 2019 17:01:53 +0000 (18:01 +0100)] 
network: Adds upscript handling for vlan network type

Signed-off-by: tomponline <thomas.parrott@canonical.com>
6 years agonetwork: Fixes a little typo in an error message
tomponline [Fri, 26 Apr 2019 16:49:32 +0000 (17:49 +0100)] 
network: Fixes a little typo in an error message

Signed-off-by: tomponline <thomas.parrott@canonical.com>
6 years agostart: silence clang
Christian Brauner [Thu, 25 Apr 2019 15:20:39 +0000 (17:20 +0200)] 
start: silence clang

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoaf_unix: backport helper functions
Christian Brauner [Thu, 25 Apr 2019 12:51:51 +0000 (14:51 +0200)] 
af_unix: backport helper functions

This backports various helpers associated with seccomp notify to make
maintenance easier.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocommands: partially backport seccomp notify
Christian Brauner [Sun, 21 Apr 2019 19:03:51 +0000 (21:03 +0200)] 
commands: partially backport seccomp notify

This backports seccomp notify into various parts of the codebase as a pure nop
to make maintenance easier.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoFix 'zfs get' command order
pgauret [Wed, 24 Apr 2019 16:29:21 +0000 (18:29 +0200)] 
Fix 'zfs get' command order

Another case of calling 'zfs get' which requires reordering arguments to work with latest zfs.

Signed-off-by: Paul Gauret <pgauret@yahoo.com>
6 years agolxc-start: remove bad doc
Tycho Andersen [Tue, 23 Apr 2019 14:48:29 +0000 (08:48 -0600)] 
lxc-start: remove bad doc

We don't in fact exit(1) if this is not specified, and it wouldn't make
sense to, since most people probably don't specify this.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agonetns_getifaddrs: adapt to kernel changes
Christian Brauner [Fri, 19 Apr 2019 13:24:51 +0000 (15:24 +0200)] 
netns_getifaddrs: adapt to kernel changes

s/NETLINK_DUMP_STRICT_CHK/NETLINK_GET_STRICT_CHK/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: do lxc.mount.entry mounts right after lxc.mount.fstab
Felix Abecassis [Tue, 16 Apr 2019 21:40:03 +0000 (14:40 -0700)] 
conf: do lxc.mount.entry mounts right after lxc.mount.fstab

These configuration options use the same syntax and therefore it seems
more intuitive to have the same behavior for both of them, which is
not the case today since mount hooks and autodev mounts are called
between the two.

See: https://github.com/lxc/lxc/issues/2932

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agostorage: update zfs
pgauret [Mon, 15 Apr 2019 07:18:42 +0000 (09:18 +0200)] 
storage: update zfs

Change zfs arguments. This also works with older zfs versions, tested with
zfs 0.7.9-3 on Ubuntu 18.10.

Closes #2916.

Signed-off-by: Paul Gauret <pgauret@yahoo.com>
[christian.brauner@ubuntu.com: adapt commit message and add Signed-off-by for Paul]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostorage: prevent unitialized variable warning
Christian Brauner [Sun, 14 Apr 2019 13:46:12 +0000 (15:46 +0200)] 
storage: prevent unitialized variable warning

We can simply fix this issue by switching to our cleanup macros instead of
manually freeing the memory.

Closes #2912.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofix: #2927 api doc generation fails under out of source build.
yosukesan [Sat, 6 Apr 2019 03:42:41 +0000 (12:42 +0900)] 
fix: #2927 api doc generation fails under out of source build.

Signed-off-by: yosukesan <y.otsuki30@gmail.com>
6 years agodoc: update Japanese lxc-user-nic manpage
KATOH Yasufumi [Fri, 5 Apr 2019 17:00:53 +0000 (02:00 +0900)] 
doc: update Japanese lxc-user-nic manpage

Update for commit db74bbd

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
6 years agolxc-user-nic: validate request
Christian Brauner [Fri, 5 Apr 2019 12:11:43 +0000 (14:11 +0200)] 
lxc-user-nic: validate request

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
6 years agodoc: update lxc-user-nic manpage
Christian Brauner [Fri, 5 Apr 2019 12:01:12 +0000 (14:01 +0200)] 
doc: update lxc-user-nic manpage

Closes #1823.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
6 years agolxc-user-nic: small tweaks
Christian Brauner [Fri, 5 Apr 2019 11:30:28 +0000 (13:30 +0200)] 
lxc-user-nic: small tweaks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
6 years agoFix user namespace pdeathsig handling
Felix Abecassis [Thu, 4 Apr 2019 04:09:53 +0000 (21:09 -0700)] 
Fix user namespace pdeathsig handling

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agonetwork: fix network device removal
Christian Brauner [Tue, 2 Apr 2019 21:26:59 +0000 (23:26 +0200)] 
network: fix network device removal

Closes #2849.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolvm: Updates lvcreate to wipe signatures if supported, fallbacks to old command if...
tomponline [Tue, 19 Mar 2019 18:14:25 +0000 (18:14 +0000)] 
lvm: Updates lvcreate to wipe signatures if supported, fallbacks to old command if not.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agotravis: Attempt to fix src/lxc/cmd/lxc_init.c:251: undefined reference to `pthread_si...
tomponline [Tue, 19 Mar 2019 13:38:55 +0000 (13:38 +0000)] 
travis: Attempt to fix src/lxc/cmd/lxc_init.c:251: undefined reference to `pthread_sigmask

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agoTravis: Adds -Wall and -Werror gcc flags to automatic build.
tomponline [Tue, 19 Mar 2019 11:40:47 +0000 (11:40 +0000)] 
Travis: Adds -Wall and -Werror gcc flags to automatic build.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agohooks/nvidia: handle spaces in NVIDIA_REQUIRE variables
Felix Abecassis [Tue, 16 Apr 2019 20:58:51 +0000 (13:58 -0700)] 
hooks/nvidia: handle spaces in NVIDIA_REQUIRE variables

Previously, environment variables with a space where splitted.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoraw_syscalls: lxc_raw_clone()
Christian Brauner [Tue, 16 Apr 2019 21:32:03 +0000 (23:32 +0200)] 
raw_syscalls: lxc_raw_clone()

Account for different trap number on 32bit SPARC.

Link: https://bugs.gentoo.org/656368
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2944 from brauner/lxc/stable-3.0
Christian Brauner [Fri, 19 Apr 2019 09:00:04 +0000 (11:00 +0200)] 
Merge pull request #2944 from brauner/lxc/stable-3.0

cgfsng: backport new cgroup handling logic

6 years agocgfsng: backport new cgroup handling logic 2944/head
Christian Brauner [Fri, 19 Apr 2019 02:46:09 +0000 (04:46 +0200)] 
cgfsng: backport new cgroup handling logic

BugLink: https://bugs.launchpad.net/bugs/1825155
This will allow us to better support cgroup2 layouts on stable-3.0.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: fix potential nullderef
Christian Brauner [Sun, 14 Apr 2019 13:35:45 +0000 (15:35 +0200)] 
cgroups: fix potential nullderef

The child_path variable is initialized very late in the function so jumping to
the on_error label would cause a nullderef. With the cleanup macros we can
simplify this function to simply do direct returns and avoid that whole issue.

Closes #2935.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: fix cgroup2 handling
Christian Brauner [Wed, 10 Apr 2019 21:10:57 +0000 (23:10 +0200)] 
cgfsng: fix cgroup2 handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: backport monitor_pid handling
Christian Brauner [Wed, 10 Apr 2019 21:07:24 +0000 (23:07 +0200)] 
start: backport monitor_pid handling

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agohardening: enable address sanitizer build
Christian Brauner [Tue, 12 Mar 2019 19:58:09 +0000 (20:58 +0100)] 
hardening: enable address sanitizer build

This adds --{disable,enable}-asan. It is disabled by default.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: fix parent PID passed to lxc_set_death_signal
Felix Abecassis [Tue, 12 Mar 2019 00:15:45 +0000 (17:15 -0700)] 
start: fix parent PID passed to lxc_set_death_signal

Fixes: #2902
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoutils: fix handling of PID namespaces in lxc_set_death_signal
Felix Abecassis [Tue, 12 Mar 2019 00:13:48 +0000 (17:13 -0700)] 
utils: fix handling of PID namespaces in lxc_set_death_signal

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agocompiler: -fexceptions hardening
Christian Brauner [Mon, 11 Mar 2019 22:36:02 +0000 (23:36 +0100)] 
compiler: -fexceptions hardening

This hardens multi-threaded C. Without it, the implementation of thread
cancellation handlers (introduced by pthread_cleanup_push) uses a completely
unprotected function pointer on the stack. This function pointer can simplify
the exploitation of stack-based buffer overflows even if the thread in question
is never canceled.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocompiler: -pipe
Christian Brauner [Mon, 11 Mar 2019 22:34:01 +0000 (23:34 +0100)] 
compiler: -pipe

Avoid temporary files, speeding up builds.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocompiler: -fasynchronous-unwind-tables hardening
Christian Brauner [Mon, 11 Mar 2019 22:30:41 +0000 (23:30 +0100)] 
compiler: -fasynchronous-unwind-tables hardening

Increased reliability of backtraces.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agobtrfs: ensure \0 byte at end
Christian Brauner [Mon, 11 Mar 2019 11:47:23 +0000 (12:47 +0100)] 
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>
6 years agohooks: drop namespace references before post-stop
Christian Brauner [Sun, 10 Mar 2019 10:46:18 +0000 (11:46 +0100)] 
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>
6 years agoFix lxc.cgroup2.<controller> on cgroup2-only systems
Michael Sparmann [Wed, 6 Mar 2019 23:06:11 +0000 (00:06 +0100)] 
Fix lxc.cgroup2.<controller> on cgroup2-only systems

Signed-off-by: Michael Sparmann <theseven@gmx.net>
6 years agoconf: avoid compiler warning
Christian Brauner [Tue, 5 Mar 2019 18:29:38 +0000 (19:29 +0100)] 
conf: avoid compiler warning

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoRevert "conf: Fixes unitialised variable."
Christian Brauner [Tue, 5 Mar 2019 18:28:52 +0000 (19:28 +0100)] 
Revert "conf: Fixes unitialised variable."

This reverts commit 912c4bb474b52284cf82c336b0af161be6c25ac1.

I accidently merged this commit. The initialization is wrong.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: Fixes unitialised variable.
tomponline [Tue, 5 Mar 2019 16:56:42 +0000 (16:56 +0000)] 
conf: Fixes unitialised variable.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agoconfile: make parse_limit_value() static
Christian Brauner [Mon, 4 Mar 2019 19:31:52 +0000 (20:31 +0100)] 
confile: make parse_limit_value() static

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile_utils: make update_hwaddr() static
Christian Brauner [Mon, 4 Mar 2019 19:30:41 +0000 (20:30 +0100)] 
confile_utils: make update_hwaddr() static

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile_utils: lxc_config_net_is_hwaddr()
Christian Brauner [Mon, 4 Mar 2019 19:26:33 +0000 (20:26 +0100)] 
confile_utils: lxc_config_net_is_hwaddr()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: shut up gcc.
tomponline [Mon, 4 Mar 2019 08:37:16 +0000 (08:37 +0000)] 
cmd: shut up gcc.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agostorage: shut up gcc and remove unused variables.
tomponline [Mon, 4 Mar 2019 08:33:51 +0000 (08:33 +0000)] 
storage: shut up gcc and remove unused variables.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agostart: shut up gcc.
tomponline [Mon, 4 Mar 2019 08:27:59 +0000 (08:27 +0000)] 
start: shut up gcc.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agomonitor: shut up gcc.
tomponline [Mon, 4 Mar 2019 08:25:42 +0000 (08:25 +0000)] 
monitor: shut up gcc.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agonetwork: shut up gcc.
tomponline [Mon, 4 Mar 2019 08:23:39 +0000 (08:23 +0000)] 
network: shut up gcc.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agolxccontainer: shut up gcc and remove unused variables.
tomponline [Mon, 4 Mar 2019 08:20:59 +0000 (08:20 +0000)] 
lxccontainer: shut up gcc and remove unused variables.

Closes #2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agoattacg: shut up gcc
tomponline [Sat, 2 Mar 2019 10:14:32 +0000 (10:14 +0000)] 
attacg: shut up gcc

Invalid warning but let's please the compiler.

Closes lxc#2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agoattach: remove unused variable
tomponline [Sat, 2 Mar 2019 10:11:51 +0000 (10:11 +0000)] 
attach: remove unused variable

Closes lxc#2885.

Signed-off-by: tomponline <tomp@tomp.uk>
6 years agostring_utils.c: fix wrong licensing
Christian Brauner [Sun, 3 Mar 2019 13:16:31 +0000 (14:16 +0100)] 
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>
6 years agofile_utils.c: fix wrong licensing
Christian Brauner [Sun, 3 Mar 2019 13:15:04 +0000 (14:15 +0100)] 
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>
6 years agocommands_utils.h: fix wrong licensing
Christian Brauner [Sun, 3 Mar 2019 13:18:41 +0000 (14:18 +0100)] 
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>
6 years agocommands_utils.c: fix wrong licensing
Christian Brauner [Sun, 3 Mar 2019 13:11:55 +0000 (14:11 +0100)] 
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>
6 years agoFix android compilation
Ondrej Kubik [Thu, 21 Feb 2019 14:59:21 +0000 (16:59 +0200)] 
Fix android compilation

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
6 years agoCODING_STYLE: update
Christian Brauner [Fri, 1 Mar 2019 20:24:31 +0000 (21:24 +0100)] 
CODING_STYLE: update

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: shut up gcc
Christian Brauner [Fri, 1 Mar 2019 20:15:49 +0000 (21:15 +0100)] 
confile: shut up gcc

Invalid warning but let's please the compiler.

Closes #2885.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: remove unused variable
Christian Brauner [Fri, 1 Mar 2019 20:15:20 +0000 (21:15 +0100)] 
conf: remove unused variable

Closes #2885.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoinitutils: remove fgets() from setproctitle()
Christian Brauner [Fri, 1 Mar 2019 20:08:28 +0000 (21:08 +0100)] 
initutils: remove fgets() from setproctitle()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoinitutils: remove fgets() from lxc_global_con[...]
Christian Brauner [Fri, 1 Mar 2019 19:55:33 +0000 (20:55 +0100)] 
initutils: remove fgets() from lxc_global_con[...]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: remove fgets() from lxc_chroot()
Christian Brauner [Fri, 1 Mar 2019 11:12:15 +0000 (12:12 +0100)] 
conf: remove fgets() from lxc_chroot()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: remove fgets() from run_buffer()
Christian Brauner [Fri, 1 Mar 2019 11:00:42 +0000 (12:00 +0100)] 
conf: remove fgets() from run_buffer()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agogpg: use proxy, if http_proxy is set
Marco Dickert [Thu, 28 Feb 2019 09:03:16 +0000 (10:03 +0100)] 
gpg: use proxy, if http_proxy is set

Signed-off-by: Marco Dickert <marco@misterunknown.de>
6 years agoattach: use move_fd in lxc_proc_close_ns_fd
Wolfgang Bumiller [Mon, 25 Feb 2019 16:05:24 +0000 (17:05 +0100)] 
attach: use move_fd in lxc_proc_close_ns_fd

Previously this set `ctx->ns_fd[*]` to `-EBADF` until commit
fd2a88b190eb ("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>
6 years agoconf: cleanup macros suggest_default_idmap
Christian Brauner [Fri, 22 Feb 2019 21:15:09 +0000 (22:15 +0100)] 
conf: cleanup macros suggest_default_idmap

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros write_id_mapping
Christian Brauner [Fri, 22 Feb 2019 21:12:20 +0000 (22:12 +0100)] 
conf: cleanup macros write_id_mapping

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros setup_mount_entries
Christian Brauner [Fri, 22 Feb 2019 21:07:26 +0000 (22:07 +0100)] 
conf: cleanup macros setup_mount_entries

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros make_anonymous_mount_file
Christian Brauner [Fri, 22 Feb 2019 21:06:47 +0000 (22:06 +0100)] 
conf: cleanup macros make_anonymous_mount_file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros lxc_fill_autodev
Christian Brauner [Fri, 22 Feb 2019 21:04:14 +0000 (22:04 +0100)] 
conf: cleanup macros lxc_fill_autodev

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros lxc_pivot_root
Christian Brauner [Fri, 22 Feb 2019 20:59:57 +0000 (21:59 +0100)] 
conf: cleanup macros lxc_pivot_root

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros lxc_chroot
Christian Brauner [Fri, 22 Feb 2019 20:56:55 +0000 (21:56 +0100)] 
conf: cleanup macros lxc_chroot

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros remount_all_slave
Christian Brauner [Fri, 22 Feb 2019 20:49:48 +0000 (21:49 +0100)] 
conf: cleanup macros remount_all_slave

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: simplify idmaptool_on_path_and_privileged
Christian Brauner [Fri, 22 Feb 2019 20:41:41 +0000 (21:41 +0100)] 
conf: simplify idmaptool_on_path_and_privileged

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-attach: switch to attach_run_wait
Christian Brauner [Thu, 21 Feb 2019 19:28:24 +0000 (20:28 +0100)] 
lxc-attach: switch to attach_run_wait

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years ago.travis: remove coverity
Christian Brauner [Thu, 21 Feb 2019 09:56:13 +0000 (10:56 +0100)] 
.travis: remove coverity

It hasn't worked reliably for us for a long time. Remove it until such time as
someone cares enough to fix it.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years ago.travis: give coverity one more try
Christian Brauner [Thu, 21 Feb 2019 09:47:13 +0000 (10:47 +0100)] 
.travis: give coverity one more try

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: cleanup macros lxc_attach_terminal_[...]
Christian Brauner [Wed, 20 Feb 2019 23:35:52 +0000 (00:35 +0100)] 
attach: cleanup macros lxc_attach_terminal_[...]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: cleanup macros lxc_put_attach_clone_[...]
Christian Brauner [Wed, 20 Feb 2019 23:21:57 +0000 (00:21 +0100)] 
attach: cleanup macros lxc_put_attach_clone_[...]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: cleanup macros in_same_namespace
Christian Brauner [Wed, 20 Feb 2019 23:18:59 +0000 (00:18 +0100)] 
attach: cleanup macros in_same_namespace

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: cleanup macros lxc_proc_close_ns_fd
Christian Brauner [Wed, 20 Feb 2019 23:12:15 +0000 (00:12 +0100)] 
attach: cleanup macros lxc_proc_close_ns_fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotravis: run coccinelle
Christian Brauner [Wed, 20 Feb 2019 20:11:46 +0000 (21:11 +0100)] 
travis: run coccinelle

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotravis: run coccinelle
Christian Brauner [Wed, 20 Feb 2019 19:44:16 +0000 (20:44 +0100)] 
travis: run coccinelle

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros suggest_default_idmap
Christian Brauner [Tue, 19 Feb 2019 22:49:14 +0000 (23:49 +0100)] 
conf: cleanup macros suggest_default_idmap

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros get{g,u}name
Christian Brauner [Tue, 19 Feb 2019 22:48:06 +0000 (23:48 +0100)] 
conf: cleanup macros get{g,u}name

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros get_minimal_idmap
Christian Brauner [Tue, 19 Feb 2019 22:47:49 +0000 (23:47 +0100)] 
conf: cleanup macros get_minimal_idmap

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros lxc_execute_bind_init
Christian Brauner [Tue, 19 Feb 2019 22:47:26 +0000 (23:47 +0100)] 
conf: cleanup macros lxc_execute_bind_init

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros remount_all_slave
Christian Brauner [Tue, 19 Feb 2019 22:47:05 +0000 (23:47 +0100)] 
conf: cleanup macros remount_all_slave

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros idmaptool_on_path_[...]
Christian Brauner [Tue, 19 Feb 2019 22:46:34 +0000 (23:46 +0100)] 
conf: cleanup macros idmaptool_on_path_[...]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: cleanup macros setup_proc_filesystem
Christian Brauner [Tue, 19 Feb 2019 22:46:11 +0000 (23:46 +0100)] 
conf: cleanup macros setup_proc_filesystem

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