]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
8 years agotree-wide: replace readdir_r() with readdir() 1310/head
Christian Brauner [Tue, 9 Aug 2016 19:05:19 +0000 (21:05 +0200)] 
tree-wide: replace readdir_r() with readdir()

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agoReplace 'index' by 'strchr' for Android build
Stéphane Graber [Fri, 18 Nov 2016 02:10:03 +0000 (21:10 -0500)] 
Replace 'index' by 'strchr' for Android build

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodebian: Don't depend on libui-dialog-perl
Stéphane Graber [Mon, 14 Nov 2016 16:53:07 +0000 (11:53 -0500)] 
debian: Don't depend on libui-dialog-perl

This package doesn't exist in stretch anymore, and it's unclear why we
were depending on a library to begin with (as opposed to having it
brought by whatever needs it).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoconf: do not use %m format specifier
Christian Brauner [Sun, 13 Nov 2016 16:10:41 +0000 (17:10 +0100)] 
conf: do not use %m format specifier

This is a GNU extension and some libcs might be missing it.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agoinstall bash completion where pkg-config tells us to
Evgeni Golov [Sat, 12 Nov 2016 13:44:40 +0000 (14:44 +0100)] 
install bash completion where pkg-config tells us to

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agotemplates: add squashfs support to lxc-ubuntu-cloud.in
Po-Hsu Lin [Thu, 10 Nov 2016 08:48:29 +0000 (16:48 +0800)] 
templates: add squashfs support to lxc-ubuntu-cloud.in

Add squashfs format file support for lxc-ubuntu-cloud.in

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
8 years agocgfs: explicitly check for NULL
Christian Brauner [Sun, 30 Oct 2016 13:44:33 +0000 (14:44 +0100)] 
cgfs: explicitly check for NULL

Somehow this implementation of a cgroupfs backend decided to use the hierarchy
numbers it detects in /proc/cgroups and /proc/self/cgroups as indices for
the hierarchy struct. Controller numbering usually starts at 1 but may start at
0 if:

    a) the controller is not mounted on a cgroups v1 hierarchy;
    b) the controller is bound to the cgroups v2 single unified hierarchy; or
    c) the controller is disabled

To avoid having to rework our fallback backend significantly, we should
explicitly check for each controller if hierarchy[i] != NULL.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agocreate symlink for /var/run
mgariepy [Tue, 8 Nov 2016 16:42:34 +0000 (11:42 -0500)] 
create symlink for /var/run

this patch create /var/run link to point to /run.

This will fix various issue present when /var/run is persistent.

Signed-off-by: Marc Gariepy <gariepy.marc@gmail.com>
8 years agoconf: merge network namespace move & rename on shutdown
Wolfgang Bumiller [Wed, 17 Aug 2016 09:36:39 +0000 (11:36 +0200)] 
conf: merge network namespace move & rename on shutdown

On shutdown we move physical network interfaces back to the
host namespace and rename them afterwards as well as in the
later lxc_network_delete() step. However, if the device had
a name which already exists in the host namespace then the
moving fails and so do the subsequent rename attempts. When
the namespace ceases to exist the devices finally end up
in the host namespace named 'dev<ID>' by the kernel.

In order to avoid this, we do the moving and renaming in a
single step (lxc_netdev_move_by_*()'s move & rename happen
in a single netlink transaction).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agotools: use correct exit code for lxc-stop
Christian Brauner [Sun, 30 Oct 2016 17:24:15 +0000 (18:24 +0100)] 
tools: use correct exit code for lxc-stop

When the container is already running our manpage promises to exit with 2.
Let's make it so.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agocgfs: skip empty entries under /proc/self/cgroup
Christian Brauner [Sun, 30 Oct 2016 12:42:37 +0000 (13:42 +0100)] 
cgfs: skip empty entries under /proc/self/cgroup

If cgroupv2 is enabled either alone or together with legacy hierarchies
/proc/self/cgroup can contain entries of the form:

        0::/

These entries need to be skipped.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agocgfs: add print_cgfs_init_debuginfo()
Christian Brauner [Sun, 30 Oct 2016 09:45:13 +0000 (10:45 +0100)] 
cgfs: add print_cgfs_init_debuginfo()

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agocgfs: fix invalid free()
Christian Brauner [Sat, 29 Oct 2016 20:47:51 +0000 (22:47 +0200)] 
cgfs: fix invalid free()

And let's be on the safe side by NULLing free()ed variables.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agouse python3_sitearch for including the python code
Evgeni Golov [Sat, 29 Oct 2016 18:29:08 +0000 (20:29 +0200)] 
use python3_sitearch for including the python code

Closes: #502
Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agoubuntu: Fix package upgrades requiring proc
Stéphane Graber [Mon, 24 Oct 2016 21:38:13 +0000 (17:38 -0400)] 
ubuntu: Fix package upgrades requiring proc

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agos390x: Fix seccomp handling of personalities
Stéphane Graber [Thu, 20 Oct 2016 20:35:36 +0000 (16:35 -0400)] 
s390x: Fix seccomp handling of personalities

There are no personalities for s390x, so don't list itself as one.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoDrop leftover references to lxc_strerror().
Jafar Al-Gharaibeh [Thu, 13 Oct 2016 23:35:29 +0000 (18:35 -0500)] 
Drop leftover references to lxc_strerror().

lxc_strerror() was dropped long time ago, in 2009 to be exact.

Related commit:
https://github.com/lxc/lxc/commit/7cee8789514fb42d6a48d50b904e24284f5526e3

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
8 years agoarchlinux: Fix resolving
Stéphane Graber [Thu, 13 Oct 2016 19:02:56 +0000 (15:02 -0400)] 
archlinux: Fix resolving

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoarchlinux: Do DHCP on eth0
Stéphane Graber [Thu, 13 Oct 2016 18:32:03 +0000 (14:32 -0400)] 
archlinux: Do DHCP on eth0

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolog: sanity check the returned value from snprintf()
Lans Zhang [Mon, 10 Oct 2016 13:49:55 +0000 (21:49 +0800)] 
log: sanity check the returned value from snprintf()

The returned value from snprintf() should be checked carefully.

This bug can be leveraged to execute arbitrary code through carefully
constructing the payload, e.g,

lxc-freeze -n `python -c "print 'AAAAAAAA' + 'B'*959"` -P PADPAD -o /tmp/log

This command running on Ubuntu 14.04 (x86-64) can cause a segment fault.

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
8 years agomark the python examples as having utf-8 encoding
Evgeni Golov [Sat, 8 Oct 2016 16:29:30 +0000 (18:29 +0200)] 
mark the python examples as having utf-8 encoding

this allows running them also under Python2, which otherwise
would choke on Stéphane's name and error out with
 SyntaxError: Non-ASCII character '\xc3' in file …

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agoFix spelling of CentOS in the templates
Roman Mueller [Wed, 28 Sep 2016 08:03:39 +0000 (10:03 +0200)] 
Fix spelling of CentOS in the templates

Signed-off-by: Roman Mueller <roman.mueller@gmail.com>
8 years agoutils: fix lxc_string_split()
Christian Brauner [Sun, 25 Sep 2016 14:51:24 +0000 (16:51 +0200)] 
utils: fix lxc_string_split()

Make sure we don't return uninitialized memory.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agolxc-create -t debian fails on ppc64el arch
Thierry Fauck [Fri, 16 Sep 2016 13:34:41 +0000 (08:34 -0500)] 
lxc-create -t debian fails on ppc64el arch

Template catches arch from uname -m, but for ppc64el system, arch reports ppc64le
which doesn't match image repo.

Signed-off-by: Thierry Fauck <tfauck@free.fr>
Signed-off-by: Serge Hallyn <serge@hallyn.com>
8 years agomake rsync deal with sparse files efficiently
Lukas Pirl [Wed, 14 Sep 2016 15:40:16 +0000 (17:40 +0200)] 
make rsync deal with sparse files efficiently

Signed-off-by: Lukas Pirl <git@lukas-pirl.de>
8 years agolxczfs: small fixes
Christian Brauner [Tue, 13 Sep 2016 15:18:23 +0000 (17:18 +0200)] 
lxczfs: small fixes

- We expect destroy to fail in zfs_clone() so try to silence it so users are
  not irritated when they create zfs snapshots.
- Add -r recursive to zfs_destroy(). This code is only hit when a) the
  container has no snapshots or b) the user calls destroy with snapshots. So
  this should be safe. Without -r snapshots will remain.

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
8 years agoconsole: use correct log name
Christian Brauner [Sat, 3 Sep 2016 18:05:54 +0000 (20:05 +0200)] 
console: use correct log name

lxc_console is used with lxc_console.c

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agoset FULL_PATH_NAMES=NO in doc/api/Doxyfile
Evgeni Golov [Sat, 27 Aug 2016 10:14:53 +0000 (12:14 +0200)] 
set FULL_PATH_NAMES=NO in doc/api/Doxyfile

otherwise the generated docs have the full build path in them
and nonbody cares that the files were built in
 /build/lxc-_BVY2u/lxc-2.0.4/src/lxc/

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agotemplates: fedora requires openssl binary
Elan Ruusamäe [Tue, 23 Aug 2016 16:31:38 +0000 (19:31 +0300)] 
templates: fedora requires openssl binary

/usr/share/lxc/templates/lxc-fedora: line 1078: openssl: command not found

Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
8 years agoseccomp: non functional changes
Christian Brauner [Fri, 19 Aug 2016 16:53:02 +0000 (18:53 +0200)] 
seccomp: non functional changes

- log more errnos
- adapt coding style

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoseccomp: remove double include and order includes
Christian Brauner [Fri, 19 Aug 2016 13:20:22 +0000 (15:20 +0200)] 
seccomp: remove double include and order includes

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoseccomp: add support for s390x
Christian Brauner [Fri, 19 Aug 2016 09:57:14 +0000 (11:57 +0200)] 
seccomp: add support for s390x

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoconfile: add more archs to lxc_config_parse_arch()
Christian Brauner [Fri, 19 Aug 2016 09:15:30 +0000 (11:15 +0200)] 
confile: add more archs to lxc_config_parse_arch()

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoseccomp: fix strerror()
James Cowgill [Thu, 18 Aug 2016 15:48:24 +0000 (16:48 +0100)] 
seccomp: fix strerror()

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
8 years agoseccomp: Add mips and mips64 entries to lxc_config_parse_arch
James Cowgill [Thu, 18 Aug 2016 13:27:35 +0000 (14:27 +0100)] 
seccomp: Add mips and mips64 entries to lxc_config_parse_arch

Fixes "unsupported personality" warnings when starting containers.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
8 years agoseccomp: Implement MIPS seccomp handling
James Cowgill [Mon, 15 Aug 2016 16:09:44 +0000 (16:09 +0000)] 
seccomp: Implement MIPS seccomp handling

MIPS processors implement 3 ABIs: o32, n64 and n32 (similar to x32). The kernel
treats each ABI separately so syscalls disallowed on "all" arches should be
added to all three seccomp sets. This is implemented by expanding compat_arch
and compat_ctx to accept two compat architectures.

After this, the MIPS hostarch detection code and config section code is added.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
8 years agoutils: Add mips signalfd syscall numbers
James Cowgill [Fri, 12 Aug 2016 15:54:14 +0000 (15:54 +0000)] 
utils: Add mips signalfd syscall numbers

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
8 years agoUse full GPG fingerprint instead of long IDs.
Stéphane Graber [Wed, 17 Aug 2016 19:42:34 +0000 (15:42 -0400)] 
Use full GPG fingerprint instead of long IDs.

With how easy it is to create a collision on a short ID nowadays and
given that the user doesn't actually have to remember or manually enter
the key ID, lets just use the full fingerprint from now on.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agotools: add missing newline in lxc-create output
Christian Brauner [Sat, 13 Aug 2016 14:04:44 +0000 (16:04 +0200)] 
tools: add missing newline in lxc-create output

Signed-off-by: Christian Brauner <cbrauner@suse.de>
8 years agoapparmor: Refresh generated file
Stéphane Graber [Tue, 28 Jun 2016 19:35:58 +0000 (15:35 -0400)] 
apparmor: Refresh generated file

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoconf: set pty_info to NULL after free
Wolfgang Bumiller [Thu, 28 Jul 2016 09:52:18 +0000 (11:52 +0200)] 
conf: set pty_info to NULL after free

This fixes a double free corruption on container-requested
reboots when lxc_spawn() fails before receiving the ttys, as
lxc_fini() (part of __lxc_start()'s cleanup) calls
lxc_delete_tty().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agoAdd a prefix to the lxc.pc
Sergio Schvezov [Tue, 26 Jul 2016 07:41:47 +0000 (09:41 +0200)] 
Add a prefix to the lxc.pc

This allows installing to different locations and using
the lxc.pc to build using the generated includedir and
libdir.

Signed-off-by: Sergio Schvezov <sergio.schvezov@ubuntu.com>
8 years agotemplates: avoid noisy perl warnings caused by missing locales
Andreas Freudenberg [Tue, 12 Jul 2016 15:51:06 +0000 (17:51 +0200)] 
templates: avoid noisy perl warnings caused by missing locales

Signed-off-by: Andreas Freudenberg <andreas.freudenberg@licomonch.net>
8 years agoSet up MTU for vlan-type interfaces.
Vitaly Lavrov [Thu, 30 Jun 2016 17:04:49 +0000 (20:04 +0300)] 
Set up MTU for vlan-type interfaces.

Signed-off-by: Vitaly Lavrov <vel21ripn@gmail.com>
8 years agolxc-debian: fix regression when creating wheezy containers
Antonio Terceiro [Wed, 29 Jun 2016 17:58:35 +0000 (14:58 -0300)] 
lxc-debian: fix regression when creating wheezy containers

The regression was introduced by commit
3c39b0b7a2b445e08d2e2aecb05566075f4f3423 which makes it possible to
create working stretch containers by forcinig `init` to be in the
included package list.

However, `init` didn't exit before jessie, so now for wheezy we
explicitly include `sysvinit`; sysvinit on wheezy is essential,
so it would already be included anyway.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
8 years agoInclude all lxcmntent.h function declarations on Bionic
Preetam D'Souza [Tue, 28 Jun 2016 03:12:12 +0000 (23:12 -0400)] 
Include all lxcmntent.h function declarations on Bionic

Newer versions of Android (5.0+, aka API Level 21+) include mntent.h,
which declares setmntent and endmntent. This hits an edge
case with the preprocessor checks in lxcmntent.h because HAVE_SETMNTENT
and HAVE_ENDMNTENT are both defined (in Bionic's mntent.h), but conf.c
always includes lxcmntent.h on Bionic! As a result, we get compiler
warnings of implicit function declarations for setmntent endmntent.

This patch always includes setmntent/endmntent/hasmntopt function
declarations on Bionic, which gets rid of these warnings.

Signed-off-by: Preetam D'Souza <preetamjdsouza@gmail.com>
8 years agoAppArmor: add make-rslave to usr.bin.lxc-start
Wolfgang Bumiller [Mon, 27 Jun 2016 20:20:00 +0000 (16:20 -0400)] 
AppArmor: add make-rslave to usr.bin.lxc-start

The profile already contains
  mount options=(rw, make-slave) -> **,

Which allows going through all mountpoints with make-slave,
so it seems to make sense to also allow the directly
recursive variant with "make-rslave".

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoplamo: Improve Plamo template
KATOH Yasufumi [Tue, 21 Jun 2016 02:06:25 +0000 (11:06 +0900)] 
plamo: Improve Plamo template

* configure to start only the minimum of service
* add ntp, kmod to ignore packages

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agolxc-debian: make sure init is installed
Antonio Terceiro [Fri, 17 Jun 2016 22:00:56 +0000 (19:00 -0300)] 
lxc-debian: make sure init is installed

init 1.34 is not "Essential" anymore, in order to make it not required
on minimal chroots, docker containers, etc. Because of that we now need
to manually include it on systems that are expected to boot.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
8 years agoFix redefinition of struct in6_addr
Jörg Krause [Thu, 19 May 2016 19:51:27 +0000 (21:51 +0200)] 
Fix redefinition of struct in6_addr

struct in6_addr is both defined in the C library header <netinet/in.h>
and the Linux kernel header <linux/in6.h>.

lxc_user_nic.c includes both <netinet/in.h> and <linux/if_bridge.h>. The
later one includes <linux/in6.h>.

This breaks build with the musl libc:
  error: redefinition of ‘struct in6_addr’

As lxc_user_nic.c does not use any references from <linux/if_bridge.h> it
is safe to remove this header.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
8 years agoFix hostname in interface config for apline template
Andrey Kostin [Wed, 11 May 2016 20:32:40 +0000 (23:32 +0300)] 
Fix hostname in interface config for apline template

Signed-off-by: Andrey Kostin <andrey@kostin.email>
8 years agoAlso allow fstype=fuse for fuse filesystems
Stéphane Graber [Wed, 11 May 2016 16:59:23 +0000 (12:59 -0400)] 
Also allow fstype=fuse for fuse filesystems

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoAllow configuration file values to be quoted
Stewart Brodie [Tue, 10 May 2016 12:57:00 +0000 (13:57 +0100)] 
Allow configuration file values to be quoted

If the value starts and ends with matching quote characters, those
characters are stripped automatically.   Quote characters are the
single quote (') or double quote (").  The quote removal is done after
the whitespace trimming.

This is needed particularly in order that lxc.environment values may
have trailing spaces.  However, the quote removal is done for all values
in the parse_line function, as it has non-const access to the value.

Signed-off-by: Stewart Brodie <stewart@metahusky.net>
8 years agoUnshare netns after setting the userns mappings
Serge Hallyn [Mon, 9 May 2016 20:30:46 +0000 (15:30 -0500)] 
Unshare netns after setting the userns mappings

so that there is a root uid mapping for the /proc/net files.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoAdded OR statement for cases of ID = rhel in RHEL 7+
Hartnell Foster [Mon, 9 May 2016 11:42:56 +0000 (12:42 +0100)] 
Added OR statement for cases of ID = rhel in RHEL 7+

Signed-off-by: Hartnell Foster <hartnell.foster@bbc.co.uk>
8 years agosync.c: use correct types
Christian Brauner [Sat, 7 May 2016 05:40:33 +0000 (07:40 +0200)] 
sync.c: use correct types

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agosync: fail on unexpected message sizes
Tycho Andersen [Fri, 6 May 2016 16:21:39 +0000 (11:21 -0500)] 
sync: fail on unexpected message sizes

I think (?) this may be related to our hanging monitor bug. Let's do this
anyway, as it's probably a good idea.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
8 years agoForce DHCP client to send hostname
Lisio [Thu, 5 May 2016 04:35:36 +0000 (08:35 +0400)] 
Force DHCP client to send hostname

Required for proper applying dnsmasq config entries.

Signed-off-by: Andrey Kostin <andrey@kostin.email>
8 years agoAdded `type` to keys in lxc_list_nicconfigs
Aron Podrigal [Sun, 1 May 2016 16:13:39 +0000 (12:13 -0400)] 
Added `type` to keys in lxc_list_nicconfigs

Signed-off-by: Aron Podrigal <aronp@guaranteedplus.com>
8 years agoFixed - set PyErr when Container.__init__ fails
Aron Podrigal [Sun, 1 May 2016 15:06:53 +0000 (11:06 -0400)] 
Fixed - set PyErr when Container.__init__ fails

When container init failed for whatever reason, previously it resulted
in a `SystemError: NULL result without error in PyObject_Call`
This will now result in a RuntimeError with the error message
previously printed to stderr.

Signed-off-by: Aron Podrigal <aronp@guaranteedplus.com>
8 years agoCheck if stdout is a terminal in lxc-checkconfig
walkerning [Sat, 30 Apr 2016 17:06:29 +0000 (01:06 +0800)] 
Check if stdout is a terminal in lxc-checkconfig

Let lxc-checkconfig write to non-tty stdout without color control
characters
Signed-off-by: walkerning <foxdoraame@gmail.com>
8 years agoUpdate maintainers
Stéphane Graber [Sun, 24 Apr 2016 22:34:15 +0000 (18:34 -0400)] 
Update maintainers

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodrop obsolete syslog.target from lxc.service.in
Evgeni Golov [Thu, 14 Apr 2016 16:03:29 +0000 (18:03 +0200)] 
drop obsolete syslog.target from lxc.service.in

the target is obsolete since systemd v38 which everybody should have.

original patch by Daniel Baumann

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agonicer date format and support for SOURCE_DATE_EPOCH in LXC_GENERATE_DATE
Evgeni Golov [Tue, 12 Apr 2016 17:20:10 +0000 (19:20 +0200)] 
nicer date format and support for SOURCE_DATE_EPOCH in LXC_GENERATE_DATE

Using $(date) for LXC_GENERATE_DATE has various flaws:
* formating depends on the locale of the system we execute configure on
* the output is not really a date but more a timestamp

Let's use $(date --utc '+%Y-%m-%d') instead.

While at it, also support SOURCE_DATE_EPOCH [1] to make the build
reproducible

[1] https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agoIgnore temporary files generated by doxygen
staticfox [Mon, 11 Apr 2016 14:54:44 +0000 (10:54 -0400)] 
Ignore temporary files generated by doxygen

Signed-off-by: Matt Ullman <staticfox@staticfox.net>
8 years agolxc_mount_auto_mounts(): free memory on failure
Christian Brauner [Wed, 6 Apr 2016 11:08:06 +0000 (13:08 +0200)] 
lxc_mount_auto_mounts(): free memory on failure

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
8 years agonetlink_open: close socket on error
Wolfgang Bumiller [Wed, 6 Apr 2016 08:56:04 +0000 (10:56 +0200)] 
netlink_open: close socket on error

All uses of netlink_open() assume that on error the
nl_handler doesn't need to be closed, but some error cases
happen after the socket was opened successfully and used to
simply return -errno.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agofix spelling mistakes spotted by Debian's lintian
Evgeni Golov [Sun, 3 Apr 2016 16:49:54 +0000 (18:49 +0200)] 
fix spelling mistakes spotted by Debian's lintian

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agostore errno immediately after ioctl
Oleg Freedholm [Sun, 3 Apr 2016 15:15:58 +0000 (01:15 +1000)] 
store errno immediately after ioctl

Signed-off-by: Oleg Freedholm <overlayfs@gmail.com>
8 years agofix btrfs_recursive_destroy
Oleg Freedhom [Sat, 2 Apr 2016 16:18:54 +0000 (16:18 +0000)] 
fix btrfs_recursive_destroy

A change in kernel 4.2 caused btrfs_recursive_destroy to
fail to delete unprivileged containers.  This patch restores
the pre-kernel-4.2 behaviour.  Ref: Issue 935.

Signed-off-by: Oleg Freedhom <overlayfs@gmail.com>
8 years agoupdate Debian release names
Evgeni Golov [Wed, 30 Mar 2016 20:50:48 +0000 (22:50 +0200)] 
update Debian release names

Squeeze is EOL now, Stretch is the upcoming stable

Signed-off-by: Evgeni Golov <evgeni@golov.de>
8 years agolxc-ubuntu: Fix building on secondary architectures
Stéphane Graber [Wed, 30 Mar 2016 05:25:53 +0000 (01:25 -0400)] 
lxc-ubuntu: Fix building on secondary architectures

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoalways provide a default mirror for debootstraping Ubuntu
Evgeni Golov [Sat, 26 Mar 2016 09:52:32 +0000 (10:52 +0100)] 
always provide a default mirror for debootstraping Ubuntu

debootstrap sometimes selects the wrong mirror due to [1]

[1] https://bugs.debian.org/819300

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agouse httpredir.debian.org as the default Debian mirror
Evgeni Golov [Sat, 26 Mar 2016 08:46:13 +0000 (09:46 +0100)] 
use httpredir.debian.org as the default Debian mirror

http.debian.net is an alias anyways and httpredir.debian.org is the official name of the service

Signed-off-by: Evgeni Golov <evgeni@debian.org>
8 years agoFix installation of out-of-tree (VPATH) builds
Aleksandr Mezin [Fri, 25 Mar 2016 13:30:49 +0000 (19:30 +0600)] 
Fix installation of out-of-tree (VPATH) builds

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agolxc-busybox: Remove warning for dynamically linked Busybox
Bogdan Purcareata [Thu, 24 Mar 2016 11:54:27 +0000 (11:54 +0000)] 
lxc-busybox: Remove warning for dynamically linked Busybox

The warning has been present since commit 32b37181ea (with no purpose stated).
Support for dynamically linked Busybox has been added since commit bf6cc73696.
Haven't encountered any issues with dynamically linked Busybox in my last
2 years' testing.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agostart: use LXC_SYNC_ERROR to report errors.
Aleksandr Mezin [Thu, 24 Mar 2016 11:55:03 +0000 (17:55 +0600)] 
start: use LXC_SYNC_ERROR to report errors.

This gives more meaningful error message than "invalid sequence".

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agosync: add LXC_SYNC_ERROR to report errors from another process.
Aleksandr Mezin [Thu, 24 Mar 2016 11:54:26 +0000 (17:54 +0600)] 
sync: add LXC_SYNC_ERROR to report errors from another process.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
8 years agolxc-busybox: Touch /etc/fstab in the container rootfs
Bogdan Purcareata [Tue, 22 Mar 2016 13:33:57 +0000 (13:33 +0000)] 
lxc-busybox: Touch /etc/fstab in the container rootfs

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
8 years agoopen_without_symlink: Don't SYSERROR on something else than ELOOP
Christian Brauner [Wed, 23 Mar 2016 15:37:09 +0000 (16:37 +0100)] 
open_without_symlink: Don't SYSERROR on something else than ELOOP

The open_without_symlink routine has been specifically created to prevent
mounts with synlinks as source or destination. Keep SYSERROR'ing in that
particular scenario, but leave error handling to calling functions for the
other ones - e.g. optional bind mount when the source dir doesn't exist
throws a nasty error.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
8 years agodoc: improve lxc-unshare(1)
Sungbae Yoo [Fri, 4 Mar 2016 03:01:15 +0000 (12:01 +0900)] 
doc: improve lxc-unshare(1)

Explain that the pipe symbol needs to be escaped for -s.

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
8 years agodoc: improve Japanese lxc-attach(1)
KATOH Yasufumi [Thu, 3 Mar 2016 07:20:34 +0000 (16:20 +0900)] 
doc: improve Japanese lxc-attach(1)

Explain that the pipe symbol needs to be escaped for -e and -s.
Update for commit 759d521

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
8 years agocgfs: be less verbose
Serge Hallyn [Wed, 2 Mar 2016 23:23:33 +0000 (15:23 -0800)] 
cgfs: be less verbose

don't always warn about unused cgroups, it's noisy and not helpful

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgfs: make sure we use valid cgroup mountpoints
Serge Hallyn [Thu, 25 Feb 2016 19:01:12 +0000 (11:01 -0800)] 
cgfs: make sure we use valid cgroup mountpoints

If lxcfs starts before cgroup-lite, then the first cgroup mountpoints in
/proc/self/mountinfo are /run/lxcfs/*.  Unprivileged users cannot access
these.  So privileged containers are ok, and unprivileged containers are ok
since they won't cache those to begin with.  But unprivileged root-owned
containers cache /run/lxcfs/* and then try to use them.

So when doing cgroup automounting check whether the mountpoints we have
stored are accessible, and if not look for a new one to use.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoFix typo in lxc manpage
Stéphane Graber [Sat, 20 Feb 2016 04:37:07 +0000 (23:37 -0500)] 
Fix typo in lxc manpage

Reported-by: lintian
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolxc: cgfs: handle lxcfs
Ubuntu [Sat, 20 Feb 2016 02:25:55 +0000 (02:25 +0000)] 
lxc: cgfs: handle lxcfs

When containers have lxcfs mounted instead of cgroupfs, we have to
process /proc/self/mountinfo a bit differently.  In particular, we
should look for fuse.lxcfs fstype, we need to look elsewhere for the
list of comounted controllers, and the mount_prefix is not a cgroup path
which was bind mounted, so we should ignore it, and named subsystems
show up without the 'name=' prefix.

With this patchset I can start containers inside a privileged lxd
container with lxcfs mounted (i.e. without cgroup namespaces).

Closes #830

Signed-off-by: Ubuntu <ubuntu@localhost.localdomain>
8 years agocgfs: also check for EACCES when writing devices
Serge Hallyn [Sat, 20 Feb 2016 02:43:50 +0000 (18:43 -0800)] 
cgfs: also check for EACCES when writing devices

Because that's what lxcfs gives us.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocgroups: do not fail if setting devices cgroup fails due to EPERM
Serge Hallyn [Fri, 19 Feb 2016 22:12:47 +0000 (14:12 -0800)] 
cgroups: do not fail if setting devices cgroup fails due to EPERM

If we're trying to allow a device which was denied to our parent
container, just continue.

Cgmanager does not help us to distinguish between eperm and other
errors, so just always continue.

We may want to consider actually computing the range of devices
to which the container monitor has access, but OTOH that introduces
a whole new set of complexity to compute access sets.

Closes #827

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoAllow sysfs remount by mountall
Stéphane Graber [Tue, 16 Feb 2016 01:03:50 +0000 (20:03 -0500)] 
Allow sysfs remount by mountall

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolog.c:__lxc_log_set_file: completely close log file when overriding
Serge Hallyn [Mon, 15 Feb 2016 20:18:18 +0000 (12:18 -0800)] 
log.c:__lxc_log_set_file: completely close log file when overriding

Otherwise after a shortcut on error we could end up trying to write
to the closed log fd.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agolog.c:__lxc_log_set_file: fname cannot be null
Serge Hallyn [Mon, 15 Feb 2016 20:15:10 +0000 (12:15 -0800)] 
log.c:__lxc_log_set_file: fname cannot be null

fname cannot be passed in as NULL by any of its current callers.  If it
could, then build_dir() would crash as it doesn't check for it.  So make
sure we are warned if in the future we pass in NULL.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agofix typo
Katze [Fri, 5 Feb 2016 17:53:59 +0000 (18:53 +0100)] 
fix typo

Signed-off-by: benaryorg <binary@benary.org>
8 years agoFix typo
Stéphane Graber [Mon, 1 Feb 2016 16:57:00 +0000 (17:57 +0100)] 
Fix typo

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoapparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}
Wolfgang Bumiller [Tue, 2 Feb 2016 08:13:04 +0000 (09:13 +0100)] 
apparmor: allow binding /run/{,lock/} -> /var/run/{,lock/}

Some systems need to be able to bind-mount /run to /var/run
and /run/lock to /var/run/lock. (Tested with opensuse 13.1
containers migrated from openvz.)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
8 years agodoc: Add network clear option to Japanese lxc.container.conf(5)
KATOH Yasufumi [Mon, 1 Feb 2016 08:29:18 +0000 (17:29 +0900)] 
doc: Add network clear option to Japanese lxc.container.conf(5)

Update for commit 020104c

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: add clear behaviour of list options to Japanese lxc.container.conf(5)
KATOH Yasufumi [Mon, 1 Feb 2016 08:29:17 +0000 (17:29 +0900)] 
doc: add clear behaviour of list options to Japanese lxc.container.conf(5)

Update for commit ff68914

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agocgfs: prune the init scope from paths
Serge Hallyn [Sun, 31 Jan 2016 15:34:54 +0000 (16:34 +0100)] 
cgfs: prune the init scope from paths

Just as cgmanager does, if we are calculating a task's paths, drop
the trailing '/init.scope'.  We don't want the container to sit under
there.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoincrease /dev size to 500k ( issue #781)
Min Wang [Fri, 29 Jan 2016 20:40:28 +0000 (15:40 -0500)] 
increase /dev size to 500k ( issue #781)

Signed-off-by: Min Wang <mingewang@gmail.com>
8 years agoIgnore any container with a name starting by '.'
Carlos Alberto Lopez Perez [Fri, 29 Jan 2016 14:39:22 +0000 (15:39 +0100)] 
Ignore any container with a name starting by '.'

  * This are either '.', '..' or a hidden directory.
    And this names should not be used for a container
    in any case.

  * Before this patch, if you created a git repository under lxc.lxcpath (it
    can be useful to keep track of the configurations of your containers)

    Then, when you run lxc-ls you will get the following output:

        # lxc-ls
        .git      container1      container2    ....

    This is because there is a 'config' file inside the '.git' directory.
    It is where git stores the configuration of the repository.

    And the test lxc-ls does to check if a directory contains a container
    is just to check if the 'directory/config' file exists.

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
8 years agoUse ${utsname} instead of ${UTSNAME} because latter variable is not defined.
KURODA Hiraku [Fri, 29 Jan 2016 08:29:38 +0000 (17:29 +0900)] 
Use ${utsname} instead of ${UTSNAME} because latter variable is not defined.

Signed-off-by: KURODA Hiraku <kuroda@syngram.co.jp>