]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 years agocoverity: #1426734
Christian Brauner [Thu, 8 Feb 2018 14:42:16 +0000 (15:42 +0100)]
coverity: #1426734

Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1429139
Christian Brauner [Thu, 8 Feb 2018 14:31:59 +0000 (15:31 +0100)]
coverity: #1429139

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2142 from hallyn/2018-02-08/priv
Christian Brauner [Thu, 8 Feb 2018 22:40:50 +0000 (23:40 +0100)]
Merge pull request #2142 from hallyn/2018-02-08/priv

2018 02 08/priv

6 years agoRestore most cases of am_guest_unpriv
Serge Hallyn [Thu, 8 Feb 2018 19:04:23 +0000 (13:04 -0600)]
Restore most cases of am_guest_unpriv

The only cases where we really need to be privileged with respect
to the host is when we are trying to mknod, and in some cases
to do with a physical network device.  This patch leaves the
detection of the network device cases as a TODO.

This should fix the currently broken case of starting a privileged
container with at least one veth nic, nested inside an unprivileged
container.

Cc: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
6 years agodefine am_guest_unpriv
Serge Hallyn [Thu, 8 Feb 2018 18:06:39 +0000 (12:06 -0600)]
define am_guest_unpriv

Sometimes we want to know whether we are privileged wrt our
namespaces, and sometimes we want to know whether we are priv
wrt init_user_ns.

Signed-off-by: Serge Hallyn <shallyn@cisco.com>
6 years agoMerge pull request #2125 from brauner/2018-02-02/add_namespace_configs
Stéphane Graber [Thu, 8 Feb 2018 15:26:57 +0000 (10:26 -0500)]
Merge pull request #2125 from brauner/2018-02-02/add_namespace_configs

confile: add lxc.namespace.share.[namespace], lxc.namespace.keep, lxc.namespace.clone

6 years agoMerge pull request #2137 from brauner/2018-02-07/fix_unprivileged_flag
Stéphane Graber [Thu, 8 Feb 2018 15:26:09 +0000 (10:26 -0500)]
Merge pull request #2137 from brauner/2018-02-07/fix_unprivileged_flag

tools/lxc-ls: fix logic for unpriv containers

6 years agoMerge pull request #2140 from brauner/2018-02-08/cgfsng_fix_ro_remount
Stéphane Graber [Thu, 8 Feb 2018 15:25:50 +0000 (10:25 -0500)]
Merge pull request #2140 from brauner/2018-02-08/cgfsng_fix_ro_remount

cgfsng: add required remount flags

6 years agocgfsng: add required remount flags
Christian Brauner [Thu, 8 Feb 2018 10:36:41 +0000 (11:36 +0100)]
cgfsng: add required remount flags

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9566d6742852c527bf5af38af5cbb878dad75705

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge branch 'marcosps-selinux_simplification' into lxc/master
Christian Brauner [Thu, 8 Feb 2018 09:50:10 +0000 (10:50 +0100)]
Merge branch 'marcosps-selinux_simplification' into lxc/master

6 years agolsm: fix missing @ in function documentation
Marcos Paulo de Souza [Wed, 7 Feb 2018 15:06:43 +0000 (13:06 -0200)]
lsm: fix missing @ in function documentation

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
6 years agoselinux: simplify check for default label
Marcos Paulo de Souza [Wed, 7 Feb 2018 14:51:38 +0000 (12:51 -0200)]
selinux: simplify check for default label

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge branch 'marcosps-issue_870' into lxc/master
Christian Brauner [Thu, 8 Feb 2018 09:34:54 +0000 (10:34 +0100)]
Merge branch 'marcosps-issue_870' into lxc/master

6 years agocgroups: add check for lxc.cgroup.use
Marcos Paulo de Souza [Thu, 8 Feb 2018 01:55:13 +0000 (23:55 -0200)]
cgroups: add check for lxc.cgroup.use

Closes #870.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
6 years agotools/lxc-ls: fix logic for unpriv containers
Christian Brauner [Wed, 7 Feb 2018 20:06:01 +0000 (21:06 +0100)]
tools/lxc-ls: fix logic for unpriv containers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotemplates: CentOS fixes
Christian Brauner [Wed, 7 Feb 2018 10:39:19 +0000 (11:39 +0100)]
templates: CentOS fixes

Issues fixed:
- lxc-centos died about a missing /run directory
- lxc-centos complained about some config files it couldn't modify
- the new container got stuck at startup time for a minute
  (literally), waiting for systemd-remount-fs startup script

Of course it still works for RHEL 6, CentOS 6 and 7 as well. I did not
verify earlier CentOS or RHEL releases.

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge branch 'lifeng68-remount_cgroup' into lxc/master
Christian Brauner [Wed, 7 Feb 2018 10:30:40 +0000 (11:30 +0100)]
Merge branch 'lifeng68-remount_cgroup' into lxc/master

6 years agocgfsng: non-functional changes
Christian Brauner [Wed, 7 Feb 2018 10:27:57 +0000 (11:27 +0100)]
cgfsng: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgfsng: do MS_REMOUNT
LiFeng [Wed, 7 Feb 2018 16:39:59 +0000 (11:39 -0500)]
cgfsng: do MS_REMOUNT

Perform MS_REMOUNT on mounts with MS_RDONLY.

Signed-off-by: LiFeng <lifeng68@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge branch 'lifeng68-use_env_vars_in_container' into lxc/master
Christian Brauner [Wed, 7 Feb 2018 10:18:42 +0000 (11:18 +0100)]
Merge branch 'lifeng68-use_env_vars_in_container' into lxc/master

6 years agoattach: non-functional changes
Christian Brauner [Wed, 7 Feb 2018 10:13:48 +0000 (11:13 +0100)]
attach: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: set the container's environment variables
l00415420 [Wed, 7 Feb 2018 12:39:28 +0000 (07:39 -0500)]
attach: set the container's environment variables

Set the same environment variables that were used when starting the container
when attaching to the container.

Signed-off-by: LiFeng <lifeng68@huawei.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agodoc: add lxc.namespace.clone + lxc.namespace.keep
Christian Brauner [Mon, 5 Feb 2018 17:32:00 +0000 (18:32 +0100)]
doc: add lxc.namespace.clone + lxc.namespace.keep

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: resolve clone flags
Christian Brauner [Fri, 2 Feb 2018 12:29:06 +0000 (13:29 +0100)]
start: resolve clone flags

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: add lxc.namespace.keep
Christian Brauner [Fri, 2 Feb 2018 11:40:55 +0000 (12:40 +0100)]
confile: add lxc.namespace.keep

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: add lxc.namespace.clone
Christian Brauner [Fri, 2 Feb 2018 11:38:14 +0000 (12:38 +0100)]
confile: add lxc.namespace.clone

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: lxc.namespace.* -> lxc.namespace.share.*
Christian Brauner [Fri, 2 Feb 2018 10:53:51 +0000 (11:53 +0100)]
confile: lxc.namespace.* -> lxc.namespace.share.*

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2117 from brauner/2018-01-26/cgroup_v2_support
Serge Hallyn [Tue, 6 Feb 2018 19:19:10 +0000 (13:19 -0600)]
Merge pull request #2117 from brauner/2018-01-26/cgroup_v2_support

cgroups: add unified hierarchy support

6 years agoMerge pull request #2044 from brauner/2017-12-16/lxc_ls_add_unprivileged_field
Serge Hallyn [Tue, 6 Feb 2018 19:08:49 +0000 (13:08 -0600)]
Merge pull request #2044 from brauner/2017-12-16/lxc_ls_add_unprivileged_field

tools: add UNPRIVILEGED field in fancy output mode

6 years agoMerge pull request #2130 from tych0/sigterm-handling
Serge Hallyn [Mon, 5 Feb 2018 15:00:27 +0000 (09:00 -0600)]
Merge pull request #2130 from tych0/sigterm-handling

Sigterm handling

6 years agoMerge pull request #2129 from tych0/sigterm-sigkill
Christian Brauner [Mon, 5 Feb 2018 14:47:07 +0000 (15:47 +0100)]
Merge pull request #2129 from tych0/sigterm-sigkill

lxc-init: use SIGKILL after alarm timeout

6 years agolxc.init: ignore SIGHUP
Tycho Andersen [Mon, 5 Feb 2018 14:19:25 +0000 (14:19 +0000)]
lxc.init: ignore SIGHUP

see comment for details.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agomonitor: send SIGTERM to the container when SIGHUP is received
Tycho Andersen [Mon, 5 Feb 2018 14:17:48 +0000 (14:17 +0000)]
monitor: send SIGTERM to the container when SIGHUP is received

For the ->execute() case, we want to make sure the application dies when
SIGHUP is received. The next patch will ignore SIGHUP in the lxc monitor,
because tasks inside the container send SIGHUP to init to have it reload
its config sometimes, and we don't want to do that with init.lxc, since it
might actually kill the container if it forwards SIGHUP to the child and
the child can't handle it.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agolxc-init: use SIGKILL after alarm timeout
Tycho Andersen [Mon, 5 Feb 2018 14:13:18 +0000 (14:13 +0000)]
lxc-init: use SIGKILL after alarm timeout

d76e3e1 inadvertently switched the alarm timeout from sigterm to sigkill.
We really want sigkill here, so let's bring it back.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoMerge pull request #2126 from flx42/nvidia-visible-devices-change-null-semantic
Christian Brauner [Fri, 2 Feb 2018 15:11:50 +0000 (16:11 +0100)]
Merge pull request #2126 from flx42/nvidia-visible-devices-change-null-semantic

hooks: change the semantic of NVIDIA_VISIBLE_DEVICES=""

6 years agohooks: change the semantic of NVIDIA_VISIBLE_DEVICES=""
Felix Abecassis [Fri, 2 Feb 2018 14:19:13 +0000 (06:19 -0800)]
hooks: change the semantic of NVIDIA_VISIBLE_DEVICES=""

With LXC, you can override the value of an environment variable to
null, but you can't unset an existing variable.

The NVIDIA hook was previously activated when NVIDIA_VISIBLE_DEVICES
was set to null. As a result, it was not possible to disable the hook
by overriding the environment variable in the configuration.

The hook can now be disabled by setting NVIDIA_VISIBLE_DEVICES to
null or to the new special value "void".

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoMerge pull request #2120 from stgraber/master
Christian Brauner [Thu, 1 Feb 2018 14:55:25 +0000 (15:55 +0100)]
Merge pull request #2120 from stgraber/master

debian: We must use iproute on wheezy

6 years agodebian: We must use iproute on wheezy
Stéphane Graber [Thu, 1 Feb 2018 14:02:25 +0000 (15:02 +0100)]
debian: We must use iproute on wheezy

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agoMerge pull request #2119 from brauner/2018-02-01/fix_android
Stéphane Graber [Thu, 1 Feb 2018 14:26:22 +0000 (15:26 +0100)]
Merge pull request #2119 from brauner/2018-02-01/fix_android

lsm: do not #ifdefine

6 years agolsm: do not #ifdefine
Christian Brauner [Thu, 1 Feb 2018 12:14:36 +0000 (13:14 +0100)]
lsm: do not #ifdefine

Since we stopped linking against AppArmor we can now remove the conditional
compilation.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2114 from brauner/2018-01-27/make_name_arg_optional
Serge Hallyn [Thu, 1 Feb 2018 04:11:48 +0000 (22:11 -0600)]
Merge pull request #2114 from brauner/2018-01-27/make_name_arg_optional

tools: make "-n" optional

6 years agocgroups: more consistent naming
Christian Brauner [Wed, 31 Jan 2018 16:09:13 +0000 (17:09 +0100)]
cgroups: more consistent naming

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: handle limits on the unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:45:04 +0000 (16:45 +0100)]
cgroups: handle limits on the unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconfile: add lxc.cgroup2.[controller].[property]
Christian Brauner [Wed, 31 Jan 2018 15:44:30 +0000 (16:44 +0100)]
confile: add lxc.cgroup2.[controller].[property]

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: cgfsng_set: handle unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:42:19 +0000 (16:42 +0100)]
cgroups: cgfsng_set: handle unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: cgfsng_get: handle unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:41:53 +0000 (16:41 +0100)]
cgroups: cgfsng_get: handle unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: cgfsng_attach: handle unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:38:55 +0000 (16:38 +0100)]
cgroups: cgfsng_attach: handle unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: cgfsng_create: handle unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:33:17 +0000 (16:33 +0100)]
cgroups: cgfsng_create: handle unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: get controllers on the unified hierarchy
Christian Brauner [Wed, 31 Jan 2018 15:25:11 +0000 (16:25 +0100)]
cgroups: get controllers on the unified hierarchy

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2116 from brauner/2018-01-29/legacy_network_fixes
Stéphane Graber [Tue, 30 Jan 2018 01:06:50 +0000 (20:06 -0500)]
Merge pull request #2116 from brauner/2018-01-29/legacy_network_fixes

confile_legacy: fix legacy network parser

6 years agoconfile_legacy: fix legacy network parser
Christian Brauner [Mon, 29 Jan 2018 21:01:20 +0000 (22:01 +0100)]
confile_legacy: fix legacy network parser

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2102 from brauner/2018-01-22/lsm_simplifications
Serge Hallyn [Mon, 29 Jan 2018 23:08:38 +0000 (17:08 -0600)]
Merge pull request #2102 from brauner/2018-01-22/lsm_simplifications

lsm: simplifcations

6 years agotools: make "-n" optional
Christian Brauner [Sat, 27 Jan 2018 13:43:14 +0000 (14:43 +0100)]
tools: make "-n" optional

This lets users use the tools with "lxc-* -n <container-name>" or
"lxc-* <container-name>".

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2113 from marcosps/seccomp_return
Christian Brauner [Sat, 27 Jan 2018 14:50:13 +0000 (15:50 +0100)]
Merge pull request #2113 from marcosps/seccomp_return

seccomp.c: Use return instead of attribution and return

6 years agoseccomp.c: Use return instead of attribution and return
Marcos Paulo de Souza [Sat, 27 Jan 2018 13:13:20 +0000 (11:13 -0200)]
seccomp.c: Use return instead of attribution and return

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
6 years agoMerge pull request #2112 from stgraber/master
Christian Brauner [Sat, 27 Jan 2018 11:31:50 +0000 (12:31 +0100)]
Merge pull request #2112 from stgraber/master

debian: Use iproute2 instead of iproute

6 years agodebian: Use iproute2 instead of iproute
Stéphane Graber [Sat, 27 Jan 2018 05:33:07 +0000 (00:33 -0500)]
debian: Use iproute2 instead of iproute

The package has pretty much always been iproute2 with iproute being an
alias for it, the alias is now gone so we need to use iproute2.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agoMerge pull request #2111 from tych0/unpriv-fixups
Christian Brauner [Fri, 26 Jan 2018 22:39:29 +0000 (23:39 +0100)]
Merge pull request #2111 from tych0/unpriv-fixups

Unpriv fixups

6 years agorename am_unpriv to am_host_unpriv
Tycho Andersen [Fri, 26 Jan 2018 22:11:09 +0000 (22:11 +0000)]
rename am_unpriv to am_host_unpriv

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agobetter unprivileged detection
Tycho Andersen [Fri, 26 Jan 2018 21:21:51 +0000 (21:21 +0000)]
better unprivileged detection

In particular, if we are already in a user namespace we are unprivileged,
and doing things like moving the physical nics back to the host netns won't
work. Let's do the same thing LXD does if euid == 0: inspect
/proc/self/uid_map and see what that says.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agobetter check for lock dir
Tycho Andersen [Fri, 26 Jan 2018 17:43:12 +0000 (17:43 +0000)]
better check for lock dir

Consider the case where we're running in a user namespace but in the host's
mount ns with the host's filesystem (something like
lxc-usernsexec ... lxc-execute ...), in this case, we'll be euid 0, but we
can't actually write to /run. Let's improve this locking check to make sure
we can actually write to /run before we decide to actually use it as our
locking dir.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoMerge pull request #2109 from duguhaotian/new
Christian Brauner [Fri, 26 Jan 2018 13:54:35 +0000 (14:54 +0100)]
Merge pull request #2109 from duguhaotian/new

[cgfsng] show wrong errno

6 years ago[cgfsng] show wrong errno
duguhaotian [Fri, 26 Jan 2018 13:07:58 +0000 (21:07 +0800)]
[cgfsng] show wrong errno

lxc_cgroup_set_data: h = get_hierarchy(controller);
if h is NULL, now errno is old, it donot set new one.
And then,
cgfsng_setup_limits:

    if (lxc_cgroup_set_data(cg->subsystem, cg->value, d)) {
if (do_devices && (errno == EACCES ||
errno == EPERM)) {
WARN("Error setting %s to %s for %s",
cg->subsystem, cg->value,
d->name);
continue;
}
SYSERROR("Error setting %s to %s for
 %s",
 cg->subsystem, cg->value,
 d->name);
goto out;
}

SYSERROR will show old errno, make me confused.

Signed-off-by: duguhaotian <duguhaotian@gmail.com>
6 years agoMerge pull request #2099 from brauner/2018-01-20/attach_init_pty
Stéphane Graber [Wed, 24 Jan 2018 20:24:46 +0000 (22:24 +0200)]
Merge pull request #2099 from brauner/2018-01-20/attach_init_pty

bugfixes

6 years agoMerge pull request #2103 from marcosps/forward_not_used
Christian Brauner [Tue, 23 Jan 2018 10:31:53 +0000 (11:31 +0100)]
Merge pull request #2103 from marcosps/forward_not_used

network.c: Remove ip_forward_set and callers

6 years agonetwork.c: Remove ip_forward_set and callers
Marcos Paulo de Souza [Tue, 23 Jan 2018 00:04:03 +0000 (22:04 -0200)]
network.c: Remove ip_forward_set and callers

The last user of ip_forward_set, lxc_ip_forward_on and
lxc_ip_forward_off was in 2009:

commit 92d385229be040cf034ac6efd9405b7bdfe06a3e
Author: Daniel Lezcano <dlezcano@fr.ibm.com>
Date:   Thu Oct 22 15:33:40 2009 +0200

    remove test directory

These functions are not called anymore.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
6 years agoautotools: do not link against libapparmor
Christian Brauner [Mon, 22 Jan 2018 11:14:21 +0000 (12:14 +0100)]
autotools: do not link against libapparmor

Since we write the label directly without going through the AppArmor API it
doesn't make sense to link against it.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoapparmor: do not call aa_change_profile()
Christian Brauner [Mon, 22 Jan 2018 11:02:44 +0000 (12:02 +0100)]
apparmor: do not call aa_change_profile()

We can simply write the label ourselves. There's no magic happening.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolsm: add lsm_process_label_set_at()
Christian Brauner [Mon, 22 Jan 2018 10:54:21 +0000 (11:54 +0100)]
lsm: add lsm_process_label_set_at()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolsm: add lsm_process_label_fd_get()
Christian Brauner [Mon, 22 Jan 2018 09:54:38 +0000 (10:54 +0100)]
lsm: add lsm_process_label_fd_get()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolsm: non-functional changes
Christian Brauner [Mon, 22 Jan 2018 09:48:56 +0000 (10:48 +0100)]
lsm: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2092 from lifeng68/modify_console_create
Christian Brauner [Mon, 22 Jan 2018 09:40:15 +0000 (10:40 +0100)]
Merge pull request #2092 from lifeng68/modify_console_create

Create console when the rootfs is NULL

6 years agoFix comments and add check in lxc_poll.
LiFeng [Mon, 22 Jan 2018 11:13:52 +0000 (06:13 -0500)]
Fix comments and add check in lxc_poll.

Add check whether handler->conf->console.path is 'none'

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agoMerge pull request #2100 from lifeng68/Modify_git_ignore
Christian Brauner [Mon, 22 Jan 2018 09:14:13 +0000 (10:14 +0100)]
Merge pull request #2100 from lifeng68/Modify_git_ignore

Modify .gitignore

6 years agoModify .gitignore
LiFeng [Mon, 22 Jan 2018 12:48:21 +0000 (07:48 -0500)]
Modify .gitignore

Add:
src/tests/lxc-test-api-reboot
src/tests/lxc-test-criu-check-feature
src/tests/lxc-test-raw-clone
src/tests/lxc-test-share-ns
src/tests/lxc-test-state-server

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agoMerge pull request #2101 from tenforward/japanese
Christian Brauner [Mon, 22 Jan 2018 09:13:55 +0000 (10:13 +0100)]
Merge pull request #2101 from tenforward/japanese

doc: Update Japanese lxc-attach(1) and lxc.container.conf(5)

6 years agodoc: Update Japanese lxc-attach(1) and lxc.container.conf(5)
KATOH Yasufumi [Mon, 22 Jan 2018 05:47:48 +0000 (14:47 +0900)]
doc: Update Japanese lxc-attach(1) and lxc.container.conf(5)

* Update for commit ba2be1a (attach: move pty allocation into api)
* Update for commit 5757588 (manpage: correct lxc.log.file conf option)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
6 years agoattach: non-functional changes
Christian Brauner [Sun, 21 Jan 2018 14:23:20 +0000 (15:23 +0100)]
attach: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: setup /proc limits
Christian Brauner [Sun, 21 Jan 2018 14:20:19 +0000 (15:20 +0100)]
attach: setup /proc limits

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: fix mainloop cleanup goto statements
Christian Brauner [Sun, 21 Jan 2018 12:55:42 +0000 (13:55 +0100)]
start: fix mainloop cleanup goto statements

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1426694
Christian Brauner [Sat, 20 Jan 2018 20:46:31 +0000 (21:46 +0100)]
coverity: #1426694

remove logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1426734
Christian Brauner [Sat, 20 Jan 2018 20:44:50 +0000 (21:44 +0100)]
coverity: #1426734

do not call close on bad fd

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1427190
Christian Brauner [Mon, 8 Jan 2018 17:25:56 +0000 (18:25 +0100)]
coverity: #1427190

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1427191
Christian Brauner [Mon, 8 Jan 2018 17:24:41 +0000 (18:24 +0100)]
coverity: #1427191

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1427638
Christian Brauner [Sat, 20 Jan 2018 20:35:35 +0000 (21:35 +0100)]
coverity: #1427638

avoid (however unlikely) double free

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1427639
Christian Brauner [Sat, 20 Jan 2018 20:30:17 +0000 (21:30 +0100)]
coverity: #1427639

remove logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1427668
Christian Brauner [Sat, 20 Jan 2018 20:26:33 +0000 (21:26 +0100)]
coverity: #1427668

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: fix android
Christian Brauner [Sat, 20 Jan 2018 13:05:01 +0000 (14:05 +0100)]
tools: fix android

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotools: non-functional changes
Christian Brauner [Sat, 20 Jan 2018 13:04:15 +0000 (14:04 +0100)]
tools: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: init struct
Christian Brauner [Sat, 20 Jan 2018 11:57:12 +0000 (12:57 +0100)]
attach: init struct

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2097 from mikemccracken/2018-01-19/report-storage-destroy
Christian Brauner [Sat, 20 Jan 2018 05:27:36 +0000 (06:27 +0100)]
Merge pull request #2097 from mikemccracken/2018-01-19/report-storage-destroy

storage: treat return value from ops->destroy as int

6 years agoMerge pull request #2096 from mikemccracken/patch-1
Christian Brauner [Fri, 19 Jan 2018 23:42:16 +0000 (00:42 +0100)]
Merge pull request #2096 from mikemccracken/patch-1

manpage: correct lxc.log.file conf option

6 years agoMerge pull request #2095 from tych0/remove-lxc-init
Christian Brauner [Fri, 19 Jan 2018 17:49:21 +0000 (18:49 +0100)]
Merge pull request #2095 from tych0/remove-lxc-init

unlink lxc-init

6 years agostorage: treat return value from ops->destroy as int
Michael McCracken [Fri, 19 Jan 2018 16:38:36 +0000 (08:38 -0800)]
storage: treat return value from ops->destroy as int

r->ops->destroy() returns an int, -1 on error.
When assigned to a bool, this becomes true and hides errors.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
6 years agounlink lxc-init
Tycho Andersen [Wed, 20 Dec 2017 17:52:38 +0000 (17:52 +0000)]
unlink lxc-init

It's sort of an implementation detail that this exists at all, and we
should probably not pollute the container's mount tables or FS with this.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years ago Adapt lxc_setup_console() to bind mount 'console'
LiFeng [Fri, 19 Jan 2018 16:23:35 +0000 (11:23 -0500)]
 Adapt lxc_setup_console() to bind mount 'console'

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agomanpage: correct lxc.log.file conf option
Michael McCracken [Fri, 19 Jan 2018 19:05:26 +0000 (11:05 -0800)]
manpage: correct lxc.log.file conf option

lxc.log.file instead of just lxc.log

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
6 years agoMerge pull request #2094 from tych0/propagate-exit-code
Serge Hallyn [Fri, 19 Jan 2018 04:26:32 +0000 (22:26 -0600)]
Merge pull request #2094 from tych0/propagate-exit-code

Propagate exit code for app containers

6 years agoset exit status to 1 in the unknown si_code case
Tycho Andersen [Fri, 19 Jan 2018 04:23:48 +0000 (04:23 +0000)]
set exit status to 1 in the unknown si_code case

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agolxc-execute: actually exit with the status of the spawned task
Tycho Andersen [Fri, 19 Jan 2018 03:31:33 +0000 (03:31 +0000)]
lxc-execute: actually exit with the status of the spawned task

Now that we have things propagated through init and liblxc correctly, at
least in non-daemon mode, we can exit with the actual exit status of the
task, instead of always succeeding, which is not so helpful.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>