Commit Graph

3134 Commits

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

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

Signed-off-by: Axel Neumann <neumann@cgws.de>
2015-01-13 10:48:52 +01:00
Serge Hallyn
db2930e174 decide whether daemonize implies close_all_fds at start
This isn't the perfect fix.  In fact close_all_fds shouldn't be stored
in the lxc_conf.  But this will fix the tests short-term.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-12 23:07:28 -06:00
Serge Hallyn
a2739df5e4 Revert "set close-all-fds by default"
it has unfortunate reprecussions elsewhere, and the needed fix
can be done another way

This reverts commit 1f76453a74.
2015-01-12 23:06:01 -06:00
Serge Hallyn
d2f31a576b containertests: don't expect NULL lxc_conf
Because we never have that any more

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-12 22:24:26 -06:00
Serge Hallyn
88322f776c Fix reversed args in mount call
Riya Khanna reported that with a ramfs rootfs the mount to make
/ rprivate was returning -EFAULT.  NULL was being passed as the
mount target.  Pass "/" instead.

Reported-by: riya khanna <riyakhanna1983@gmail.com>>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-12 16:26:08 -05:00
Serge Hallyn
1f76453a74 set close-all-fds by default
When containers request to be daemonized, close-all-fd is
set to true.  But when we switched ot daemonize-by-default we didn't
set close-all-fd by default.

Fix that.  In order to do that we have to always have a lxc_conf
object.  As a consequence, after this patch we can drop a bunch
of checks for c->lxc_conf existing.  We should consider removing
those.  This patch does not do that.

This should close https://github.com/lxc/lxc/issues/354

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-12 16:26:08 -05:00
Michael Adam
fccc348be4 lxc-fedora: let help text fit into 80 columns
by breaking and shortening some lines.

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
9aed78fad1 lxc-fedora: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
98d316e29a lxc-fedora: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
a2780518da lxc-centos: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
2ae8252a4f lxc-centos: fix tab/space mixup in help text.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
6976826fed lxc-centos: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
c4834f3c12 lxc-openmandriva: protect possibly unset variable with quotes in -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
fe9d4df40a lxc-openmandriva: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
4986f1c435 lxc-altlinux: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
217535de29 lxc-altlinux: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
b5a285ea8f lxc-opensuse: protect possibly unset variable with quotes in -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
eb4cd29636 lxc-opensuse: fix parsing of option "--clean": it takes no argument
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
1111674232 lxc-opensuse: fix tab/whitespace mixup in usage text.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
227c560065 lxc-debian: protect possibly unset variable with quotes for -z check
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
a64da4c358 lxc-debian: document "--clean" in the usage.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
Michael Adam
e4d4da6211 lxc-debian: fix parsing of option "--clean": it takes no argument.
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
2015-01-10 10:07:41 -06:00
hallyn
bb2afd6038 Merge pull request #393 from martinpitt/master
apparmor: Fix slave bind mounts
2015-01-08 10:57:57 -06:00
Martin Pitt
64b4c7a34b apparmor: Fix slave bind mounts
The permission to make a mount "slave" is spelt "make-slave", not "slave", see
https://launchpad.net/bugs/1401619. Also, we need to make all mounts slave, not
just the root dir.

https://launchpad.net/bugs/1350947
2015-01-08 13:09:37 +01:00
Stéphane Graber
97a8f74f0c Also drop caps in unpriv containers
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:28:36 -05:00
Stéphane Graber
98b745498b apparmor: Block access to /proc/kcore
Just like we block access to mem and kmem, there's no good reason for
the container to have access to kcore.

Reported-by: Marc Schaefer
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:28:33 -05:00
Natanael Copa
abf117c398 lxc-alpine: use yaml for detection of latest release
Alpine Linux provides yaml files with latest release instead of the old
approach with .latest.txt.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2015-01-05 16:27:39 -05:00
Michael Adam
afc55ed279 lxc-fedora: In fedora21, the fedora-repos package is needed.
fedora-release has been split into fedora-release and fedora-repos.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:25:42 -05:00
Michael Adam
5b75ee4747 lxc-fedora: when using systemd, set lxc.kmsg = 0 in the config
This is to prevent systemd-journald to enter a 100% cpu loop.

Signed-off-by: Michael Adam <obnox@samba.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
2015-01-05 16:25:37 -05:00
Johannes Kastl
d3eccbbf80 lxc-opensuse: Disable building openSUSE containers on 13.2/Tumbleweed only if wrong version of build package is installed
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:45:07 -05:00
Johannes Kastl
8f3a3cd805 lxc-opensuse: default release changed to 13.1, as 12.3 reaches end-of-life soon
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:43:21 -05:00
Serge Hallyn
218f99322c Enable seccomp by default for unprivileged users.
In contrast to what the comment above the line disabling it said,
it seems to work just fine.  It also is needed on current kernels
(until Eric's patch hits upstream) to prevent unprivileged containers
from hosing fuse filesystems they inherit.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:42:54 -05:00
Serge Hallyn
6166fa6d83 seccomp: add rule to reject umount -f
If a container has a bind mount from a host nfs or fuse
filesystem, and does 'umount -f', it will disconnect the
host's filesystem.  This patch adds a seccomp rule to
block umount -f from a container.  It also adds that rule
to the default seccomp profile.

Thanks stgraber for the idea :)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-19 13:42:47 -05:00
Veres Lajos
ec64264d78 typofixes - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 18:40:26 -05:00
S.Çağlar Onur
8479c13635 rmdir and lxc_unpriv returns non-negative error codes
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 14:14:03 -05:00
Shuai Zhang
06f976cad7 audit: added capacity and reserve() to nlmsg
There are now two (permitted) ways to add data to netlink message:

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

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

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

Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 11:49:57 -05:00
Arjun Sreedharan
21e624d9cf tests: try again when waitpid() sets errno as EINTR
when waitpid() is interrupted, errno is not set to the negative
value -EINTR. It is set to EINTR. check against EINTR.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-04 11:48:00 -05:00
Stéphane Graber
d2928eafbb
change version to 1.1.0.alpha3 in configure.ac
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 14:59:15 -05:00
Shuai Zhang
c8a600ea29 fixed typo in comment
Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 11:04:19 -05:00
Stéphane Graber
2e2d6a7be9
Improve veth error cases logging
The previous error message made it look like the host interface name was
the concatenation of both the host and guest interface names.

Closes #374

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-03 11:01:45 -05:00
Cameron Norman
4de03d375b lxc-debian: mask both Wheezy and Jessie udev services
Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:21 -05:00
Cameron Norman
2b75b644f8 lxc-debian: adjust init system configurations
Do as much as possible to allow containers switching from non-systemd to
systemd to work as intended (but nothing that will cause side effects).
Use update-rc.d disable instead of remove so the init scripts are not
re-enabled when the package is updated

Signed-off-by: Cameron Norman <camerontnorman@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:59:16 -05:00
KATOH Yasufumi
be54cb1c55 doc: Always include the Japanese lxc-top manpage
Update for commit e71549f

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:56:03 -05:00
KATOH Yasufumi
c881c406ac Add the Japanese translation for the lxc.init_cmd config option
Update for commit 67c660d

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-02 10:55:56 -05:00
Stéphane Graber
a4318300b4 Revert "audit: added capacity and reserve() to nlmsg"
This reverts commit 55ae7edb18.

This change caused hangs in the testsuite, specifically with lxc-user-nic.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 15:37:42 -05:00
Casey Marshall
26f1b3902c Allow lxc_clear_config_item to clear idmaps.
Ran into this when trying to automate stgraber's "GUI in containers"
post.

Signed-off-by: Casey Marshall <casey.marshall@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 15:15:32 -05:00
overlay fs
40d811614c Issue #278: lxc-start-ephemeral: add --cdir option for cow-mounts
This is a copy of patch version 3 for issue #278 on the issue-tracker:

 - Allow multiple bind-mounts (--bdir) and multiple cow-mounts (--cdir).

 - Further fixes to permissions throughout lxc-start-ephemeral (annotated
   in the code).

Signed-off by: Oleg Freedholm <overlayfs@gmail.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 14:01:56 -05:00
Johannes Kastl
de548c6055 lxc-opensuse: Disabling builds on openSUSE Tumbleweed, detection improved.
Signed-off-by: Johannes Kastl <git@ojkastl.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:47:10 -05:00
Stéphane Graber
e71549fc7e doc: Always include the lxc-top manpage
Since it's no longer written in lua.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2014-12-01 13:46:37 -05:00
Stéphane Graber
67c660d0aa Define a new lxc.init_cmd config option
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
2014-12-01 13:46:11 -05:00