- 23 Jan, 2017 2 commits
-
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Sergei Trofimovich authored
Before the change build failed on Gentoo as: bdev/lxclvm.c: In function 'lvm_detect': bdev/lxclvm.c:140:4: error: implicit declaration of function 'major' [-Werror=implicit-function-declaration] major(statbuf.st_rdev), minor(statbuf.st_rdev)); ^~~~~ bdev/lxclvm.c:140:28: error: implicit declaration of function 'minor' [-Werror=implicit-function-declaration] major(statbuf.st_rdev), minor(statbuf.st_rdev)); ^~~~~ glibc plans to remove <sys/sysmacros.h> from glibc's <sys/types.h>: https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html Gentoo already applied glibc patch to experimental glibc-2.24 to start preparingfor the change. Autoconf has AC_HEADER_MAJOR to find out which header defines reqiured macros: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html This change should also increase portability across other libcs. Bug: https://bugs.gentoo.org/604360Signed-off-by:Sergei Trofimovich <siarheit@google.com>
-
- 18 Jan, 2017 6 commits
-
-
Evgeni Golov authored
otherwise init might try to start the containers before cgroupfs was mounted. Debian-Bug: https://bugs.debian.org/850212Signed-off-by:
Evgeni Golov <evgeni@debian.org>
-
Christian Brauner authored
We do not check here whether the container is defined, because we support volatile containers. Which means the container does not need to be created for it to be started. You can just pass a configuration file as argument and start the container right away. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
lxc_execute() and lxc-execute where broken when a user tried to switch to a non-root uid/gid. This prevented necessary setup operations like mounting the rootfs which require root in the user namespace. This commit separates switching to root in the user namespace from switching to the requested uid/gid by lxc_execute(). This should be safe: Once we switched to root in the user namespace via setuid() and then switch to a non-root uid/gid in the user namespace for lxc_execute() via setuid() we cannot regain root privileges again. So we can only make us safer (Unless I forget about some very intricate user namespace nonsense; which is not as unlikely as I try to make it sound.). Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
This commit adds lxc_switch_uid_gid() which allows to switch the uid and gid of a process via setuid() and setgid() and lxc_setgroups() which allows to set groups via setgroups(). The main advantage is that they nicely log the switches they perform. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 05 Jan, 2017 4 commits
-
-
Christian Brauner authored
On some Android systems the lxc folders where containers are stored might be read-only and so checking for O_RDWR, will effectively make the tools useless on these systems, so let's dumb the check down to O_RDONLY. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Po-Hsu Lin authored
The api_test.py script uses Trusty release by default, which does not have s390x image. Switch to Xenial to solve this. Signed-off-by:Po-Hsu Lin <po-hsu.lin@canonical.com>
-
Christian Brauner authored
We need to remove the newline otherwise lxc_safe_uint() will fail as it detects an invalid (non-numeric) char in the string. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 03 Jan, 2017 4 commits
-
-
Christian Brauner authored
This mainly affects Trusty. The 3.13 kernel has a broken overlay module which does not handle symlinks correctly. This is a problem for containers that use an overlay based rootfs since safe_mount() uses /proc/<pid>/fd/<fd-number> in its calls to mount(). Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Fabrice Fontaine authored
Previously HAVE_LIBGNUTLS was never set in config.h even if gnutls was detected as AC_CHECK_LIB default action-if-found was overriden by enable_gnutls=yes This patch adds an --enable-gnutls option and will call AC_CHECK_LIB with the default action to write HAVE_LIBGNUTLS in config.h Signed-off-by:Fabrice Fontaine <fabrice.fontaine@orange.com>
-
Evgeni Golov authored
Given commit 330ae3d3: lxccontainer: detect if we should send SIGRTMIN+3 This is required by systemd to cleanly shutdown. Other init systems should not have SIGRTMIN+3 in the blocked signals set. we should stop poking around with sigpwr.target for systemd. Signed-off-by:
Evgeni Golov <evgeni@debian.org>
-
Evgeni Golov authored
it might not even be there… Signed-off-by:Evgeni Golov <evgeni@debian.org>
-
- 15 Dec, 2016 8 commits
-
-
Terzeus S. Dominguez authored
Removed libgcc_s1 because it breaks container building for openSUSE. Related: openSUSE/obs-build#188 Signed-off-by:Terzeus S. Dominguez <tsdmgz@gmail.com>
-
Santiago Ruano Rincón authored
Signed-off-by:
Santiago Ruano Rincón <santiago@debian.org> Signed-off-by:
Evgeni Golov <evgeni@debian.org>
-
Santiago Ruano Rincón authored
Signed-off-by:
Santiago Ruano Rincón <santiago@debian.org> Signed-off-by:
Evgeni Golov <evgeni@debian.org>
-
Terzeus S. Dominguez authored
Uncommented lxc.aa_profile = unconfined. Otherwise, container fails to start up. Signed-off-by:Terzeus S. Dominguez <tsdmgz@gmail.com>
-
Terzeus S. Dominguez authored
Signed-off-by:Terzeus S. Dominguez <tsdmgz@gmail.com>
-
Terzeus S. Dominguez authored
Aside from adding a 42.2 option, $DISTRO comparisons for Leap have been changed [ exp ] => [[ exp ]] to accomodate pattern matching for future releases. Signed-off-by:Terzeus S. Dominguez <tsdmgz@gmail.com>
-
Wolfgang Bumiller authored
Save errno across some calls to close() since it can be interrupted. Signed-off-by:Wolfgang Bumiller <wry.git@bumiller.com>
-
- 09 Dec, 2016 1 commit
-
-
Stéphane Graber authored
attach: close lsm label file descriptor
-
- 08 Dec, 2016 1 commit
-
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
- 07 Dec, 2016 3 commits
-
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Wolfgang Bumiller authored
Same change as in 6118210e which was missing in lxc-start and back then is_defined() wasn't being called. Signed-off-by:
Wolfgang Bumiller <w.bumiller@proxmox.com>
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
- 01 Dec, 2016 11 commits
-
-
Christian Brauner authored
- improve logging - simplify functions Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Stéphane Graber authored
Signed-off-by:Stéphane Graber <stgraber@ubuntu.com>
-
Christian Brauner authored
gettimeofday() is not async signal safe. So let's switch to clock_gettime() to be on the safe side. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
- single digit months, days, hours, minutes, and seconds should always be preceded by a 0. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
This allows us to generate nice timestamps in a thread-safe manner without relying on locale touching functions from any libc. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Converts a unix time Epoch given by a struct timespec to a UTC string useable in our logging functions. Maybe expanded to allow for more generic formatting. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
Our log functions need to make extra sure that they are thread-safe. We had some problems with that before. This especially involves time-conversion functions. I don't want to find any localtime() or gmtime() functions or relatives in here. Not even localtime_r() or gmtime_r() or relatives. They all fiddle with global variables and locking in various libcs. They cause deadlocks when liblxc is used multi-threaded and no matter how smart you think you are, you __will__ cause trouble using them. (As a short example how this can cause trouble: LXD uses forkstart to fork off a new process that runs the container. At the same time the go runtime LXD relies on does its own multi-threading thing which we can't control. The fork()ing + threading then seems to mess with the locking states in these time functions causing deadlocks.) The current solution is to be good old unix people and use the Epoch as our reference point and simply use the seconds and nanoseconds that have past since then. This relies on clock_gettime() which is explicitly marked MT-Safe with no restrictions! This way, anyone who is really strongly invested in getting the actual time the log entry was created, can just convert it for themselves. Our logging is mostly done for debugging purposes so don't try to make it pretty. Pretty might cost you thread-safety. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-
Christian Brauner authored
This macro can be used to set or allocate a string buffer that can hold any 64bit representable number. Signed-off-by:Christian Brauner <christian.brauner@ubuntu.com>
-