]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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>
6 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>
6 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>
6 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>

6 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>
6 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

6 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>
6 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

6 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>
6 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>
6 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

6 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

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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>
6 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>
6 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>
6 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

6 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>
6 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>
6 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

6 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

6 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>
6 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>
6 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>
6 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>
6 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

6 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

6 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>
6 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>
6 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>
6 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

6 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
6 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

6 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

6 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>
6 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>
6 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

6 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>
6 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>
6 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

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

6 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

6 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

6 years agoconf: fix path/lxcpath mixups in tty setup
Wolfgang Bumiller [Mon, 20 Aug 2018 08:02:35 +0000 (10:02 +0200)]
conf: fix path/lxcpath mixups in tty setup

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 6947153da ("conf: use mknod() to create dummy mount target")
6 years agotools: lxc-wait: add default log priority & cleanups
2xsec [Mon, 20 Aug 2018 01:43:22 +0000 (10:43 +0900)]
tools: lxc-wait: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agostorage: exit() => _exit(). when exec is failed, child process needs to use _exit()
2xsec [Mon, 20 Aug 2018 01:41:50 +0000 (10:41 +0900)]
storage: exit() => _exit(). when exec is failed, child process needs to use _exit()

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: Indicate container startup failure
Tobin C. Harding [Fri, 17 Aug 2018 06:49:46 +0000 (16:49 +1000)]
tools: Indicate container startup failure

When running lxc-autostart we do not currently indicate failure to start
containers, either partial failure i.e. some of the containers failed to
start or total failure i.e. all of the containers failed to start.

Indicate container startup failure.  For total failure exit(1), for
partial failure exit(2).

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agomacro: add macvlan properties
Christian Brauner [Sun, 19 Aug 2018 18:14:25 +0000 (20:14 +0200)]
macro: add macvlan properties

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agomacro: add missing headers
Christian Brauner [Sun, 19 Aug 2018 18:01:45 +0000 (20:01 +0200)]
macro: add missing headers

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: use safe number parsers in lxc-usernsexec
Christian Brauner [Sun, 19 Aug 2018 17:41:00 +0000 (19:41 +0200)]
cmd: use safe number parsers in lxc-usernsexec

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: simplify lxc-usernsexec
Christian Brauner [Sun, 19 Aug 2018 17:37:49 +0000 (19:37 +0200)]
cmd: simplify lxc-usernsexec

Calculate length only once.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: use utils.{c,h} helpers in lxc-usernsexec
Christian Brauner [Sun, 19 Aug 2018 17:33:25 +0000 (19:33 +0200)]
cmd: use utils.{c,h} helpers in lxc-usernsexec

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: move declarations to macro.h
Christian Brauner [Sun, 19 Aug 2018 17:32:38 +0000 (19:32 +0200)]
cmd: move declarations to macro.h

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: lxc-usernsexec reorder includes
Christian Brauner [Sun, 19 Aug 2018 17:30:59 +0000 (19:30 +0200)]
cmd: lxc-usernsexec reorder includes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2548 from 2xsec/bugfix
Christian Brauner [Sun, 19 Aug 2018 10:03:27 +0000 (12:03 +0200)]
Merge pull request #2548 from 2xsec/bugfix

cmd: lxc-user-nic: change log macro & cleanups

6 years agocmd: lxc-user-nic: change log macro & cleanups
2xsec [Sun, 19 Aug 2018 03:45:54 +0000 (12:45 +0900)]
cmd: lxc-user-nic: change log macro & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agoMerge pull request #2547 from brauner/2018-08-18/fix_execute_parsing
Serge Hallyn [Sat, 18 Aug 2018 16:35:11 +0000 (11:35 -0500)]
Merge pull request #2547 from brauner/2018-08-18/fix_execute_parsing

tools: fix lxc-execute command parsing

6 years agoMerge pull request #2545 from ljagiello/integer-overflow
Christian Brauner [Sat, 18 Aug 2018 16:05:19 +0000 (18:05 +0200)]
Merge pull request #2545 from ljagiello/integer-overflow

storage/loop.c: integer overflow

6 years agolseek - integer overflow
Lukasz Jagiello [Sat, 18 Aug 2018 15:32:21 +0000 (08:32 -0700)]
lseek - integer overflow

The issue was introduced in PR (https://github.com/lxc/lxc/pull/1705):

Previous code:
```
  if (lseek(fd, size, SEEK_SET) < 0) {
    SYSERROR("Error seeking to set new loop file size");
    close(fd);
    return -1;
  }
```
New code:
```
  int fd, ret;

  [...]

  ret = lseek(fd, size, SEEK_SET);
  if (ret < 0) {
    SYSERROR("Failed to seek to set new loop file size for loop "
       "file \"%s\"", path);
    close(fd);
    return -1;
  }
```

Based on http://man7.org/linux/man-pages/man2/lseek.2.html:
> Upon successful completion, lseek() returns the resulting offset
> location as measured in bytes from the beginning of the file.

So in this case value of `size` and `size` is `uint64_t`.

This fix change declaration of `ret`, but it can be fixed in other ways.
Let me know what works for you.

This PR fix issues (https://github.com/lxc/lxc/issues/1872).

Signed-off-by: Lukasz Jagiello <lukasz@wikia-inc.com>
6 years agotools: fix lxc-execute command parsing
Christian Brauner [Sat, 18 Aug 2018 09:56:05 +0000 (11:56 +0200)]
tools: fix lxc-execute command parsing

Initialize buf to avoid parsing random data later on.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2546 from 2xsec/bugfix
Christian Brauner [Sat, 18 Aug 2018 09:46:10 +0000 (11:46 +0200)]
Merge pull request #2546 from 2xsec/bugfix

storage_utils: move duplicated function from tools

6 years agostorage_utils: move duplicated function from tools
2xsec [Sat, 18 Aug 2018 09:05:32 +0000 (18:05 +0900)]
storage_utils: move duplicated function from tools

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agoMerge pull request #2544 from 2xsec/bugfix
Christian Brauner [Sat, 18 Aug 2018 07:58:53 +0000 (09:58 +0200)]
Merge pull request #2544 from 2xsec/bugfix

tools: add default log priority & cleanups

6 years agotools: lxc-unfreeze: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:42:15 +0000 (01:42 +0900)]
tools: lxc-unfreeze: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: lxc-freeze: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:41:51 +0000 (01:41 +0900)]
tools: lxc-freeze: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: lxc-stop: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:41:06 +0000 (01:41 +0900)]
tools: lxc-stop: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: lxc-start: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:40:29 +0000 (01:40 +0900)]
tools: lxc-start: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: lxc-execute: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:39:20 +0000 (01:39 +0900)]
tools: lxc-execute: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agotools: lxc-device: add default log priority & cleanups
2xsec [Fri, 17 Aug 2018 16:38:13 +0000 (01:38 +0900)]
tools: lxc-device: add default log priority & cleanups

Signed-off-by: 2xsec <dh48.jeong@samsung.com>