Commit Graph

7627 Commits

Author SHA1 Message Date
2xsec
8fb41a340f tools: lxc-checkpoint: remove the trailing .
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-07-01 22:38:52 +09:00
2xsec
54d4713113 tools: lxc-autostart: remove the trailing . & fix coding style of strncmp
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-07-01 22:37:00 +09:00
2xsec
03e6adc680 tools: remote tool_list, tool_utils
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
ae41d188ee tools: arguments: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
457e3c5daf tools: lxc-monitor: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
9c382925a1 tools: lxc-create: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
ce9ed7c0c4 tools: lxc-snapshot: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
4888c7312f tools: lxc-checkpoint: fix log name
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
124fef5a83 tools: lxc-checkpoint: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
4f66541cc6 tools: lxc-unshare: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:22 +09:00
2xsec
e809eec64e tools: lxc-top: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
e9b0c67964 tools: lxc-copy: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
d899f11b7b tools: lxc-execute: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
a9cb0fb86f tools: lxc-device: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
75e607ba45 tools: lxc-destroy: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
138eda996f tools: lxc-console: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
b27cdf66dc tools: lxc-config: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
d2ba12a8af tools: lxc-ls: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
469711c520 tools: lxc-info: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
b14fc1007c utils: code cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
2xsec
1cd7db650a tools: lxc-autostart: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-30 18:45:21 +09:00
Stéphane Graber
bb9f9cede7
Merge pull request #2438 from brauner/2018-06-29/linux-v4.18
autodev: adapt to changes in Linux 4.18
2018-06-29 12:28:58 -04:00
Christian Brauner
3e04a6083e
autodev: adapt to changes in Linux 4.18
Starting with commit
55956b59df33 ("vfs: Allow userns root to call mknod on owned filesystems.")
Linux will allow mknod() in user namespaces for userns root if CAP_MKNOD is
available.
However, these device nodes are useless since

static struct super_block *alloc_super(struct file_system_type *type, int flags,
                                       struct user_namespace *user_ns)
{
        /* <snip> */

        if (s->s_user_ns != &init_user_ns)
                s->s_iflags |= SB_I_NODEV;

        /* <snip> */
}

will set the SB_I_NODEV flag on the filesystem. When a device node created in
non-init userns is open()ed the call chain will hit:

bool may_open_dev(const struct path *path)
{
        return !(path->mnt->mnt_flags & MNT_NODEV) &&
                !(path->mnt->mnt_sb->s_iflags & SB_I_NODEV);
}

which will cause an EPERM because the device node is located on an fs
owned by non-init-userns and thus doesn't grant access to device nodes due to
SB_I_NODEV.

The solution is straightforward. Unless you're real root you should bind-mount
device nodes.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-29 14:36:13 +02:00
2xsec
1b36d9e9dd
tools: lxc-attach: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 23:19:50 +09:00
2xsec
93f81bc78d
tools: lxc-cgroup: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 23:13:01 +09:00
2xsec
df3ab00995
tools: lxc-wait: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 23:07:01 +09:00
2xsec
7d6ee132a5
tools: lxc-unfreeze: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 23:03:55 +09:00
2xsec
a599e9c043
tools: lxc-freeze: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 23:00:03 +09:00
2xsec
19eacdc057
tools: lxc-stop: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 22:54:27 +09:00
2xsec
eb0c9382b4
tools: lxc-start: share internal API symbols
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-28 22:49:38 +09:00
Christian Brauner
4c08bd46b9
Merge pull request #2434 from 2xsec/bugfix
tools: fix quiet option is not working
2018-06-27 10:48:07 +02:00
2xsec
097268e12b
tools: cgroup, freeze, unfreeze, wait: change fprintf => lxc_error
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-27 17:09:58 +09:00
2xsec
a13daf8e7d
tools: fix quiet option is not working
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-27 16:44:06 +09:00
Stéphane Graber
74fd09a860
Merge pull request #2433 from brauner/2018-06-26/fix_android
log: account for Android's Bionic's strerror_r()
2018-06-26 10:06:28 -04:00
Christian Brauner
44eff07559
Merge pull request #2430 from duguhaotian/work
clear ONLCR flag for container pty
2018-06-26 14:31:45 +02:00
Christian Brauner
e46fec5c7f
log: account for Android's Bionic's strerror_r()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-26 13:51:09 +02:00
duguhaotian
e5adb2b559 clear ONLCR flag for container pty
now container pty output log, use \r\n as a newline flag.
This is a windows type, so we need to change it. By clear
ONLCR can reach it.

Signed-off-by: duguhaotian <duguhaotian@gmail.com>
2018-06-26 19:39:29 +08:00
Christian Brauner
508f470010
Merge pull request #2431 from 2xsec/bugfix
log: change LOG macros using strerror to SYS* macros
2018-06-26 11:00:29 +02:00
2xsec
6d1400b572
log: change ERROR macro using sterror to SYSERROR
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-26 17:27:19 +09:00
2xsec
b5be6a7caa
log: remove strerror() from SYSERROR call
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-26 17:27:07 +09:00
2xsec
7874d81a4d
log: change DEBUG, INFO, TRACE, NOTICE macro using strerror to SYS* macro
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-26 17:26:50 +09:00
2xsec
a24c5678a9
log: change WARN macro using strerror to SYSWARN
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-26 17:26:38 +09:00
Christian Brauner
37f068c859
Merge pull request #2429 from 2xsec/bugfix
log: add strerror_r macro
2018-06-25 16:16:32 +02:00
2xsec
9d46514002
log: add lxc_log_strerror_r macro
Let's ensure that we always use the thread-safe strerror_r() function and add
an approriate macro.
Additionally, define SYS*() macros for all log levels. They will use the new
macro and ensure thread-safe retrieval of errno values.

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
[christian.brauner@ubuntu.com: simplify lxc_log_strerror_r macro]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-25 16:04:25 +02:00
Christian Brauner
62f76cc0f6
Merge pull request #2428 from 2xsec/bugfix
move some comments in lxc.spec.in
2018-06-25 11:14:21 +02:00
2xsec
723e380b6a move some comments in lxc.spec.in
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-25 13:26:39 +09:00
Stéphane Graber
9dbb10c136
Merge pull request #2425 from brauner/2018-06-22/cleanups
commands: simplify lxc_cmd()
2018-06-22 14:06:53 -04:00
Christian Brauner
7d1e281dca
Merge pull request #2426 from 2xsec/bugfix
monitor: change exit() => _exit() system call in child process
2018-06-22 16:35:25 +02:00
2xsec
f15e4fd2fb monitor: change exit() => _exit() system call in child process
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-06-22 22:42:32 +09:00
Christian Brauner
6a93ae7710
commands: simplify lxc_cmd()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-22 14:15:24 +02:00