]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 years agoutils: fix task_blocking_signal()
Christian Brauner [Thu, 24 May 2018 18:45:29 +0000 (20:45 +0200)]
utils: fix task_blocking_signal()

sscanf() skips whitespace anyway so don't account for tabs in case the file
layout changes.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: s/sigprocmask/pthread_sigmask()/g
Christian Brauner [Thu, 24 May 2018 18:29:48 +0000 (20:29 +0200)]
tree-wide: s/sigprocmask/pthread_sigmask()/g

The behavior of sigprocmask() is unspecified in multi-threaded programs. Let's
use pthread_sigmask() instead.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2345 from flx42/seccomp-fixes
Christian Brauner [Thu, 24 May 2018 09:30:30 +0000 (11:30 +0200)]
Merge pull request #2345 from flx42/seccomp-fixes

Seccomp fixes

6 years agoseccomp: fix type mismatch when parsing syscall arguments filters
Felix Abecassis [Thu, 24 May 2018 05:25:53 +0000 (22:25 -0700)]
seccomp: fix type mismatch when parsing syscall arguments filters

Specifier %lli was insufficient for the type uint64_t, all values
between 2^63-1 and 2^64-1 were silently converted to 2^63-1.

We can't use %llu since it doesn't handle hexadecimal. Instead, we
parse the values as strings and then use strtoull(3).

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: remove unnecessary memset
Felix Abecassis [Thu, 24 May 2018 04:28:39 +0000 (21:28 -0700)]
seccomp: remove unnecessary memset

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: remove confusing comment line
Felix Abecassis [Thu, 24 May 2018 04:28:01 +0000 (21:28 -0700)]
seccomp: remove confusing comment line

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoseccomp: fix off-by-one error in array allocation for sscanf
Felix Abecassis [Thu, 24 May 2018 03:51:42 +0000 (20:51 -0700)]
seccomp: fix off-by-one error in array allocation for sscanf

The maximum field width does not include the null terminator.

Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
6 years agoMerge pull request #2344 from brauner/2018-05-23/on_demand_log_file
Stéphane Graber [Wed, 23 May 2018 15:28:01 +0000 (11:28 -0400)]
Merge pull request #2344 from brauner/2018-05-23/on_demand_log_file

tools: only create log file when requested

6 years agoMerge pull request #2340 from brauner/2018-05-22/fix_init_cmd
Stéphane Graber [Wed, 23 May 2018 15:27:10 +0000 (11:27 -0400)]
Merge pull request #2340 from brauner/2018-05-22/fix_init_cmd

lxc-init: skip signals that can't be caught

6 years agoMerge pull request #2338 from brauner/2018-05-17/multi_threaded_logging
Stéphane Graber [Wed, 23 May 2018 15:26:43 +0000 (11:26 -0400)]
Merge pull request #2338 from brauner/2018-05-17/multi_threaded_logging

log: enable per-thread container name prefix

6 years agotools: only create log file when requested
Christian Brauner [Wed, 23 May 2018 11:49:42 +0000 (13:49 +0200)]
tools: only create log file when requested

We used to initialize a log unconditionally before. This has led to scenarios
where users where left with container directories and an empty log file even
though they didn't request a log be created at all.
Switch all tools to only create a log file when the user explicitly requests
this.

Closes #1779.
Closes #2032.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2341 from tych0/optionally-execveat
Christian Brauner [Wed, 23 May 2018 10:25:42 +0000 (12:25 +0200)]
Merge pull request #2341 from tych0/optionally-execveat

use execveat syscall to exec lxc-init if supported

6 years agoexecute: use execveat() syscall if supported
Tycho Andersen [Tue, 22 May 2018 23:33:17 +0000 (23:33 +0000)]
execute: use execveat() syscall if supported

The execveat allows us to exec stuff via a fd so we don't have to bind mount
stuff in. See the comment about why we're using the syscall directly.

Closes #2339.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
[christian.brauner@ubuntu.com: adapt error message and whitespace fixes]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxc-init: skip signals that can't be caught
Christian Brauner [Tue, 22 May 2018 21:26:03 +0000 (23:26 +0200)]
lxc-init: skip signals that can't be caught

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2337 from brauner/2018-05-18/cgroup_rework
Serge Hallyn [Tue, 22 May 2018 19:48:39 +0000 (14:48 -0500)]
Merge pull request #2337 from brauner/2018-05-18/cgroup_rework

cgroups: refactor cgroup handling

6 years agolog: enable per-thread container name prefix
Christian Brauner [Sun, 20 May 2018 12:05:51 +0000 (14:05 +0200)]
log: enable per-thread container name prefix

When using the LXC API multi-thread and users initialize a log:

struct lxc_log log;
log.name = "my-log";
lxc_log_init(&log);

all threads will have the same "my-log" prefix even though thy might call
lxc_container_new() in separate threads. There is currently no easy way to
handle per-thread container name prefixes.
To handle this carry a reference to the name of the container in struct
lxc_conf and if no log.name was set, use it by default. This way each thread
will get the container it is currently working on as a log-prefix.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: duguhaotian <duguhaotian@gmail.com>
6 years agoconf: simplify write_id_mapping()
Christian Brauner [Sat, 19 May 2018 20:51:29 +0000 (22:51 +0200)]
conf: simplify write_id_mapping()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoseccomp: #ifdef SCMP_ARCH_AARCH64
Christian Brauner [Sat, 19 May 2018 19:47:39 +0000 (21:47 +0200)]
seccomp: #ifdef SCMP_ARCH_AARCH64

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: remove freezer_state()
Christian Brauner [Sat, 19 May 2018 19:28:12 +0000 (21:28 +0200)]
cgroups: remove freezer_state()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocgroups: refactor cgroup handling
Christian Brauner [Fri, 18 May 2018 18:16:22 +0000 (20:16 +0200)]
cgroups: refactor cgroup handling

This replaces the constructor implementation of cgroup handling with a simpler,
thread-safe on-demand model of cgroup driver initialization.
Making the cgroup initialization code run in a constructor means that each time
the shared library gets mapped the cgroup parsing code gets run. That's
unnecessary overhead.
It also feels to me that this is only accidently thread-safe because
constructors are only run once. But should threads actually end up manipulating
or freeing memory that is file-global to cgfsng.c we'd be screwed. Now, I might
be wrong here but the cleaner implementation is to allocate a cgroup driver on
demand whenever we need it.
Take the chance and rework the cgroup_ops interface to make the functions it
wants to have implemented a lot cleaner.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2328 from simos/fix-resource-leak-cid1425802
Christian Brauner [Thu, 17 May 2018 11:11:39 +0000 (13:11 +0200)]
Merge pull request #2328 from simos/fix-resource-leak-cid1425802

coverity: #1425802

6 years agocoverity: #1425802
Simos Xenitellis [Tue, 15 May 2018 11:34:38 +0000 (11:34 +0000)]
coverity: #1425802

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agoMerge pull request #2324 from simos/fix-resource-leak-cid1248106
Christian Brauner [Wed, 16 May 2018 16:31:10 +0000 (18:31 +0200)]
Merge pull request #2324 from simos/fix-resource-leak-cid1248106

Fixed resource leak in is_wlan() at network.c

6 years agoMerge pull request #2323 from simos/fix-resource-leak-cid1425836
Christian Brauner [Wed, 16 May 2018 16:15:29 +0000 (18:15 +0200)]
Merge pull request #2323 from simos/fix-resource-leak-cid1425836

Fixed resource leak in userns_exec_full()

6 years agoMerge pull request #2332 from brauner/2018-05-16/use_ambient_capabilities
Serge Hallyn [Wed, 16 May 2018 14:46:54 +0000 (09:46 -0500)]
Merge pull request #2332 from brauner/2018-05-16/use_ambient_capabilities

capabilities: raise ambient capabilities

6 years agocapabilities: raise ambient capabilities
Christian Brauner [Tue, 15 May 2018 19:33:48 +0000 (21:33 +0200)]
capabilities: raise ambient capabilities

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Suggested-by: Jonathan Calmels <jcalmels@nvidia.com>
6 years agoMerge pull request #2319 from brauner/2018-05-13/allow_sys_rw_for_unpriv_containers
Stéphane Graber [Tue, 15 May 2018 14:34:22 +0000 (10:34 -0400)]
Merge pull request #2319 from brauner/2018-05-13/allow_sys_rw_for_unpriv_containers

config: allow read-write /sys in user namespace

6 years agoMerge pull request #2327 from brauner/2018-05-15/coverity
Stéphane Graber [Tue, 15 May 2018 14:34:05 +0000 (10:34 -0400)]
Merge pull request #2327 from brauner/2018-05-15/coverity

coverity

6 years agoMerge pull request #2329 from simos/fix-resource-leak-cid1425844
Christian Brauner [Tue, 15 May 2018 14:11:04 +0000 (16:11 +0200)]
Merge pull request #2329 from simos/fix-resource-leak-cid1425844

coverity: #1425844

6 years agoconfig: allow read-write /sys in user namespace
Christian Brauner [Sun, 13 May 2018 13:02:09 +0000 (15:02 +0200)]
config: allow read-write /sys in user namespace

Unprivileged containers can safely mount /sys as read-write. This also allows
systemd-udevd to be started in unprivileged containers.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425844
Simos Xenitellis [Tue, 15 May 2018 11:37:14 +0000 (11:37 +0000)]
coverity: #1425844

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1248106
Simos Xenitellis [Tue, 15 May 2018 00:05:13 +0000 (00:05 +0000)]
coverity: #1248106

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1425836
Simos Xenitellis [Tue, 15 May 2018 00:19:12 +0000 (00:19 +0000)]
coverity: #1425836

Resource leak

Signed-off-by: Simos Xenitellis <simos.lists@googlemail.com>
6 years agocoverity: #1435602
Christian Brauner [Tue, 15 May 2018 10:35:34 +0000 (12:35 +0200)]
coverity: #1435602

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435603
Christian Brauner [Tue, 15 May 2018 10:34:24 +0000 (12:34 +0200)]
coverity: #1435603

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435604
Christian Brauner [Tue, 15 May 2018 10:33:22 +0000 (12:33 +0200)]
coverity: #1435604

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2326 from tenforward/japanese
Christian Brauner [Tue, 15 May 2018 09:53:12 +0000 (11:53 +0200)]
Merge pull request #2326 from tenforward/japanese

Update Japanese man pages

6 years agodoc: Fix size unit style in Japanese lxc.container.conf(5)
KATOH Yasufumi [Tue, 15 May 2018 09:07:27 +0000 (18:07 +0900)]
doc: Fix size unit style in Japanese lxc.container.conf(5)

fix "kB" to "KB", and tweak description. Update for commit 6d276ed and
6d276ed .

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
6 years agodoc: Add "-d/--daemon" option to Japanese lxc-execute(1)
KATOH Yasufumi [Tue, 15 May 2018 08:52:46 +0000 (17:52 +0900)]
doc: Add "-d/--daemon" option to Japanese lxc-execute(1)

Update for commit 4160ef0

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
6 years agoMerge pull request #2318 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 14:12:32 +0000 (10:12 -0400)]
Merge pull request #2318 from brauner/2018-05-11/compiler_fixes

tools: s/strncpy()/memcpy()/g

6 years agotools: s/strncpy()/memcpy()/
Christian Brauner [Fri, 11 May 2018 13:58:33 +0000 (15:58 +0200)]
tools: s/strncpy()/memcpy()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoRevert "tools: s/strncpy()/strlcpy()/g"
Christian Brauner [Fri, 11 May 2018 13:56:58 +0000 (15:56 +0200)]
Revert "tools: s/strncpy()/strlcpy()/g"

This reverts commit 2ec47d5149e73db97f7877d06d67cb11421097bb.

First, I forgot to actually replace strncpy() with strlcpy(). Second, we don't
want to \0-terminate since this is an abstract unix socket and this is not
required. Instead, let's simply use memcpy() which is more correct and also
silences gcc-8.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2317 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 13:43:34 +0000 (09:43 -0400)]
Merge pull request #2317 from brauner/2018-05-11/compiler_fixes

tools: s/strncpy()/strlcpy()/g

6 years agotools: s/strncpy()/strlcpy()/g
Christian Brauner [Fri, 11 May 2018 13:19:45 +0000 (15:19 +0200)]
tools: s/strncpy()/strlcpy()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2316 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Fri, 11 May 2018 13:07:41 +0000 (09:07 -0400)]
Merge pull request #2316 from brauner/2018-05-11/compiler_fixes

tree-wide: s/strncpy()/strlcpy()/g

6 years agoCODING_STYLE: add section about using strlcpy()
Christian Brauner [Fri, 11 May 2018 11:02:41 +0000 (13:02 +0200)]
CODING_STYLE: add section about using strlcpy()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agotree-wide: s/strncpy()/strlcpy()/g
Christian Brauner [Fri, 11 May 2018 10:58:11 +0000 (12:58 +0200)]
tree-wide: s/strncpy()/strlcpy()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostrlcpy: add strlcpy() implementation
Christian Brauner [Fri, 11 May 2018 10:57:51 +0000 (12:57 +0200)]
strlcpy: add strlcpy() implementation

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2315 from duguhaotian/master
Christian Brauner [Fri, 11 May 2018 11:22:16 +0000 (13:22 +0200)]
Merge pull request #2315 from duguhaotian/master

support case ignored suffix for sizes

6 years agoutils: fix parse_byte_size_string() coding style
Christian Brauner [Fri, 11 May 2018 11:08:20 +0000 (13:08 +0200)]
utils: fix parse_byte_size_string() coding style

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agosupport case ignored suffix for sizes
l00355512 [Fri, 11 May 2018 01:47:49 +0000 (09:47 +0800)]
support case ignored suffix for sizes

suffix of console max size and console buffer max size

Signed-off-by: l00355512 <liuhao27@huawei.com>
6 years agoMerge pull request #2314 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Thu, 10 May 2018 23:44:44 +0000 (19:44 -0400)]
Merge pull request #2314 from brauner/2018-05-11/compiler_fixes

gcc-8: silence

6 years agonetwork: adhere to IFNAMSIZ limit
Christian Brauner [Thu, 10 May 2018 22:54:47 +0000 (00:54 +0200)]
network: adhere to IFNAMSIZ limit

The additional \0-byte space added is not needed since IFNAMSIZ needs to
include the \0-byte.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: silence gcc-8
Christian Brauner [Thu, 10 May 2018 22:52:33 +0000 (00:52 +0200)]
network: silence gcc-8

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2313 from brauner/2018-05-11/compiler_fixes
Stéphane Graber [Thu, 10 May 2018 22:38:54 +0000 (18:38 -0400)]
Merge pull request #2313 from brauner/2018-05-11/compiler_fixes

confile: satisfy gcc-8

6 years agoconfile: satisfy gcc-8
Christian Brauner [Thu, 10 May 2018 22:16:41 +0000 (00:16 +0200)]
confile: satisfy gcc-8

Apparently -Werror=stringop-overflow will trigger an error here even though
this is completely valid since we now that we're definitely copying a \0-byte.
Work around this gcc-8 quirk by using memcpy(). This shouldn't trigger the
warning.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2299 from brauner/2018-05-01/bugfixes
Stéphane Graber [Thu, 10 May 2018 21:51:15 +0000 (17:51 -0400)]
Merge pull request #2299 from brauner/2018-05-01/bugfixes

coverity + code removal

6 years agoutils: account for terminating \0 byte
Christian Brauner [Thu, 10 May 2018 18:25:08 +0000 (20:25 +0200)]
utils: account for terminating \0 byte

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425744
Christian Brauner [Tue, 1 May 2018 15:27:51 +0000 (17:27 +0200)]
coverity: #1425744

Dereference after null check

userns_exec_{1,full} are called from functions that might not have a conf.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1248105
Christian Brauner [Tue, 1 May 2018 15:18:26 +0000 (17:18 +0200)]
coverity: #1248105

Time of check time of use

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1248104
Christian Brauner [Tue, 1 May 2018 15:17:03 +0000 (17:17 +0200)]
coverity: #1248104

Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agogenl: remove
Christian Brauner [Tue, 1 May 2018 14:59:19 +0000 (16:59 +0200)]
genl: remove

These files have never been used and as such have no dependencies in the
codebase whatsoever. So remove them. If we need them we can simply pull them
out of the git history.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2308 from tych0/add-logging
Serge Hallyn [Wed, 9 May 2018 14:50:31 +0000 (09:50 -0500)]
Merge pull request #2308 from tych0/add-logging

fix execute when init in the container already exists

6 years agoexecute: set init_path when existing init is found
Tycho Andersen [Wed, 9 May 2018 01:48:31 +0000 (01:48 +0000)]
execute: set init_path when existing init is found

I'm not really sure we should be looking in the rootfs for an existing
init, but I'll send a much more invasive patch to correct that. For now,
let's just make sure we set init_path when we find one, so that later in
execute_start() we don't bail.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoexecute: account for -o path option count
Tycho Andersen [Wed, 9 May 2018 01:29:06 +0000 (01:29 +0000)]
execute: account for -o path option count

This always works fine... until your exec() fails and you try to go and
free it, you've overwritten the allocator's metadata (and potentially other
stuff) and it fails.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoadd some TRACE/ERROR reporting
Tycho Andersen [Tue, 8 May 2018 15:43:19 +0000 (09:43 -0600)]
add some TRACE/ERROR reporting

The errors in execute_start are important because nothing actually prints
out what error if any there was in these cases, so you're left with an
empty log.

The TRACE logs are simply to tell you which version of start lxc chose to
invoke: exec or start.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agoMerge pull request #2309 from brauner/2018-05-08/fix_execute
Serge Hallyn [Wed, 9 May 2018 13:49:07 +0000 (08:49 -0500)]
Merge pull request #2309 from brauner/2018-05-08/fix_execute

execute: do not check inherited fds again

6 years agoexecute: do not check inherited fds again
Christian Brauner [Tue, 8 May 2018 15:58:36 +0000 (17:58 +0200)]
execute: do not check inherited fds again

This is already done in do_lxcapi_start{l}() so a) no need to do it again here
and b) this would close the state socket pair sockets, corrup the fd, and lead
to EBADF.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2305 from brauner/2018-05-04/fix_execute_logging
Christian Brauner [Fri, 4 May 2018 10:35:23 +0000 (12:35 +0200)]
Merge pull request #2305 from brauner/2018-05-04/fix_execute_logging

fix logic for execute log file

6 years agoexecute: use static buffer
Christian Brauner [Fri, 4 May 2018 09:59:27 +0000 (11:59 +0200)]
execute: use static buffer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: add LXC_PROC_PID_FD_LEN
Christian Brauner [Fri, 4 May 2018 09:59:11 +0000 (11:59 +0200)]
utils: add LXC_PROC_PID_FD_LEN

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofix logic for execute log file
Tycho Andersen [Thu, 3 May 2018 18:32:19 +0000 (18:32 +0000)]
fix logic for execute log file

The problem here is that lxc-init runs *inside* the container. So if a
person has the log file set to /home/$USER/foo, lxc-init ends up making a
directory /home/$USER/foo inside the container to put the log file in. What
we really want are the logs to be propagated from inside the container to
the outside. We accomplish this by passing an fd without O_CLOEXEC, and
telling lxc-init to log to that file.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
6 years agocoverity: #1435263
Christian Brauner [Mon, 30 Apr 2018 10:18:23 +0000 (12:18 +0200)]
coverity: #1435263

Use after free

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2297 from brauner/2018-04-29/bugfixes
Stéphane Graber [Mon, 30 Apr 2018 09:29:41 +0000 (05:29 -0400)]
Merge pull request #2297 from brauner/2018-04-29/bugfixes

coverity

6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:58:06 +0000 (16:58 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:56:58 +0000 (16:56 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 14:45:43 +0000 (16:45 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: use thread-safe open() + write()
Christian Brauner [Sun, 29 Apr 2018 14:42:44 +0000 (16:42 +0200)]
lxccontainer: use thread-safe open() + write()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 13:08:46 +0000 (15:08 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_unfreeze()
Christian Brauner [Sun, 29 Apr 2018 12:53:12 +0000 (14:53 +0200)]
lxccontainer: do_lxcapi_unfreeze()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_freeze()
Christian Brauner [Sun, 29 Apr 2018 12:52:40 +0000 (14:52 +0200)]
lxccontainer: do_lxcapi_freeze()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: do_lxcapi_is_running()
Christian Brauner [Sun, 29 Apr 2018 12:49:36 +0000 (14:49 +0200)]
lxccontainer: do_lxcapi_is_running()

There's no need to do string comparisons.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 12:48:08 +0000 (14:48 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: use thread-safe *_OFD_* locks
Christian Brauner [Sun, 29 Apr 2018 11:39:28 +0000 (13:39 +0200)]
lxccontainer: use thread-safe *_OFD_* locks

If they aren't available fallback to BSD flock()s.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: non-functional changes
Christian Brauner [Sun, 29 Apr 2018 11:32:42 +0000 (13:32 +0200)]
lxccontainer: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1426734
Christian Brauner [Sat, 28 Apr 2018 22:53:12 +0000 (00:53 +0200)]
coverity: #1426734

Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435198
Christian Brauner [Sat, 28 Apr 2018 22:50:50 +0000 (00:50 +0200)]
coverity: #1435198

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435200
Christian Brauner [Sat, 28 Apr 2018 22:49:30 +0000 (00:49 +0200)]
coverity: #1435200

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435203
Christian Brauner [Sat, 28 Apr 2018 22:43:34 +0000 (00:43 +0200)]
coverity: #1435203

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435205
Christian Brauner [Sat, 28 Apr 2018 22:38:29 +0000 (00:38 +0200)]
coverity: #1435205

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435206
Christian Brauner [Sat, 28 Apr 2018 22:32:42 +0000 (00:32 +0200)]
coverity: #1435206

Time of check time of use

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435207
Christian Brauner [Sat, 28 Apr 2018 22:22:54 +0000 (00:22 +0200)]
coverity: #1435207

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435208
Christian Brauner [Sat, 28 Apr 2018 22:21:33 +0000 (00:21 +0200)]
coverity: #1435208

Unused value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1435210
Christian Brauner [Sat, 28 Apr 2018 22:16:05 +0000 (00:16 +0200)]
coverity: #1435210

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2279 from kunkku/create-umask
Christian Brauner [Sat, 28 Apr 2018 21:23:27 +0000 (23:23 +0200)]
Merge pull request #2279 from kunkku/create-umask

do_lxcapi_create: set umask

6 years agoMerge pull request #2293 from pkun/master
Christian Brauner [Thu, 26 Apr 2018 16:36:46 +0000 (18:36 +0200)]
Merge pull request #2293 from pkun/master

Fix tool_utils.c build when HAVE_SETNS is unset

6 years agoFix tool_utils.c build when HAVE_SETNS is unset
Serj Kalichev [Thu, 26 Apr 2018 13:20:30 +0000 (16:20 +0300)]
Fix tool_utils.c build when HAVE_SETNS is unset

Add inline setns() function to tool_utils.h. Without it
tool_utils.c can't be build when HAVE_SETNS is unset.

Signed-off-by: Serj Kalichev <serj.kalichev@gmail.com>
6 years agoMerge pull request #2289 from lifeng68/Fix_mem_leak_list_active_containers
Christian Brauner [Tue, 24 Apr 2018 13:14:25 +0000 (15:14 +0200)]
Merge pull request #2289 from lifeng68/Fix_mem_leak_list_active_containers

Fix memory leak in list_active_containers

6 years agoFix memory leak in list_active_containers
LiFeng [Tue, 24 Apr 2018 19:10:15 +0000 (15:10 -0400)]
Fix memory leak in list_active_containers

Signed-off-by: LiFeng <lifeng68@huawei.com>
6 years agoFix the memory leak in cgfsng_attach
LiFeng [Tue, 24 Apr 2018 16:53:57 +0000 (12:53 -0400)]
Fix the memory leak in cgfsng_attach

Signed-off-by: LiFeng <lifeng68@huawei.com>