]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
7 years agoMerge pull request #1500 from BegBlev/1498
Stéphane Graber [Fri, 7 Apr 2017 16:09:54 +0000 (12:09 -0400)]
Merge pull request #1500 from BegBlev/1498

make Alpine template more POSIX shell friendly #1498

7 years agoavoid assigning to a variable which is not POSIX shell proof (bug #1498)
Vincent Catros [Fri, 7 Apr 2017 15:14:44 +0000 (17:14 +0200)]
avoid assigning  to a variable which is not POSIX shell proof (bug #1498)

Signed-off-by: Vincent Catros <vincent.catros@laposte.net>
7 years agoMerge pull request #1494 from d4s/lxcinfo
Stéphane Graber [Thu, 30 Mar 2017 16:26:27 +0000 (12:26 -0400)]
Merge pull request #1494 from d4s/lxcinfo

Increased buffer length in print_stats()

7 years agoMerge pull request #1493 from t-fohrer/t-fohrer-patch-4
Stéphane Graber [Thu, 30 Mar 2017 16:11:19 +0000 (12:11 -0400)]
Merge pull request #1493 from t-fohrer/t-fohrer-patch-4

Avoid waiting for bridge interface on bootup

7 years agoIncreased buffer length in print_stats()
Denis Pynkin [Thu, 30 Mar 2017 15:31:48 +0000 (18:31 +0300)]
Increased buffer length in print_stats()

Some "/sys" entries exceeds buffer size.
This results to some statistics loss ('BlkIO' in particular):

 wc -c /sys/fs/cgroup/blkio/lxc/alt/blkio.throttle.io_service_bytes
 318 /sys/fs/cgroup/blkio/lxc/alt/blkio.throttle.io_service_bytes

Signed-off-by: Denis Pynkin <dans@altlinux.org>
7 years agoAvoid waiting for bridge interface if disabled in sysconfig/lxc | lxc-net via USE_LXC...
Torsten Fohrer [Thu, 30 Mar 2017 09:55:28 +0000 (11:55 +0200)]
Avoid waiting for bridge interface if disabled in sysconfig/lxc | lxc-net via USE_LXC_BRIDGE

Signed-off-by: Torsten Fohrer <tfohrer@googlemail.com>
7 years agoMerge pull request #1432 from brauner/2017-02-15/fix_lxc_execute_return_code
Stéphane Graber [Thu, 23 Mar 2017 21:49:56 +0000 (17:49 -0400)]
Merge pull request #1432 from brauner/2017-02-15/fix_lxc_execute_return_code

tools: exit with return code of lxc_execute()

7 years agoMakefile: fix static clang init.lxc build
Christian Brauner [Thu, 23 Mar 2017 21:22:10 +0000 (22:22 +0100)]
Makefile: fix static clang init.lxc build

Signed-off-by: Serge Hallyn <serge@hallyn.com>
7 years agoMerge pull request #1487 from t-fohrer/t-fohrer-patch-3
Stéphane Graber [Thu, 23 Mar 2017 15:43:58 +0000 (11:43 -0400)]
Merge pull request #1487 from t-fohrer/t-fohrer-patch-3

Keep veth.pair.name on network shutdown

7 years agoKeep veth.pair.name on network shutdown
Torsten Fohrer [Thu, 23 Mar 2017 13:58:33 +0000 (14:58 +0100)]
Keep veth.pair.name on network shutdown

In case of a container that is rebooting, freeing veth.pair.name here results in losing given veth.pair name
(Only if given lxc_netdev is reused).

Signed-off-by: Torsten Fohrer <tfohrer@googlemail.com>
7 years agoMerge pull request #1486 from stgraber/master
Christian Brauner [Wed, 22 Mar 2017 21:30:36 +0000 (22:30 +0100)]
Merge pull request #1486 from stgraber/master

fedora: Fix i386 handling

7 years agofedora: Fix i386 handling
Stéphane Graber [Wed, 22 Mar 2017 21:18:47 +0000 (17:18 -0400)]
fedora: Fix i386 handling

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1483 from johnchen902/patch-1
Stéphane Graber [Wed, 22 Mar 2017 04:38:34 +0000 (00:38 -0400)]
Merge pull request #1483 from johnchen902/patch-1

Fix opening wrong file in suggest_default_idmap

7 years agoFix opening wrong file in suggest_default_idmap
John Chen [Wed, 22 Mar 2017 03:03:59 +0000 (11:03 +0800)]
Fix opening wrong file in suggest_default_idmap

Fixing the typo making `suggest_default_idmap` open `subuidfile`
instead of `subgidfile` to read subgid information.

Signed-off-by: Pochang Chen <johnchen902@gmail.com>
7 years agoMerge pull request #1479 from brauner/2017-03-20/sysmacro
Stéphane Graber [Tue, 21 Mar 2017 23:19:50 +0000 (19:19 -0400)]
Merge pull request #1479 from brauner/2017-03-20/sysmacro

tree-wide: include <sys/sysmacros.h> directly

7 years agoMerge pull request #1482 from stgraber/master
Christian Brauner [Tue, 21 Mar 2017 21:18:16 +0000 (22:18 +0100)]
Merge pull request #1482 from stgraber/master

tests: Support running on IPv6 networks

7 years agotests: Kill containers (don't wait for shutdown)
Stéphane Graber [Tue, 21 Mar 2017 20:35:44 +0000 (16:35 -0400)]
tests: Kill containers (don't wait for shutdown)

We waste a lot of time waiting for Ubuntu containers to cleanly stop
right before we destroy them anyway.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agotests: Support running on IPv6 networks
Stéphane Graber [Tue, 21 Mar 2017 20:23:27 +0000 (16:23 -0400)]
tests: Support running on IPv6 networks

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agotree-wide: include <sys/sysmacros.h> directly
Christian Brauner [Tue, 21 Mar 2017 11:03:16 +0000 (12:03 +0100)]
tree-wide: include <sys/sysmacros.h> directly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1476 from brauner/2017-03-20/sysmacro
Stéphane Graber [Mon, 20 Mar 2017 15:10:57 +0000 (11:10 -0400)]
Merge pull request #1476 from brauner/2017-03-20/sysmacro

tree-wide: include <sys/sysmacros.h> directly

7 years agotree-wide: include <sys/sysmacros.h> directly
Christian Brauner [Mon, 20 Mar 2017 14:42:50 +0000 (15:42 +0100)]
tree-wide: include <sys/sysmacros.h> directly

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1474 from evgeni/no-default-passwords
Stéphane Graber [Sun, 19 Mar 2017 19:01:21 +0000 (15:01 -0400)]
Merge pull request #1474 from evgeni/no-default-passwords

don't set a default password for altlinux, gentoo, openmandriva and pld

7 years agoMerge pull request #1473 from taikedz/keyservfix
Stéphane Graber [Sun, 19 Mar 2017 19:00:03 +0000 (15:00 -0400)]
Merge pull request #1473 from taikedz/keyservfix

Allow setting the key server as an environment variable

7 years agodon't set a default password for altlinux, gentoo, openmandriva and pld
Evgeni Golov [Sun, 19 Mar 2017 17:47:17 +0000 (18:47 +0100)]
don't set a default password for altlinux, gentoo, openmandriva and pld

Refs: #1158
Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agoChange variable check to match existing style
Tai Kedzierski [Sun, 19 Mar 2017 17:28:26 +0000 (17:28 +0000)]
Change variable check to match existing style

Signed-off-by: Tai Kedzierski <dch.tai@gmail.com>
7 years agolxc-download.in / Document keyserver change in help
Tai Kedzierski [Sun, 19 Mar 2017 09:27:42 +0000 (09:27 +0000)]
lxc-download.in / Document keyserver change in help

Signed-off-by: Tai Kedzierski <dch.tai@gmail.com>
7 years agolxc-download.in / allow setting keyserver from env
Tai Kedzierski [Sun, 19 Mar 2017 09:21:29 +0000 (09:21 +0000)]
lxc-download.in / allow setting keyserver from env

Checks if DOWNLOAD_KEYSERVER has already been set in the environment before setting a value

Signed-off-by: Tai Kedzierski <dch.tai@gmail.com>
7 years agoMerge pull request #1468 from stgraber/master
Christian Brauner [Fri, 17 Mar 2017 09:45:10 +0000 (10:45 +0100)]
Merge pull request #1468 from stgraber/master

python3: Deal with potential NULL char*

7 years agopython3: Deal with potential NULL char*
Stéphane Graber [Fri, 17 Mar 2017 08:52:41 +0000 (09:52 +0100)]
python3: Deal with potential NULL char*

Closes #1466

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1433 from rjmccabe3701/bugfix/run-within-docker
Stéphane Graber [Wed, 15 Mar 2017 23:41:13 +0000 (19:41 -0400)]
Merge pull request #1433 from rjmccabe3701/bugfix/run-within-docker

Added 'mkdir -p' functionality in create_or_remove_cgroup

7 years agoMerge pull request #1465 from geaaru/lxc-sabayon-unpriv
Stéphane Graber [Wed, 15 Mar 2017 23:10:36 +0000 (19:10 -0400)]
Merge pull request #1465 from geaaru/lxc-sabayon-unpriv

[lxc-sabayon] Disable _unprivileged_shift_owner for create unprivileg…

7 years ago[lxc-sabayon] Disable _unprivileged_shift_owner for create unprivileged container...
Geaaru [Tue, 14 Mar 2017 14:57:50 +0000 (15:57 +0100)]
[lxc-sabayon] Disable _unprivileged_shift_owner for create unprivileged container images for lxd and lxc-download.

Signed-off-by: Geaaru <geaaru@gmail.com>
7 years agoMerge pull request #1463 from armchair-philosophy/up_templates_arch
Stéphane Graber [Wed, 15 Mar 2017 00:47:21 +0000 (20:47 -0400)]
Merge pull request #1463 from armchair-philosophy/up_templates_arch

[templates] archlinux: resolve conflicting files

7 years ago[templates] archlinux: noneed default_timezone variable
otofune [Wed, 15 Mar 2017 00:36:57 +0000 (09:36 +0900)]
[templates] archlinux: noneed default_timezone variable

Signed-off-by: otofune <otofune@gmail.com>
7 years ago[templates] archlinux: resolve conflicting files
otofune [Wed, 15 Mar 2017 00:09:17 +0000 (09:09 +0900)]
[templates] archlinux: resolve conflicting files

- already found /etc/localtime
- duplicate creation /etc/resolv.conf

Signed-off-by: otofune <otofune@gmail.com>
7 years agoMerge pull request #1462 from hallyn/2017-03-14/checknewuidmap
Christian Brauner [Tue, 14 Mar 2017 19:41:25 +0000 (20:41 +0100)]
Merge pull request #1462 from hallyn/2017-03-14/checknewuidmap

lxc-checkconfig: verify new[ug]idmap are setuid-root

7 years agolxc-checkconfig: verify new[ug]idmap are setuid-root
Serge Hallyn [Tue, 14 Mar 2017 18:16:48 +0000 (13:16 -0500)]
lxc-checkconfig: verify new[ug]idmap are setuid-root

Signed-off-by: Serge Hallyn <serge@hallyn.com>
7 years agoMerge pull request #1461 from jirutka/alpine
Christian Brauner [Tue, 14 Mar 2017 18:01:08 +0000 (19:01 +0100)]
Merge pull request #1461 from jirutka/alpine

lxc-alpine: few modifications

7 years agolxc-alpine: use dl-cdn.a.o as default mirror instead of random one
Jakub Jirutka [Tue, 14 Mar 2017 16:35:46 +0000 (17:35 +0100)]
lxc-alpine: use dl-cdn.a.o as default mirror instead of random one

Some mirrors from the mirrors list are not very reliable and it seems
that no one really wants to use some random mirror as the default
option.

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
7 years agolxc-alpine: add community repository to default repositories
Jakub Jirutka [Tue, 14 Mar 2017 16:28:47 +0000 (17:28 +0100)]
lxc-alpine: add community repository to default repositories

Signed-off-by: Jakub Jirutka <jakub@jirutka.cz>
7 years agoMerge pull request #1460 from stgraber/master
Christian Brauner [Tue, 14 Mar 2017 13:36:02 +0000 (14:36 +0100)]
Merge pull request #1460 from stgraber/master

Patch from Harald Dunkel + tweak

7 years agoFix mixed tab/spaces in previous patch
Stéphane Graber [Tue, 14 Mar 2017 12:44:35 +0000 (12:44 +0000)]
Fix mixed tab/spaces in previous patch

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoFix lxc-containers to support multiple bridges
Harald Dunkel [Tue, 14 Mar 2017 12:42:15 +0000 (12:42 +0000)]
Fix lxc-containers to support multiple bridges

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
7 years agoMerge pull request #1458 from brauner/2017-01-28/lxc_user_nic_ensure_target_netns_is_...
Serge Hallyn [Sun, 12 Mar 2017 21:18:06 +0000 (16:18 -0500)]
Merge pull request #1458 from brauner/2017-01-28/lxc_user_nic_ensure_target_netns_is_caller_owned

lxc-user-nic: improvements

7 years agoconf: only try to delete veth when privileged
Christian Brauner [Sat, 11 Mar 2017 12:12:52 +0000 (13:12 +0100)]
conf: only try to delete veth when privileged

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-user-nic: delete link on failure
Christian Brauner [Sat, 11 Mar 2017 11:11:40 +0000 (12:11 +0100)]
lxc-user-nic: delete link on failure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-user-nic: improve + bugfix
Christian Brauner [Sun, 29 Jan 2017 15:34:22 +0000 (16:34 +0100)]
lxc-user-nic: improve + bugfix

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agolxc-user-nic: re-order #includes
Christian Brauner [Sun, 29 Jan 2017 14:34:42 +0000 (15:34 +0100)]
lxc-user-nic: re-order #includes

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoCVE-2017-5985: Ensure target netns is caller-owned
Christian Brauner [Sat, 28 Jan 2017 12:02:34 +0000 (13:02 +0100)]
CVE-2017-5985: Ensure target netns is caller-owned

Before this commit, lxc-user-nic could potentially have been tricked into
operating on a network namespace over which the caller did not hold privilege.

This commit ensures that the caller is privileged over the network namespace by
temporarily dropping privilege.

Launchpad: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1654676
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1453 from hallyn/2017-03-06/seccomp
Christian Brauner [Mon, 6 Mar 2017 21:43:06 +0000 (22:43 +0100)]
Merge pull request #1453 from hallyn/2017-03-06/seccomp

seccomp: set SCMP_FLTATR_ATL_TSKIP if available

7 years agoseccomp: set SCMP_FLTATR_ATL_TSKIP if available
Serge Hallyn [Mon, 6 Mar 2017 19:36:19 +0000 (13:36 -0600)]
seccomp: set SCMP_FLTATR_ATL_TSKIP if available

Newer libseccomp has a flag called SCMP_FLTATR_ATL_TSKIP which
allows syscall '-1' (nop) to be executed.  Without that flag,
debuggers cannot skip system calls inside containers.  For reference,
see the seccomp(2) manpage, which says:

The tracer can skip the system call by changing the system call  number  to  -1.

and see the seccomp issue #80

Signed-off-by: Serge Hallyn <serge@hallyn.com>
7 years agoMerge pull request #1449 from brauner/2017-03-03/fix_trim
Serge Hallyn [Fri, 3 Mar 2017 00:16:16 +0000 (18:16 -0600)]
Merge pull request #1449 from brauner/2017-03-03/fix_trim

cgfsng: make trim() safer

7 years agocgfsng: make trim() safer
Christian Brauner [Thu, 2 Mar 2017 23:33:40 +0000 (00:33 +0100)]
cgfsng: make trim() safer

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1447 from brauner/2017-02-27/fix_logging_timestamps
Stéphane Graber [Mon, 27 Feb 2017 16:50:21 +0000 (11:50 -0500)]
Merge pull request #1447 from brauner/2017-02-27/fix_logging_timestamps

log: fix lxc_unix_epoch_to_utc()

7 years agolog: fix lxc_unix_epoch_to_utc()
Christian Brauner [Mon, 27 Feb 2017 15:02:24 +0000 (16:02 +0100)]
log: fix lxc_unix_epoch_to_utc()

The conversion algorithm used uses a clever trick by letting a year start at 1
March. So we need to add 1 for January and February.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1445 from brauner/2017-02-26/dumb_down_invalid_sigchld_warning
Stéphane Graber [Sun, 26 Feb 2017 16:12:43 +0000 (11:12 -0500)]
Merge pull request #1445 from brauner/2017-02-26/dumb_down_invalid_sigchld_warning

start: dumb down SIGCHLD from WARN() to NOTICE()

7 years agostart: dumb down SIGCHLD from WARN() to NOTICE()
Christian Brauner [Sun, 26 Feb 2017 11:51:30 +0000 (12:51 +0100)]
start: dumb down SIGCHLD from WARN() to NOTICE()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoMerge pull request #1417 from zorun/master
Christian Brauner [Sat, 25 Feb 2017 02:02:41 +0000 (03:02 +0100)]
Merge pull request #1417 from zorun/master

debian template: Allow to embed a SSH public key in the new container

7 years agoMerge pull request #1444 from evgeni/kill-squeeze
Christian Brauner [Thu, 23 Feb 2017 21:16:32 +0000 (22:16 +0100)]
Merge pull request #1444 from evgeni/kill-squeeze

squeeze is not a supported release anymore, drop the key

7 years agosqueeze is not a supported release anymore, drop the key
Evgeni Golov [Thu, 23 Feb 2017 21:03:40 +0000 (22:03 +0100)]
squeeze is not a supported release anymore, drop the key

Signed-off-by: Evgeni Golov <evgeni@debian.org>
7 years agoMerge pull request #1442 from mkeeler/master
Stéphane Graber [Thu, 23 Feb 2017 17:47:10 +0000 (12:47 -0500)]
Merge pull request #1442 from mkeeler/master

Fix issue with the clonehostname hook not working for overlayfs snapshot clones

7 years agoUse LXC_ROOTFS_MOUNT in clonehostname hook
Matt Keeler [Wed, 22 Feb 2017 20:57:59 +0000 (15:57 -0500)]
Use LXC_ROOTFS_MOUNT in clonehostname hook

Previously this hook did not work when cloning containers using an overlayfs snapshot as the LXC_ROOTFS_PATH didn't point to the actual filesystem that the container would see. LXC_ROOTFS_MOUNT should be used instead and in fact lxc.container.conf man page says that you usually would want to use the _MOUNT variant.

Signed-off-by: Matt Keeler <mjkeeler7@gmail.com>
7 years agoMerge pull request #1441 from tych0/only-do-bind-mounts
Christian Brauner [Wed, 22 Feb 2017 17:29:41 +0000 (18:29 +0100)]
Merge pull request #1441 from tych0/only-do-bind-mounts

c/r: only supply --ext-mount-map for bind mounts

7 years agoMerge pull request #1438 from stgraber/master
Christian Brauner [Sun, 19 Feb 2017 22:13:31 +0000 (23:13 +0100)]
Merge pull request #1438 from stgraber/master

lxc-download: Bump compat level to 4

7 years agolxc-download: Bump compat level to 4
Stéphane Graber [Sun, 19 Feb 2017 20:17:39 +0000 (15:17 -0500)]
lxc-download: Bump compat level to 4

For templates introduced after LXC 2.0 was released.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoMerge pull request #1437 from ganto/lxc-fedora
Stéphane Graber [Sat, 18 Feb 2017 16:52:44 +0000 (11:52 -0500)]
Merge pull request #1437 from ganto/lxc-fedora

Various fixes for Fedora bootstrapping on non-Fedora hosts

7 years agoFix argument parsing for recently added parameters
Reto Gantenbein [Sat, 18 Feb 2017 16:05:31 +0000 (17:05 +0100)]
Fix argument parsing for recently added parameters

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoAdjust indenting
Reto Gantenbein [Sat, 18 Feb 2017 15:57:55 +0000 (16:57 +0100)]
Adjust indenting

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoVarious fixes for bootstrap image download via HTTPS
Reto Gantenbein [Sat, 18 Feb 2017 15:33:48 +0000 (16:33 +0100)]
Various fixes for bootstrap image download via HTTPS

- Make sure mirror URL is queried for $FEDORA_RELEASE_DEFAULT
- Fix image path for URLs queried via mirror list

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoFix undefined arch on initial bootstrap setup
Reto Gantenbein [Sat, 18 Feb 2017 14:24:03 +0000 (15:24 +0100)]
Fix undefined arch on initial bootstrap setup

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoMerge pull request #1435 from stgraber/master
Christian Brauner [Sat, 18 Feb 2017 00:34:51 +0000 (01:34 +0100)]
Merge pull request #1435 from stgraber/master

sabayon: Use /bin/bash

7 years agosabayon: Use /bin/bash
Stéphane Graber [Fri, 17 Feb 2017 22:06:23 +0000 (17:06 -0500)]
sabayon: Use /bin/bash

The script is full of bashisms making it break when run with a simple
POSIX shell.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
7 years agoAdded 'mkdir -p' functionality in create_or_remove_cgroup
McCabe, Robert J [Wed, 15 Feb 2017 20:36:03 +0000 (14:36 -0600)]
Added 'mkdir -p' functionality in create_or_remove_cgroup

This allows us to run LXC containers from within docker

Signed-off-by: McCabe, Robert J <Robert.McCabe@rockwellcollins.com>
7 years agoMerge pull request #1371 from ganto/lxc-fedora
Stéphane Graber [Thu, 16 Feb 2017 21:12:33 +0000 (22:12 +0100)]
Merge pull request #1371 from ganto/lxc-fedora

Complete rework of lxc-fedora template

7 years agotools: exit with return code of lxc_execute()
Christian Brauner [Wed, 15 Feb 2017 12:34:43 +0000 (13:34 +0100)]
tools: exit with return code of lxc_execute()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoc/r: only supply --ext-mount-map for bind mounts
Tycho Andersen [Wed, 15 Feb 2017 18:28:24 +0000 (11:28 -0700)]
c/r: only supply --ext-mount-map for bind mounts

The rest of the mounts can be restored normally.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
7 years agoMerge pull request #1428 from kilobyte/master
Serge Hallyn [Wed, 15 Feb 2017 05:35:02 +0000 (23:35 -0600)]
Merge pull request #1428 from kilobyte/master

fix seccomp blocking x32 guests on amd64 (userspace) hosts

7 years agoMerge pull request #1430 from ffontaine/master
Christian Brauner [Sun, 12 Feb 2017 15:32:37 +0000 (16:32 +0100)]
Merge pull request #1430 from ffontaine/master

Add HAVE_LIBCAP

7 years agoAdd HAVE_LIBCAP
Fabrice Fontaine [Sat, 11 Feb 2017 21:40:19 +0000 (22:40 +0100)]
Add HAVE_LIBCAP

Currently it is impossible to build lxc with --disable-capabilities if
the user has libcap-dev installed on his system as:
 - calls to cap_xxx functions are not protected by HAVE_LIBCAP defines.
 The whole file is only protected by HAVE_SYS_CAPABILITY_H.
 - AC_CHECK_LIB default action-if-found is overriden by [true] so
 HAVE_LIBCAP is never written to config.h

This patch replaces all HAVE_SYS_CAPABILITY_H checks by HAVE_LIBCAP
checks (fix #1361)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
7 years agoseccomp: allow x32 guests on amd64 hosts.
Adam Borowski [Sun, 12 Feb 2017 06:26:54 +0000 (07:26 +0100)]
seccomp: allow x32 guests on amd64 hosts.

Without this patch, x32 guests (and no others) worked "natively" with x32
host lxc, but not on regular amd64 hosts.  That was especially problematic
as a number of ioctls such as those needed by netfilter don't work in such
scenarios, thus you want to run amd64 on the host.

With the patch, you can use all three ABIs: i386 x32 amd64 on amd64 hosts.

Despite x32 being little used, there's no reason to deny it by default:
the admin needs to compile their own kernel with CONFIG_X86_X32=y or (on
Debian) boot with syscall.x32=y.  If they've done so, it is a reasonable
assumption they want x32 guests.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
7 years agoMerge pull request #1424 from brauner/2017-02-08/thomasDOTjaroschATintra2netDOTcom_pt...
Stéphane Graber [Wed, 8 Feb 2017 16:07:26 +0000 (17:07 +0100)]
Merge pull request #1424 from brauner/2017-02-08/thomasDOTjaroschATintra2netDOTcom_pty_sigttou

lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals

7 years agoMerge pull request #1425 from cebe/patch-1
Stéphane Graber [Wed, 8 Feb 2017 16:06:33 +0000 (17:06 +0100)]
Merge pull request #1425 from cebe/patch-1

Make lxc-net return non-zero on failure

7 years agoMake lxc-net return non-zero on failure
Carsten Brandt [Wed, 8 Feb 2017 13:46:59 +0000 (14:46 +0100)]
Make lxc-net return non-zero on failure

I found that even though the service lxc-net failed to start because I made some wrong configuration
settings the command exists zero.
So systemd reports the status of the service as good even though it failed:

    # service lxc-net status
    ● lxc-net.service - LXC network bridge setup
       Loaded: loaded (/lib/systemd/system/lxc-net.service; enabled)
       Active: active (exited) since Wed 2017-02-08 08:17:32 EST; 21min ago
      Process: 529 ExecStart=/usr/lib/x86_64-linux-gnu/lxc/lxc-net start (code=exited, status=0/SUCCESS)
     Main PID: 529 (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/lxc-net.service

    Feb 08 08:17:30 dvm2 systemd[1]: Starting LXC network bridge setup...
    Feb 08 08:17:32 dvm2 lxc-net[529]: dnsmasq: failed to create listening socket for 10.2.2.1: Address already in use
    Feb 08 08:17:32 dvm2 lxc-net[529]: Failed to setup lxc-net.
    Feb 08 08:17:32 dvm2 systemd[1]: Started LXC network bridge setup.

Adding `exit 1` here makes it exit non-zero to make systemd recognize the failure.

Signed-off-by: Carsten Brandt <mail@cebe.cc>
7 years agolxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals
Thomas Jarosch [Thu, 2 Feb 2017 11:48:35 +0000 (12:48 +0100)]
lxc_setup_tios(): Ignore SIGTTOU and SIGTTIN signals

Prevent an endless loop while executing lxc-attach in the background:

The kernel might fire SIGTTOU while an ioctl() in tcsetattr()
is executed. When the ioctl() is resumed and retries,
the signal handler interrupts it again.

We can't configure the TTY to stop sending
the signals in the first place since that
is a modification/write to the TTY already.

Still we clear the TOSTOP flag to prevent further signals.

Command to reproduce the hang:
----------------------------
cat > lxc_hang.sh << EOF
/usr/bin/timeout 5s /usr/bin/lxc-attach -n SOMECONTAINER -- /bin/true
EOF
sh lxc_hang.sh    # hangs
----------------------------

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
7 years agoChange Fedora mirror downloads to https by default, rsync optional
Reto Gantenbein [Tue, 7 Feb 2017 05:59:15 +0000 (06:59 +0100)]
Change Fedora mirror downloads to https by default, rsync optional

This mainly affects the download of the bootstrap image when
running on a non-Fedora host and the initial download of the
repo and release RPMs. The container rootfs creation will then
be verified by dnf against the GPG signatures in the repos RPM.

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoQuery Fedora mirror list over HTTPS
Reto Gantenbein [Mon, 6 Feb 2017 07:17:13 +0000 (08:17 +0100)]
Query Fedora mirror list over HTTPS

Signed-off-by: Reto Gantenbein <reto.gantenbein@linuxmonk.ch>
7 years agoMerge pull request #1422 from brauner/2017-06-02/clear_config_vals
Stéphane Graber [Mon, 6 Feb 2017 22:49:30 +0000 (23:49 +0100)]
Merge pull request #1422 from brauner/2017-06-02/clear_config_vals

confile: clear lxc.network.<n>.ipv{4,6} when empty

7 years agoconfile: clear lxc.network.<n>.ipv{4,6} when empty
Christian Brauner [Mon, 6 Feb 2017 22:08:26 +0000 (23:08 +0100)]
confile: clear lxc.network.<n>.ipv{4,6} when empty

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agodebian template: Allow to embed a SSH public key in the new container
Baptiste Jonglez [Sun, 5 Feb 2017 21:58:30 +0000 (22:58 +0100)]
debian template: Allow to embed a SSH public key in the new container

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
7 years agoMerge pull request #1410 from brauner/2017-02-02/fix_compiler_error
Stéphane Graber [Thu, 2 Feb 2017 10:34:16 +0000 (05:34 -0500)]
Merge pull request #1410 from brauner/2017-02-02/fix_compiler_error

conf/ile: make sure buffer is large enough

7 years agoMerge pull request #1409 from tych0/setproctitle-comments
Christian Brauner [Thu, 2 Feb 2017 09:54:49 +0000 (10:54 +0100)]
Merge pull request #1409 from tych0/setproctitle-comments

util: update setproctitle comments

7 years agoMerge pull request #1398 from geaaru/lxc-sabayon
Stéphane Graber [Thu, 2 Feb 2017 09:45:46 +0000 (04:45 -0500)]
Merge pull request #1398 from geaaru/lxc-sabayon

Add LXC template script of Sabayon OS

7 years agoconf/ile: make sure buffer is large enough
Christian Brauner [Thu, 2 Feb 2017 09:31:30 +0000 (10:31 +0100)]
conf/ile: make sure buffer is large enough

conf.c: In function 'lxc_assign_network':
conf.c:3096:25: error: '%lu' directive output may be truncated writing between 1 and 20 bytes into a region of size 19 [-Werror=format-truncation=]
   snprintf(pidstr, 19, "%lu", (unsigned long) pid);
                         ^~~
conf.c:3096:24: note: using the range [1, 18446744073709551615] for directive argument
   snprintf(pidstr, 19, "%lu", (unsigned long) pid);
                        ^~~~~
In file included from /usr/include/stdio.h:938:0,
                 from conf.c:35:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 2 and 21 bytes into a destination of size 19
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
confile.c: In function 'network_new_hwaddrs':
confile.c:2889:38: error: '%02x' directive output may be truncated writing between 2 and 8 bytes into a region of size 6 [-Werror=format-truncation=]
  snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x",
                                      ^~~~
confile.c:2889:23: note: using the range [0, 4294967295] for directive argument
  snprintf(hwaddr, 18, "00:16:3e:%02x:%02x:%02x",
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
confile.c:2889:23: note: using the range [0, 4294967295] for directive argument
In file included from /usr/include/stdio.h:938:0,
                 from confile.c:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: format output between 18 and 36 bytes into a destination of size 18
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Not sure whether the latter is really a problem. We might need an additional
fix later on.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
7 years agoutil: update setproctitle comments
Tycho Andersen [Thu, 2 Feb 2017 09:30:43 +0000 (10:30 +0100)]
util: update setproctitle comments

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
7 years agoMerge pull request #1408 from tych0/setproctitle-always-malloc
Christian Brauner [Thu, 2 Feb 2017 09:09:23 +0000 (10:09 +0100)]
Merge pull request #1408 from tych0/setproctitle-always-malloc

util: always malloc for setproctitle

7 years agoutil: always malloc for setproctitle
Tycho Andersen [Thu, 2 Feb 2017 08:36:31 +0000 (09:36 +0100)]
util: always malloc for setproctitle

Closes #1407

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
7 years agoMerge pull request #1402 from mabes/patch-1
Christian Brauner [Mon, 30 Jan 2017 13:52:36 +0000 (14:52 +0100)]
Merge pull request #1402 from mabes/patch-1

lxc-opensuse: fix default value for release code

7 years agolxc-opensuse: fix default value for release code
Maxime Besson [Mon, 30 Jan 2017 12:08:40 +0000 (13:08 +0100)]
lxc-opensuse: fix default value for release code

Signed-off-by: Maxime Besson <maxime.besson@smile.fr>
7 years ago[lxc-sabayon] Add common scripts for daily image generation.
Geaaru [Sun, 29 Jan 2017 18:03:55 +0000 (19:03 +0100)]
[lxc-sabayon] Add common scripts for daily image generation.

Signed-off-by: Geaaru <geaaru@gmail.com>
7 years agoMerge pull request #1400 from bneumeier/master
Christian Brauner [Sun, 29 Jan 2017 16:23:47 +0000 (17:23 +0100)]
Merge pull request #1400 from bneumeier/master

Allow build without sys/capability.h