]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
9 years agocoverity: avoid use of NULL c1
Serge Hallyn [Fri, 4 Sep 2015 18:21:35 +0000 (13:21 -0500)]
coverity: avoid use of NULL c1

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agocoverity: fix mount_entry_create_dir_file
Serge Hallyn [Fri, 4 Sep 2015 18:15:13 +0000 (13:15 -0500)]
coverity: fix mount_entry_create_dir_file

First, fix use of uninitialized variable 'ret'.  Then, actually use
the value it returned in its caller.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #649 from major/lxc-delete-network-test
Stéphane Graber [Thu, 3 Sep 2015 16:58:53 +0000 (12:58 -0400)]
Merge pull request #649 from major/lxc-delete-network-test

Tear down network devices during container halt

9 years agoTear down network devices during container halt
Major Hayden [Wed, 2 Sep 2015 21:21:11 +0000 (16:21 -0500)]
Tear down network devices during container halt

On very busy systems, some virtual network devices won't be destroyed after a
container halts.  This patch uses the lxc_delete_network() method to ensure
that network devices attached to the container are destroyed when the
container halts.

Without the patch, some virtual network devices are left over on the system
and must be removed with `ip link del <device>`.  This caused containers
with lxc.network.veth.pair to not be able to start.  For containers using
randomly generated virtual network device names, the old devices will hang
around on the bridge with their original MAC address.

Signed-off-by: Major Hayden <major@mhtx.net>
9 years agoMerge pull request #646 from brauner/manpages_new
Stéphane Graber [Fri, 28 Aug 2015 17:36:19 +0000 (13:36 -0400)]
Merge pull request #646 from brauner/manpages_new

Adapt manpage for lxc-snapshot

9 years agoAdapt manpage for lxc-snapshot
Christian Brauner [Fri, 28 Aug 2015 16:55:29 +0000 (18:55 +0200)]
Adapt manpage for lxc-snapshot

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoMerge pull request #585 from ptoomey3/lxc-execute-as-user
Stéphane Graber [Fri, 28 Aug 2015 15:23:13 +0000 (11:23 -0400)]
Merge pull request #585 from ptoomey3/lxc-execute-as-user

Add support for specified UID/GID for lxc-execute in a private user namespace

9 years agoMerge pull request #643 from raspberrypython/issue-616
Stéphane Graber [Fri, 28 Aug 2015 15:22:10 +0000 (11:22 -0400)]
Merge pull request #643 from raspberrypython/issue-616

Test dpkg for multiarch support in lxc-debian template

9 years agoAlternative test for dpkg multiarch support in lxc-debian template
David Noyes [Fri, 28 Aug 2015 14:44:25 +0000 (14:44 +0000)]
Alternative test for dpkg multiarch support in lxc-debian template

Signed-off-by: David Noyes <david.j.noyes@gmail.com>
9 years agoAdd support for get_config_item and set_config_item
Patrick Toomey [Thu, 27 Aug 2015 22:21:35 +0000 (16:21 -0600)]
Add support for get_config_item and set_config_item

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoUpdate docs to reflect lxc.init_uid and lxc.init_gid options
Patrick Toomey [Wed, 19 Aug 2015 17:19:11 +0000 (11:19 -0600)]
Update docs to reflect lxc.init_uid and lxc.init_gid options

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoUpdate english docs for new lxc.init_uid and lxc.init_gid options
Patrick Toomey [Wed, 19 Aug 2015 17:05:12 +0000 (11:05 -0600)]
Update english docs for new lxc.init_uid and lxc.init_gid options

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoAdd support for setting lxc-execute init UID/GID via configuration file
Patrick Toomey [Wed, 19 Aug 2015 17:04:38 +0000 (11:04 -0600)]
Add support for setting lxc-execute init UID/GID via configuration file

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoClarify struct field comment
Patrick Toomey [Wed, 19 Aug 2015 15:57:59 +0000 (09:57 -0600)]
Clarify struct field comment

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoPass UID/GID explicitly through flags
Patrick Toomey [Tue, 18 Aug 2015 22:26:28 +0000 (16:26 -0600)]
Pass UID/GID explicitly through flags

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoSet UID/GID to parent value for lxc-execute
Patrick Toomey [Mon, 20 Jul 2015 18:37:20 +0000 (12:37 -0600)]
Set UID/GID to parent value for lxc-execute

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoDo not switch to root for lxc-execute
Patrick Toomey [Thu, 9 Jul 2015 22:58:17 +0000 (16:58 -0600)]
Do not switch to root for lxc-execute

Signed-off-by: Patrick Toomey <ptoomey3@biasedcoin.com>
9 years agoFix verification of start hook without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:20 +0000 (10:57 -0400)]
Fix verification of start hook without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoWhen creating container, save configuration if rootfs already exists
David Ward [Tue, 23 Jun 2015 14:57:24 +0000 (10:57 -0400)]
When creating container, save configuration if rootfs already exists

Commit 6c6892b "fix multithreaded create()" prevented the container
configuration from being saved if the backing store does not need
to be created.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoOnly mount /proc if needed, even without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:19 +0000 (10:57 -0400)]
Only mount /proc if needed, even without a rootfs

Use the same code with and without a rootfs to check if mounting
/proc is necessary before doing so. If mounting it is unsuccessful
and there is no rootfs, continue as before.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoAllow autodev without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:23 +0000 (10:57 -0400)]
Allow autodev without a rootfs

A container without a rootfs is useful for running a collection of
processes in separate namespaces (to provide separate networking as
an example), while sharing the host filesystem (except for specific
paths that are re-mounted as needed). For multiple processes to run
automatically when such a container is started, it can be launched
using lxc-start, and a separate instance of systemd can manage just
the processes inside the container. (This assumes that the path to
the systemd unit files is re-mounted and only contains the services
that should run inside the container.) For this use case, autodev
should be permitted for a container that does not have a rootfs.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix /dev symlinks without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:21 +0000 (10:57 -0400)]
Fix /dev symlinks without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix container creation without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:25 +0000 (10:57 -0400)]
Fix container creation without a rootfs

It is not an error to create a container without a template or rootfs.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix automatic mounts without a rootfs
David Ward [Tue, 23 Jun 2015 14:57:22 +0000 (10:57 -0400)]
Fix automatic mounts without a rootfs

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoMerge pull request #617 from alkino/master
Stéphane Graber [Thu, 27 Aug 2015 20:58:06 +0000 (16:58 -0400)]
Merge pull request #617 from alkino/master

A little bit of refactor and doc

9 years agoMerge pull request #631 from alkino/doc
Stéphane Graber [Thu, 27 Aug 2015 20:34:00 +0000 (16:34 -0400)]
Merge pull request #631 from alkino/doc

Add long option for -P in documentation

9 years agoMerge pull request #634 from alkino/config_mount
Stéphane Graber [Thu, 27 Aug 2015 20:33:38 +0000 (16:33 -0400)]
Merge pull request #634 from alkino/config_mount

Split handle of lxc.mount* with 3 functions

9 years agoMerge pull request #638 from schiele/master
Stéphane Graber [Thu, 27 Aug 2015 20:22:14 +0000 (16:22 -0400)]
Merge pull request #638 from schiele/master

check for NULL pointers before calling setenv()

9 years agoClone bridge interface MTU setting
Natanael Copa [Fri, 21 Aug 2015 09:48:10 +0000 (11:48 +0200)]
Clone bridge interface MTU setting

Instead of require static mtu setting in config we simply clone the
existing MTU setting of the bridge interface.

This fixes issue when bridge interface has bigger MTU (like 9000 for
jumbo frame support) than the default 1500. When veth interface is
created it has by default MTU set to 1500 and when this is added to the
bridge, the kernel wee reduce the MTU for the bridge to 1500. We solve
this by cloning the MTU value from bridge interface.

This simplifies managing containers with bridge interface who supports
jumbo frames (mtu 9000) and makes it easier to move containers between
hosts with different MTU settings.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agofix open() results check to include 0
Serge Hallyn [Thu, 27 Aug 2015 20:12:26 +0000 (15:12 -0500)]
fix open() results check to include 0

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agoDestroy container with snapshots & clone-snapshots
Christian Brauner [Tue, 18 Aug 2015 11:40:11 +0000 (13:40 +0200)]
Destroy container with snapshots & clone-snapshots

- This enables lxc-destroy to destroy a container with all its snapshots
  including clone-snapshots not located in the snaps/ folder.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agomod_rdep(): Write path and name of clone to file
Christian Brauner [Tue, 11 Aug 2015 08:33:46 +0000 (10:33 +0200)]
mod_rdep(): Write path and name of clone to file

If we currently create clone-snapshots via lxc-clone only the plain total
number of the containers it serves as a base-container is written to the file
"lxc-snapshots". This commit modifies mod_rdep() so it will store the paths and
names to the containers that are clone-snapshots (similar to the "lxc_rdepends"
file for the clones). **Users which still have containers that have a non-empty
(with a number > 0 as an entry) "lxc-snapshots" file in the old format are not
affected by this change. It will be used until all old clones have been
deleted!** For all others, the "lxc_snapshots" file placed under the original
container now looks like this:

      /var/lib/lxc
      bb
      /var/lib/lxc
      cc
      /opt
      dd

This is an example of a container that provides the base for three
clone-snapshots bb, cc, and dd. Where bb and cc both are placed in the usual
path for privileged containers and dd is placed in a custom path.

- Add additional argument to function that takes in the clone-snapshotted
  lxc_container.
- Have mod_rdep() write the path and name of the clone-snapshotted container the
  file lxc_snapshots of the original container.
- If a clone-snapshot gets deleted the corresponding line in the file
  lxc_snapshot of the original container will be deleted and the file updated
  via mmap() + memmove() + munmap().
- Adapt has_fs_snapshots().
- **If an lxc-snapshot file in the old format is found we'll keep using it.**

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoFix grammar in some of the executables
Christian Brauner [Fri, 14 Aug 2015 18:24:05 +0000 (20:24 +0200)]
Fix grammar in some of the executables
"NAME for name of the container" becomes "NAME of the container"

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoMake LXC_CLONE_KEEPNAME work
Christian Brauner [Fri, 14 Aug 2015 18:17:21 +0000 (20:17 +0200)]
Make LXC_CLONE_KEEPNAME work

- Passing the LXC_CLONE_KEEPNAME flag to do_lxcapi_clone() was not respected and
  let to unexpected behaviour for e.g. lxc-clone. We wrap
  clear_unexp_config_line() and set_config_item_line() in an appropriate
  if-condition.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-destroy: Remove container with all snapshots
Christian Brauner [Fri, 14 Aug 2015 18:16:16 +0000 (20:16 +0200)]
lxc-destroy: Remove container with all snapshots

- This enables the user to destroy a container with all its snapshots without
  having to use lxc-snapshot first to destroy all snapshots. (The enum values
  DESTROY and SNAP from the previous commit are reused here again.)
- Some unification regarding the usage of exit() and return has been done.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoRefactor lxc-snapshot
Christian Brauner [Fri, 14 Aug 2015 18:14:01 +0000 (20:14 +0200)]
Refactor lxc-snapshot

- lxc_snapshot.c lacked necessary members in the associated lxc_arguments struct
  in arguments.h. This commit extends the lxc_arguments struct to include
  several parameters used by lxc-snapshot which allows a rewrite that is more
  consistent with the rest of the lxc-* executables.
- All tests have been moved beyond the call to lxc_log_init() to allow for the
  messages to be printed or saved.
- Some small changes to the my_args struct. (The enum task is set to SNAP (for
  snapshot) per default and variables illustrating the usage of the command line
  flags are written in all caps.)
- arguments.h has been extended to accommodate a future rewrite of lxc-clone
- Traditional behaviour of the executable has been retained in this commit.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agodoc: Update lxc.cgroup.use in lxc.system.conf(5)
KATOH Yasufumi [Wed, 19 Aug 2015 11:35:36 +0000 (20:35 +0900)]
doc: Update lxc.cgroup.use in lxc.system.conf(5)

LXC now uses lxc.cgroup.use even when cgmanager is used.
So remove the description for the case of using cgmanager.
And add the case of not specifying it.
This commit only updates en and ja man pages.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agolxc-debian: allow not including contrib/non-free
Antonio Terceiro [Wed, 19 Aug 2015 21:06:50 +0000 (23:06 +0200)]
lxc-debian: allow not including contrib/non-free

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc-debian: support stretch (Debian 9) images
Antonio Terceiro [Wed, 19 Aug 2015 20:14:13 +0000 (22:14 +0200)]
lxc-debian: support stretch (Debian 9) images

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoinit: Support older apparmor
Stéphane Graber [Thu, 27 Aug 2015 19:25:08 +0000 (15:25 -0400)]
init: Support older apparmor

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoTest dpkg for multiarch support in lxc-debian template
David Noyes [Wed, 26 Aug 2015 13:18:49 +0000 (14:18 +0100)]
Test dpkg for multiarch support in lxc-debian template

Signed-off-by: David Noyes <david.j.noyes@gmail.com>
9 years agocheck for NULL pointers before calling setenv()
Robert Schiele [Fri, 21 Aug 2015 05:35:34 +0000 (07:35 +0200)]
check for NULL pointers before calling setenv()

Latest glibc release actually honours calling setenv with a NULL
pointer by causing SIGSEGV but checking pointers before submitting
to any system function is a good idea anyway.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
9 years agoSplit handle of lxc.mount* with 3 functions
Nicolas Cornu [Sat, 15 Aug 2015 22:52:44 +0000 (00:52 +0200)]
Split handle of lxc.mount* with 3 functions

Signed-off-by: Nicolas Cornu <nicolac76@yahoo.fr>
9 years agoc/r: enable tracefs
Tycho Andersen [Fri, 14 Aug 2015 16:24:47 +0000 (10:24 -0600)]
c/r: enable tracefs

tracefs is a new filesystem that can be mounted by users. Only the options
and fs name need to be passed to restore the state, so we can use criu's
auto fs feature.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #632 from lxc/revert-621-arguments
Serge Hallyn [Fri, 14 Aug 2015 16:01:56 +0000 (11:01 -0500)]
Merge pull request #632 from lxc/revert-621-arguments

Revert "Refactor lxc-snapshot, lxc-clone, make LXC_CLONE_KEEPNAME wor…

9 years agoRevert "Refactor lxc-snapshot, lxc-clone, make LXC_CLONE_KEEPNAME work and add option...
Serge Hallyn [Fri, 14 Aug 2015 15:59:19 +0000 (10:59 -0500)]
Revert "Refactor lxc-snapshot, lxc-clone, make LXC_CLONE_KEEPNAME work and add option to destroy container with all snapshots to lxc-destroy"

9 years agoRefactor and factorize mount entries
Nicolas Cornu [Thu, 6 Aug 2015 08:37:15 +0000 (10:37 +0200)]
Refactor and factorize mount entries

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agoAdd doc for optional, create=dir and create=file in lxc.container.conf man
Nicolas Cornu [Wed, 5 Aug 2015 18:17:48 +0000 (20:17 +0200)]
Add doc for optional, create=dir and create=file in lxc.container.conf man

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agoFactorize handle of create=dir and create=file
Nicolas Cornu [Thu, 6 Aug 2015 08:35:16 +0000 (10:35 +0200)]
Factorize handle of create=dir and create=file

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agoAdd long option for -P in documentation
Nicolas Cornu [Fri, 14 Aug 2015 15:57:53 +0000 (17:57 +0200)]
Add long option for -P in documentation

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agoMerge pull request #621 from brauner/arguments
Serge Hallyn [Fri, 14 Aug 2015 00:36:16 +0000 (19:36 -0500)]
Merge pull request #621 from brauner/arguments

Refactor lxc-snapshot, lxc-clone, make LXC_CLONE_KEEPNAME work and add option to destroy container with all snapshots to lxc-destroy

9 years agoMerge pull request #596 from lazy404/master
Stéphane Graber [Thu, 13 Aug 2015 21:00:19 +0000 (17:00 -0400)]
Merge pull request #596 from lazy404/master

Only use LOGPATH if lxcpath is unset or default

9 years agoOnly use LOGPATH if lxcpath is unset or default
Michal Grzedzicki [Tue, 21 Jul 2015 08:29:00 +0000 (10:29 +0200)]
Only use LOGPATH if lxcpath is unset or default

Signed-off-by: Michał Grzędzicki <lazy404@gmail.com>
9 years agoMerge pull request #628 from rldleblanc/cap_clone_fix
Stéphane Graber [Thu, 13 Aug 2015 20:38:07 +0000 (16:38 -0400)]
Merge pull request #628 from rldleblanc/cap_clone_fix

Caps are getting lost when cloning an LXC.

9 years agoMerge pull request #629 from rldleblanc/clone_typo
Stéphane Graber [Thu, 13 Aug 2015 20:37:32 +0000 (16:37 -0400)]
Merge pull request #629 from rldleblanc/clone_typo

Small trivial typo.

9 years agolxc-debian: skip security updates for unstable/sid
Antonio Terceiro [Sat, 18 Jul 2015 23:24:12 +0000 (20:24 -0300)]
lxc-debian: skip security updates for unstable/sid

There is no such thing as security support for unstable/sid.

Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agodoc: Add the rename option to lxc-clone(1)
KATOH Yasufumi [Wed, 5 Aug 2015 08:49:19 +0000 (17:49 +0900)]
doc: Add the rename option to lxc-clone(1)

Update Japanese and English man pages.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoc/r: get rid of dump_net_info()
Tycho Andersen [Mon, 10 Aug 2015 17:12:18 +0000 (11:12 -0600)]
c/r: get rid of dump_net_info()

This was originally used to propagate the bridge and veth names across
hosts, but now we extract both from the container's config file, and
nothing reads the files that dump_net_info() writes, so let's just get rid
of them.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoc/r: allow empty networks to be checkpointed/restored
Tycho Andersen [Mon, 10 Aug 2015 17:12:19 +0000 (11:12 -0600)]
c/r: allow empty networks to be checkpointed/restored

Empty networks don't have anything (besides lo) for us to dump and restore,
so we should allow these as well.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agogitignore: add TAGS files
Tycho Andersen [Mon, 10 Aug 2015 17:12:17 +0000 (11:12 -0600)]
gitignore: add TAGS files

Somehow our `make tags` target generates TAGS and not tags, so let's ignore
that too.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agolxc_monitor: free @preg on error
Arjun Sreedharan [Sun, 12 Jul 2015 12:46:17 +0000 (18:16 +0530)]
lxc_monitor: free @preg on error

reuse label cleanup since free(NULL) is a no-op
Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agopass on reboot flag and delete old veth on reboot
Wolfgang Bumiller [Mon, 27 Jul 2015 05:33:08 +0000 (07:33 +0200)]
pass on reboot flag and delete old veth on reboot

When setting lxc.network.veth.pair to get a fixed interface
name the recreation of it after a reboot caused an EEXIST.
-) The reboot flag is now a three-state value. It's set to
1 to request a reboot, and 2 during a reboot until after
lxc_spawn where it is reset to 0.
-) If the reboot is set (!= 0) within instantiate_veth and
a fixed name is used, the interface is now deleted before
being recreated.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoPrevent from error on umount /proc if userns are used.
Przemek Rudy [Wed, 29 Jul 2015 17:41:28 +0000 (19:41 +0200)]
Prevent from error on umount /proc if userns are used.

Signed-off-by: Przemek Rudy <prudy1@o2.pl>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
9 years agoSmall trivial typo.
Robert LeBlanc [Thu, 13 Aug 2015 20:14:52 +0000 (14:14 -0600)]
Small trivial typo.

9 years agoMerge pull request #623 from christiaan/ephemeral_bind
Stéphane Graber [Thu, 13 Aug 2015 20:11:29 +0000 (16:11 -0400)]
Merge pull request #623 from christiaan/ephemeral_bind

Bind mount at different location

9 years agoMerge pull request #619 from alkino/contributing
Stéphane Graber [Thu, 13 Aug 2015 20:08:41 +0000 (16:08 -0400)]
Merge pull request #619 from alkino/contributing

Fresh CONTRIBUTING

9 years agoMerge pull request #577 from CameronNemo/systemd-instanced
Stéphane Graber [Thu, 13 Aug 2015 20:03:33 +0000 (16:03 -0400)]
Merge pull request #577 from CameronNemo/systemd-instanced

Add instanced systemd service

9 years agoCaps are getting lost when cloning an LXC. Adding the -X parameter copies the extende...
Robert LeBlanc [Thu, 13 Aug 2015 19:36:55 +0000 (13:36 -0600)]
Caps are getting lost when cloning an LXC. Adding the -X parameter copies the extended attributes. This allows things like ping to continue to be used by a non-privilged user in Debian at least.

9 years agolxc-destroy: Remove container with all snapshots
Christian Brauner [Sat, 8 Aug 2015 12:51:11 +0000 (14:51 +0200)]
lxc-destroy: Remove container with all snapshots

- This enables the user to destroy a container with all its snapshots without
  having to use lxc-snapshot first to destroy all snapshots. (The enum values
  DESTROY and SNAP from the previous commit are reused here again.)
- Some unification regarding the usage of exit() and return has been done.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoFix grammar in some of the executables
Christian Brauner [Sat, 8 Aug 2015 00:34:18 +0000 (02:34 +0200)]
Fix grammar in some of the executables

"NAME for name of the container" becomes "NAME of the container"

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoMake LXC_CLONE_KEEPNAME work
Christian Brauner [Fri, 7 Aug 2015 23:31:21 +0000 (01:31 +0200)]
Make LXC_CLONE_KEEPNAME work

Passing the LXC_CLONE_KEEPNAME flag to do_lxcapi_clone() was not respected. We
wrap clear_unexp_config_line() and set_config_item_line() in an appropriate
if-condition.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoRefactor lxc-clone
Christian Brauner [Fri, 7 Aug 2015 23:25:41 +0000 (01:25 +0200)]
Refactor lxc-clone

- This commit adapts lxc-clone to be similiar in usage and feel to the other
  lxc-* executables. It builds on the previous extension of the lxc_argument
  struct and now uses the default lxc_arguments_parse() function.
- Options which were not used have been removed.
- The LXC_CLONE_KEEPNAME flag was not respected in the previous version of
  lxc-clone. The culprit is a missing if-condition in lxccontainer.c. As this
  requires a change in one of the API functions in lxccontainer.c it will be
  addressed in a follow-up commit.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoRefactor lxc-snapshot
Christian Brauner [Thu, 6 Aug 2015 12:54:25 +0000 (14:54 +0200)]
Refactor lxc-snapshot

- lxc_snapshot.c lacked necessary members in the associated lxc_arguments struct
  in arguments.h. This commit extends the lxc_arguments struct to include
  several parameters used by lxc-snapshot which allows a rewrite that is more
  consistent with the rest of the lxc-* executables.
- All tests have been moved beyond the call to lxc_log_init() to allow for the
  messages to be printed or saved.
- Some small changes to the my_args struct. (The enum task is set to
  SNAP (for snapshot) per default and variables illustrating the usage of the
  command line flags are written in all caps.)
- arguments.h has been extended to accommodate a rewrite of lxc-clone

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoBind mount at different location
Christiaan Baartse [Fri, 7 Aug 2015 14:32:30 +0000 (16:32 +0200)]
Bind mount at different location

Binding a directory at a different location in a ephemeral container is
currently not possible. Using a regular container it however is possible.

Signed-off-by: Christiaan Baartse <anotherhero@gmail.com>
9 years agoFresh CONTRIBUTING
Nicolas Cornu [Wed, 5 Aug 2015 18:27:31 +0000 (20:27 +0200)]
Fresh CONTRIBUTING

Signed-off-by: Nicolas Cornu <nicolac76@yahoo.fr>
9 years agoMerge pull request #615 from jirislaby/master
Stéphane Graber [Wed, 5 Aug 2015 14:42:49 +0000 (10:42 -0400)]
Merge pull request #615 from jirislaby/master

templates: lxc-opensuse, use rpm to determine build version

9 years agoMerge pull request #614 from alkino/master
Stéphane Graber [Wed, 5 Aug 2015 14:42:23 +0000 (10:42 -0400)]
Merge pull request #614 from alkino/master

Fix error message when cannot find an lxc-init

9 years agotemplates: lxc-opensuse, use rpm to determine build version
Jiri Slaby [Wed, 5 Aug 2015 08:32:54 +0000 (10:32 +0200)]
templates: lxc-opensuse, use rpm to determine build version

zypper info's output is not usable for several reasons:
* it is localized -- there is no "Version: " in my output
* it shows results both from the repo and local system

So use plain rpm to determine whether build is installed and if proper
version is in place.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
9 years agoFix error message when cannot find an lxc-init
Nicolas Cornu [Wed, 5 Aug 2015 07:22:24 +0000 (09:22 +0200)]
Fix error message when cannot find an lxc-init

lxc-init has been renamed init.lxc so adapt error message

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
9 years agolxc-alpine: fix verification of apk.static binary
Natanael Copa [Mon, 3 Aug 2015 11:40:25 +0000 (13:40 +0200)]
lxc-alpine: fix verification of apk.static binary

We need specify which hashing algorithm was used to create the signature
we check.

Fixes #609

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
9 years agoMerge pull request #612 from brauner/lxc_rename
Stéphane Graber [Tue, 4 Aug 2015 12:23:43 +0000 (08:23 -0400)]
Merge pull request #612 from brauner/lxc_rename

Add option to rename container to lxc-clone

9 years agoMerge pull request #613 from ysbnim/master
Stéphane Graber [Tue, 4 Aug 2015 12:23:02 +0000 (08:23 -0400)]
Merge pull request #613 from ysbnim/master

Update Korean manuals

9 years agodoc: Add the description for --version to Korean common_options
Sungbae Yoo [Tue, 4 Aug 2015 09:16:14 +0000 (18:16 +0900)]
doc: Add the description for --version to Korean common_options
Update for commit 7cab33b

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Add the description for -P and --version to Korean lxc-ls(1)
Sungbae Yoo [Tue, 4 Aug 2015 09:09:25 +0000 (18:09 +0900)]
doc: Add the description for -P and --version to Korean lxc-ls(1)
Update for commit 2cf7c05

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agodoc: Update Korean lxc-usernet(5) for supporting usergroups
Sungbae Yoo [Thu, 2 Jul 2015 09:19:29 +0000 (18:19 +0900)]
doc: Update Korean lxc-usernet(5) for supporting usergroups
Update for commit 1940bff

Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
9 years agoAdd option to rename container to lxc-clone
Christian Brauner [Mon, 3 Aug 2015 19:32:13 +0000 (21:32 +0200)]
Add option to rename container to lxc-clone

This commit adds an -R, --rename option to lxc-clone to rename a container. As
c->rename calls do_lxcapi_rename() which in turn calls do_lxcapi_clone() it
seemed best to implement it in lxc-clone rather than lxc-snapshot which also
calls do_lxcapi_clone(). Some additional unification regarding the usage of
return vs exit() in main() was done.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoMerge pull request #610 from tenforward/update_man
Stéphane Graber [Mon, 3 Aug 2015 13:24:38 +0000 (09:24 -0400)]
Merge pull request #610 from tenforward/update_man

Update man pages

9 years agodoc: Remove unnecessary common options from lxc-user-nic(1)
KATOH Yasufumi [Mon, 3 Aug 2015 07:42:38 +0000 (16:42 +0900)]
doc: Remove unnecessary common options from lxc-user-nic(1)

lxc-user-nic command cannot use common options.

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Add the description for --version to English and Japanese common_options
KATOH Yasufumi [Mon, 3 Aug 2015 07:40:13 +0000 (16:40 +0900)]
doc: Add the description for --version to English and Japanese common_options

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agodoc: Add the description for -P and --version to English and Japanese lxc-ls(1)
KATOH Yasufumi [Mon, 3 Aug 2015 07:23:45 +0000 (16:23 +0900)]
doc: Add the description for -P and --version to English and Japanese lxc-ls(1)

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
9 years agoMerge pull request #608 from brauner/lxc_ls_doc
Stéphane Graber [Mon, 3 Aug 2015 04:33:47 +0000 (00:33 -0400)]
Merge pull request #608 from brauner/lxc_ls_doc

Add -P lxcpath and --version to lxc-ls manpage

9 years agoAdd -P lxcpath and --version to lxc-ls manpage
Christian Brauner [Sat, 1 Aug 2015 14:54:30 +0000 (16:54 +0200)]
Add -P lxcpath and --version to lxc-ls manpage

lxc-ls takes -P lxcpath and --version as arguments but it did not specify these
options on the manpages.

Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
9 years agoMerge pull request #600 from Blub/wbumiller/seccomp
Serge Hallyn [Wed, 29 Jul 2015 02:37:14 +0000 (21:37 -0500)]
Merge pull request #600 from Blub/wbumiller/seccomp

seccomp: simplify and fix rule parsing

9 years agoseccomp: simplify and fix rule parsing
Wolfgang Bumiller [Thu, 23 Jul 2015 09:10:18 +0000 (11:10 +0200)]
seccomp: simplify and fix rule parsing

1) Two checks on amd64 for whether compat_ctx has already
been generated were redundant, as compat_ctx is generally
generated before entering the parsing loop.

2) With introduction of reject_force_umount the check for
whether the syscall has the same id on both native and
compat archs results in false behavior as this is an
internal keyword and thus produces a -1 on
seccomp_syscall_resolve_name_arch().
The result was that it was added to the native architecture
twice and never to the 32 bit architecture, causing it to
have no effect on 32 bit containers on 64 bit hosts.

3) I do not see a reason to care about whether the syscalls
have the same number on the two architectures. On the one
hand this check was there to avoid adding it to two archs
(and effectively leaving one arch unprotected), while on
the other hand it seemed to be okay to add it to the
same arch *twice*.

The entire architecture checking branches are now reduced to
three simple cases: 'native', 'non-native' and 'all'. With
'all' adding to both architectures regardless of the syscall
ID.

Also note that libseccomp had a bug in its architecture
checking, so architecture related filters weren't working as
expected before version 2.2.2, which may have contributed to
the confusion in the original architecture-related code.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 years agoFix Android build due to missing constant
Stéphane Graber [Wed, 22 Jul 2015 15:55:46 +0000 (11:55 -0400)]
Fix Android build due to missing constant

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
9 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>
9 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>
9 years agoMerge pull request #597 from smoser/ubuntu-cloud-vendordata
Stéphane Graber [Tue, 21 Jul 2015 14:43:48 +0000 (10:43 -0400)]
Merge pull request #597 from smoser/ubuntu-cloud-vendordata

lxc-ubuntu-cloud: support passing vendor-data

9 years agolxc-ubuntu-cloud: support passing vendor-data
Scott Moser [Tue, 21 Jul 2015 14:30:19 +0000 (10:30 -0400)]
lxc-ubuntu-cloud: support passing vendor-data

vendor-data is supported in Ubuntu cloud images in trusty and later.
This allows the user to pass it in on create or clone.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
9 years agoMerge pull request #581 from Blub/master
Stéphane Graber [Mon, 20 Jul 2015 02:21:21 +0000 (22:21 -0400)]
Merge pull request #581 from Blub/master

Use /dev/loop-control if it exists