Christian Brauner
0e83121caa
Merge pull request #2221 from tych0/fix-use-after-free
...
fix handler use-after-free
2018-03-15 16:52:39 +01:00
Tycho Andersen
a3b4f3d680
fix handler use-after-free
...
The problem here is that __lxc_start frees the handler, so any use
afterwards is invalid. Since we don't have access to the actual struct
lxc_container object in __lxc_start, let's pass a pointer to error_num in
so it can be returned.
Unfortunately, I'm a little too paranoid to change the return type of
lxc_start, since it returns failure if some of the cleanup fails, which
may be useful in some cases. So let's keep this out of band.
Closes #2218
Closes #2219
Reported-by: Felix Abecassis <fabecassis@nvidia.com>
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-03-15 15:29:27 +00:00
Christian Brauner
d61bda5fcb
Merge pull request #2217 from flx42/fix-mount-hooks-double-call
...
conf: do not run the "mount" hooks twice
2018-03-15 00:37:17 +01:00
Felix Abecassis
1a2cf89d99
conf: do not run the "mount" hooks twice
...
Regression introduced by 8353b4c90e
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-14 16:20:18 -07:00
Christian Brauner
55fc780b23
Merge pull request #2216 from igalic/fix/clang-warning
...
conf: fix clang warning when building w/o libcap
2018-03-14 17:27:55 +01:00
Igor Galić
8560cd364b
conf: fix clang warning when building w/o libcap
...
when compiling lxc with clang-5.0 parse_cap()'s main loop will produce a
warning about a tautological comparision (#2215 ).
By moving the result of computation into a variable (end) this is no
longer a constant expression. clang-5.0 does not do dataflow analysis at
this point, so it is, to quote someone from #llvm, "morally equivalent"
to casting `(int)i`.
in addition, we also clean up the #if HAVE_LIBCAP to no longer need
its #else branch!
Signed-off-by: Igor Galić <igor.galic@automatic-server.com>
2018-03-14 17:01:39 +01:00
Christian Brauner
0b628094f8
Merge pull request #2214 from flx42/fix-lxc-execute
...
tools: fix usage of boolean function set_config_item
2018-03-14 06:31:54 +01:00
Felix Abecassis
e2eae70354
tools: fix usage of boolean function set_config_item
...
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-13 21:50:46 -07:00
Christian Brauner
93936fbc7b
Merge pull request #2213 from hallyn/2018-03-13/revert-cg
...
Revert "cgroups: don't escape if we're not real root"
2018-03-13 20:11:03 +01:00
Serge Hallyn
53386adb78
Revert "cgroups: don't escape if we're not real root"
...
This reverts commit 8d961e28f1
.
Unfortunately I don't believe the check is correct in the general case.
Signed-off-by: Serge Hallyn <shallyn@cisco.com>
2018-03-13 13:01:51 -05:00
Christian Brauner
f432873366
Merge pull request #2212 from tych0/cgroup-escape-host-unpriv
...
cgroups: don't escape if we're not real root
2018-03-13 17:14:15 +01:00
Tycho Andersen
8d961e28f1
cgroups: don't escape if we're not real root
...
If we're host unpriv but root in our userns, we can't really escape
cgroups. Let's switch the cgroup escape test to reflect this.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-03-13 15:57:10 +00:00
Serge Hallyn
e3bc3b8645
Merge pull request #2211 from tych0/usernsexec-init-log
...
usernsexec: init log fd
2018-03-12 11:31:46 -05:00
Tycho Andersen
2d22b22dd4
usernsexec: init log fd
...
lxc-usernsexec uses some functions (e.g. lxc_map_ids()), which are part of
the lxc library and thus use the WARN etc. macros to emit log messages.
However, it doesn't initialize the log in any way, so these messages go
into the ether.
lxc-usernsexec currently has no log parameters, so let's just log these to
stderr. Someone can do something fancier later if they want.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
2018-03-12 09:39:37 -06:00
Christian Brauner
f392f4edf3
Merge pull request #2209 from tenforward/fix_personality
...
tools: Include config.h in tool_utils.c
2018-03-09 10:42:24 +01:00
KATOH Yasufumi
2e607d1c13
tools: Include config.h in tool_utils.c
...
Since we do not include config.h, personality is not set. This is fix
it. See issue #2208 .
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2018-03-09 17:53:09 +09:00
Christian Brauner
9574bd59a3
Merge pull request #2203 from flx42/fix-libcap-amzn1
...
Add a workaround for a build issue with old versions of libcap
2018-03-03 07:33:18 +01:00
Felix Abecassis
9cd5f7fa1c
Add a workaround for a build issue with old versions of libcap
...
Fixes : #2178
Signed-off-by: Felix Abecassis <fabecassis@nvidia.com>
2018-03-02 22:03:25 -08:00
Christian Brauner
844a5c73cf
Merge pull request #2202 from brauner/2018-03-02/coding_style_update
...
CODING_STYLE: update
2018-03-02 13:01:13 +01:00
Christian Brauner
b0c407f7d2
CODING_STYLE: add languages to highlight
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-02 12:57:18 +01:00
Christian Brauner
b629739c34
CODING_STYLE: arrays of structs
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-02 12:54:58 +01:00
Christian Brauner
c67cb61950
CODING_STYLE: clang-format
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-02 12:54:58 +01:00
Christian Brauner
0c9119fc1f
CODING_STYLE: remove duplicate _exit() entry
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-02 12:18:38 +01:00
Christian Brauner
a73c39ccda
Merge pull request #2201 from tenforward/japanese
...
doc: Add lxc.console.size and remove lxc.console.buffer.logfile in Japanese man page
2018-03-02 10:37:03 +01:00
KATOH Yasufumi
d9874b217a
doc: Add lxc.console.size and remove lxc.console.buffer.logfile in Japanese man pages
...
Update for commit 861813e
and 23e0d9a
for lxc.container.conf(5)
Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2018-03-02 15:09:34 +09:00
Stéphane Graber
282753c6c9
Release LXC 3.0.0.beta1
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-01 13:59:24 -05:00
Stéphane Graber
ba588b38b2
Merge pull request #2199 from brauner/2018-03-01/bugfixes
...
start: handle kernels without setns support
2018-03-01 12:09:32 -05:00
Christian Brauner
5c0d54cd8c
config: start with a full capability set
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-01 17:09:44 +01:00
Christian Brauner
4cb53844bc
start: handle kernels without setns support
...
Closes #1390 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-01 12:12:50 +01:00
Christian Brauner
9e84479f4c
attach: rename to LXC_ATTACH_TERMINAL
...
Rename from LXC_ATTACH_ALLOCATE_PTY to LXC_ATTACH_TERMINAL. The latter is
shorter and more generic. I don't want this whole terminology of ptys, ttys,
and consoles to leak through the API.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-03-01 11:56:15 +01:00
Christian Brauner
8b909dfddb
Merge pull request #2197 from stgraber/master
...
Fix typo
2018-03-01 08:23:02 +01:00
Stéphane Graber
083bcf36ca
Fix typo
...
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-01 01:31:50 -05:00
Stéphane Graber
a98bd0bd8d
Merge pull request #2164 from brauner/2018-02-14/add_flag_to_compile_tools
...
tree-wide: rm {lua,python3} bindings, rm deprecated binaries, rm deprecated templates, add --{disable,enable}-{commands,tools} flag
2018-02-28 14:13:52 -05:00
Serge Hallyn
ff305221bf
Merge pull request #2196 from brauner/2018-02-28/more_terminal_fixes
...
terminal: improvements and cleanup
2018-02-28 10:18:39 -06:00
Christian Brauner
e9a55b51b8
terminal: non-functional changes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:10 +01:00
Christian Brauner
d712f9e8f4
terminal: non-functional changes
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:10 +01:00
Christian Brauner
03700cab61
terminal: lxc_terminal_map_ids()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
d049f0e9d5
terminal: lxc_terminal_prepare_login()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
cd0a2b2f0b
terminal: lxc_make_controlling_terminal()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
71ac3f071b
terminal: lxc_console()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
5bd171bd77
terminal: lxc_terminal_master_cb()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
150852928a
terminal: lxc_terminal_stdin_cb()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:09 +01:00
Christian Brauner
8ca7b37422
terminal: lxc_terminal_set_stdfds()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:08 +01:00
Christian Brauner
1a443ac10c
terminal: lxc_terminal_setup()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:08 +01:00
Christian Brauner
8ded924414
terminal: lxc_terminal_create()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:08 +01:00
Christian Brauner
49cd065668
terminal: lxc_terminal_peer_default()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:08 +01:00
Christian Brauner
1b5e93c49f
terminal: lxc_terminal_free()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:08 +01:00
Christian Brauner
12c2eaaa0a
terminal: lxc_terminal_allocate()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:07 +01:00
Christian Brauner
60dd8ef44f
terminal: lxc_terminal_peer_proxy_alloc()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:07 +01:00
Christian Brauner
e788f4ac5d
terminal: lxc_terminal_peer_proxy_free()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 17:08:07 +01:00