]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
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>
8 years agoFix echo statement inside fedora template
Nehal J Wani [Thu, 21 Jan 2016 19:05:27 +0000 (00:35 +0530)] 
Fix echo statement inside fedora template

We no longer use mirrors.kernel.org.
Commit f71e8f4 switched it to archives.fedoraproject.org

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
8 years agocleanup: lxc_container::want_* comment descriptions
Wolfgang Bumiller [Thu, 14 Jan 2016 13:30:20 +0000 (14:30 +0100)] 
cleanup: lxc_container::want_* comment descriptions

They change a value and return true on success rather than
fetching the value as the comments previously suggested.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agocgmanager: don't make tasks + cgroup.procs +x
Tycho Andersen [Wed, 13 Jan 2016 07:59:59 +0000 (00:59 -0700)] 
cgmanager: don't make tasks + cgroup.procs +x

No reason for these to be +x, and it looks weird.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agolxc_setup_fs: Create /dev/shm folder if it doesn't exist
Bogdan Purcareata [Fri, 8 Jan 2016 15:38:44 +0000 (15:38 +0000)] 
lxc_setup_fs: Create /dev/shm folder if it doesn't exist

When running application containers with lxc-execute, /dev is
populated only with device entries. Since /dev is a tmpfs mount in
the container environment, the /dev/shm folder not being present is not
a sufficient reason for the /dev/shm mount to fail.

Create the /dev/shm directory if not present.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoopen_without_symlink: Account when prefix is empty string
Bogdan Purcareata [Fri, 8 Jan 2016 15:38:35 +0000 (15:38 +0000)] 
open_without_symlink: Account when prefix is empty string

In the current implementation, the open_without_symlink function
will default to opening the root mount only if the passed rootfs
prefix is null. It doesn't account for the case where this prefix
is passed as an empty string.

Properly handle this second case as well.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoDocument network clear option
Marko Hauptvogel [Mon, 4 Jan 2016 21:58:41 +0000 (22:58 +0100)] 
Document network clear option

Should be mentioned separately because it will reset a big group of options.

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agofix lockpath removal in Python lxc-ls
Christian Brauner [Mon, 11 Jan 2016 13:43:42 +0000 (14:43 +0100)] 
fix lockpath removal in Python lxc-ls

The lock path for lxc is not

RUNTIME_PATH/lock/lxc

but rather

RUNTIME_PATH/lxc/lock

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoDocument clear behaviour of list options
Marko Hauptvogel [Mon, 4 Jan 2016 21:57:38 +0000 (22:57 +0100)] 
Document clear behaviour of list options

More general for all list options.

Seems to currently affect:
lxc.network (clear all NICs)
lxc.network.* (clear current NIC)
lxc.cap.drop
lxc.cap.keep
lxc.cgroup
lxc.mount.entry
lxc.mount.auto
lxc.hook
lxc.id_map
lxc.group
lxc.environment

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agodoc: Add valueless lxc.cap.drop behaviour to Japanese man page
KATOH Yasufumi [Tue, 5 Jan 2016 07:31:46 +0000 (16:31 +0900)] 
doc: Add valueless lxc.cap.drop behaviour to Japanese man page

Update for commit 7eff30f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoFix Comment inside Fedora Template
Nehal J Wani [Tue, 19 Jan 2016 18:51:13 +0000 (00:21 +0530)] 
Fix Comment inside Fedora Template

We no longer use mirrors.kernel.org.
Commit f71e8f4 switched it to archives.fedoraproject.org

Signed-off-by: Nehal J Wani <nehaljw.kkd1@gmail.com>
8 years agoavoid printing null string in error message
Serge Hallyn [Thu, 14 Jan 2016 23:07:31 +0000 (15:07 -0800)] 
avoid printing null string in error message

Show the ifindex in case it's useful

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agopreserve inherited fds for stop hook
Serge Hallyn [Tue, 12 Jan 2016 04:55:30 +0000 (20:55 -0800)] 
preserve inherited fds for stop hook

When preserving fds for the stop hook, make sure to also save
any fds we've inherited.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoSet the right variable to NULL when unsetting ipv6_gateway
Serge Hallyn [Tue, 12 Jan 2016 02:25:19 +0000 (18:25 -0800)] 
Set the right variable to NULL when unsetting ipv6_gateway

We were freeing one and setting a different one to NULL, eventually
leading to a crash when closing the netdev (at container shutdown)
and freeing already-freed memory.

Closes #732

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agobash completion: the 'have' command was deprecated in favor of '_have'
Peter Simons [Sat, 2 Jan 2016 16:53:07 +0000 (17:53 +0100)] 
bash completion: the 'have' command was deprecated in favor of '_have'

`bash-completion` version 2.1 and later no longer include the `have` command,
and consequently the `lxc` competion file fails on such systems. The command is
now called `_have`.

Signed-off-by: Peter Simons <simons@cryp.to>
8 years agoapparmor: recognize 'unconfined' as unconfined.
Serge Hallyn [Wed, 6 Jan 2016 19:45:38 +0000 (11:45 -0800)] 
apparmor: recognize 'unconfined' as unconfined.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agocoverity: preserve_ns returns bool, not int
Serge Hallyn [Mon, 4 Jan 2016 22:39:50 +0000 (14:39 -0800)] 
coverity: preserve_ns returns bool, not int

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
8 years agoDon't try to change aa label if we are already apparmor-confined
Serge Hallyn [Mon, 4 Jan 2016 21:20:06 +0000 (21:20 +0000)] 
Don't try to change aa label if we are already apparmor-confined

Closes #1459

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoNULL pointer deference if nlmsg_reserve() returns NULL for ifi
Wim Coekaerts [Tue, 29 Dec 2015 06:25:58 +0000 (22:25 -0800)] 
NULL pointer deference if nlmsg_reserve() returns NULL for ifi

nlmsg_reserve() might return NULL

        if (nlmsg_len + tlen > nlmsg->cap)
                return NULL;

Also set err = -ENOMEM where appropriate

Signed-off-by: Wim Coekaerts <wim.coekaerts@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agoDocumenting valueless lxc.cap.drop behaviour
Marko Hauptvogel [Sun, 3 Jan 2016 22:20:47 +0000 (23:20 +0100)] 
Documenting valueless lxc.cap.drop behaviour

From b24b0e16848fbb93402a08efa3950cd59272b8da Mon Sep 17 00:00:00 2001
From: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Date: Sun, 3 Jan 2016 23:07:19 +0100
Subject: [PATCH] Documenting valueless lxc.cap.drop behaviour

Undocummented behaviour since 7d0eb87.

Signed-off-by: Marko Hauptvogel <marko.hauptvogel@googlemail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agofix buffer overflow in ifaddrs.c
tw19881113@gmail.com [Wed, 30 Dec 2015 07:24:43 +0000 (15:24 +0800)] 
fix buffer overflow in ifaddrs.c

jenkins: ok to test

Signed-off-by: Tw <tw19881113@gmail.com>
8 years agopython-lxc: Call PyOS_AfterFork after attaching to a container
Danil Osherov [Thu, 24 Dec 2015 13:54:19 +0000 (16:54 +0300)] 
python-lxc: Call PyOS_AfterFork after attaching to a container

As lxc_attach() calls fork() PyOS_AfterFork should be called in the new
process if the Python interpreter will continue to be used.

Signed-off-by: Danil Osherov <shindo@yandex-team.ru>
8 years agoFix swap calculation
Eva Charlotte Mayer [Wed, 23 Dec 2015 12:15:26 +0000 (13:15 +0100)] 
Fix swap calculation

Signed-off-by: Eva Charlotte Mayer <eva-charlotte.mayer@posteo.de>
8 years agoRefactoring conditional directives.
Wesley M [Tue, 15 Dec 2015 15:47:22 +0000 (10:47 -0500)] 
Refactoring conditional directives.

Signed-off-by: Wesley Marques <wesleymr.27@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agolxc-checkconfig: remove zgrep dependency
Andre McCurdy [Fri, 11 Dec 2015 20:35:55 +0000 (12:35 -0800)] 
lxc-checkconfig: remove zgrep dependency

zgrep is a script provided by the 'gzip' package, which may not be
installed on embedded systems etc which use busybox instead of the
standard full-featured utilities.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
8 years agoReturn immediately in save_phys_nics if not run as root
Li Qiu [Fri, 11 Dec 2015 05:54:10 +0000 (07:54 +0200)] 
Return immediately in save_phys_nics if not run as root
Physical nic is not instantiated in lxc_create_network

Signed-off-by: Li Qiu <li.qiu@nomovok.com>
8 years agoFix seccomp profile on attach of undefined container
Stéphane Graber [Thu, 10 Dec 2015 23:58:58 +0000 (18:58 -0500)] 
Fix seccomp profile on attach of undefined container

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
8 years agoUpdate get_item test after the lxc.mount.entry fix
Stéphane Graber [Thu, 10 Dec 2015 04:45:26 +0000 (23:45 -0500)] 
Update get_item test after the lxc.mount.entry fix

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
8 years agofix 'lxc.mount.entry' key when clearing unexpanded config
Serge Hallyn [Thu, 10 Dec 2015 02:12:41 +0000 (02:12 +0000)] 
fix 'lxc.mount.entry' key when clearing unexpanded config

Closes #712

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
8 years agoprune_init_cgroup: don't dereference NULL
Serge Hallyn [Sat, 5 Dec 2015 00:24:55 +0000 (18:24 -0600)] 
prune_init_cgroup: don't dereference NULL

This is to avoid:

https://errors.ubuntu.com/problem/d640a68bf7343705899d7ca8c6bc070d477cd845

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>