]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
5 years agocaps: fix illegal access to array bound
2xsec [Mon, 3 Sep 2018 06:10:05 +0000 (15:10 +0900)]
caps: fix illegal access to array bound

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
5 years agoMerge pull request #2581 from brauner/2018-09-02/macro
Wolfgang Bumiller [Sun, 2 Sep 2018 08:03:16 +0000 (10:03 +0200)]
Merge pull request #2581 from brauner/2018-09-02/macro

macro: move MS_* macros

5 years agomacro: move MS_* macros
Christian Brauner [Sun, 2 Sep 2018 05:32:23 +0000 (07:32 +0200)]
macro: move MS_* macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2580 from brauner/2018-09-01/revert_blub_revert
Wolfgang Bumiller [Sat, 1 Sep 2018 18:53:32 +0000 (20:53 +0200)]
Merge pull request #2580 from brauner/2018-09-01/revert_blub_revert

Revert "Revert "tree-wide: use sizeof on static arrays""

5 years agoRevert "Revert "tree-wide: use sizeof on static arrays""
Christian Brauner [Sat, 1 Sep 2018 18:25:07 +0000 (20:25 +0200)]
Revert "Revert "tree-wide: use sizeof on static arrays""

This reverts commit 2fb7cf0b325d2e34cd6faa2758cbaba6b6c3b99f.

The problem wasn't caused by the reverted commit and was fixed in

commit 0c9b1f826d3 ("macro: calculate buffer lengths correctly")

The full explanation can be taken from the following irc excerpt from
the #lxc-dev channel:

│19:54:47 brauner | there was a bug in one of the standard macros we used
│19:55:01 brauner | and the changes by INTTYPE_TO_STRLEN() caused the issue to surface
│19:55:03 brauner | which is good
│19:55:16 brauner | i sent a branch and stgraber merged it that fixes it
│19:57:56  Blub\0 | so...
│19:58:31  Blub\0 | still doesn't explain how it was the sizeof() patch
│20:07:14 brauner | Blub\0: so here's the long explanation
│20:07:35 brauner | Blub\0: stgraber bumped pid_max on our jenkins test builders
│20:07:53 brauner | Blub\0: because we're running *a lot* of containers
│20:07:56 brauner | in any case
│20:08:06 brauner | there was a buffer
│20:08:12 brauner | LXC_LSMATTRLEN
│20:08:59 brauner | it used to be
│20:09:03 brauner | -/* /proc/pid-to-str/attr/current = (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) */
│20:09:03 brauner | -#define LXC_LSMATTRLEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
│20:09:14 brauner | which one can see is wrong
│20:09:21 brauner | before the INTTYPE patchset
│20:09:40 brauner | INTTYPE_TO_STRLEN(pid_t) was LXC_NUMSTRLEN64
│20:09:45 brauner | which gave you 21 chars
│20:09:57 brauner | so it accounted for the missing parts
│20:10:03 brauner | because the correct macro should've been
│20:10:17 brauner | +/* /proc/        = 6
│20:10:17 brauner | + *               +
│20:10:17 brauner | + * <pid-as-str>  = INTTYPE_TO_STRLEN(pid_t)
│20:10:17 brauner | + *               +
│20:10:17 brauner | + * /attr/        = 6
│20:10:17 brauner | + *               +
│20:10:17 brauner | + * /current      = 8
│20:10:17 brauner | + *               +
│20:10:17 brauner | + * \0            = 1
│20:10:17 brauner | + */
│20:10:17 brauner | +#define LXC_LSMATTRLEN (6 + INTTYPE_TO_STRLEN(pid_t) + 6 + 8 + 1)
│20:10:24  Blub\0 | still
│20:10:31 brauner | the issue was only seen
│20:10:39 brauner | when the pid number hit a specific maximum
│20:10:50  Blub\0 | the sizeof patch only changed instances of actual char buf[A_FIXED_NUMBER] + snprintf(buf, A_FIXED_NUMBER, ...)
│20:10:54 brauner | aka exceeded the newly shortened buffer
│20:11:42 brauner | your patch was a red herring
│20:12:03  Blub\0 | I guess
│20:12:06 brauner | it didn't cause it
│20:12:14 brauner | it just surfaced at the same time it was merged
│20:12:25  Blub\0 | so we can revert the revert then? :)
│20:12:35 brauner | yes, that was th eplan all along

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2579 from brauner/2018-08-31/int64_t_pids
Stéphane Graber [Fri, 31 Aug 2018 23:52:23 +0000 (16:52 -0700)]
Merge pull request #2579 from brauner/2018-08-31/int64_t_pids

macro: calculate buffer lengths correctly

5 years agomacro: calculate buffer lengths correctly
Christian Brauner [Fri, 31 Aug 2018 22:53:33 +0000 (00:53 +0200)]
macro: calculate buffer lengths correctly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: assign before converting to pointer
Christian Brauner [Fri, 31 Aug 2018 22:14:06 +0000 (00:14 +0200)]
commands: assign before converting to pointer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2578 from brauner/2018-08-31/int64_t_pids
Stéphane Graber [Fri, 31 Aug 2018 21:30:21 +0000 (14:30 -0700)]
Merge pull request #2578 from brauner/2018-08-31/int64_t_pids

commands: pass around intmax_t

5 years agocommands: pass around intmax_t
Christian Brauner [Fri, 31 Aug 2018 19:25:45 +0000 (21:25 +0200)]
commands: pass around intmax_t

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoRevert "tree-wide: use sizeof on static arrays"
Stéphane Graber [Fri, 31 Aug 2018 18:58:17 +0000 (11:58 -0700)]
Revert "tree-wide: use sizeof on static arrays"

This reverts commit 81a3bb64b4147ac6da3087cb77ac67828a2f2b76.

This commit broke all builders running with pid_max > 32768.

Reverting for now so we can bring the build farm back online.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoMerge pull request #2435 from brauner/2018-06-27/storage_managed
Wolfgang Bumiller [Thu, 30 Aug 2018 06:28:08 +0000 (08:28 +0200)]
Merge pull request #2435 from brauner/2018-06-27/storage_managed

[RFC] conf: introduce lxc.rootfs.managed

5 years agoMerge pull request #2577 from Blub/inttype-lengths
Christian Brauner [Wed, 29 Aug 2018 20:26:46 +0000 (22:26 +0200)]
Merge pull request #2577 from Blub/inttype-lengths

tree-wide: use sizeof on static arrays

5 years agotree-wide: use sizeof on static arrays
Wolfgang Bumiller [Wed, 29 Aug 2018 19:45:45 +0000 (21:45 +0200)]
tree-wide: use sizeof on static arrays

Instead of duplicating their lengths in read/snprintf/...
calls.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoMerge pull request #2572 from brauner/2018-08-24/musl_fixes
Wolfgang Bumiller [Wed, 29 Aug 2018 19:39:05 +0000 (21:39 +0200)]
Merge pull request #2572 from brauner/2018-08-24/musl_fixes

build: fix musl + add compiler.h

5 years agoMerge pull request #2576 from brauner/2018-08-28/command_init_id
Stéphane Graber [Tue, 28 Aug 2018 18:29:02 +0000 (11:29 -0700)]
Merge pull request #2576 from brauner/2018-08-28/command_init_id

commands: always return -1 on lxc_cmd_get_init_pid() err

5 years agostring_utils: use UINT64_MAX macro
Christian Brauner [Sun, 26 Aug 2018 23:05:18 +0000 (01:05 +0200)]
string_utils: use UINT64_MAX macro

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocaps: move macros to macro header
Christian Brauner [Sun, 26 Aug 2018 23:01:47 +0000 (01:01 +0200)]
caps: move macros to macro header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostart: remove duplicate macros
Christian Brauner [Sun, 26 Aug 2018 22:59:12 +0000 (00:59 +0200)]
start: remove duplicate macros

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMakefile: correctly add ifaddrs to noinst_HEADERS
Christian Brauner [Sun, 26 Aug 2018 15:24:27 +0000 (17:24 +0200)]
Makefile: correctly add ifaddrs to noinst_HEADERS

Before this we only added ifaddrs.h to noinst_HEADERS when we were running on
Android's bionic. That obviously doesn't make sense since it is possible that
ifaddrs.h is not defined and we're also not running on Android's bionic.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: coding style fixes
Christian Brauner [Sun, 26 Aug 2018 10:34:11 +0000 (12:34 +0200)]
macro: coding style fixes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: final INTTYPE_TO_STRLEN() related cleanups
Christian Brauner [Sat, 25 Aug 2018 10:30:50 +0000 (12:30 +0200)]
macro: final INTTYPE_TO_STRLEN() related cleanups

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotests: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:39:57 +0000 (12:39 +0200)]
tests: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconf: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:28:32 +0000 (12:28 +0200)]
conf: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:27:10 +0000 (12:27 +0200)]
tools: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoutils: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:25:27 +0000 (12:25 +0200)]
utils: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostring_utils: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:22:53 +0000 (12:22 +0200)]
string_utils: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agonetwork: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:20:12 +0000 (12:20 +0200)]
network: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomonitor: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:17:36 +0000 (12:17 +0200)]
monitor: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolxccontainer: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:16:32 +0000 (12:16 +0200)]
lxccontainer: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:15:15 +0000 (12:15 +0200)]
macro: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolsm: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:13:55 +0000 (12:13 +0200)]
lsm: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolog: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:11:42 +0000 (12:11 +0200)]
log: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconfile: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:09:41 +0000 (12:09 +0200)]
confile: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocgfsng: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:04:56 +0000 (12:04 +0200)]
cgfsng: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocaps: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/
Christian Brauner [Sat, 25 Aug 2018 10:04:17 +0000 (12:04 +0200)]
caps: s/LXC_NUMSTRLEN64/INTTYPE_TO_STRLEN()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: add INTTYPE_TO_STRLEN()
Christian Brauner [Sat, 25 Aug 2018 09:56:10 +0000 (11:56 +0200)]
macro: add INTTYPE_TO_STRLEN()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: add PTR_TO_INT() and INT_TO_PTR()
Christian Brauner [Sat, 25 Aug 2018 09:31:36 +0000 (11:31 +0200)]
macro: add PTR_TO_INT() and INT_TO_PTR()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: move LXC_CMD_DATA_MAX from commands.h
Christian Brauner [Sat, 25 Aug 2018 09:30:39 +0000 (11:30 +0200)]
macro: move LXC_CMD_DATA_MAX from commands.h

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: add LXC_AUDS_ADDR_LEN
Christian Brauner [Sat, 25 Aug 2018 05:24:37 +0000 (07:24 +0200)]
macro: add LXC_AUDS_ADDR_LEN

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: ensure -1 is sent on EPIPE for init pid
Christian Brauner [Sat, 25 Aug 2018 05:01:26 +0000 (07:01 +0200)]
commands: ensure -1 is sent on EPIPE for init pid

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agotests: cleanup Makefile
Christian Brauner [Sat, 25 Aug 2018 04:44:36 +0000 (06:44 +0200)]
tests: cleanup Makefile

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agotests: add basic.c
Christian Brauner [Sat, 25 Aug 2018 04:36:12 +0000 (06:36 +0200)]
tests: add basic.c

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agocommands: return -1 on lxc_cmd_get_init_pid() err
Christian Brauner [Sat, 25 Aug 2018 04:17:49 +0000 (06:17 +0200)]
commands: return -1 on lxc_cmd_get_init_pid() err

A while back the whole lxc_cmd() infrastructure was changed to return
meaningful negative error codes. But lxc_cmd_get_init_pid() should always
return -1. Make it so!

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agocompiler: add compiler.h header
Christian Brauner [Fri, 24 Aug 2018 14:07:07 +0000 (16:07 +0200)]
compiler: add compiler.h header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoconfigure: reorder header checks
Christian Brauner [Fri, 24 Aug 2018 10:44:21 +0000 (12:44 +0200)]
configure: reorder header checks

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agobuild: fix musl
Christian Brauner [Fri, 24 Aug 2018 10:25:28 +0000 (12:25 +0200)]
build: fix musl

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2574 from brauner/2018-08-26/cgroup_keep
Stéphane Graber [Tue, 28 Aug 2018 18:06:40 +0000 (11:06 -0700)]
Merge pull request #2574 from brauner/2018-08-26/cgroup_keep

 confile: add lxc.cgroup.keep

5 years agocgroups: don't escape if lxc.cgroup.keep is true
Christian Brauner [Sun, 26 Aug 2018 16:59:01 +0000 (18:59 +0200)]
cgroups: don't escape if lxc.cgroup.keep is true

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Felix Abecassis <fabecassis@nvidia.com>
Cc: Jonathan Calmels <jcalmels@nvidia.com>
5 years agoconfile: add lxc.cgroup.keep
Christian Brauner [Fri, 18 May 2018 14:16:22 +0000 (16:16 +0200)]
confile: add lxc.cgroup.keep

This adds the new lxc.cgroup.keep config key. The key can be used to instruct
LXC to not escape to never escape to the root cgroup. This makes it easy for
users to adhere to restrictions enforced by cgroup2 and systemd. Specifically,
this makes it possible to run LXC containers as systemd services.

Note that cgroup v1 is considered legacy and will not see additional
controllers being added to it. This means that it is safe to use
lxc.cgroup.keep as config key since there is no "keep" controller. The only way
a conflict can be introduced is if the user is creating a named controller. I
think this case can be safely ignored since it is super rare and also the users
problem.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Felix Abecassis <fabecassis@nvidia.com>
Cc: Jonathan Calmels <jcalmels@nvidia.com>
5 years agostart: do not initialize cgroup_ops twice
Christian Brauner [Sun, 26 Aug 2018 16:49:21 +0000 (18:49 +0200)]
start: do not initialize cgroup_ops twice

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2570 from brauner/2018-08-23/fix_privileged_logging
Wolfgang Bumiller [Thu, 23 Aug 2018 15:58:43 +0000 (17:58 +0200)]
Merge pull request #2570 from brauner/2018-08-23/fix_privileged_logging

execute: pass /proc/self/fd/<nr>

5 years agoexecute: pass /proc/self/fd/<nr>
Christian Brauner [Thu, 23 Aug 2018 15:35:40 +0000 (17:35 +0200)]
execute: pass /proc/self/fd/<nr>

Passing /proc/1/fd/<nr> presupposes that CLONE_NEWPID was specified. This isn't
the case when users use lxc.namespace.keep = pid to inherit pid namespaces.
Pass /proc/self/fd/<nr> instead.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Mrinal Dhillon <mdhillon@juniper.net>
5 years agoMerge pull request #2569 from brauner/2018-08-23/fix_unpriv_execute_logging
Stéphane Graber [Thu, 23 Aug 2018 15:30:14 +0000 (11:30 -0400)]
Merge pull request #2569 from brauner/2018-08-23/fix_unpriv_execute_logging

execute: skip lxc-init logging when unprivileged

5 years agoexecute: skip lxc-init logging when unprivileged
Christian Brauner [Thu, 23 Aug 2018 13:46:12 +0000 (15:46 +0200)]
execute: skip lxc-init logging when unprivileged

Unprivileged app containers will not be able to open the passed in
/proc/1/fd/<idx> log path and will thus currently fail completely as soon as
any log level or log file is passed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reported-by: Mrinal Dhillon <mdhillon@juniper.net>
5 years agoMerge pull request #2568 from brauner/2018-08-22/ifaddrs
Wolfgang Bumiller [Thu, 23 Aug 2018 12:26:42 +0000 (14:26 +0200)]
Merge pull request #2568 from brauner/2018-08-22/ifaddrs

include: add safe getifaddrs() version

5 years agoMakefile: conditionalize ifaddrs.h inclusion
Christian Brauner [Wed, 22 Aug 2018 18:28:52 +0000 (20:28 +0200)]
Makefile: conditionalize ifaddrs.h inclusion

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoifaddrs: add safe implementation of getifaddrs()
Christian Brauner [Wed, 22 Aug 2018 15:29:33 +0000 (17:29 +0200)]
ifaddrs: add safe implementation of getifaddrs()

The old version was crazy. This replaces it with an internal version based on
musl.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2565 from brauner/2018-08-22/more_fixes
Stéphane Graber [Wed, 22 Aug 2018 22:54:18 +0000 (18:54 -0400)]
Merge pull request #2565 from brauner/2018-08-22/more_fixes

remove last pam_cgfs special-casing

5 years agoMerge pull request #2567 from stgraber/master
Christian Brauner [Wed, 22 Aug 2018 18:06:14 +0000 (20:06 +0200)]
Merge pull request #2567 from stgraber/master

Fix typo

5 years agoFix typo
Stéphane Graber [Wed, 22 Aug 2018 17:58:17 +0000 (13:58 -0400)]
Fix typo

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
5 years agoconf: add missing headers
Christian Brauner [Wed, 22 Aug 2018 13:52:18 +0000 (15:52 +0200)]
conf: add missing headers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMakefile: remove last pam_cgfs special-casing
Christian Brauner [Wed, 22 Aug 2018 13:45:54 +0000 (15:45 +0200)]
Makefile: remove last pam_cgfs special-casing

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostring_utils: add remove_trailing_slashes()
Christian Brauner [Wed, 22 Aug 2018 13:45:33 +0000 (15:45 +0200)]
string_utils: add remove_trailing_slashes()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostring_utils: remove unused headers
Christian Brauner [Wed, 22 Aug 2018 13:40:58 +0000 (15:40 +0200)]
string_utils: remove unused headers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agostring_utils: remove unnecessary include
Christian Brauner [Wed, 22 Aug 2018 13:37:41 +0000 (15:37 +0200)]
string_utils: remove unnecessary include

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoinitutils: remove useless comment
Christian Brauner [Wed, 22 Aug 2018 13:37:04 +0000 (15:37 +0200)]
initutils: remove useless comment

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years ago{file,string}_utils: remove NO_LOG
Christian Brauner [Wed, 22 Aug 2018 13:36:15 +0000 (15:36 +0200)]
{file,string}_utils: remove NO_LOG

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2564 from brauner/2018-08-22/strerror_r_detection
Wolfgang Bumiller [Wed, 22 Aug 2018 12:24:08 +0000 (14:24 +0200)]
Merge pull request #2564 from brauner/2018-08-22/strerror_r_detection

log: handle strerror_r() versions + autotools: add --{disable,enable}-thread-safety

5 years agolog: fail build on ENFORCE_THREAD_SAFETY error
Christian Brauner [Wed, 22 Aug 2018 11:27:24 +0000 (13:27 +0200)]
log: fail build on ENFORCE_THREAD_SAFETY error

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoautotools: add --{disable,enable}-thread-safety
Christian Brauner [Wed, 22 Aug 2018 11:13:29 +0000 (13:13 +0200)]
autotools: add --{disable,enable}-thread-safety

Fail the build if --enable-thread-safety is passed and the environment cannot
guarantee thread-safety.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agolog: handle strerror_r() versions
Christian Brauner [Wed, 22 Aug 2018 10:25:16 +0000 (12:25 +0200)]
log: handle strerror_r() versions

Closes #2563.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2562 from brauner/2018-08-22/check_compiler
Christian Brauner [Tue, 21 Aug 2018 23:57:28 +0000 (01:57 +0200)]
Merge pull request #2562 from brauner/2018-08-22/check_compiler

autotools: check if compiler is new enough

5 years agostart: add out_sync_fini cleanup label
Christian Brauner [Tue, 21 Aug 2018 23:54:40 +0000 (01:54 +0200)]
start: add out_sync_fini cleanup label

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoautotools: check if compiler is new enough
Christian Brauner [Tue, 21 Aug 2018 22:04:19 +0000 (00:04 +0200)]
autotools: check if compiler is new enough

We line up with the Linux kernel and won't support any compiler under 4.6.
Additionally, we also require at least gnu99 so this is due anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2554 from brauner/2018-08-21/attach_fixes
Stéphane Graber [Tue, 21 Aug 2018 15:59:55 +0000 (11:59 -0400)]
Merge pull request #2554 from brauner/2018-08-21/attach_fixes

attach: bugfixes

5 years agoMerge pull request #2561 from brauner/2018-08-21/test_pam_cgfs
Stéphane Graber [Tue, 21 Aug 2018 15:58:01 +0000 (11:58 -0400)]
Merge pull request #2561 from brauner/2018-08-21/test_pam_cgfs

Makefile: don't allow undefined symbols

5 years agoMakefile: don't allow undefined symbols
Christian Brauner [Tue, 21 Aug 2018 15:13:39 +0000 (17:13 +0200)]
Makefile: don't allow undefined symbols

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: move macros from attach.c
Christian Brauner [Mon, 20 Aug 2018 23:09:19 +0000 (01:09 +0200)]
macro: move macros from attach.c

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoattach: move struct declaration to top
Christian Brauner [Mon, 20 Aug 2018 23:06:05 +0000 (01:06 +0200)]
attach: move struct declaration to top

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agomacro: s/rexit()/_exit()/g
Christian Brauner [Mon, 20 Aug 2018 23:05:14 +0000 (01:05 +0200)]
macro: s/rexit()/_exit()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2560 from brauner/2018-08-21/fix_fully_unprivileged_containers
Stéphane Graber [Tue, 21 Aug 2018 14:53:57 +0000 (10:53 -0400)]
Merge pull request #2560 from brauner/2018-08-21/fix_fully_unprivileged_containers

conf: fix devpts mounting when fully unprivileged

5 years agoMerge pull request #2558 from brauner/2018-08-21/pam_cgfs
Stéphane Graber [Tue, 21 Aug 2018 14:52:46 +0000 (10:52 -0400)]
Merge pull request #2558 from brauner/2018-08-21/pam_cgfs

pam_cgfs: build from the same sources as liblxc

5 years agoconf: fix devpts mounting when fully unprivileged
Christian Brauner [Tue, 21 Aug 2018 12:16:09 +0000 (14:16 +0200)]
conf: fix devpts mounting when fully unprivileged

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agopam_cgfs: build from the same sources as liblxc
Christian Brauner [Tue, 21 Aug 2018 09:35:31 +0000 (11:35 +0200)]
pam_cgfs: build from the same sources as liblxc

Closes #2556.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoutils: split into {file,string}_utils.{c,h}
Christian Brauner [Tue, 21 Aug 2018 10:59:07 +0000 (12:59 +0200)]
utils: split into {file,string}_utils.{c,h}

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2559 from ssup2/master
Christian Brauner [Tue, 21 Aug 2018 10:59:49 +0000 (12:59 +0200)]
Merge pull request #2559 from ssup2/master

start: Fix net iface remaining issue

5 years agostart: Fix net iface remaining issue
Jungsub Shin [Tue, 21 Aug 2018 10:21:59 +0000 (19:21 +0900)]
start: Fix net iface remaining issue

When creating container that has multiple net ifaces fails
because of wrong net config, lxc doesn't remove previously created
net ifaces.

Solve this issue with changing return path in lxc_spawn().

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
5 years agoMerge pull request #2555 from tcharding/clang-format-cmd
Christian Brauner [Tue, 21 Aug 2018 09:25:34 +0000 (11:25 +0200)]
Merge pull request #2555 from tcharding/clang-format-cmd

cmd: Fix format issues found by clang-format

5 years agoMerge pull request #2557 from 2xsec/bugfix
Christian Brauner [Tue, 21 Aug 2018 09:24:52 +0000 (11:24 +0200)]
Merge pull request #2557 from 2xsec/bugfix

list: fix indent

5 years agolist: fix indent
2xsec [Tue, 21 Aug 2018 06:02:06 +0000 (15:02 +0900)]
list: fix indent

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
5 years agocmd: Fix format issues found by clang-format
Tobin C. Harding [Mon, 20 Aug 2018 23:44:36 +0000 (09:44 +1000)]
cmd: Fix format issues found by clang-format

clang-format finds a few format issues, lets fix these up.

Fix format issues found by clang-format.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
5 years agoMerge pull request #2552 from tcharding/cpp-check
Christian Brauner [Mon, 20 Aug 2018 23:37:31 +0000 (01:37 +0200)]
Merge pull request #2552 from tcharding/cpp-check

cmd: Lint with cppcheck

5 years agocmd: Reduce scope of 'count' variable
Tobin C. Harding [Mon, 20 Aug 2018 06:31:33 +0000 (16:31 +1000)]
cmd: Reduce scope of 'count' variable

Variable is used in one plaice only within a nested statement block.
The code is cleaner if the variable is declared near where it is used.
Found using cppcheck.

Reduce the scope of 'count' variable.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
5 years agocmd: Do not reassign variable before it is used
Tobin C. Harding [Mon, 20 Aug 2018 06:28:39 +0000 (16:28 +1000)]
cmd: Do not reassign variable before it is used

cppcheck emits warning

  Variable 'ofd' is reassigned a value before the old one has been used.

We do not need to initialise a variable if it is assigned to on first use.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
5 years agoMerge pull request #2549 from brauner/2018-08-19/cmd_usernsexec_fixes
Wolfgang Bumiller [Mon, 20 Aug 2018 13:35:10 +0000 (15:35 +0200)]
Merge pull request #2549 from brauner/2018-08-19/cmd_usernsexec_fixes

cmd: lxc-usernsexec fixes + macro: move declarations + config_utils: macvlan fixes

5 years agocmd: use goto for cleanup in lxc-usernsexec
Christian Brauner [Mon, 20 Aug 2018 12:24:55 +0000 (14:24 +0200)]
cmd: use goto for cleanup in lxc-usernsexec

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
5 years agoMerge pull request #2550 from 2xsec/bugfix
Christian Brauner [Mon, 20 Aug 2018 10:34:15 +0000 (12:34 +0200)]
Merge pull request #2550 from 2xsec/bugfix

storage: exit() => _exit()

5 years agoMerge pull request #2542 from tcharding/signal-fail-2523
Christian Brauner [Mon, 20 Aug 2018 10:33:45 +0000 (12:33 +0200)]
Merge pull request #2542 from tcharding/signal-fail-2523

tools: Indicate container startup failure

5 years agoMerge pull request #2553 from Blub/ttydir-path-fixup
Christian Brauner [Mon, 20 Aug 2018 08:37:50 +0000 (10:37 +0200)]
Merge pull request #2553 from Blub/ttydir-path-fixup

conf: fix path/lxcpath mixups in tty setup