]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 years agolxc-cmd-stop: two fixes
Serge Hallyn [Mon, 13 Apr 2015 21:19:47 +0000 (21:19 +0000)] 
lxc-cmd-stop: two fixes

These are two fixes for long, long-standing bugs.

1. When we stop a container from the lxc_cmd stop handler, we kill its
init task, then we unfreeze the container to make sure it receives the
signal.  When that unfreeze succeeds, we were immediately returning 0,
without sending a response to the invoker.

2. lxc_cmd returns the length of the field received.  In the case of
an lxc_cmd_stop this is 16.  But a comment claims we expect no response,
only a 0.  In fact the handler does send a response, which may or may
not include an error.  So don't call an error just because we got back a
response.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoadd vim swap files to .gitignore
Tycho Andersen [Thu, 9 Apr 2015 21:59:20 +0000 (21:59 +0000)] 
add vim swap files to .gitignore

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoupdate path of tty.conf
teruo-oshida [Fri, 27 Mar 2015 09:04:31 +0000 (18:04 +0900)] 
update path of tty.conf

$container_rootfs may not be used so 'sed' will try to patch
"/etc/init/tty.conf". It must not be correct.

Signed-off-by: Teruo Oshida <teruo.oshida@miraclelinux.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-test-apparmor: flush the pipe before exiting child
Serge Hallyn [Fri, 3 Apr 2015 23:40:49 +0000 (23:40 +0000)] 
lxc-test-apparmor: flush the pipe before exiting child

to make sure the parent's read returns.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAdd the use of 'attach' to lxc-start-ephemeral(1)
KATOH Yasufumi [Wed, 1 Apr 2015 16:56:03 +0000 (01:56 +0900)] 
Add the use of 'attach' to lxc-start-ephemeral(1)

Update for commit 8158c05

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Add '--storage-type' option to lxc-start-ephemeral(1)
KATOH Yasufumi [Fri, 27 Mar 2015 09:32:05 +0000 (18:32 +0900)] 
doc: Add '--storage-type' option to lxc-start-ephemeral(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoconcurrent: check realloc() rc and exit on failure
Arjun Sreedharan [Wed, 1 Apr 2015 19:06:48 +0000 (00:36 +0530)] 
concurrent: check realloc() rc and exit on failure

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agocgmanager: free line at end of check_supports_multiple_controllers
Serge Hallyn [Wed, 18 Mar 2015 00:02:19 +0000 (19:02 -0500)] 
cgmanager: free line at end of check_supports_multiple_controllers

This is only called at startup so it wasn't a big leak, but it is a leak.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agocgmanager: put unprivileged containers under $(curcgroup)/lxc/$(container0
Serge Hallyn [Wed, 18 Mar 2015 00:02:18 +0000 (19:02 -0500)] 
cgmanager: put unprivileged containers under $(curcgroup)/lxc/$(container0

Currently if we are in /user.slice/user-1000.slice/session-c2.scope,
and we start an unprivileged container t1, it will be in cgroup
3:memory:/user.slice/user-1000.slice/session-c2.scope/t1.  If
we then do a 'lxc-cgroup -n t1 freezer.tasks', cgm_get will
first switch to 3:memory:/user.slice/user-1000.slice/session-c2.scope
then look up 't1's values.  The reasons for this are

1. cgmanager get_value is relative to your own cgroup, so we need
to be sure to be in t1's cgroup or an ancestor
2. we don't want to be in the container's cgroup bc it might freeze us.

But in Ubuntu 15.04 it was decided that
3:memory:/user.slice/user-1000.slice/session-c2.scope/tasks should
not be writeable by the user, making this fail.

Therefore put all unprivileged cgroups under "lxc/%n".  That way
the "lxc" cgroup should always be owned by the user so that he can
enter.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoNow including grep -q
Alexandre Létourneau [Wed, 1 Apr 2015 22:22:50 +0000 (18:22 -0400)] 
Now including grep -q
Signed-off-by: Alexandre Letourneau <letourneau.alexandre@gmail.com>
9 years agoAdded a more reliable test for yum --releasever in the centos template
Alexandre Létourneau [Mon, 30 Mar 2015 22:19:27 +0000 (18:19 -0400)] 
Added a more reliable test for yum --releasever in the centos template
Signed-off-by: Alexandre Létourneau <letourneau.alexandre@gmail.com>
9 years agoCorrect typo.
Achton [Thu, 26 Feb 2015 13:47:25 +0000 (14:47 +0100)] 
Correct typo.

Signed-off-by: Achton Smidt Winther <mail@achton.net>
9 years agoSkip control tty code for non-ttys
Stéphane Graber [Tue, 17 Mar 2015 01:54:26 +0000 (21:54 -0400)] 
Skip control tty code for non-ttys

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Add options of 'loop' backingstore to lxc-create(1)
KATOH Yasufumi [Tue, 10 Mar 2015 10:07:39 +0000 (19:07 +0900)] 
doc: Add options of 'loop' backingstore to lxc-create(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoseccomp: add ppc support
Bogdan Purcareata [Thu, 12 Mar 2015 08:57:47 +0000 (08:57 +0000)] 
seccomp: add ppc support

This patch enables seccomp support for LXC containers running on PowerPC
architectures. It is based on the latest PowerPC support added to libseccomp, on
the working-ppc64 branch [1].

Libseccomp has been tested on ppc, ppc64 and ppc64le architectures. LXC with
seccomp support has been tested on ppc and ppc64 architectures, using the
default seccomp policy example files delivered with the LXC package.

[1] https://github.com/seccomp/libseccomp/commits/working-ppc64

v2:
- add #ifdefs in get_new_ctx to fix builds on systems not having SCMP_ARCH_PPC*
  defined

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix the --auth-key flag in gentoo template
Erik Mackdanz [Thu, 12 Mar 2015 21:36:18 +0000 (16:36 -0500)] 
Fix the --auth-key flag in gentoo template

Fix a typo in the getopt call,  should be auth-key not auth_key.
Also provide the argument to cat, so the script doesn't hang waiting
on stdin.

Closes #379

Signed-off-by: Erik Mackdanz <erikmack@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoAttempt to fix control tty issues on attach
Stéphane Graber [Fri, 13 Mar 2015 20:43:16 +0000 (16:43 -0400)] 
Attempt to fix control tty issues on attach

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agofix lxc-console on centos / oracle unprivileged containers
Stuart Cardall [Mon, 2 Mar 2015 17:49:20 +0000 (17:49 +0000)] 
fix lxc-console on centos / oracle unprivileged containers

Signed-off-by: Stuart Cardall <developer@it-offshore.co.uk>
9 years agoUse rdepends when non-thinpool LVM container is cloned
KATOH Yasufumi [Wed, 4 Mar 2015 09:39:14 +0000 (18:39 +0900)] 
Use rdepends when non-thinpool LVM container is cloned

When a non-thinpool LVM container which have snapshotted clone is
destroyed, the LV of snapshotted clone was also deleted. This patch
prevent it.

The original non-thinpool LVM container of snapshotted clone cannot be
now destroyed.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agogentoo container building fails during wget.
lxc@zitta.fr [Fri, 20 Feb 2015 21:53:40 +0000 (22:53 +0100)] 
gentoo container building fails during wget.

follow new gentoo's download server configuration.
Should be backported in earlier lxc versions.

Signed-off-by: Guillaume ZITTA <lxc@zitta.fr>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoattach: use _exit() instead of exit() in the intermediate child process
Johannes Henninger [Fri, 20 Feb 2015 13:11:03 +0000 (14:11 +0100)] 
attach: use _exit() instead of exit() in the intermediate child process

This prevents on_exit() and atexit() handlers registered by the parent
process from being run in the forked intermediate process.

Signed-off-by: Johannes Henninger <johannes@henninger.io>
9 years agono such option: --releasever on CentOS5's yum
tukiyo [Tue, 17 Feb 2015 01:05:25 +0000 (10:05 +0900)] 
no such option: --releasever on CentOS5's yum

Signed-off-by: tukiyo3 <tukiyo3@gmail.com>
9 years agoUpdate CONTRIBUTING
Дмитрий Пацура [Sat, 14 Feb 2015 14:30:49 +0000 (22:30 +0800)] 
Update CONTRIBUTING

Signed-off-by: Dmitry Patsura <talk@dmtry.me>
10 years agoCVE-2015-1334: Don't use the container's /proc during attach
Stéphane Graber [Thu, 16 Jul 2015 20:37:51 +0000 (16:37 -0400)] 
CVE-2015-1334: Don't use the container's /proc during attach

A user could otherwise over-mount /proc and prevent the apparmor profile
or selinux label from being written which combined with a modified
/bin/sh or other commonly used binary would lead to unconfined code
execution.

Reported-by: Roman Fiedler
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoCVE-2015-1331: lxclock: use /run/lxc/lock rather than /run/lock/lxc
Serge Hallyn [Fri, 3 Jul 2015 14:26:17 +0000 (09:26 -0500)] 
CVE-2015-1331: lxclock: use /run/lxc/lock rather than /run/lock/lxc

This prevents an unprivileged user to use LXC to create arbitrary file
on the filesystem.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-net.conf: use +e at teardown
Serge Hallyn [Thu, 19 Mar 2015 18:41:46 +0000 (18:41 +0000)] 
lxc-net.conf: use +e at teardown

When we are shutting down the lxc network, we should not fail when
things go wrong, as that only makes it harder to clean up later.

See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1429140 in particular

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Add about zfs, aufs, overlayfs to '-s' option of lxc-clone(1)
KATOH Yasufumi [Mon, 23 Feb 2015 08:18:59 +0000 (17:18 +0900)] 
doc: Add about zfs, aufs, overlayfs to '-s' option of lxc-clone(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoUpdate Travis configuration
Stéphane Graber [Mon, 23 Feb 2015 23:38:49 +0000 (18:38 -0500)] 
Update Travis configuration

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoIn lxc.mount.auto, skip on ENONENT
Stéphane Graber [Mon, 2 Feb 2015 09:21:20 +0000 (11:21 +0200)] 
In lxc.mount.auto, skip on ENONENT

This resolves the case where /proc/sysrq-trigger doesn't exist by simply
ignoring any mount failure on ENOENT. With the current mount list, this
will always result in a safe environment (typically the read-only
underlay).

Closes #425

v2: Don't always show an error

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoubuntu: Drop lucid support and refresh releaess list
Stéphane Graber [Thu, 29 Jan 2015 22:06:05 +0000 (23:06 +0100)] 
ubuntu: Drop lucid support and refresh releaess list

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoclone_paths: use 'rootfs' for destination directory
Serge Hallyn [Thu, 29 Jan 2015 16:09:45 +0000 (16:09 +0000)] 
clone_paths: use 'rootfs' for destination directory

We were trying to be smart and use whatever the last part of
the container's rootfs path was.  However for block devices
that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
chances are that /var/lib/lxc/c1/md-1 does not exist.

So always use the $lxcpath/$lxcname/rootfs, and if it does
not exist, try to create it.

With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix clearing IPv4/IPv6 addresses
Stéphane Graber [Wed, 28 Jan 2015 09:33:58 +0000 (10:33 +0100)] 
Fix clearing IPv4/IPv6 addresses

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-{centos|fedora}: Respect --rootfs
Stéphane Graber [Wed, 28 Jan 2015 08:47:44 +0000 (09:47 +0100)] 
lxc-{centos|fedora}: Respect --rootfs

Close #406

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agofix busybox unpriv
Serge Hallyn [Tue, 27 Jan 2015 09:29:17 +0000 (10:29 +0100)] 
fix busybox unpriv

1. tty5 is not needed
2. the devices should be optional in case they didn't exist in the
host / parent-container
3. switch from 'touch $rootfs/dev/$dev' to using create=file in the
mount entry.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoUse 'overlay' as fs name when needed
Serge Hallyn [Mon, 26 Jan 2015 05:58:50 +0000 (05:58 +0000)] 
Use 'overlay' as fs name when needed

Close #389

We will probably also want to switch the order of the mount attempts, as
the new overlay fs should quickly become the more common scenario.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolua: fix crash on missing blkio
Stéphane Graber [Mon, 26 Jan 2015 05:11:55 +0000 (00:11 -0500)] 
lua: fix crash on missing blkio

Closes: #403
Signed-off-by: Dwight Engen
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoreplace deprecated `index` with `strchr`
Patrick O'Leary [Wed, 17 Dec 2014 01:47:21 +0000 (19:47 -0600)] 
replace deprecated `index` with `strchr`

The `index` libc function was removed in POSIX 2008, and `strchr` is a direct
replacement. The bionic (Android) libc has removed `index` when you are
compiling for a 64-bit architecture, such as AArch64.

Signed-off-by: Patrick O'Leary <patrick.oleary@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoGentoo template - Add a hwaddr if there is only one veth
Vicente Olivert Riera [Fri, 23 Jan 2015 16:03:13 +0000 (16:03 +0000)] 
Gentoo template - Add a hwaddr if there is only one veth

Reuse the code from the Debian template to associate a hwaddr if there
is only one veth interface in the container's config file.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoSmall fix for Lua 5.3 compatibility.
Thomas Moschny [Fri, 23 Jan 2015 21:00:40 +0000 (22:00 +0100)] 
Small fix for Lua 5.3 compatibility.

Signed-off-by: Thomas Moschny <thomas.moschny@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoadd "--mask-tmp" to lxc-fedora, plus some template script fixes]
Michael Adam [Mon, 19 Jan 2015 21:50:58 +0000 (22:50 +0100)] 
add "--mask-tmp" to lxc-fedora, plus some template script fixes]

Hi Michael,

do you have any concerns with the attached patch to
the fedora template that adds an option --mask-tmp
that prevents fedora/systemd from over-mounting
/tmp with tmpfs, which is useful in some cases?

Thanks - Michael

----- Forwarded message from Michael Adam <obnox@samba.org> -----

Date: Sat, 10 Jan 2015 13:12:06 +0100
From: Michael Adam <obnox@samba.org>
To: LXC development mailing-list <lxc-devel@lists.linuxcontainers.org>
Subject: Re: [lxc-devel] [PATCHES] add "--mask-tmp" to lxc-fedora, plus some
template script fixes
User-Agent: Mutt/1.5.23 (2014-03-12)

On 2015-01-10 at 13:08 +0100, Michael Adam wrote:
> On 2015-01-10 at 04:05 +0000, Serge Hallyn wrote:
>
> > The less controversial one is adding mask-tmp to the fedora template.
> > It looks fine to me, but that should go separately to mwarfield, our
> > fedora template maintainer :)
>
> I had notified mhw of my patches on irc, but apparently he is
> currently very busy.
>
> For a start, following is an update of the uncontroversial fix
> patches, i.e. the fix patche without the path ones, and without
> the mask-tmp patch.

And here comes the mask-tmp patch.
It needs to be applied onto the previous fix-patchset.

From 9589dca113535ed2f4faad89db2fab33bb8a9d7e Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox@samba.org>
Date: Thu, 8 Jan 2015 10:25:24 +0100
Subject: [PATCH] lxc-fedora: add a new option --mask-tmp

This will configure the container to prevent the standard
behaviour of over-mounting /tmp with tmpfs, which can be
undesirable in some cases.

My personal use case is vagrant-lxc in combination with
vagrant-cachier.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoUpdate MAINTAINERS
Stéphane Graber [Mon, 19 Jan 2015 21:23:21 +0000 (16:23 -0500)] 
Update MAINTAINERS

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-centos: pass releasever parameter to yum
Alexander Vladimirov [Fri, 16 Jan 2015 10:37:00 +0000 (17:37 +0700)] 
lxc-centos: pass releasever parameter to yum

Signed-off-by: Alexander Vladimirov <alexander.idkfa.vladimirov@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: Update the description of the veth in the Japanese lxc.container.conf(5)
KATOH Yasufumi [Fri, 16 Jan 2015 06:54:11 +0000 (15:54 +0900)] 
doc: Update the description of the veth in the Japanese lxc.container.conf(5)

Update for the commit 38005c5

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-download: improve help text.
Michael Adam [Thu, 15 Jan 2015 23:15:50 +0000 (00:15 +0100)] 
lxc-download: improve help text.

--help and --list are special in the sense that they
are independent of the other options and exit early.
Document them separately.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-download: make --list more useful.
Michael Adam [Thu, 15 Jan 2015 23:14:15 +0000 (00:14 +0100)] 
lxc-download: make --list more useful.

Make it possible to use --list without having to specify
--dist, --release, and --arch, which does not make a lot
of sense.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-download: fix typo in help text.
Michael Adam [Thu, 15 Jan 2015 23:13:35 +0000 (00:13 +0100)] 
lxc-download: fix typo in help text.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agodoc: clarify the description of the veth network type in the manpage.
Michael Adam [Tue, 13 Jan 2015 21:27:08 +0000 (22:27 +0100)] 
doc: clarify the description of the veth network type in the  manpage.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix instantiation of multiple vlan interfaces with same id
Axel Neumann [Tue, 13 Jan 2015 09:48:52 +0000 (10:48 +0100)] 
Fix instantiation of multiple vlan interfaces with same id

Container fail to start with configs (as shown below) where the same
vlan id is used for several type=vlan container interfaces.
Then, during the instantiation of the vlan interfaces, an error occurs
because the lxc code tries to assign the same temporary name to both
of them before it is bound into the container.

> lxc.network.type      = vlan
> lxc.network.flags     = up
> lxc.network.link      = eth1
> lxc.network.vlan.id   = 3842
> lxc.network.name      = iso0
>
> lxc.network.type      = vlan
> lxc.network.flags     = up
> lxc.network.link      = eth2
> lxc.network.vlan.id   = 3842
> lxc.network.name      = iso1

Signed-off-by: Axel Neumann <neumann@cgws.de>
10 years agoFix reversed args in mount call
Serge Hallyn [Fri, 9 Jan 2015 22:00:28 +0000 (22:00 +0000)] 
Fix reversed args in mount call

Riya Khanna reported that with a ramfs rootfs the mount to make
/ rprivate was returning -EFAULT.  NULL was being passed as the
mount target.  Pass "/" instead.

Reported-by: riya khanna <riyakhanna1983@gmail.com>>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-fedora: let help text fit into 80 columns
Michael Adam [Thu, 8 Jan 2015 09:22:18 +0000 (10:22 +0100)] 
lxc-fedora: let help text fit into 80 columns

by breaking and shortening some lines.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-fedora: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:01:18 +0000 (10:01 +0100)] 
lxc-fedora: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-fedora: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:00:06 +0000 (10:00 +0100)] 
lxc-fedora: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-centos: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:03:53 +0000 (10:03 +0100)] 
lxc-centos: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-centos: fix tab/space mixup in help text.
Michael Adam [Thu, 8 Jan 2015 09:03:31 +0000 (10:03 +0100)] 
lxc-centos: fix tab/space mixup in help text.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-centos: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:03:05 +0000 (10:03 +0100)] 
lxc-centos: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-openmandriva: protect possibly unset variable with quotes in -z check
Michael Adam [Thu, 8 Jan 2015 09:49:19 +0000 (10:49 +0100)] 
lxc-openmandriva: protect possibly unset variable with quotes in -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-openmandriva: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:48:40 +0000 (10:48 +0100)] 
lxc-openmandriva: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-altlinux: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 09:43:52 +0000 (10:43 +0100)] 
lxc-altlinux: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-altlinux: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:43:12 +0000 (10:43 +0100)] 
lxc-altlinux: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-opensuse: protect possibly unset variable with quotes in -z check
Michael Adam [Thu, 8 Jan 2015 09:36:06 +0000 (10:36 +0100)] 
lxc-opensuse: protect possibly unset variable with quotes in -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-opensuse: fix parsing of option "--clean": it takes no argument
Michael Adam [Thu, 8 Jan 2015 09:35:20 +0000 (10:35 +0100)] 
lxc-opensuse: fix parsing of option "--clean": it takes no argument

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-debian: protect possibly unset variable with quotes for -z check
Michael Adam [Thu, 8 Jan 2015 08:58:09 +0000 (09:58 +0100)] 
lxc-debian: protect possibly unset variable with quotes for -z check

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-debian: document "--clean" in the usage.
Michael Adam [Thu, 8 Jan 2015 08:38:48 +0000 (09:38 +0100)] 
lxc-debian: document "--clean" in the usage.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-debian: fix parsing of option "--clean": it takes no argument.
Michael Adam [Thu, 8 Jan 2015 08:32:39 +0000 (09:32 +0100)] 
lxc-debian: fix parsing of option "--clean": it takes no argument.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agoapparmor: Fix slave bind mounts
Martin Pitt [Thu, 8 Jan 2015 12:09:37 +0000 (13:09 +0100)] 
apparmor: Fix slave bind mounts

The permission to make a mount "slave" is spelt "make-slave", not "slave", see
https://launchpad.net/bugs/1401619. Also, we need to make all mounts slave, not
just the root dir.

https://launchpad.net/bugs/1350947

10 years agoAlso drop caps in unpriv containers
Stéphane Graber [Thu, 25 Dec 2014 23:17:25 +0000 (00:17 +0100)] 
Also drop caps in unpriv containers

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agoapparmor: Block access to /proc/kcore
Stéphane Graber [Sun, 28 Dec 2014 17:33:29 +0000 (18:33 +0100)] 
apparmor: Block access to /proc/kcore

Just like we block access to mem and kmem, there's no good reason for
the container to have access to kcore.

Reported-by: Marc Schaefer
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-alpine: use yaml for detection of latest release
Natanael Copa [Wed, 31 Dec 2014 07:31:45 +0000 (08:31 +0100)] 
lxc-alpine: use yaml for detection of latest release

Alpine Linux provides yaml files with latest release instead of the old
approach with .latest.txt.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-fedora: In fedora21, the fedora-repos package is needed.
Michael Adam [Fri, 2 Jan 2015 19:28:59 +0000 (20:28 +0100)] 
lxc-fedora: In fedora21, the fedora-repos package is needed.

fedora-release has been split into fedora-release and fedora-repos.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-fedora: when using systemd, set lxc.kmsg = 0 in the config
Michael Adam [Fri, 2 Jan 2015 20:12:21 +0000 (21:12 +0100)] 
lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config

This is to prevent systemd-journald to enter a 100% cpu loop.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agooracle: Fix /dev/shm
Stéphane Graber [Thu, 29 Jan 2015 21:44:56 +0000 (22:44 +0100)] 
oracle: Fix /dev/shm

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agocentos: Fix booting a Centos 6 container
Stéphane Graber [Thu, 29 Jan 2015 21:37:47 +0000 (22:37 +0100)] 
centos: Fix booting a Centos 6 container

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoMerge pull request #342 from tukiyo/patch-2
hallyn [Wed, 21 Jan 2015 15:40:25 +0000 (09:40 -0600)] 
Merge pull request #342 from tukiyo/patch-2

big big login delays in CentOS 7 systemd

10 years agoEnable seccomp by default for unprivileged users.
Serge Hallyn [Fri, 19 Dec 2014 18:23:52 +0000 (18:23 +0000)] 
Enable seccomp by default for unprivileged users.

In contrast to what the comment above the line disabling it said,
it seems to work just fine.  It also is needed on current kernels
(until Eric's patch hits upstream) to prevent unprivileged containers
from hosing fuse filesystems they inherit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoseccomp: add rule to reject umount -f
Serge Hallyn [Fri, 19 Dec 2014 18:22:55 +0000 (18:22 +0000)] 
seccomp: add rule to reject umount -f

If a container has a bind mount from a host nfs or fuse
filesystem, and does 'umount -f', it will disconnect the
host's filesystem.  This patch adds a seccomp rule to
block umount -f from a container.  It also adds that rule
to the default seccomp profile.

Thanks stgraber for the idea :)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong...
Johannes Kastl [Wed, 17 Dec 2014 20:08:21 +0000 (21:08 +0100)] 
lxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong version of build package is installed

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-opensuse: default release changed to 13.1, as 12.3 reaches end-of-life soon
Johannes Kastl [Fri, 12 Dec 2014 20:58:59 +0000 (21:58 +0100)] 
lxc-opensuse: default release changed to 13.1, as 12.3 reaches  end-of-life soon

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agochange version to 1.0.7 in configure.ac lxc-1.0.7
Stéphane Graber [Fri, 5 Dec 2014 18:37:33 +0000 (13:37 -0500)] 
change version to 1.0.7 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agotypofixes - https://github.com/vlajos/misspell_fixer
Veres Lajos [Thu, 4 Dec 2014 21:57:38 +0000 (21:57 +0000)] 
typofixes - https://github.com/vlajos/misspell_fixer

Signed-off-by: Veres Lajos <vlajos@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agormdir and lxc_unpriv returns non-negative error codes
S.Çağlar Onur [Thu, 4 Dec 2014 17:59:47 +0000 (12:59 -0500)] 
rmdir and lxc_unpriv returns non-negative error codes

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoaudit: added capacity and reserve() to nlmsg
Shuai Zhang [Sun, 30 Nov 2014 13:03:37 +0000 (21:03 +0800)] 
audit: added capacity and reserve() to nlmsg

There are now two (permitted) ways to add data to netlink message:

 1. put_xxx()
 2. call nlmsg_reserve() to get a pointer to newly reserved room within the
    original netlink message, then write or memcpy data to that area.

Both of them guarantee adding requested length data do not overflow the
pre-allocated message buffer by checking against its cap field first.

And there may be no need to access nlmsg_len outside nl module, because both
put_xxx() and nlmsg_reserve() have alread did that for us.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agotests: try again when waitpid() sets errno as EINTR
Arjun Sreedharan [Thu, 4 Dec 2014 08:56:04 +0000 (14:26 +0530)] 
tests: try again when waitpid() sets errno as EINTR

when waitpid() is interrupted, errno is not set to the negative
value -EINTR. It is set to EINTR. check against EINTR.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofixed typo in comment
Shuai Zhang [Wed, 3 Dec 2014 06:13:20 +0000 (14:13 +0800)] 
fixed typo in comment

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoImprove veth error cases logging
Stéphane Graber [Wed, 3 Dec 2014 16:01:45 +0000 (11:01 -0500)] 
Improve veth error cases logging

The previous error message made it look like the host interface name was
the concatenation of both the host and guest interface names.

Closes #374

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoFix clone issues
KATOH Yasufumi [Wed, 5 Nov 2014 07:03:34 +0000 (16:03 +0900)] 
Fix clone issues

This commit fixes two issues at the time of clone:
* unnecessary directory is created when clone between overlayfs/aufs
* clone failed when the end of rootfs path is not "/rootfs"

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agooverlayfs: overlayfs.v22 or higher needs workdir option
KATOH Yasufumi [Thu, 30 Oct 2014 11:31:20 +0000 (20:31 +0900)] 
overlayfs: overlayfs.v22 or higher needs workdir option

This patch creates workdir as "olwork", and retry mount with workdir
option when mount is failed.
It is used to prepare files before atomically swithing with
destination, and needs to be on the same filesystem as upperdir. It's
OK for it to be empty.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
10 years agooverlay and aufs clone_paths: be more robust
Serge Hallyn [Thu, 16 Oct 2014 15:10:21 +0000 (15:10 +0000)] 
overlay and aufs clone_paths: be more robust

Currently when we clone a container, bdev_copy passes NULL as dst argument
of bdev_init, then sees bdev->dest (as a result) is NULL, and sets
bdev->dest to $lxcpath/$name/rootfs.  so $ops->clone_paths() can
assume that "/rootfs" is at the end of the path.  The overlayfs and
aufs clonepaths do assume that and index to endofstring-6 and append
delta0.  Let's be more robust by actually finding the last / in
the path.

Then, instead of always setting oldbdev->dest to $lxcpath/$name/rootfs,
set it to oldbdev->src.  Else dir_clonepaths fails when mounting src
onto dest bc dest does not exist.  We could also fix that by creating
bdev->dest if needed, but that addes an empty directory to the old
container.

This fixes 'lxc-clone -o x1 -n x2' if x1 has lxc.rootfs = /var/lib/lxc/x1/x
and makes the overlayfs and aufs paths less fragile should something else
change.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoAllow lxc_clear_config_item to clear idmaps.
Casey Marshall [Fri, 28 Nov 2014 07:11:06 +0000 (01:11 -0600)] 
Allow lxc_clear_config_item to clear idmaps.

Ran into this when trying to automate stgraber's "GUI in containers"
post.

Signed-off-by: Casey Marshall <casey.marshall@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.
Johannes Kastl [Sat, 29 Nov 2014 20:43:26 +0000 (21:43 +0100)] 
lxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-debian: mask both Wheezy and Jessie udev services
Cameron Norman [Mon, 1 Dec 2014 21:35:52 +0000 (13:35 -0800)] 
lxc-debian: mask both Wheezy and Jessie udev services

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-debian: adjust init system configurations
Cameron Norman [Mon, 1 Dec 2014 21:29:26 +0000 (13:29 -0800)] 
lxc-debian: adjust init system configurations

Do as much as possible to allow containers switching from non-systemd to
systemd to work as intended (but nothing that will cause side effects).
Use update-rc.d disable instead of remove so the init scripts are not
re-enabled when the package is updated

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-debian: support systemd as PID 1
Antonio Terceiro [Mon, 24 Nov 2014 01:51:06 +0000 (23:51 -0200)] 
lxc-debian: support systemd as PID 1

Containers with systemd need a somewhat special setup, which I borrowed
and adapted from lxc-fedora. These changes are required so that Debian 8
(jessie) containers work properly, and are a no-op for previous Debian
versions.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-debian: Fix default mirrors
Gu1 [Tue, 28 Oct 2014 01:14:28 +0000 (02:14 +0100)] 
lxc-debian: Fix default mirrors

Fix a typo in the lines inserted in the default sources.list.
Change the default mirror to http.debian.net which is (supposedly) more
accurate and better than cdn.debian.net for a generic configuration.
Use security.debian.org directly for the {release}/updates repository.

Signed-off-by: Gu1 <gu1@aeroxteam.fr>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-debian: added support for package installation
Alexander Dreweke [Tue, 8 Jul 2014 05:17:37 +0000 (07:17 +0200)] 
lxc-debian: added support for package installation

- added --mirror, --security-mirror and --package parameters
- generate source.list
- install packages into final lxc instance

Update by Stéphane Graber for stable-1.0:
 - Drop the addition of --packages (new feature)

Signed-off-by: Alexander Dreweke <alexander@dreweke.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agotabs/spaces consistency
Stéphane Graber [Wed, 26 Nov 2014 19:23:05 +0000 (14:23 -0500)] 
tabs/spaces consistency

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agoRemounts bind mounts if read-only flag is provided
Abin Shahab [Wed, 12 Nov 2014 00:06:52 +0000 (00:06 +0000)] 
Remounts bind mounts if read-only flag is provided

Bind mounts do not honor filesystem mount options. This change will
remount filesystems that are bind mounted if there are changes to
filesystem mount options, specifically if the mount is readonly.

Signed-off-by: Abin Shahab <ashahab@altiscale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
10 years agolxc-alpine: create a default tty for console
Natanael Copa [Thu, 27 Nov 2014 14:21:21 +0000 (15:21 +0100)] 
lxc-alpine: create a default tty for console

Create a tty so we get login prompt on console by default

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-alpine: make sure /dev/shm is world writeable
Natanael Copa [Thu, 27 Nov 2014 14:20:50 +0000 (15:20 +0100)] 
lxc-alpine: make sure /dev/shm is world writeable

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agofix wrong nlmsg_len
Shuai Zhang [Thu, 27 Nov 2014 12:38:01 +0000 (20:38 +0800)] 
fix wrong nlmsg_len

nlmsg_len is the length of message including header.

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
10 years agolxc-opensuse: Disable on 13.2
Johannes Kastl [Wed, 26 Nov 2014 19:26:08 +0000 (20:26 +0100)] 
lxc-opensuse: Disable on 13.2

Disabled building openSUSE containers on openSUSE 13.2 and openSUSE
Tumbleweed due to faulty behaviour with newer versions of
init_buildsystem.

Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>