]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
9 years agodoc: Fix the mistranslation about lxc.group in Japanese lxc.container.conf(5)
KATOH Yasufumi [Wed, 13 May 2015 06:19:16 +0000 (15:19 +0900)] 
doc: Fix the mistranslation about lxc.group in Japanese lxc.container.conf(5)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoenable cgmanager support for Travis CI
S.Çağlar Onur [Tue, 12 May 2015 18:30:33 +0000 (14:30 -0400)] 
enable cgmanager support for Travis CI

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUse 'cgm listcontrollers' list rather than /proc/self/cgroups
Serge Hallyn [Fri, 1 May 2015 21:11:28 +0000 (21:11 +0000)] 
Use 'cgm listcontrollers' list rather than /proc/self/cgroups

to populate the list of subsystems to use.

Cgmanager can be started with some subsystems disabled (i.e.
cgmanager -M cpuset).  If lxc using cgmanager then uses the
/proc/self/cgroup output to determine which controllers to use,
it will fail when trying to do things to cpuset.  Instead, ask
cgmanager which controllers to use.

This still defers (per patch 1/1) to the lxc.cgroup.use values.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agomake cgmanager follow lxc.cgroup.use
Serge Hallyn [Fri, 1 May 2015 15:09:41 +0000 (15:09 +0000)] 
make cgmanager follow lxc.cgroup.use

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoUpdate lxc-debian.in
有张纸 [Fri, 22 May 2015 13:26:35 +0000 (21:26 +0800)] 
Update lxc-debian.in

fix "bash: warning: setlocale: LC_ALL: cannot change locale"

Signed-off-by: <feng xiahou xiahoufeng@yahoo.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoChange lxc-clone to use 'rsync -aH' instead of just 'rsync -a' for cloning to fix...
Erik B. Andersen [Fri, 15 May 2015 04:39:57 +0000 (21:39 -0700)] 
Change lxc-clone to use 'rsync -aH' instead of just 'rsync -a' for cloning to fix Launchpad Bug #1441307.

Signed-off-by: Erik B. Andersen <erik.b.andersen@gmail.com>
9 years agoUse POSIX-compliant function names in bash completion
Lucas Werkmeister [Thu, 14 May 2015 20:12:52 +0000 (22:12 +0200)] 
Use POSIX-compliant function names in bash completion

When running in posix mode (for example, because it was invoked as `sh`,
or with the --posix option), bash rejects the function names previously
used because they contain hyphens, which are not legal POSIX names, and
exits immediately.

This is a particularly serious problem on a system in which the
following three conditions hold:

1. The `sh` executable is provided by bash, e. g. via a symlink
2. Gnome Display Manager is used to launch X sessions
3. Bash completion is loaded in the (system or user) profile file
   instead of in the bashrc file

In that case, GDM's Xsession script (run with `sh`, i. e., bash in posix
mode) sources the profile files, thus causing the shell to load the bash
completion files. Upon encountering the non-POSIX-compliant function
names, bash would then exit, immediately ending the X session.

Fixes #521.

Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
9 years agolxc-debian.in: Fixed errors if dbus is not installed
Cyril Bitterich [Sat, 9 May 2015 19:57:14 +0000 (21:57 +0200)] 
lxc-debian.in: Fixed errors if dbus is not installed

The lxc-debian template debootstraps a minimum debian system which does not contain dbus.
If systemd is used this will result in getty-static.service to be used instead of getty@ .
The systemd default files uses 6 tty's instead of the 4 the script creates.
This will lead to repeated error messages in the systemd journal.

Signed-off-by: Cyril Bitterich <Cyril.Bitterich@1und1.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoadded doc/api/doxygen_sqlite3.db to .gitignore
Karl-Philipp Richter [Mon, 11 May 2015 19:59:19 +0000 (21:59 +0200)] 
added doc/api/doxygen_sqlite3.db to .gitignore

Signed-off-by: Karl-Philipp Richter <krichter722@aol.de>
9 years agoCall /lib/apparmor/profile-load directly instead of the wrapper
Martin Pitt [Thu, 7 May 2015 11:38:50 +0000 (13:38 +0200)] 
Call /lib/apparmor/profile-load directly instead of the wrapper

AppArmor ships /lib/apparmor/profile-load. /lib/init/apparmor-profile-load is
merely a wrapper which calls the former, so just call it directly to avoid the
dependency on the wrapper.

LP: #1432683

9 years agooverlay: create workdir if it doesn't exist
Serge Hallyn [Fri, 1 May 2015 12:56:33 +0000 (14:56 +0200)] 
overlay: create workdir if it doesn't exist

Otherwise a container created before we needed workdir will fail
to start after a kernel+lxc update.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoFix Lua 5.3 compatibility code.
Thomas Moschny [Sun, 26 Apr 2015 21:25:59 +0000 (23:25 +0200)] 
Fix Lua 5.3 compatibility code.

If Lua 5.3 is compiled with LUA_COMPAT_5_2 defined, the
luaL_checkunsigned compatibility macro is already defined
in lauxlib.h.

Signed-off-by: Thomas Moschny <thomas.moschny@gmx.de>
9 years agoadded build and test results to .gitignore
Karl-Philipp Richter [Sat, 25 Apr 2015 11:06:00 +0000 (13:06 +0200)] 
added build and test results to .gitignore

Signed-off-by: Karl-Philipp Richter <krichter722@aol.de>
9 years agoMake lxc-checkconfig work with kernel versions > 3
Christian Brauner [Sat, 25 Apr 2015 08:05:07 +0000 (10:05 +0200)] 
Make lxc-checkconfig work with kernel versions > 3

(1) Add test for kernel version greater 3.
(2) Use && and || instead of -a and -o as suggested in
    http://www.unix.com/man-page/posix/1p/test/.

lxc-checkconfig will currently report "missing" on "Cgroup memory controller"
for kernel versions greater 3. This happens because the script, before checking
for the corresponding memory variable in the kernel config, currently will test
whether we have a major kernel version greater- or equal to 3 and a minor kernel
version greater- or equal to 6. This adds an additional test whether we have a
major kernel version greater than 3.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agouse poll instead of select
Serge Hallyn [Tue, 21 Apr 2015 18:34:45 +0000 (13:34 -0500)] 
use poll instead of select

Particularly when using the go-lxc api with lots of threads, it
happens that if the open files limit is > 1024, we will try to
select on fd > 1024 which breaks on glibc.

So use poll instead of select.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoRevert "lxc-cmd-stop: two fixes"
Serge Hallyn [Tue, 14 Apr 2015 19:56:51 +0000 (14:56 -0500)] 
Revert "lxc-cmd-stop: two fixes"

This breaks code that depended on the monitor being fully dead before
c->stop() returns.

This reverts commit 62e041610609c8913c3d397a521716819a91f850.

9 years agoRevert "do_lxcap_stop: wait until container is stopped"
Serge Hallyn [Tue, 14 Apr 2015 19:56:10 +0000 (14:56 -0500)] 
Revert "do_lxcap_stop: wait until container is stopped"

This breaks lxc-test-concurrent.

This reverts commit fef9aa89e99285609d51848623f84ecd3a3109df.

9 years agodo_lxcap_stop: wait until container is stopped
Serge Hallyn [Tue, 14 Apr 2015 14:28:20 +0000 (09:28 -0500)] 
do_lxcap_stop: wait until container is stopped

In the past, lxc-cmd-stop would wait until the command pipe was closed
before returning, ensuring that the container monitor had exited.
Now that we accept the actual success return value, lxcapi_stop can
return success before the monitor has fully exited.

So explicitly wait for the container to stop, when lxc-cmd-stop returned
success.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-fedora: manage secondary architectures
Laurent Vivier [Tue, 7 Apr 2015 19:17:37 +0000 (21:17 +0200)] 
lxc-fedora: manage secondary architectures

URL for packages and LiveOS differs from x86, x86_64 and ARM.

This patch allows to select the good mirror URL according to
the architecture.

Primary architecture: http://mirrors.kernel.org/fedora
Secondary architecture: http://mirrors.kernel.org/fedora-secondary

The managed secondary architectures are only ppc64 and s390x,
the secondary architectures for Fedora 20 (the base of initial bootstrap).

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
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>