]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
7 years agocoverity: #1435747 2353/head
Christian Brauner [Sat, 26 May 2018 01:25:20 +0000 (03:25 +0200)] 
coverity: #1435747

Dereference before null check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocoverity: #1435803
Christian Brauner [Sat, 26 May 2018 01:22:58 +0000 (03:22 +0200)] 
coverity: #1435803

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocoverity: #1435805
Christian Brauner [Sat, 26 May 2018 01:21:05 +0000 (03:21 +0200)] 
coverity: #1435805

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agocoverity: #1435806
Christian Brauner [Sat, 26 May 2018 01:20:36 +0000 (03:20 +0200)] 
coverity: #1435806

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agotools: fix lxc-create with global config value II
Christian Brauner [Fri, 25 May 2018 17:35:00 +0000 (19:35 +0200)] 
tools: fix lxc-create with global config value II

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2352 from brauner/2018-05-25/further_seccomp_fixes
Stéphane Graber [Fri, 25 May 2018 14:12:04 +0000 (10:12 -0400)] 
Merge pull request #2352 from brauner/2018-05-25/further_seccomp_fixes

seccomp: more fixes

7 years agotools: fix lxc-create with global config value 2352/head
Christian Brauner [Fri, 25 May 2018 13:43:59 +0000 (15:43 +0200)] 
tools: fix lxc-create with global config value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: make do_resolve_add_rule() more strict
Christian Brauner [Fri, 25 May 2018 11:27:50 +0000 (13:27 +0200)] 
seccomp: make do_resolve_add_rule() more strict

Let's error out on syscalls that cannot be resolved or fail to resolve instead
of just warning users.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: parse_v2_rules()
Christian Brauner [Fri, 25 May 2018 11:26:25 +0000 (13:26 +0200)] 
seccomp: parse_v2_rules()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: lxc_read_seccomp_config()
Christian Brauner [Fri, 25 May 2018 11:16:31 +0000 (13:16 +0200)] 
seccomp: lxc_read_seccomp_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2351 from Blub/seccomp-fixup-2
Christian Brauner [Fri, 25 May 2018 10:43:53 +0000 (12:43 +0200)] 
Merge pull request #2351 from Blub/seccomp-fixup-2

Seccomp fixup part 2

7 years agoseccomp: error on unrecognized actions 2351/head
Wolfgang Bumiller [Fri, 25 May 2018 10:07:12 +0000 (12:07 +0200)] 
seccomp: error on unrecognized actions

Be more strict about unrecognized actions. Previously the
parser would happily accept lines with typos like:

  kexec_load errrno 1

(note the extra 'r')

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
7 years agoseccomp: refactor line handling of parse_config
Wolfgang Bumiller [Fri, 25 May 2018 10:04:13 +0000 (12:04 +0200)] 
seccomp: refactor line handling of parse_config

Moving parse_config_v2 to use getline accidentally parsed
the wrong buffer. Since both _v1 and _v2 now use getline it
seems to be simpler to also use getline() for the first line
before entering the version specific parsers and pass along
the pointer and size so they can reuse them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 9c3798eba41c ("seccomp: parse_config_v2()")
7 years agoseccomp: re-add action parse error handling
Wolfgang Bumiller [Fri, 25 May 2018 09:44:42 +0000 (11:44 +0200)] 
seccomp: re-add action parse error handling

This can happen when the 'errno' action can't parse its
supplied number.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: f67c94d00a0d ("seccomp: parse_v2_rules()")
7 years agoMerge pull request #2350 from Blub/seccomp-cleanup-fixup
Christian Brauner [Fri, 25 May 2018 07:13:29 +0000 (09:13 +0200)] 
Merge pull request #2350 from Blub/seccomp-cleanup-fixup

seccomp: leak fixup

7 years agoseccomp: leak fixup 2350/head
Wolfgang Bumiller [Fri, 25 May 2018 06:42:01 +0000 (08:42 +0200)] 
seccomp: leak fixup

Fix an error case not free()ing the line forgotten during
the move from fgets() on a static buffer to using getline.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: ccf8d128e430 ("seccomp: parse_config_v1()")
7 years agoMerge pull request #2349 from brauner/2018-05-24/prevent_fd_leak
Stéphane Graber [Fri, 25 May 2018 00:22:28 +0000 (20:22 -0400)] 
Merge pull request #2349 from brauner/2018-05-24/prevent_fd_leak

lxccontainer: fix fd leaks when sending signals

7 years agostart: log setns() failure 2349/head
Christian Brauner [Thu, 24 May 2018 22:25:16 +0000 (00:25 +0200)] 
start: log setns() failure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoconfile: order architectures
Christian Brauner [Thu, 24 May 2018 22:12:46 +0000 (00:12 +0200)] 
confile: order architectures

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxccontainer: fix fd leaks when sending signals
Christian Brauner [Thu, 24 May 2018 22:00:50 +0000 (00:00 +0200)] 
lxccontainer: fix fd leaks when sending signals

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #2347 from brauner/2018-05-24/seccomp_cleanups
Stéphane Graber [Thu, 24 May 2018 20:57:13 +0000 (16:57 -0400)] 
Merge pull request #2347 from brauner/2018-05-24/seccomp_cleanups

seccomp: cleanup

7 years agoMerge pull request #2348 from brauner/2018-05-24/pthread_sigmask
Stéphane Graber [Thu, 24 May 2018 20:53:19 +0000 (16:53 -0400)] 
Merge pull request #2348 from brauner/2018-05-24/pthread_sigmask

tree-wide: s/sigprocmask/pthread_sigmask()/g

7 years agoutils: fix task_blocking_signal() 2348/head
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>
7 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>
7 years agoseccomp: lxc_read_seccomp_config() 2347/head
Christian Brauner [Thu, 24 May 2018 14:53:31 +0000 (16:53 +0200)] 
seccomp: lxc_read_seccomp_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: parse_config()
Christian Brauner [Thu, 24 May 2018 14:49:28 +0000 (16:49 +0200)] 
seccomp: parse_config()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: parse_config_v2()
Christian Brauner [Thu, 24 May 2018 14:47:08 +0000 (16:47 +0200)] 
seccomp: parse_config_v2()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: do_resolve_add_rule()
Christian Brauner [Thu, 24 May 2018 14:35:21 +0000 (16:35 +0200)] 
seccomp: do_resolve_add_rule()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: scmp_filter_ctx get_new_ctx()
Christian Brauner [Thu, 24 May 2018 14:28:02 +0000 (16:28 +0200)] 
seccomp: scmp_filter_ctx get_new_ctx()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: get_hostarch()
Christian Brauner [Thu, 24 May 2018 14:24:59 +0000 (16:24 +0200)] 
seccomp: get_hostarch()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: move #ifdefines
Christian Brauner [Thu, 24 May 2018 14:24:09 +0000 (16:24 +0200)] 
seccomp: move #ifdefines

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: parse_v2_rules()
Christian Brauner [Thu, 24 May 2018 14:22:58 +0000 (16:22 +0200)] 
seccomp: parse_v2_rules()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: fix get_seccomp_arg_value()
Christian Brauner [Thu, 24 May 2018 11:49:36 +0000 (13:49 +0200)] 
seccomp: fix get_seccomp_arg_value()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: get_v2_action()
Christian Brauner [Thu, 24 May 2018 11:47:59 +0000 (13:47 +0200)] 
seccomp: get_v2_action()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: get_action_name()
Christian Brauner [Thu, 24 May 2018 11:46:06 +0000 (13:46 +0200)] 
seccomp: get_action_name()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: get_v2_default_action()
Christian Brauner [Thu, 24 May 2018 11:42:47 +0000 (13:42 +0200)] 
seccomp: get_v2_default_action()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutils: add remove_trailing_newlines()
Christian Brauner [Thu, 24 May 2018 11:38:08 +0000 (13:38 +0200)] 
utils: add remove_trailing_newlines()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoseccomp: parse_config_v1()
Christian Brauner [Thu, 24 May 2018 11:35:01 +0000 (13:35 +0200)] 
seccomp: parse_config_v1()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxcseccomp: cleanup header
Christian Brauner [Thu, 24 May 2018 11:34:49 +0000 (13:34 +0200)] 
lxcseccomp: cleanup header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 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

7 years agoseccomp: fix type mismatch when parsing syscall arguments filters 2345/head
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>
7 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>
7 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>
7 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>
7 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

7 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

7 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

7 years agotools: only create log file when requested 2344/head
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>
7 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

7 years agoexecute: use execveat() syscall if supported 2341/head
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>
7 years agolxc-init: skip signals that can't be caught 2340/head
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>
7 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

7 years agolog: enable per-thread container name prefix 2338/head
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>
7 years agoconf: simplify write_id_mapping() 2337/head
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>
7 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>
7 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>
7 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>
7 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

7 years agocoverity: #1425802 2328/head
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>
7 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

7 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()

7 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

7 years agocapabilities: raise ambient capabilities 2332/head
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>
7 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

7 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

7 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

7 years agoconfig: allow read-write /sys in user namespace 2319/head
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>
7 years agocoverity: #1425844 2329/head
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>
7 years agocoverity: #1248106 2324/head
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>
7 years agocoverity: #1425836 2323/head
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>
7 years agocoverity: #1435602 2327/head
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>
7 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>
7 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>
7 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

7 years agodoc: Fix size unit style in Japanese lxc.container.conf(5) 2326/head
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>
7 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>
7 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

7 years agotools: s/strncpy()/memcpy()/ 2318/head
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>
7 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>
7 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

7 years agotools: s/strncpy()/strlcpy()/g 2317/head
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>
7 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

7 years agoCODING_STYLE: add section about using strlcpy() 2316/head
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>
7 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>
7 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>
7 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

7 years agoutils: fix parse_byte_size_string() coding style 2315/head
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>
7 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>
7 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

7 years agonetwork: adhere to IFNAMSIZ limit 2314/head
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>
7 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>
7 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

7 years agoconfile: satisfy gcc-8 2313/head
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>
7 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

7 years agoutils: account for terminating \0 byte 2299/head
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>
7 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>
7 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>
7 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>
7 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>
7 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