Stéphane Graber
2339fce523
Merge pull request #2631 from brauner/2018-09-20/rename_backgrounded
...
start: s/backgrounded/daemonize/g
2018-09-21 13:36:57 +02:00
Christian Brauner
bb955810ef
start: s/backgrounded/daemonize/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-21 12:52:32 +02:00
2xsec
74e7b66219
conf: realpath() uses null as second parameter to prevent buffer overflow
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-21 11:09:54 +09:00
Cameron Nemo
b19c5d1237
apparmor: account for specified rootfs path ( closes #2617 )
...
Signed-off-by: Cameron Nemo <camerontnorman@gmail.com>
2018-09-20 15:56:05 -07:00
Stéphane Graber
2eea260752
Merge pull request #2626 from brauner/2018-09-20/remove_locking
...
lxccontainer: remove cgroup locking
2018-09-21 00:11:43 +02:00
Christian Brauner
152508ba09
lxccontainer: remove locks from get_cgroup_item()
...
The on-disk config file is not altered and the in-memory config isn't
altered so no need for locking.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-20 22:42:55 +02:00
Christian Brauner
03095169ca
lxccontainer: remove locks from set_cgroup_item()
...
The on-disk config file is not altered and the in-memory config isn't
altered so no need for locking.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-20 22:41:45 +02:00
Christian Brauner
7fc5ee66fe
Merge pull request #2624 from 2xsec/bugfix
...
af_unix: add function to remove duplicated codes for set sockaddr
2018-09-20 21:55:08 +02:00
2xsec
c62fb5e023
af_unix: add function to remove duplicated codes for set sockaddr
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-19 20:38:16 +09:00
Stéphane Graber
95bdc9e7e5
Merge pull request #2622 from brauner/2018-09-19/attach_exit_status
...
attach: report standard shell exit codes
2018-09-19 11:49:02 +02:00
Christian Brauner
06346bb04a
attach: report standard shell exit codes
...
POSIX mandates that on ENOEXEC 126 and on ENOENT 127 is supposed to be
reported.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-19 11:26:37 +02:00
Christian Brauner
28360e951c
Merge pull request #2621 from 2xsec/bugfix
...
security: fix too wide or inconsistent non-owner permissions
2018-09-19 09:11:36 +02:00
2xsec
e581b9b5f2
security: fix too wide or inconsistent non-owner permissions
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-19 14:30:12 +09:00
Christian Brauner
ee3d71040d
Merge pull request #2619 from smibarber/attach-shutdown
...
attach: don't shutdown ipc socket in child
2018-09-18 18:24:46 +03:00
Stephen Barber
5dc59a0755
attach: don't shutdown ipc socket in child
...
shutdown() affects sockets even across forked processes. The
attached child process doesn't have any interest in using the
IPC socket, so just close it in the child process and let the
intermediate process handle shutting it down.
This fixes a bug seen with lxc exec in crbug.com/884244
Signed-off-by: Stephen Barber <smbarber@chromium.org>
2018-09-17 20:07:43 -07:00
Christian Brauner
de6af06271
Merge pull request #2611 from 2xsec/bugfix
...
add compile flags for dlog
2018-09-17 09:25:34 +03:00
2xsec
de1c05f339
log: add additional info of dlog
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-14 18:28:44 +09:00
2xsec
8178adc6ad
log: add common functions
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-14 18:16:04 +09:00
2xsec
a8eed52c17
add compile flags for dlog
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-13 11:37:54 +09:00
Christian Brauner
9d036caab3
network: minor tweaks
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-13 01:16:30 +02:00
Christian Brauner
fd73418875
Merge pull request #2609 from 2xsec/bugfix
...
remove unused variables & function
2018-09-12 13:34:36 +02:00
2xsec
8b7421f2e5
file_utils: remove unused function
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-12 17:31:40 +09:00
2xsec
01c8b1cd9d
remove unused variables
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-12 17:29:09 +09:00
Christian Brauner
938980bac3
network: add lxc_netns_get_nsid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-12 04:38:49 +02:00
Wolfgang Bumiller
aec2500592
Merge pull request #2604 from brauner/2018-09-09/fix_pid_file
...
lxccontainer: use correct pid_t type
2018-09-11 14:18:04 +02:00
Christian Brauner
41a3300dbb
network: use correct type in lxc_netns_set_nsid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 14:02:03 +02:00
Christian Brauner
51a922baf7
conf: remove extra MS_BIND with sysfs:mixed
...
The extra bind-mount is not required. To succesfully remount read-only
we just need MS_REMOUNT|MS_RDONLY.
Closes #2602 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Serge Hallyn <serge@hallyn.com>
2018-09-11 12:15:48 +02:00
Christian Brauner
855358c801
Merge pull request #2601 from 2xsec/bugfix
...
log: support dlog
2018-09-11 11:39:54 +02:00
Christian Brauner
b07ea13d4a
lxccontainer: use correct pid_t type
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 11:18:13 +02:00
Wolfgang Bumiller
88fbc01082
Merge pull request #2596 from brauner/2018-09-05/attach_id
...
utils: allow lxc-attach to set uid / gid
2018-09-11 11:06:42 +02:00
Christian Brauner
464c46115f
utils: make lxc_switch_uid_gid() return bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 10:55:07 +02:00
Christian Brauner
8af07f821c
utils: make lxc_setgroups() return bool
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 10:54:46 +02:00
Christian Brauner
964581c210
start: avoid unnecessary syscalls
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 10:54:46 +02:00
Christian Brauner
ddd51fdb8e
tools/lxc-attach: add -u and -g arguments
...
This lets users specify uids and gids to switch to.
Closes #2591 .
Signed-off-by: Disassembler disassembler@dasm.cz
[christian.brauner@ubuntu.com: adapt coding style + commit message]
2018-09-11 10:54:46 +02:00
Christian Brauner
936efc72f6
attach: handle id switching smarter
...
For setup, switch to the most privileged ids we can find. That is either
nsuid 0 if a mapping has been established if not switch to the ids the
init running in the container was started with.
After setup, switch to the actual requested ids.
Closes #2591 .
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 10:54:44 +02:00
2xsec
5c7bfc0231
log: support dlog
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-11 16:04:25 +09:00
Christian Brauner
db2d1af171
utils: improve lxc_switch_uid_gid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 00:44:57 +02:00
Christian Brauner
b962868f4c
utils: improve get_ns_uid() and add get_ns_gid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-11 00:44:56 +02:00
Christian Brauner
1ea1496dfd
Merge pull request #2594 from ffontaine/master
...
lxc: fix build with --disable-werror
2018-09-08 20:39:05 +01:00
Fabrice Fontaine
218e814412
lxc: fix build with --disable-werror
...
Fix #2592 by defining -Wvla -std=gnu11 even if --disable-werror is set
As -std=gnu11 is always set, bump requirement on gcc from 4.6 to 4.7
(see https://gcc.gnu.org/projects/cxx-status.html#cxx11 )
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-09-08 21:09:20 +02:00
Christian Brauner
0b26d75e62
Merge pull request #2589 from 2xsec/bugfix
...
lxccontainer: fix dereferenced pointer
2018-09-07 13:54:09 +01:00
2xsec
5106ecd032
lxccontainer: fix dereferenced pointer
...
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-06 16:55:10 +09:00
Wolfgang Bumiller
a21ed5555d
Merge pull request #2584 from brauner/2018-09-03/bugfixes
...
commands: switch to setting errno and returning -1
2018-09-04 14:45:55 +02:00
Christian Brauner
a9d4137983
log: log_append_logfile() add new error path
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 14:05:28 +02:00
Christian Brauner
bfcedc7ea0
nl: save errno on lxc_netns_set_nsid()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 14:05:28 +02:00
Christian Brauner
7fbb15ec9c
tree-wide: s/send()/lxc_send_nointr()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 14:05:28 +02:00
Christian Brauner
28143f8862
file_utils: add lxc_send_nointr()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 13:59:13 +02:00
Christian Brauner
e3233f26ce
tree-wide: s/recv()/lxc_recv_nointr()/g
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 13:59:13 +02:00
Christian Brauner
a285b30814
log: save errno on strerror_r()
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 13:57:35 +02:00
Christian Brauner
b7051eb7e6
log: do not clobber errno
...
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-04 13:57:19 +02:00