Commit Graph

7645 Commits

Author SHA1 Message Date
Christian Brauner
ef05d36887
attach: move struct declaration to top
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-21 16:54:36 +02:00
Christian Brauner
c7ac2e1ca7
macro: s/rexit()/_exit()/g
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-21 16:54:34 +02:00
Stéphane Graber
ac907950d8
Merge pull request #2560 from brauner/2018-08-21/fix_fully_unprivileged_containers
conf: fix devpts mounting when fully unprivileged
2018-08-21 10:53:57 -04:00
Stéphane Graber
d5f670c12c
Merge pull request #2558 from brauner/2018-08-21/pam_cgfs
pam_cgfs: build from the same sources as liblxc
2018-08-21 10:52:46 -04:00
Christian Brauner
ce155c606d
conf: fix devpts mounting when fully unprivileged
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-21 16:16:36 +02:00
Christian Brauner
71174d464f
pam_cgfs: build from the same sources as liblxc
Closes #2556.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-21 13:01:44 +02:00
Christian Brauner
37ef15bbd2
utils: split into {file,string}_utils.{c,h}
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-21 13:00:20 +02:00
Christian Brauner
f8f3f6672e
Merge pull request #2559 from ssup2/master
start: Fix net iface remaining issue
2018-08-21 12:59:49 +02:00
Jungsub Shin
78852a0c17 start: Fix net iface remaining issue
When creating container that has multiple net ifaces fails
because of wrong net config, lxc doesn't remove previously created
net ifaces.

Solve this issue with changing return path in lxc_spawn().

Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
2018-08-21 19:21:59 +09:00
Christian Brauner
501751d09a
Merge pull request #2555 from tcharding/clang-format-cmd
cmd: Fix format issues found by clang-format
2018-08-21 11:25:34 +02:00
Christian Brauner
3c84108681
Merge pull request #2557 from 2xsec/bugfix
list: fix indent
2018-08-21 11:24:52 +02:00
2xsec
ca9a25048b
list: fix indent
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-21 15:02:06 +09:00
Tobin C. Harding
2ec1c48453 cmd: Fix format issues found by clang-format
clang-format finds a few format issues, lets fix these up.

Fix format issues found by clang-format.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
2018-08-21 09:56:26 +10:00
Christian Brauner
06d390dfb9
Merge pull request #2552 from tcharding/cpp-check
cmd: Lint with cppcheck
2018-08-21 01:37:31 +02:00
Tobin C. Harding
aac44dc4ff cmd: Reduce scope of 'count' variable
Variable is used in one plaice only within a nested statement block.
The code is cleaner if the variable is declared near where it is used.
Found using cppcheck.

Reduce the scope of 'count' variable.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
2018-08-21 09:25:30 +10:00
Tobin C. Harding
ba464e9b66 cmd: Do not reassign variable before it is used
cppcheck emits warning

  Variable 'ofd' is reassigned a value before the old one has been used.

We do not need to initialise a variable if it is assigned to on first use.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
2018-08-21 09:25:30 +10:00
Wolfgang Bumiller
86cea5d143
Merge pull request #2549 from brauner/2018-08-19/cmd_usernsexec_fixes
cmd: lxc-usernsexec fixes + macro: move declarations + config_utils: macvlan fixes
2018-08-20 15:35:10 +02:00
Christian Brauner
62a38dfff0
cmd: use goto for cleanup in lxc-usernsexec
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-20 15:16:33 +02:00
Christian Brauner
87a70c5703
Merge pull request #2550 from 2xsec/bugfix
storage: exit() => _exit()
2018-08-20 12:34:15 +02:00
Christian Brauner
de206187cd
Merge pull request #2542 from tcharding/signal-fail-2523
tools: Indicate container startup failure
2018-08-20 12:33:45 +02:00
Christian Brauner
4f9500b1a5
Merge pull request #2553 from Blub/ttydir-path-fixup
conf: fix path/lxcpath mixups in tty setup
2018-08-20 10:37:50 +02:00
Wolfgang Bumiller
adc1c7156c conf: fix path/lxcpath mixups in tty setup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 6947153da ("conf: use mknod() to create dummy mount target")
2018-08-20 10:07:08 +02:00
2xsec
75457df5dc
tools: lxc-wait: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-20 10:43:22 +09:00
2xsec
2c70300ad8
storage: exit() => _exit(). when exec is failed, child process needs to use _exit()
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-20 10:41:50 +09:00
Tobin C. Harding
e3e70db364 tools: Indicate container startup failure
When running lxc-autostart we do not currently indicate failure to start
containers, either partial failure i.e. some of the containers failed to
start or total failure i.e. all of the containers failed to start.

Indicate container startup failure.  For total failure exit(1), for
partial failure exit(2).

Signed-off-by: Tobin C. Harding <me@tobin.cc>
2018-08-20 09:00:14 +10:00
Christian Brauner
7b15813c33
macro: add macvlan properties
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:46 +02:00
Christian Brauner
85de58d6e3
macro: add missing headers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:45 +02:00
Christian Brauner
d3b413e7d5
cmd: use safe number parsers in lxc-usernsexec
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:45 +02:00
Christian Brauner
5ff0284480
cmd: simplify lxc-usernsexec
Calculate length only once.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:45 +02:00
Christian Brauner
197c9293a6
cmd: use utils.{c,h} helpers in lxc-usernsexec
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:45 +02:00
Christian Brauner
c881c8101b
cmd: move declarations to macro.h
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:45 +02:00
Christian Brauner
72a506941f
cmd: lxc-usernsexec reorder includes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-19 20:27:43 +02:00
Christian Brauner
89a9f3933b
Merge pull request #2548 from 2xsec/bugfix
cmd: lxc-user-nic: change log macro & cleanups
2018-08-19 12:03:27 +02:00
2xsec
3725a69c38 cmd: lxc-user-nic: change log macro & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-19 12:45:54 +09:00
Serge Hallyn
59c018f20b
Merge pull request #2547 from brauner/2018-08-18/fix_execute_parsing
tools: fix lxc-execute command parsing
2018-08-18 11:35:11 -05:00
Christian Brauner
0a4f0d02d8
Merge pull request #2545 from ljagiello/integer-overflow
storage/loop.c: integer overflow
2018-08-18 18:05:19 +02:00
Lukasz Jagiello
8737e2a8a5
lseek - integer overflow
The issue was introduced in PR (https://github.com/lxc/lxc/pull/1705):

Previous code:
```
  if (lseek(fd, size, SEEK_SET) < 0) {
    SYSERROR("Error seeking to set new loop file size");
    close(fd);
    return -1;
  }
```
New code:
```
  int fd, ret;

  [...]

  ret = lseek(fd, size, SEEK_SET);
  if (ret < 0) {
    SYSERROR("Failed to seek to set new loop file size for loop "
       "file \"%s\"", path);
    close(fd);
    return -1;
  }
```

Based on http://man7.org/linux/man-pages/man2/lseek.2.html:
> Upon successful completion, lseek() returns the resulting offset
> location as measured in bytes from the beginning of the file.

So in this case value of `size` and `size` is `uint64_t`.

This fix change declaration of `ret`, but it can be fixed in other ways.
Let me know what works for you.

This PR fix issues (https://github.com/lxc/lxc/issues/1872).

Signed-off-by: Lukasz Jagiello <lukasz@wikia-inc.com>
2018-08-18 08:32:21 -07:00
Christian Brauner
0044aab02a
tools: fix lxc-execute command parsing
Initialize buf to avoid parsing random data later on.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-18 11:56:05 +02:00
Christian Brauner
2957be64da
Merge pull request #2546 from 2xsec/bugfix
storage_utils: move duplicated function from tools
2018-08-18 11:46:10 +02:00
2xsec
2b670dfeb0 storage_utils: move duplicated function from tools
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 18:05:32 +09:00
Christian Brauner
826a94a587
Merge pull request #2544 from 2xsec/bugfix
tools: add default log priority & cleanups
2018-08-18 09:58:53 +02:00
2xsec
34a10bfa34 tools: lxc-unfreeze: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:42:15 +09:00
2xsec
fe8c37efdb tools: lxc-freeze: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:41:51 +09:00
2xsec
c2a23ef6e4 tools: lxc-stop: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:41:06 +09:00
2xsec
c7013c1303 tools: lxc-start: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:40:29 +09:00
2xsec
e8c0bb81d3 tools: lxc-execute: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:39:20 +09:00
2xsec
9fe1638742 tools: lxc-device: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:38:13 +09:00
2xsec
a53759568a tools: lxc-destroy: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:36:58 +09:00
2xsec
0e9dc035dd tools: lxc-create: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:35:57 +09:00
2xsec
a291ab7859 tools: lxc-console: add default log priority & cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-08-18 01:34:28 +09:00