]>
git.ipfire.org Git - thirdparty/lxc.git/log
Christian Brauner [Thu, 18 May 2017 11:18:29 +0000 (13:18 +0200)]
utils: fix ppc64le builds
I suspect that there's a glibc bug on ppc64le. Both clang and gcc a very
unhappy when you return -errno from these functions. Instead, let's return
concrete errno numbers, e.g. -EINVAL.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 16 May 2017 18:23:51 +0000 (20:23 +0200)]
Merge pull request #1567 from anevenchanniy/lxc-top/memory
[lxc-top] Add memory+swap monitoring
Nevenchanniy Aleksandr [Mon, 15 May 2017 22:46:09 +0000 (01:46 +0300)]
[lxc-top] Add memory+swap monitoring
This is patch add memory + swap monitoring from lxc-top tool
Signed-off-by: Alexandr Nevenchanniy <a.nevenchannyy@gmail.com>
Serge Hallyn [Tue, 16 May 2017 14:45:30 +0000 (09:45 -0500)]
Merge pull request #1565 from brauner/2017-05-15/clear_all_config_items
conf{,ile}: allow to clear all config items
Serge Hallyn [Tue, 16 May 2017 14:39:14 +0000 (09:39 -0500)]
Merge pull request #1566 from brauner/2017-05-16/pin_rootfs_when_privileged
start: pin rootfs when privileged
Christian Brauner [Mon, 15 May 2017 22:42:30 +0000 (00:42 +0200)]
start: pin rootfs when privileged
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 15 May 2017 15:55:55 +0000 (17:55 +0200)]
Merge pull request #1563 from 0x0916/seccomp
Seccomp: update comment, print action name etc
Christian Brauner [Mon, 15 May 2017 12:53:06 +0000 (14:53 +0200)]
conf{,ile}: allow to clear all config items
Closes #1561.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
0x0916 [Mon, 15 May 2017 10:05:09 +0000 (18:05 +0800)]
seccomp: print action name in log
This patch add function `get_action_name`, so we can print action name
in the log file. for example:
```
lxc-start ubuntu
20170515095416 .561 INFO lxc_seccomp - seccomp.c:parse_config_v2:613 - Adding compat rule for reject_force_umount action 0(kill).
lxc-start ubuntu
20170515095416 .562 INFO lxc_seccomp - seccomp.c:parse_config_v2:613 - Adding compat rule for kexec_load action 327681(errno).
```
Signed-off-by: 0x0916 <w@laoqinren.net>
0x0916 [Mon, 15 May 2017 10:04:27 +0000 (18:04 +0800)]
seccomp: update comment for function `parse_config`
Signed-off-by: 0x0916 <w@laoqinren.net>
0x0916 [Mon, 15 May 2017 10:03:41 +0000 (18:03 +0800)]
seccomp: s/n-new-privs/no-new-privs/g
Signed-off-by: 0x0916 <w@laoqinren.net>
Christian Brauner [Mon, 15 May 2017 09:06:56 +0000 (11:06 +0200)]
Merge pull request #1558 from 0x0916/lxc-top
add more detail for blkio
Christian Brauner [Mon, 15 May 2017 09:06:24 +0000 (11:06 +0200)]
Merge pull request #1562 from 0x0916/delete-unneccessory-include
monitor: delete unnecessary include file
0x0916 [Mon, 15 May 2017 07:31:33 +0000 (15:31 +0800)]
monitor: delete unneccessory include file
we want to export `monitor.h`, `#include "conf.h"` will cause error
and it is unneccessory so just delete it.
Signed-off-by: 0x0916 <w@laoqinren.net>
0x0916 [Tue, 9 May 2017 11:07:24 +0000 (19:07 +0800)]
add more detail for blkio
This patch add Read and Write information for blkio bytes.
Signed-off-by: 0x0916 <w@laoqinren.net>
Christian Brauner [Sun, 14 May 2017 09:59:52 +0000 (11:59 +0200)]
Merge pull request #1560 from dimkr/master
conf: fix build without libcap
Dima Krasner [Sun, 14 May 2017 09:24:59 +0000 (12:24 +0300)]
conf: fix build without libcap
Signed-off-by: Dima Krasner <samdima@securingsam.com>
Stéphane Graber [Sat, 13 May 2017 20:18:30 +0000 (16:18 -0400)]
Merge pull request #1553 from brauner/2017-05-12/allow_no_controlling_terminal
lxc-attach: allow for situations without /dev/tty
Serge Hallyn [Sat, 13 May 2017 19:46:45 +0000 (14:46 -0500)]
Merge pull request #1551 from brauner/2017-05-11/fix_num_parsing
utils: fix num parsing functions
Serge Hallyn [Sat, 13 May 2017 19:39:07 +0000 (14:39 -0500)]
Merge pull request #1556 from brauner/2017-05-13/fix_newuidmap_regression
start: don't call lxc_map_ids() without id map
Christian Brauner [Sat, 13 May 2017 15:16:25 +0000 (17:16 +0200)]
start: don't call lxc_map_ids() without id map
So far, we somehow always called lxc_map_ids(), even when no id map was
configured. Let's not do this.
Closes #1555.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 12 May 2017 14:33:23 +0000 (16:33 +0200)]
lxc-attach: allow for situations without /dev/tty
Closes #1552.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 11 May 2017 23:16:18 +0000 (01:16 +0200)]
tests: lxc_safe_{u}int() add corner-case tests
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 11 May 2017 18:08:32 +0000 (20:08 +0200)]
utils: fix num parsing functions
Suggested-by: Benedikt Rosenkranz beluro@web.de
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Thu, 11 May 2017 15:10:19 +0000 (11:10 -0400)]
Merge pull request #1550 from brauner/2017-05-11/add_comment_to_lxc_spawn
start: add crucial details about lxc_spawn()
Christian Brauner [Thu, 11 May 2017 12:41:47 +0000 (14:41 +0200)]
start: add crucial details about lxc_spawn()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Thu, 11 May 2017 10:14:08 +0000 (12:14 +0200)]
Merge pull request #1549 from 0x0916/install-systemd-unit-for-centos
Install systemd units for CentOS
0x0916 [Thu, 11 May 2017 07:16:14 +0000 (15:16 +0800)]
Merge `ubuntu` and `debian`case
Signed-off-by: 0x0916 <w@laoqinren.net>
0x0916 [Thu, 11 May 2017 07:07:07 +0000 (15:07 +0800)]
Install systemd units for CentOS
Signed-off-by: 0x0916 <w@laoqinren.net>
Stéphane Graber [Wed, 10 May 2017 21:04:57 +0000 (17:04 -0400)]
Merge pull request #1548 from brauner/2017-05-10/prevent_umount_propagation
utils: handle > 2^31 in lxc_unstack_mountpoint()
Christian Brauner [Wed, 10 May 2017 14:56:37 +0000 (16:56 +0200)]
utils: handle > 2^31 in lxc_unstack_mountpoint()
I mean.. really? But better safe than sorry.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Wed, 10 May 2017 15:43:53 +0000 (10:43 -0500)]
Merge pull request #1547 from brauner/2017-05-10/prevent_umount_propagation
start: remove umount2()
Christian Brauner [Wed, 10 May 2017 11:32:23 +0000 (13:32 +0200)]
conf: non-functional changes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 10 May 2017 11:27:38 +0000 (13:27 +0200)]
start: remove umount2()
I really fail to see the point of this and git {blame, log -S} don't really
enlighten me on the reason for this as well. But I might be dense. The way I
see it the only thing this line achieves is causing trouble when the container
is started as root because the umount2() call will umount e.g.
/usr/lib/x86_64-linux-gnu/lxc in case it is a mountpoint on the host. Note,
this is because lxc_spawn() is still called in the hosts namespaces.
Closes https://github.com/lxc/lxd/#3255.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Wed, 10 May 2017 05:31:03 +0000 (00:31 -0500)]
Merge pull request #1544 from brauner/2017-05-08/harden_console_handling
harden console handling
Christian Brauner [Wed, 10 May 2017 00:52:17 +0000 (02:52 +0200)]
console: fail when we cannot allocate peer tty
There's really no reason not to if it's requested.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 9 May 2017 20:21:07 +0000 (22:21 +0200)]
conf: unstack all mounts atop /dev/console
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 9 May 2017 20:04:21 +0000 (22:04 +0200)]
utils: add lxc_unstack_mountpoint()
lxc_unstack_mountpoint() tries to clear all mountpoints from a given path.
It return the number of successful umounts on success and -errno on error.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 9 May 2017 00:15:24 +0000 (02:15 +0200)]
doc: document console behavior
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 22:39:28 +0000 (00:39 +0200)]
config: remove /dev/console bind mount
The code in conf will bind-mount a /dev/pts/<n> device over a dummy regular
/dev/console file. If users really want /dev/console bind-mount from the host
they can request it explicitly in the containers config file. This change will
have no effect on current LX{C,D} behavior since we (as said above) overmount
the /dev/console bind-mount anyway.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 19:13:37 +0000 (21:13 +0200)]
conf: lxc_setup_ttydir_console()
In case the user specified
lxc.console = none
lxc.devttydir = bla
lxc.mount.entry = /dev/console dev/console none bind,create=file 0 0
move the mount under /dev/bla/console
If he requested a mknod()ed /dev/console rename it to /dev/bla/console.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 19:11:58 +0000 (21:11 +0200)]
conf: improve lxc_setup_dev_console()
In case the user did request a console to be set up unmount any prior
bind-mount for it.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 18:01:22 +0000 (20:01 +0200)]
conf: non-functional changes to console functions
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 17:43:58 +0000 (19:43 +0200)]
conf: non-functional changes lxc_setup()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
0x0916 [Mon, 8 May 2017 13:06:21 +0000 (21:06 +0800)]
fix the wrong exit status
Signed-off-by: 0x0916 <w@laoqinren.net>
Christian Brauner [Mon, 8 May 2017 17:39:41 +0000 (19:39 +0200)]
conf: remove /dev/console from lxc_fill_autodev()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 8 May 2017 17:38:59 +0000 (19:38 +0200)]
conf: non-functional changes lxc_fill_autodev()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 8 May 2017 22:08:22 +0000 (18:08 -0400)]
Merge pull request #1539 from brauner/2017-05-06/fix_abstract_unix_sockets
bugfixes: {segfaults, hashes, abstract unix sockets}
Christian Brauner [Mon, 8 May 2017 19:04:36 +0000 (21:04 +0200)]
Merge pull request #1543 from evgeni/patch-1
precise is not the latest LTS, let's use xenial instead
Evgeni Golov [Mon, 8 May 2017 18:56:04 +0000 (14:56 -0400)]
precise is not the latest LTS, let's use xenial instead
Christian Brauner [Sat, 6 May 2017 21:40:04 +0000 (23:40 +0200)]
monitor: simplify abstract socket logic
Older version of liblxc only allowed for 105 bytes to be used for the abstract
unix domain socket name because the code for our abstract unix socket handling
performed invalid checks. Since we \0-terminate we could now have a maximum of
106 chars. But do not break backwards compatibility we keep the limit at 105.
Reported-by: 0x0916 w@laoqinren.net
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 6 May 2017 21:38:22 +0000 (23:38 +0200)]
lxccontainer: avoid NULL pointer dereference
In case the lxc command socket is hashed and the socket was created for a
different path than the one we're currently querying
lxc_cmd_get_{lxcpath,name}() can return NULL. The command socket path is hashed
when len(lxcpath) > sizeof(sun_path) - 2.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 6 May 2017 21:37:53 +0000 (23:37 +0200)]
commands: non-functional changes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 6 May 2017 21:35:57 +0000 (23:35 +0200)]
commands: avoid NULL pointer dereference
lxc_cmd_get_lxcpath() and lxc_cmd_get_name() both pass a nil pointer to
fill_sock_name(). Make sure that they are not dereferenced.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 6 May 2017 16:33:28 +0000 (18:33 +0200)]
af unix: allow for maximum socket name
Abstract unix sockets need not be \0-terminated. So you can effectively have
107 chars available. If you \0-terminate you'll have a 106. Don't enforce
\0-termination in these low-level functions. Enforce it higher up which we
already do.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Sat, 6 May 2017 03:33:51 +0000 (22:33 -0500)]
Merge pull request #1537 from brauner/2017-05-05/report_errno_on_monitor_startup_failure
monitor: report errno on exec() error
Christian Brauner [Fri, 5 May 2017 12:37:27 +0000 (14:37 +0200)]
monitor: report errno on exec() error
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Wed, 3 May 2017 22:35:46 +0000 (18:35 -0400)]
Merge pull request #1533 from brauner/2017-05-02/mount_opts
conf: pedantry
Stéphane Graber [Wed, 3 May 2017 22:35:27 +0000 (18:35 -0400)]
Merge pull request #1535 from brauner/2017-05-03/api_extension_lxc_is_supported_config_item
api extension: lxc_config_item_is_supported()
Christian Brauner [Wed, 3 May 2017 10:24:39 +0000 (12:24 +0200)]
test: add lxc_config_item_is_supported() tests
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Wed, 3 May 2017 10:12:22 +0000 (12:12 +0200)]
lxccontainer: add lxc_config_item_is_supported()
This adds lxc_config_item_is_supported() as API extension. It allows to check
whether a given config item (e.g. lxc.autodev) is supported by this LXC
instance. The function is useful in the following scenarios:
1. Users have compiled liblxc from source and have removed a config items from
the corresponding struct in confile.c. (For example, embedded users might
decide to gut a bunch of options that they cannot use.)
2. Callers that want to check for a specific configuration item independent of
the version numbers exposed in our version.h header.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 2 May 2017 21:38:14 +0000 (23:38 +0200)]
conf: add MS_LAZYTIME to mount options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 2 May 2017 21:37:16 +0000 (23:37 +0200)]
conf: order mount options
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Tue, 2 May 2017 04:07:37 +0000 (00:07 -0400)]
Merge pull request #1531 from mar-kolya/master
Change sshd template to work with Ubuntu 17.04
Nikolay Martynov [Tue, 2 May 2017 01:45:10 +0000 (21:45 -0400)]
Change sshd template to work with Ubuntu 17.04
A few things have changed and this patch makes container generated for sshd work in Ubuntu
Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Serge Hallyn [Sat, 29 Apr 2017 01:06:07 +0000 (20:06 -0500)]
Merge pull request #1529 from brauner/2017-04-28/create_proc_if_missing
utils: tweak lxc_mount_proc_if_needed()
Christian Brauner [Fri, 28 Apr 2017 22:03:06 +0000 (00:03 +0200)]
utils: tweak lxc_mount_proc_if_needed()
Create /proc directory if it doesn't exist.
Closes #1475.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 28 Apr 2017 21:54:24 +0000 (23:54 +0200)]
conf: non-functional changes
Closes #1475.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Fri, 28 Apr 2017 14:44:08 +0000 (09:44 -0500)]
Merge pull request #1528 from brauner/2017-04-28/close_fd_in_lxc_setup_devpts
conf: close fd in lxc_setup_devpts()
Christian Brauner [Fri, 28 Apr 2017 11:52:43 +0000 (13:52 +0200)]
conf: close fd in lxc_setup_devpts()
This left the file descriptor to the underlying /dev/ptmx file open which
confused the hell out of criu. Let's close it.
Closes https://github.com/lxc/lxd/issues/3243.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 25 Apr 2017 09:09:03 +0000 (11:09 +0200)]
Merge pull request #1527 from tenforward/japanese
doc: add lxc.limit to lxc.container.conf(5)
KATOH Yasufumi [Tue, 25 Apr 2017 08:33:36 +0000 (17:33 +0900)]
doc: add lxc.limit to lxc.container.conf(5)
Update for commit
93f9e90
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
Stéphane Graber [Mon, 24 Apr 2017 01:55:44 +0000 (21:55 -0400)]
Merge pull request #1526 from brauner/2017-04-24/build_lxc_with_musl
confile: fix musl build
Christian Brauner [Sun, 23 Apr 2017 22:34:48 +0000 (00:34 +0200)]
confile: fix musl build
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Sun, 23 Apr 2017 20:50:56 +0000 (16:50 -0400)]
Merge pull request #1523 from brauner/2017-04-23/improve_cgfsng_debug
cgroups: improve cgfsng debugging
Christian Brauner [Sun, 23 Apr 2017 20:04:54 +0000 (22:04 +0200)]
issue template: fix typo
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sun, 23 Apr 2017 13:06:10 +0000 (15:06 +0200)]
cgroups: improve cgfsng debugging
In a lot of cases we need a list of the writeable cgroup controllers detected
by the cgfsng driver.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Sun, 23 Apr 2017 01:10:10 +0000 (21:10 -0400)]
Merge pull request #1520 from brauner/2017-04-22/improve_loop
utils: use loop device helpers from LXD
Stéphane Graber [Sun, 23 Apr 2017 01:09:44 +0000 (21:09 -0400)]
Merge pull request #1522 from brauner/2017-04-22/lxc_issue_template
create ISSUE_TEMPLATE.md
Christian Brauner [Sat, 22 Apr 2017 16:38:44 +0000 (18:38 +0200)]
create ISSUE_TEMPLATE.md
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 22 Apr 2017 12:01:59 +0000 (14:01 +0200)]
utils: use loop device helpers from LXD
Use the loop device helpers I wrote for LXD in LXC as well. They should be more
efficient.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 22 Apr 2017 11:22:16 +0000 (13:22 +0200)]
conf: non-functional changes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Sat, 22 Apr 2017 01:12:43 +0000 (21:12 -0400)]
Merge pull request #1519 from brauner/2017-04-21/setup_pts
conf: use bind-mount for /dev/ptmx
Christian Brauner [Fri, 21 Apr 2017 22:14:15 +0000 (00:14 +0200)]
conf: use bind-mount for /dev/ptmx
AppArmor will refuse on /dev/ptmx being a symlink.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 21 Apr 2017 20:37:27 +0000 (22:37 +0200)]
conf: non-functional changes to setup_pts()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Serge Hallyn [Wed, 19 Apr 2017 00:36:38 +0000 (19:36 -0500)]
Merge pull request #1514 from brauner/2017-04-18/autoconf_cap_get_file
autotools: check for cap_get_file
Christian Brauner [Tue, 18 Apr 2017 22:58:46 +0000 (00:58 +0200)]
caps: return false if caps are not supported
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 18 Apr 2017 22:05:24 +0000 (00:05 +0200)]
autotools: check for cap_get_file
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Tue, 18 Apr 2017 20:00:19 +0000 (16:00 -0400)]
Merge pull request #1513 from brauner/2017-04-17/skip_cap_get_file_on_android
caps: skip file capability checks on android
Christian Brauner [Mon, 17 Apr 2017 21:23:26 +0000 (23:23 +0200)]
caps: skip file capability checks on android
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 17 Apr 2017 15:09:06 +0000 (17:09 +0200)]
Merge pull request #1512 from 0x0916/fix-comment
attach|unshare: fix the wrong comment
0x0916 [Mon, 17 Apr 2017 14:57:41 +0000 (22:57 +0800)]
attach|unshare: fix the wrong comment
Signed-off-by: 0x0916 <w@laoqinren.net>
Christian Brauner [Mon, 17 Apr 2017 08:21:12 +0000 (10:21 +0200)]
Merge pull request #1511 from evgeni/typo
fix typo introduced in #1509
Evgeni Golov [Mon, 17 Apr 2017 08:04:57 +0000 (10:04 +0200)]
fix typo introduced in #1509
Signed-off-by: Evgeni Golov <evgeni@debian.org>
Serge Hallyn [Sun, 16 Apr 2017 15:20:50 +0000 (10:20 -0500)]
Merge pull request #1509 from brauner/2017-04-15/improve_lxc_id_map
idmap improvements
Christian Brauner [Sun, 16 Apr 2017 12:51:28 +0000 (14:51 +0200)]
Merge pull request #1510 from 0x0916/fix-ls
ls: simplify the judgment condition when list active containers
0x0916 [Sun, 16 Apr 2017 02:34:08 +0000 (10:34 +0800)]
ls: simplify the judgment condition when list active containers
Signed-off-by: 0x0916 <w@laoqinren.net>
Christian Brauner [Sat, 15 Apr 2017 16:16:31 +0000 (18:16 +0200)]
conf: improve log when mounting rootfs
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 15 Apr 2017 11:50:27 +0000 (13:50 +0200)]
conf: check for {filecaps,setuid} on new{g,u}idmap
The new{g,u}idmap binaries where a source of trouble for users when they lacked
sufficient privileges. This commit adds code to check for sufficient privilege.
It checks whether new{g,u}idmap is root owned and has the setuid bit set and if
it doesn't it checks whether new{g,u}idmap is root owned and has CAP_SETUID in
its CAP_PERMITTED and CAP_EFFECTIVE set.
Closes #296.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 15 Apr 2017 13:00:14 +0000 (15:00 +0200)]
caps: add lxc_{proc,file}_cap_is_set()
Add two new helpers that allow to determine whether a given proc or file has a
capability in the given set and move lxc_cap_is_set() to static function that
both call internally.
Closes #296.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>