lxc-4.0.12/0000755061062106075000000000000014176404015007377 500000000000000lxc-4.0.12/src/0000755061062106075000000000000014176404015010166 500000000000000lxc-4.0.12/src/tests/0000755061062106075000000000000014176404015011330 500000000000000lxc-4.0.12/src/tests/concurrent.c0000644061062106075000000001527214176403775013621 00000000000000/* concurrent.c * * Copyright © 2013 S.Çağlar Onur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include static int nthreads = 5; static int iterations = 1; static int debug = 0; static int quiet = 0; static int delay = 0; static const char *template = "busybox"; static const struct option options[] = { { "threads", required_argument, NULL, 'j' }, { "iterations", required_argument, NULL, 'i' }, { "template", required_argument, NULL, 't' }, { "delay", required_argument, NULL, 'd' }, { "modes", required_argument, NULL, 'm' }, { "quiet", no_argument, NULL, 'q' }, { "debug", no_argument, NULL, 'D' }, { "help", no_argument, NULL, '?' }, { 0, 0, 0, 0 }, }; static void usage(void) { fprintf(stderr, "Usage: lxc-test-concurrent [OPTION]...\n\n" "Common options :\n" " -j, --threads=N Threads to run concurrently\n" " (default: 5, use 1 for no threading)\n" " -i, --iterations=N Number times to run the test (default: 1)\n" " -t, --template=t Template to use (default: busybox)\n" " -d, --delay=N Delay in seconds between start and stop\n" " -m, --modes= Modes to run (create, start, stop, destroy)\n" " -q, --quiet Don't produce any output\n" " -D, --debug Create a debug log\n" " -?, --help Give this help list\n" "\n" "Mandatory or optional arguments to long options are also mandatory or optional\n" "for any corresponding short options.\n\n"); } struct thread_args { int thread_id; int return_code; const char *mode; }; static void do_function(void *arguments) { char name[NAME_MAX + 1]; struct thread_args *args = arguments; struct lxc_container *c; sprintf(name, "lxc-test-concurrent-%d", args->thread_id); args->return_code = 1; c = lxc_container_new(name, NULL); if (!c) { fprintf(stderr, "Unable to instantiate container (%s)\n", name); return; } if (debug) c->set_config_item(c, "lxc.log.level", "DEBUG"); if (strcmp(args->mode, "create") == 0) { if (!c->is_defined(c)) { if (!c->create(c, template, NULL, NULL, 1, NULL)) { fprintf(stderr, "Creating the container (%s) failed...\n", name); goto out; } } } else if(strcmp(args->mode, "start") == 0) { if (c->is_defined(c) && !c->is_running(c)) { c->want_daemonize(c, true); if (!c->start(c, false, NULL)) { fprintf(stderr, "Starting the container (%s) failed...\n", name); goto out; } if (!c->wait(c, "RUNNING", 15)) { fprintf(stderr, "Waiting the container (%s) to start failed...\n", name); goto out; } sleep(delay); } } else if(strcmp(args->mode, "stop") == 0) { if (c->is_defined(c) && c->is_running(c)) { if (!c->stop(c)) { fprintf(stderr, "Stopping the container (%s) failed...\n", name); goto out; } if (!c->wait(c, "STOPPED", 15)) { fprintf(stderr, "Waiting the container (%s) to stop failed...\n", name); goto out; } } } else if(strcmp(args->mode, "destroy") == 0) { if (c->is_defined(c) && !c->is_running(c)) { if (!c->destroy(c)) { fprintf(stderr, "Destroying the container (%s) failed...\n", name); goto out; } } } args->return_code = 0; out: lxc_container_put(c); if (debug) lxc_log_close(); } static void *concurrent(void *arguments) { do_function(arguments); pthread_exit(NULL); return NULL; } int main(int argc, char *argv[]) { int i, j, iter, opt; pthread_attr_t attr; pthread_t *threads; struct thread_args *args; char *modes_default[] = {"create", "start", "stop", "destroy", NULL}; char **modes = modes_default; pthread_attr_init(&attr); while ((opt = getopt_long(argc, argv, "j:i:t:d:m:qD", options, NULL)) != -1) { switch(opt) { case 'j': nthreads = atoi(optarg); break; case 'i': iterations = atoi(optarg); break; case 't': template = optarg; break; case 'd': delay = atoi(optarg); break; case 'q': quiet = 1; break; case 'D': debug = 1; break; case 'm': { char *mode_tok, *tok, *saveptr = NULL; if (!optarg) continue; modes = NULL; for (i = 0, mode_tok = optarg; (tok = strtok_r(mode_tok, ",", &saveptr)); i++, mode_tok = NULL) { modes = realloc(modes, sizeof(*modes) * (i+2)); if (!modes) { perror("realloc"); exit(EXIT_FAILURE); } modes[i] = tok; } if (modes) modes[i] = NULL; break; } default: /* '?' */ usage(); exit(EXIT_FAILURE); } } threads = malloc(sizeof(*threads) * nthreads); args = malloc(sizeof(*args) * nthreads); if (threads == NULL || args == NULL) { fprintf(stderr, "Unable malloc enough memory for %d threads\n", nthreads); exit(EXIT_FAILURE); } for (iter = 1; iter <= iterations; iter++) { int fd; fd = open("/", O_RDONLY); if (fd < 0) { fprintf(stderr, "Failed to open /\n"); continue; } if (!quiet) printf("\nIteration %d/%d maxfd:%d\n", iter, iterations, fd); close(fd); for (i = 0; modes[i];i++) { if (!quiet) printf("Executing (%s) for %d containers...\n", modes[i], nthreads); for (j = 0; j < nthreads; j++) { args[j].thread_id = j; args[j].mode = modes[i]; if (nthreads > 1) { if (pthread_create(&threads[j], &attr, concurrent, (void *) &args[j]) != 0) { perror("pthread_create() error"); exit(EXIT_FAILURE); } } else { do_function(&args[j]); } } for (j = 0; j < nthreads; j++) { if (nthreads > 1) { if (pthread_join(threads[j], NULL) != 0) { perror("pthread_join() error"); exit(EXIT_FAILURE); } } if (args[j].return_code) { fprintf(stderr, "thread returned error %d\n", args[j].return_code); exit(EXIT_FAILURE); } } } } free(args); free(threads); pthread_attr_destroy(&attr); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/lxc-test-usernic.in0000755061062106075000000001275714176403775015044 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # # This is a test script for the lxc-user-nic program # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # This test assumes an Ubuntu host DONE=0 LXC_USER_NIC="@LIBEXECDIR@/lxc/lxc-user-nic" cleanup() { set +e ( lxc-stop -n usernic-c1 -k lxc-destroy -n usernic-c1 sed -i '/usernic-user/d' /run/lxc/nics /etc/lxc/lxc-usernet ifconfig usernic-br0 down ifconfig usernic-br1 down brctl delbr usernic-br0 brctl delbr usernic-br1 run_cmd "lxc-stop -n b1 -k" pkill -u $(id -u usernic-user) -9 rm -rf /tmp/usernic-test /home/usernic-user /run/user/$(id -u usernic-user) deluser usernic-user ) >/dev/null 2>&1 if [ "$DONE" = "1" ]; then echo "PASS" exit 0 fi echo "FAIL" exit 1 } run_cmd() { sudo -i -u usernic-user \ env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \ XDG_RUNTIME_DIR=/run/user/$(id -u usernic-user) ASAN_OPTIONS=${ASAN_OPTIONS:-} \ UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $* } set -eu trap cleanup EXIT SIGHUP SIGINT SIGTERM # create a test user deluser usernic-user || true useradd usernic-user sudo mkdir -p /home/usernic-user sudo chown usernic-user: /home/usernic-user usermod -v 910000-919999 -w 910000-919999 usernic-user mkdir -p /home/usernic-user/.config/lxc/ cat > /home/usernic-user/.config/lxc/default.conf << EOF lxc.net.0.type = empty lxc.idmap = u 0 910000 10000 lxc.idmap = g 0 910000 10000 EOF if command -v cgm >/dev/null 2>&1; then cgm create all usernic-user cgm chown all usernic-user $(id -u usernic-user) $(id -g usernic-user) cgm movepid all usernic-user $$ elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:usernic-user >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Chown \ string:$d string:usernic-user int32:$(id -u usernic-user) int32:$(id -g usernic-user) >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.MovePid \ string:$d string:usernic-user int32:$$ >/dev/null done else for d in /sys/fs/cgroup/*; do [ "$d" = "/sys/fs/cgroup/unified" ] && continue [ -f $d/cgroup.clone_children ] && echo 1 > $d/cgroup.clone_children [ ! -d $d/lxctest ] && mkdir $d/lxctest chown -R usernic-user: $d/lxctest echo $$ > $d/lxctest/tasks done fi mkdir -p /run/user/$(id -u usernic-user) chown -R usernic-user: /run/user/$(id -u usernic-user) /home/usernic-user # Create two test bridges brctl addbr usernic-br0 brctl addbr usernic-br1 ifconfig usernic-br0 0.0.0.0 up ifconfig usernic-br1 0.0.0.0 up # Create three containers run_cmd "lxc-create -t busybox -n b1" run_cmd "lxc-start -n b1 -d" p1=$(run_cmd "lxc-info -n b1 -p -H") lxcpath=/home/usernic-user/.local/share/lxc lxcname=b1 # Assign one veth, should fail as no allowed entries yet if run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br0 xx1"; then echo "FAIL: able to create nic with no entries" exit 1 fi # Give him a quota of two touch /etc/lxc/lxc-usernet sed -i '/^usernic-user/d' /etc/lxc/lxc-usernet echo "usernic-user veth usernic-br0 2" >> /etc/lxc/lxc-usernet # Assign one veth to second bridge, should fail if run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br1 xx1"; then echo "FAIL: able to create nic with no entries" exit 1 fi # Assign two veths, should succeed if ! run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br0 xx2"; then echo "FAIL: unable to create first nic" exit 1 fi if ! run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br0 xx3"; then echo "FAIL: unable to create second nic" exit 1 fi # Assign one more veth, should fail. if run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br0 xx4"; then echo "FAIL: able to create third nic" exit 1 fi # Shut down and restart the container, should be able to assign more nics run_cmd "lxc-stop -n b1 -k" run_cmd "lxc-start -n b1 -d" p1=$(run_cmd "lxc-info -n b1 -p -H") if ! run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p1 veth usernic-br0 xx5"; then echo "FAIL: unable to create nic after destroying the old" cleanup 1 fi run_cmd "lxc-stop -n b1 -k" # Create a root-owned ns lxc-create -t busybox -n usernic-c1 lxc-start -n usernic-c1 -d p2=$(lxc-info -n usernic-c1 -p -H) # assign veth to it - should fail if run_cmd "$LXC_USER_NIC create $lxcpath $lxcname $p2 veth usernic-br0 xx6"; then echo "FAIL: able to attach nic to root-owned container" cleanup 1 fi echo "All tests passed" DONE=1 lxc-4.0.12/src/tests/saveconfig.c0000644061062106075000000000546514176403775013566 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #define MYNAME "lxctest1" static int create_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 1; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (create_container()) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } if (!c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } c->load_config(c, NULL); unlink("/tmp/lxctest1"); if (!c->save_config(c, "/tmp/lxctest1")) { fprintf(stderr, "%d: failed writing config file /tmp/lxctest1\n", __LINE__); goto out; } rename(LXCPATH "/" MYNAME "/config", LXCPATH "/" MYNAME "/config.bak"); if (!c->save_config(c, NULL)) { fprintf(stderr, "%d: failed writing config file\n", __LINE__); goto out; } if (!c->destroy(c)) { fprintf(stderr, "%d: error deleting %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/lxc-test-snapdeps0000755061062106075000000000403514176403775014572 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # # This is a test for dependency between snapshots # # When container c2 is created as an overlayfs clone of c1, then # we record it as such, because c1 cannot be deleted until c2 is # deleted. Once c2 is deleted, c1 should be delete-able. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # This test assumes an Ubuntu host set -e if ! grep -q overlay /proc/filesystems; then echo "Not running this test as overlay is not available" exit 0 fi cleanup() { for i in $(seq 1 20); do lxc-destroy -n snapdeptest$i > /dev/null 2>&1 || true done lxc-destroy -n snapdeptest > /dev/null 2>&1 || true } verify_deps() { n=$1 m=$(wc -l /var/lib/lxc/snapdeptest/lxc_snapshots | awk '{ print $1 }') [ $((n*2)) -eq $m ] } cleanup trap cleanup EXIT SIGHUP SIGINT SIGTERM lxc-create -t busybox -n snapdeptest lxc-copy -s -n snapdeptest -N snapdeptest1 fail=0 lxc-destroy -n snapdeptest || fail=1 if [ $fail -eq 0 ]; then echo "FAIL: clone did not prevent deletion" false fi for i in $(seq 2 20); do lxc-copy -s -n snapdeptest -N snapdeptest$i done verify_deps 20 lxc-destroy -n snapdeptest1 verify_deps 19 lxc-destroy -n snapdeptest20 verify_deps 18 for i in $(seq 2 19); do lxc-destroy -n snapdeptest$i done lxc-destroy -n snapdeptest echo "Snapshot clone dependency test passed" exit 0 lxc-4.0.12/src/tests/cgpath.c0000644061062106075000000001356714176403775012712 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "cgroup.h" #include "commands.h" #include "lxc.h" #include "lxctest.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define MYNAME "lxctest1" #define TSTERR(fmt, ...) do { \ fprintf(stderr, "%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ } while (0) /* * test_running_container: test cgroup functions against a running container * * @name : name of the container */ static int test_running_container(const char *lxcpath, const char *name) { __do_close int fd_log = -EBADF; int ret = -1; struct lxc_container *c = NULL; struct lxc_log log = {}; char template[sizeof(P_tmpdir"/attach_XXXXXX")]; char *cgrelpath; char relpath[PATH_MAX+1]; char value[NAME_MAX], value_save[NAME_MAX]; call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL; (void)strlcpy(template, P_tmpdir"/attach_XXXXXX", sizeof(template)); fd_log = lxc_make_tmpfile(template, false); if (fd_log < 0) { lxc_error("Failed to create temporary log file for container %s\n", name); exit(EXIT_FAILURE); } log.name = name; log.file = template; log.level = "TRACE"; log.prefix = "cgpath"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) goto err1; sprintf(relpath, DEFAULT_PAYLOAD_CGROUP_PREFIX "%s", name); if ((c = lxc_container_new(name, lxcpath)) == NULL) { TSTERR("container %s couldn't instantiate", name); goto err1; } if (!c->is_defined(c)) { TSTERR("container %s does not exist", name); goto err2; } cgrelpath = lxc_cmd_get_cgroup_path(c->name, c->config_path, "freezer"); if (!cgrelpath) { TSTERR("lxc_cmd_get_cgroup_path returned NULL"); goto err2; } if (!strstr(cgrelpath, relpath)) { TSTERR("lxc_cmd_get_cgroup_path %s not in %s", relpath, cgrelpath); goto err3; } cgroup_ops = cgroup_init(c->lxc_conf); if (!cgroup_ops) goto err3; /* test get/set value using memory.soft_limit_in_bytes file */ ret = cgroup_ops->get(cgroup_ops, "pids.max", value, sizeof(value), c->name, c->config_path); if (ret < 0) { TSTERR("cgroup_get failed"); goto err3; } (void)strlcpy(value_save, value, NAME_MAX); ret = cgroup_ops->set(cgroup_ops, "pids.max", "10000", c->name, c->config_path); if (ret < 0) { TSTERR("cgroup_set failed %d %d", ret, errno); goto err3; } ret = cgroup_ops->get(cgroup_ops, "pids.max", value, sizeof(value), c->name, c->config_path); if (ret < 0) { TSTERR("cgroup_get failed"); goto err3; } if (strcmp(value, "10000\n")) { TSTERR("cgroup_set_bypath failed to set value >%s<", value); goto err3; } /* restore original value */ ret = cgroup_ops->set(cgroup_ops, "pids.max", value_save, c->name, c->config_path); if (ret < 0) { TSTERR("cgroup_set failed"); goto err3; } ret = 0; err3: free(cgrelpath); err2: lxc_container_put(c); err1: if (ret != 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd_log, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } } (void)unlink(template); return ret; } static int test_container(const char *lxcpath, const char *name, const char *template) { int ret; struct lxc_container *c = NULL; if (lxcpath) { ret = mkdir(lxcpath, 0755); if (ret < 0 && errno != EEXIST) { TSTERR("failed to mkdir %s %s", lxcpath, strerror(errno)); goto out1; } } ret = -1; if ((c = lxc_container_new(name, lxcpath)) == NULL) { TSTERR("instantiating container %s", name); goto out1; } if (c->is_defined(c)) { c->stop(c); c->destroy(c); lxc_container_put(c); c = lxc_container_new(name, lxcpath); } c->set_config_item(c, "lxc.net.0.type", "empty"); if (!c->createl(c, template, NULL, NULL, 0, NULL)) { TSTERR("creating container %s", name); goto out2; } c->load_config(c, NULL); c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { TSTERR("starting container %s", name); goto out3; } ret = test_running_container(lxcpath, name); c->stop(c); out3: c->destroy(c); out2: lxc_container_put(c); out1: return ret; } int main(int argc, char *argv[]) { int ret = EXIT_FAILURE; /* won't require privilege necessarily once users are classified by * pam_cgroup */ if (geteuid() != 0) { TSTERR("requires privilege"); exit(EXIT_SUCCESS); } #if TEST_ALREADY_RUNNING_CT /* * This is useful for running with valgrind to test for memory * leaks. The container should already be running, we can't start * the container ourselves because valgrind gets confused by lxc's * internal calls to clone. */ if (test_running_container(NULL, "bb01") < 0) goto out; printf("Running container cgroup tests...Passed\n"); #else if (test_container(NULL, MYNAME, "busybox") < 0) goto out; printf("Container creation tests...Passed\n"); if (test_container("/var/lib/lxctest2", MYNAME, "busybox") < 0) goto out; printf("Container creation with LXCPATH tests...Passed\n"); #endif ret = EXIT_SUCCESS; out: return ret; } lxc-4.0.12/src/tests/lxc-test-procsys0000755061062106075000000000275314176403775014464 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Motiejus Jakštys # # Ensure that when /proc and/or /sys do not exist in the container, # it is started successfully anyway. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -ex FAIL() { echo -n "Failed " >&2 echo "$*" >&2 lxc-destroy -n lxc-test-procsys -f exit 1 } lxc-destroy -n lxc-test-procsys -f || : lxc-create -t busybox -n lxc-test-procsys rmdir /var/lib/lxc/lxc-test-procsys/rootfs/{proc,sys} lxc-start -n lxc-test-procsys lxc-wait -n lxc-test-procsys -s RUNNING || FAIL "waiting for busybox container to run" lxc-attach -n lxc-test-procsys -- sh -c 'test -f /proc/version' || FAIL "/proc/version not found" lxc-attach -n lxc-test-procsys -- sh -c 'test -d /sys/fs' || FAIL "/sys/fs not found" lxc-destroy -n lxc-test-procsys -f exit 0 lxc-4.0.12/src/tests/fuzz-lxc-config-read.c0000644061062106075000000000137114176403775015370 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include "conf.h" #include "confile.h" #include "lxctest.h" #include "utils.h" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { int fd = -1; char tmpf[] = "/tmp/fuzz-lxc-config-read-XXXXXX"; struct lxc_conf *conf = NULL; /* * 100Kb should probably be enough to trigger all the issues * we're interested in without any timeouts */ if (size > 102400) return 0; fd = lxc_make_tmpfile(tmpf, false); lxc_test_assert_abort(fd >= 0); lxc_write_nointr(fd, data, size); close(fd); conf = lxc_conf_init(); lxc_test_assert_abort(conf); lxc_config_read(tmpf, conf, false); lxc_conf_free(conf); (void) unlink(tmpf); return 0; } lxc-4.0.12/src/tests/lxc-test-exit-code0000755061062106075000000000342214176403775014635 00000000000000#!/bin/sh # lxc: linux Container library # Authors: # Florian Margaine # # This is a test script for the lxc-attach and lxc-execute # programs. It tests whether the exit code is not 0 when a script # fails to execute. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -e FAIL() { echo -n "Failed " >&2 echo "$*" >&2 lxc-destroy -n busy -f exit 1 } # Create a container lxc-create -t busybox -n busy || FAIL "creating busybox container" # Run lxc-execute to make sure it fails when the command fails, and # succeed when the command succeeds. lxc-execute -n busy -- sh -c 'exit 1' && FAIL "should be failing" || true lxc-execute -n busy -- sh -c 'exit 0' || FAIL "should be succeeding" # Now, start the container and wait for it to be in running state. lxc-start -n busy -d || FAIL "starting busybox container" lxc-wait -n busy -s RUNNING || FAIL "waiting for busybox container to run" # And run the same tests on lxc-attach. lxc-attach -n busy -- sh -c 'exit 1' && FAIL "should be failing" || true lxc-attach -n busy -- sh -c 'exit 0' || FAIL "should be succeeding" lxc-destroy -n busy -f exit 0 lxc-4.0.12/src/tests/sys_mixed.c0000644061062106075000000000672614176403775013447 00000000000000/* liblxcapi * * Copyright © 2021 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "lxccontainer.h" #include "attach_options.h" #ifdef HAVE_STATVFS #include #endif #include "lxctest.h" #include "utils.h" static int is_read_only(const char *path) { #ifdef HAVE_STATVFS int ret; struct statvfs sb; ret = statvfs(path, &sb); if (ret < 0) return -errno; return (sb.f_flag & MS_RDONLY) > 0; #else return -EOPNOTSUPP; #endif } static int sys_mixed(void *payload) { int ret; ret = is_read_only("/sys"); if (ret == -EOPNOTSUPP) return 0; if (ret <= 0) return -1; if (is_read_only("/sys/devices/virtual/net")) return -1; return 0; } int main(int argc, char *argv[]) { int fret = EXIT_FAILURE; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; int ret; pid_t pid; struct lxc_container *c; c = lxc_container_new("sys-mixed", NULL); if (!c) { lxc_error("%s", "Failed to create container \"sys-mixed\""); exit(fret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"sys-mixed\" is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"sys-mixed\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"sys-mixed\" is not defined"); goto on_error_put; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"sys-mixed\""); goto on_error_stop; } if (!c->set_config_item(c, "lxc.mount.auto", "sys:mixed")) { lxc_error("%s\n", "Failed to set config item \"lxc.mount.auto=sys:mixed\""); goto on_error_put; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"sys-mixed\" daemonized"); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"sys-mixed\" daemonized"); goto on_error_stop; } /* Leave some time for the container to write something to the log. */ sleep(2); ret = c->attach(c, sys_mixed, NULL, &attach_options, &pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container \"sys-mixed\""); goto on_error_stop; } ret = wait_for_pid(pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container \"sys-mixed\""); goto on_error_stop; } fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"sys-mixed\""); if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"sys-mixed\""); on_error_put: lxc_container_put(c); exit(fret); } lxc-4.0.12/src/tests/startone.c0000644061062106075000000001432014176403775013267 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #define MYNAME "lxctest1" static int destroy_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } static int create_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 0; const char *s; bool b; char buf[201]; int len; ret = 1; /* test a real container */ c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%d: error creating lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } ret = create_container(); if (ret) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } b = c->is_defined(c); if (!b) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } len = c->get_cgroup_item(c, "cpuset.cpus", buf, 200); if (len >= 0) { fprintf(stderr, "%d: %s not running but had cgroup settings\n", __LINE__, MYNAME); goto out; } sprintf(buf, "0"); b = c->set_cgroup_item(c, "cpuset.cpus", buf); if (b) { fprintf(stderr, "%d: %s not running but could set cgroup settings\n", __LINE__, MYNAME); goto out; } s = c->state(c); if (!s || strcmp(s, "STOPPED")) { fprintf(stderr, "%d: %s is in state %s, not in STOPPED.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } b = c->load_config(c, NULL); if (!b) { fprintf(stderr, "%d: %s failed to read its config\n", __LINE__, c->name); goto out; } if (!c->set_config_item(c, "lxc.uts.name", "bobo")) { fprintf(stderr, "%d: failed setting lxc.uts.name\n", __LINE__); goto out; } if (!lxc_container_get(c)) { fprintf(stderr, "%d: failed to get extra ref to container\n", __LINE__); exit(EXIT_FAILURE); } c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { fprintf(stderr, "%d: %s failed to start\n", __LINE__, c->name); exit(EXIT_FAILURE); } sleep(3); s = c->state(c); if (!s || strcmp(s, "RUNNING")) { fprintf(stderr, "%d: %s is in state %s, not in RUNNING.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } len = c->get_cgroup_item(c, "cpuset.cpus", buf, 0); if (len <= 0) { fprintf(stderr, "%d: not able to get length of cpuset.cpus (ret %d)\n", __LINE__, len); goto out; } len = c->get_cgroup_item(c, "cpuset.cpus", buf, 200); if (len <= 0 || strncmp(buf, "0", 1)) { fprintf(stderr, "%d: not able to get cpuset.cpus (len %d buf %s)\n", __LINE__, len, buf); goto out; } sprintf(buf, "FROZEN"); b = c->set_cgroup_item(c, "freezer.state", buf); if (!b) { fprintf(stderr, "%d: not able to set freezer.state.\n", __LINE__); goto out; } sprintf(buf, "XXX"); len = c->get_cgroup_item(c, "freezer.state", buf, 200); if (len <= 0 || (strcmp(buf, "FREEZING\n") && strcmp(buf, "FROZEN\n"))) { fprintf(stderr, "%d: not able to get freezer.state (len %d buf %s)\n", __LINE__, len, buf); goto out; } c->set_cgroup_item(c, "freezer.state", "THAWED"); c->stop(c); /* feh - multilib has moved the lxc-init crap */ #if 0 goto ok; ret = system("mkdir -p " LXCPATH "/lxctest1/rootfs//usr/local/libexec/lxc"); if (!ret) ret = system("mkdir -p " LXCPATH "/lxctest1/rootfs/usr/lib/lxc/"); if (!ret) ret = system("cp src/lxc/lxc-init " LXCPATH "/lxctest1/rootfs//usr/local/libexec/lxc"); if (!ret) ret = system("cp src/lxc/liblxc.so " LXCPATH "/lxctest1/rootfs/usr/lib/lxc"); if (!ret) ret = system("cp src/lxc/liblxc.so " LXCPATH "/lxctest1/rootfs/usr/lib/lxc/liblxc.so.0"); if (!ret) ret = system("cp src/lxc/liblxc.so " LXCPATH "/lxctest1/rootfs/usr/lib"); if (!ret) ret = system("mkdir -p " LXCPATH "/lxctest1/rootfs/dev/shm"); if (!ret) ret = system("chroot " LXCPATH "/lxctest1/rootfs apt-get install --no-install-recommends lxc"); if (ret) { fprintf(stderr, "%d: failed to installing lxc-init in container\n", __LINE__); goto out; } // next write out the config file; does it match? if (!c->startl(c, 1, "/bin/hostname", NULL)) { fprintf(stderr, "%d: failed to lxc-execute /bin/hostname\n", __LINE__); goto out; } // auto-check result? ('bobo' is printed on stdout) ok: #endif fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: if (c) { c->stop(c); destroy_container(); } lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/console_log.c0000644061062106075000000001216714176403775013742 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "lxctest.h" #include "utils.h" int main(int argc, char *argv[]) { int ret; struct stat st_log_file; struct lxc_container *c; struct lxc_console_log log; bool do_unlink = false; int fret = EXIT_FAILURE; c = lxc_container_new("console-log", NULL); if (!c) { lxc_error("%s", "Failed to create container \"console-log\""); exit(fret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"console-log\" is defined"); goto on_error_put; } /* Set console ringbuffer size. */ if (!c->set_config_item(c, "lxc.console.buffer.size", "4096")) { lxc_error("%s\n", "Failed to set config item \"lxc.console.buffer.size\""); goto on_error_put; } /* Set console log file. */ if (!c->set_config_item(c, "lxc.console.logfile", "/tmp/console-log.log")) { lxc_error("%s\n", "Failed to set config item \"lxc.console.logfile\""); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"console-log\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"console-log\" is not defined"); goto on_error_put; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"console-log\""); goto on_error_stop; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"console-log\" daemonized"); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"console-log\" daemonized"); goto on_error_stop; } /* Leave some time for the container to write something to the log. */ sleep(2); /* Retrieve the contents of the ringbuffer. */ log.clear = false; log.read_max = &(uint64_t){0}; log.read = true; ret = c->console_log(c, &log); if (ret < 0) { lxc_error("%s - Failed to retrieve console log \n", strerror(-ret)); goto on_error_stop; } else { lxc_debug("Retrieved %" PRIu64 " bytes from console log. Contents are \"%s\"\n", *log.read_max, log.data); free(log.data); } /* Leave another two seconds to ensure boot is finished. */ sleep(2); /* Clear the console ringbuffer. */ log.read_max = &(uint64_t){0}; log.read = false; log.clear = true; ret = c->console_log(c, &log); if (ret < 0) { if (ret != -ENODATA) { lxc_error("%s - Failed to retrieve console log\n", strerror(-ret)); goto on_error_stop; } } if (!c->stop(c)) { lxc_error("%s\n", "Failed to stop container \"console-log\""); goto on_error_stop; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"console-log\""); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"console-log\" daemonized"); goto on_error_destroy; } /* Leave some time for the container to write something to the log. */ sleep(2); ret = stat("/tmp/console-log.log", &st_log_file); if (ret < 0) { lxc_error("%s - Failed to stat on-disk logfile\n", strerror(errno)); goto on_error_stop; } /* Turn on rotation for the console log file. */ if (!c->set_config_item(c, "lxc.console.rotate", "1")) { lxc_error("%s\n", "Failed to set config item \"lxc.console.rotate\""); goto on_error_put; } if (!c->stop(c)) { lxc_error("%s\n", "Failed to stop container \"console-log\""); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"console-log\" daemonized"); goto on_error_destroy; } /* Leave some time for the container to write something to the log. */ sleep(2); fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"console-log\""); on_error_destroy: if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"console-log\""); on_error_put: lxc_container_put(c); if (do_unlink) { ret = unlink("/tmp/console-log.log"); if (ret < 0) lxc_error("%s - Failed to remove container log file\n", strerror(errno)); ret = unlink("/tmp/console-log.log.1"); if (ret < 0) lxc_error("%s - Failed to remove container log file\n", strerror(errno)); } exit(fret); } lxc-4.0.12/src/tests/share_ns.c0000644061062106075000000002253414176403775013240 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "lxc/lxccontainer.h" #include "lxctest.h" #include "../lxc/compiler.h" #define TEST_DEFAULT_BUF_SIZE 256 struct thread_args { int thread_id; bool success; pid_t init_pid; char inherited_ipc_ns[TEST_DEFAULT_BUF_SIZE]; char inherited_net_ns[TEST_DEFAULT_BUF_SIZE]; }; __noreturn static void *ns_sharing_wrapper(void *data) { int init_pid; ssize_t ret; char name[100]; char owning_ns_init_pid[100]; char proc_ns_path[TEST_DEFAULT_BUF_SIZE]; char ns_buf[TEST_DEFAULT_BUF_SIZE]; struct lxc_container *c; struct thread_args *args = data; lxc_debug("Starting namespace sharing thread %d\n", args->thread_id); sprintf(name, "share-ns-%d", args->thread_id); c = lxc_container_new(name, NULL); if (!c) { lxc_error("Failed to create container \"%s\"\n", name); goto out_pthread_exit; } if (c->is_defined(c)) { lxc_error("Container \"%s\" is defined\n", name); goto out; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("Failed to create busybox container \"%s\"\n", name); goto out; } if (!c->is_defined(c)) { lxc_error("Container \"%s\" is not defined\n", name); goto out; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("Failed to load config for container \"%s\"\n", name); goto out; } /* share ipc namespace by container name */ if (!c->set_config_item(c, "lxc.namespace.share.ipc", "owning-ns")) { lxc_error("Failed to set \"lxc.namespace.share.ipc=owning-ns\" for container \"%s\"\n", name); goto out; } /* clear all network configuration */ if (!c->set_config_item(c, "lxc.net", "")) { lxc_error("Failed to set \"lxc.namespace.share.ipc=owning-ns\" for container \"%s\"\n", name); goto out; } if (!c->set_config_item(c, "lxc.net.0.type", "empty")) { lxc_error("Failed to set \"lxc.net.0.type=empty\" for container \"%s\"\n", name); goto out; } sprintf(owning_ns_init_pid, "%d", args->init_pid); /* share net namespace by pid */ if (!c->set_config_item(c, "lxc.namespace.share.net", owning_ns_init_pid)) { lxc_error("Failed to set \"lxc.namespace.share.net=%s\" for container \"%s\"\n", owning_ns_init_pid, name); goto out; } if (!c->want_daemonize(c, true)) { lxc_error("Failed to mark container \"%s\" daemonized\n", name); goto out; } if (!c->startl(c, 0, NULL)) { lxc_error("Failed to start container \"%s\" daemonized\n", name); goto out; } init_pid = c->init_pid(c); if (init_pid < 0) { lxc_error("Failed to retrieve init pid of container \"%s\"\n", name); goto out; } /* Check whether we correctly inherited the ipc namespace. */ ret = snprintf(proc_ns_path, sizeof(proc_ns_path), "/proc/%d/ns/ipc", init_pid); if (ret < 0 || (size_t)ret >= sizeof(proc_ns_path)) { lxc_error("Failed to create string for container \"%s\"\n", name); goto out; } ret = readlink(proc_ns_path, ns_buf, sizeof(ns_buf)); if (ret < 0 || (size_t)ret >= sizeof(ns_buf)) { lxc_error("Failed to retrieve ipc namespace for container \"%s\"\n", name); goto out; } ns_buf[ret] = '\0'; if (strcmp(args->inherited_ipc_ns, ns_buf) != 0) { lxc_error("Failed to inherit ipc namespace from container \"owning-ns\": %s != %s\n", args->inherited_ipc_ns, ns_buf); goto out; } lxc_debug("Inherited ipc namespace from container \"owning-ns\": %s == %s\n", args->inherited_ipc_ns, ns_buf); /* Check whether we correctly inherited the net namespace. */ ret = snprintf(proc_ns_path, sizeof(proc_ns_path), "/proc/%d/ns/net", init_pid); if (ret < 0 || (size_t)ret >= sizeof(proc_ns_path)) { lxc_error("Failed to create string for container \"%s\"\n", name); goto out; } ret = readlink(proc_ns_path, ns_buf, sizeof(ns_buf)); if (ret < 0 || (size_t)ret >= sizeof(ns_buf)) { lxc_error("Failed to retrieve ipc namespace for container \"%s\"\n", name); goto out; } ns_buf[ret] = '\0'; if (strcmp(args->inherited_net_ns, ns_buf) != 0) { lxc_error("Failed to inherit net namespace from container \"owning-ns\": %s != %s\n", args->inherited_net_ns, ns_buf); goto out; } lxc_debug("Inherited net namespace from container \"owning-ns\": %s == %s\n", args->inherited_net_ns, ns_buf); args->success = true; out: if (c->is_running(c) && !c->stop(c)) lxc_error("Failed to stop container \"%s\"\n", name); if (!c->destroy(c)) lxc_error("Failed to destroy container \"%s\"\n", name); lxc_container_put(c); out_pthread_exit: pthread_exit(NULL); } int main(int argc, char *argv[]) { struct thread_args *args = NULL; pthread_t *threads = NULL; size_t nthreads = 10; int i, init_pid, j; char proc_ns_path[TEST_DEFAULT_BUF_SIZE]; char ipc_ns_buf[TEST_DEFAULT_BUF_SIZE]; char net_ns_buf[TEST_DEFAULT_BUF_SIZE]; pthread_attr_t attr; struct lxc_container *c; int ret = EXIT_FAILURE; pthread_attr_init(&attr); c = lxc_container_new("owning-ns", NULL); if (!c) { lxc_error("%s", "Failed to create container \"owning-ns\""); exit(ret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"owning-ns\" is defined"); goto on_error_stop; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"owning-ns\""); goto on_error_stop; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"owning-ns\" is not defined"); goto on_error_stop; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"owning-ns\""); goto on_error_stop; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"owning-ns\" daemonized"); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"owning-ns\" daemonized"); goto on_error_stop; } init_pid = c->init_pid(c); if (init_pid < 0) { lxc_error("%s\n", "Failed to retrieve init pid of container \"owning-ns\""); goto on_error_stop; } /* record our ipc namespace */ ret = snprintf(proc_ns_path, sizeof(proc_ns_path), "/proc/%d/ns/ipc", init_pid); if (ret < 0 || (size_t)ret >= sizeof(proc_ns_path)) { lxc_error("%s\n", "Failed to create string for container \"owning-ns\""); goto on_error_stop; } ret = readlink(proc_ns_path, ipc_ns_buf, sizeof(ipc_ns_buf)); if (ret < 0 || (size_t)ret >= sizeof(ipc_ns_buf)) { lxc_error("%s\n", "Failed to retrieve ipc namespace for container \"owning-ns\""); goto on_error_stop; } ipc_ns_buf[ret] = '\0'; /* record our net namespace */ ret = snprintf(proc_ns_path, sizeof(proc_ns_path), "/proc/%d/ns/net", init_pid); if (ret < 0 || (size_t)ret >= sizeof(proc_ns_path)) { lxc_error("%s\n", "Failed to create string for container \"owning-ns\""); goto on_error_stop; } ret = readlink(proc_ns_path, net_ns_buf, sizeof(net_ns_buf)); if (ret < 0 || (size_t)ret >= sizeof(net_ns_buf)) { lxc_error("%s\n", "Failed to retrieve ipc namespace for container \"owning-ns\""); goto on_error_stop; } net_ns_buf[ret] = '\0'; sleep(5); args = malloc(sizeof(struct thread_args) * nthreads); if (!args) { lxc_error("%s\n", "Failed to allocate memory"); goto on_error_stop; } threads = malloc(sizeof(pthread_t) * nthreads); if (!threads) { lxc_error("%s\n", "Failed to allocate memory"); goto on_error_stop; } for (j = 0; j < 10; j++) { bool had_error = false; lxc_debug("Starting namespace sharing test iteration %d\n", j); for (i = 0; i < nthreads; i++) { memset(&args[i], 0, sizeof(struct thread_args)); memset(&threads[i], 0, sizeof(pthread_t)); args[i].thread_id = i; args[i].success = false; args[i].init_pid = init_pid; snprintf(args[i].inherited_ipc_ns, sizeof(args[i].inherited_ipc_ns), "%s", ipc_ns_buf); snprintf(args[i].inherited_net_ns, sizeof(args[i].inherited_net_ns), "%s", net_ns_buf); ret = pthread_create(&threads[i], &attr, ns_sharing_wrapper, (void *)&args[i]); if (ret != 0) goto on_error_stop; } for (i = 0; i < nthreads; i++) { ret = pthread_join(threads[i], NULL); if (ret != 0) goto on_error_stop; if (!args[i].success) { lxc_error("ns sharing thread %d failed\n", args[i].thread_id); had_error = true; } } if (had_error) goto on_error_stop; } ret = EXIT_SUCCESS; on_error_stop: free(args); free(threads); pthread_attr_destroy(&attr); if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"owning-ns\""); if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"owning-ns\""); lxc_container_put(c); if (ret == EXIT_SUCCESS) lxc_debug("%s\n", "All state namespace sharing tests passed"); exit(ret); } lxc-4.0.12/src/tests/rootfs_options.c0000644061062106075000000000716114176403775014524 00000000000000/* liblxcapi * * Copyright © 2021 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "lxccontainer.h" #include "attach_options.h" #ifdef HAVE_STATVFS #include #endif #include "lxctest.h" #include "utils.h" static int has_mount_properties(const char *path, unsigned int flags) { #ifdef HAVE_STATVFS int ret; struct statvfs sb; ret = statvfs(path, &sb); if (ret < 0) return -errno; if ((sb.f_flag & flags) == flags) return 0; return -EINVAL; #else return -EOPNOTSUPP; #endif } static int rootfs_options(void *payload) { int ret; ret = has_mount_properties("/", MS_NODEV | MS_NOSUID | MS_RDONLY); if (ret != 0) { if (ret == -EOPNOTSUPP) return EXIT_SUCCESS; return EXIT_FAILURE; } return EXIT_SUCCESS; } int main(int argc, char *argv[]) { int fret = EXIT_FAILURE; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; int ret; pid_t pid; struct lxc_container *c; c = lxc_container_new("rootfs-options", NULL); if (!c) { lxc_error("%s", "Failed to create container \"rootfs-options\""); exit(fret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"rootfs-options\" is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"rootfs-options\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"rootfs-options\" is not defined"); goto on_error_put; } c->clear_config(c); if (!c->set_config_item(c, "lxc.rootfs.options", "nodev,nosuid,ro")) { lxc_error("%s\n", "Failed to set config item \"lxc.mount.auto=sys:mixed\""); goto on_error_put; } if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"rootfs-options\""); goto on_error_stop; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"rootfs-options\" daemonized"); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"rootfs-options\" daemonized"); goto on_error_stop; } /* Leave some time for the container to write something to the log. */ sleep(2); ret = c->attach(c, rootfs_options, NULL, &attach_options, &pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container \"rootfs-options\""); goto on_error_stop; } ret = wait_for_pid(pid); if (ret < 0) { lxc_error("%s\n", "Function \"rootfs-options\" failed"); goto on_error_stop; } fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"rootfs-options\""); if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"rootfs-options\""); on_error_put: lxc_container_put(c); exit(fret); } lxc-4.0.12/src/tests/criu_check_feature.c0000644061062106075000000000601614176403775015245 00000000000000/* liblxcapi * * Copyright © 2017 Adrian Reber * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include "lxc/lxccontainer.h" #include "lxctest.h" int main(int argc, char *argv[]) { struct lxc_container *c; struct migrate_opts m_opts; int ret = EXIT_FAILURE; /* Test the feature check interface, * we actually do not need a container. */ c = lxc_container_new("check_feature", NULL); if (!c) { lxc_error("%s", "Failed to create container \"check_feature\""); exit(ret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"check_feature\" is defined"); goto on_error_put; } /* check the migrate API call with wrong 'cmd' */ if (!c->migrate(c, UINT_MAX, &m_opts, sizeof(struct migrate_opts))) { /* This should failed */ lxc_error("%s\n", "Migrate API calls with command UINT_MAX did not fail"); goto on_error_put; } /* do the actual feature check for memory tracking */ m_opts.features_to_check = FEATURE_MEM_TRACK; if (c->migrate(c, MIGRATE_FEATURE_CHECK, &m_opts, sizeof(struct migrate_opts))) { lxc_debug("%s\n", "System does not support \"FEATURE_MEM_TRACK\"."); } /* check for lazy pages */ m_opts.features_to_check = FEATURE_LAZY_PAGES; if (c->migrate(c, MIGRATE_FEATURE_CHECK, &m_opts, sizeof(struct migrate_opts))) { lxc_debug("%s\n", "System does not support \"FEATURE_LAZY_PAGES\"."); } /* check for lazy pages and memory tracking */ m_opts.features_to_check = FEATURE_LAZY_PAGES | FEATURE_MEM_TRACK; if (c->migrate(c, MIGRATE_FEATURE_CHECK, &m_opts, sizeof(struct migrate_opts))) { if (m_opts.features_to_check == FEATURE_LAZY_PAGES) lxc_debug("%s\n", "System does not support \"FEATURE_MEM_TRACK\""); else if (m_opts.features_to_check == FEATURE_MEM_TRACK) lxc_debug("%s\n", "System does not support \"FEATURE_LAZY_PAGES\""); else lxc_debug("%s\n", "System does not support \"FEATURE_MEM_TRACK\" " "and \"FEATURE_LAZY_PAGES\""); } /* test for unknown feature; once there are 64 features to test * this will be valid... */ m_opts.features_to_check = -1ULL; if (!c->migrate(c, MIGRATE_FEATURE_CHECK, &m_opts, sizeof(struct migrate_opts))) { lxc_error("%s\n", "Unsupported feature supported, which is strange."); goto on_error_put; } ret = EXIT_SUCCESS; on_error_put: lxc_container_put(c); if (ret == EXIT_SUCCESS) lxc_debug("%s\n", "All criu feature check tests passed"); exit(ret); } lxc-4.0.12/src/tests/lxc-test-checkpoint-restore0000755061062106075000000000226114176403775016564 00000000000000#!/bin/sh # Do an end to end checkpoint and restore with criu. set -e FAIL() { echo -n "Failed " >&2 echo "$*" >&2 exit 1 } if [ "$(id -u)" != "0" ]; then echo "ERROR: Must run as root." exit 1 fi verlte() { ! [ "$1" = "$(printf "$1\n$2" | sort -V | tail -n1)" ] } criu_version="$(criu --version | head -n1 | cut -d' ' -f 2)" if verlte "$criu_version" "1.3.1"; then echo "SKIP: skipping test because no (or wrong) criu installed." exit 0 fi name=lxc-test-criu lxc-create -t busybox -n $name || FAIL "creating container" cat >> "$(lxc-config lxc.lxcpath)/$name/config" <&2 echo "$*" >&2 exit 1 } run_cmd() { sudo -i -u $TUSER \ env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \ XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) ASAN_OPTIONS=${ASAN_OPTIONS:-} \ UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $* } DONE=0 MOUNTSR=/sys/kernel/security/apparmor/features/mount dnam=$(mktemp -d) logfile=$(mktemp) cname=$(basename $dnam) cleanup() { run_cmd lxc-destroy -f -n $cname || true umount -l $MOUNTSR || true rmdir $dnam || true pkill -u $(id -u $TUSER) -9 || true sed -i '/lxcunpriv/d' /run/lxc/nics /etc/lxc/lxc-usernet sed -i '/^lxcunpriv:/d' /etc/subuid /etc/subgid rm -Rf $HDIR /run/user/$(id -u $TUSER) deluser $TUSER if [ $DONE -eq 0 ]; then echo 'Failed container log:' >&2 cat "$logfile" >&2 echo 'End log' >&2 rm -f "$logfile" echo "FAIL" exit 1 fi rm -f "$logfile" echo "PASS" } clear_log() { truncate -s0 "$logfile" } trap cleanup exit chmod 0666 "$logfile" # This would be much simpler if we could run it as # root. However, in order to not have the bind mount # of an empty directory over the securityfs 'mount' directory # be removed, we need to do this as non-root. command -v newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } # create a test user TUSER=lxcunpriv HDIR=/home/$TUSER deluser $TUSER && rm -Rf $HDIR || true useradd $TUSER mkdir -p $HDIR echo "$TUSER veth lxcbr0 2" >> /etc/lxc/lxc-usernet sed -i '/^lxcunpriv:/d' /etc/subuid /etc/subgid usermod -v 910000-919999 -w 910000-919999 $TUSER mkdir -p $HDIR/.config/lxc/ cat > $HDIR/.config/lxc/default.conf << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 lxc.idmap = u 0 910000 9999 lxc.idmap = g 0 910000 9999 EOF chown -R $TUSER: $HDIR mkdir -p /run/user/$(id -u $TUSER) chown -R $TUSER: /run/user/$(id -u $TUSER) cd $HDIR if command -v cgm >/dev/null 2>&1; then cgm create all $TUSER cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER) cgm movepid all $TUSER $$ elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:$TUSER >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Chown \ string:$d string:$TUSER int32:$(id -u $TUSER) int32:$(id -g $TUSER) >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.MovePid \ string:$d string:$TUSER int32:$$ >/dev/null done else for d in /sys/fs/cgroup/*; do [ "$d" = "/sys/fs/cgroup/unified" ] && continue [ -f $d/cgroup.clone_children ] && echo 1 > $d/cgroup.clone_children [ ! -d $d/lxctest ] && mkdir $d/lxctest chown -R $TUSER: $d/lxctest echo $$ > $d/lxctest/tasks done fi run_cmd lxc-create -t busybox -n $cname echo "test default confined container" run_cmd lxc-start -n $cname -d -lDEBUG -o "$logfile" run_cmd lxc-wait -n $cname -s RUNNING pid=$(run_cmd lxc-info -p -H -n $cname) profile=$(cat /proc/$pid/attr/current) if [ "x$profile" != "x${default_profile}" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi run_cmd lxc-stop -n $cname -k clear_log echo "test regular unconfined container" echo "lxc.apparmor.profile = unconfined" >> $HDIR/.local/share/lxc/$cname/config run_cmd lxc-start -n $cname -d -lDEBUG -o "$logfile" run_cmd lxc-wait -n $cname -s RUNNING pid=$(run_cmd lxc-info -p -H -n $cname) profile=$(cat /proc/$pid/attr/current) if [ "x$profile" != "xunconfined" ]; then echo "FAIL: unconfined container was in profile $profile" exit 1 fi run_cmd lxc-stop -n $cname -k clear_log echo "masking $MOUNTSR" mount --bind $dnam $MOUNTSR echo "test default confined container" sed -i '/apparmor.profile/d' $HDIR/.local/share/lxc/$cname/config run_cmd lxc-start -n $cname -d || true sleep 3 pid=$(run_cmd lxc-info -p -H -n $cname) || true if [ -n "$pid" -a "$pid" != "-1" ]; then echo "FAIL: confined container started without mount restrictions" echo "pid was $pid" exit 1 fi echo "test regular unconfined container" echo "lxc.apparmor.profile = unconfined" >> $HDIR/.local/share/lxc/$cname/config run_cmd lxc-start -n $cname -d -lDEBUG -o "$logfile" run_cmd lxc-wait -n $cname -s RUNNING pid=$(run_cmd lxc-info -p -H -n $cname) if [ "$pid" = "-1" ]; then echo "FAIL: unconfined container failed to start without mount restrictions" exit 1 fi profile=$(cat /proc/$pid/attr/current) if [ "x$profile" != "xunconfined" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi run_cmd lxc-stop -n $cname -k clear_log echo "testing override" sed -i '/apparmor.profile/d' $HDIR/.local/share/lxc/$cname/config echo "lxc.apparmor.allow_incomplete = 1" >> $HDIR/.local/share/lxc/$cname/config run_cmd lxc-start -n $cname -d -lDEBUG -o "$logfile" run_cmd lxc-wait -n $cname -s RUNNING pid=$(run_cmd lxc-info -p -H -n $cname) if [ "$pid" = "-1" ]; then echo "FAIL: excepted container failed to start without mount restrictions" exit 1 fi profile=$(cat /proc/$pid/attr/current) if [ "x$profile" != "x${default_profile}" ]; then echo "FAIL: confined container was in profile $profile" exit 1 fi run_cmd lxc-stop -n $cname -k clear_log DONE=1 lxc-4.0.12/src/tests/device_add_remove.c0000644061062106075000000000541514176403775015061 00000000000000/* DEVICE_add_remove.c * * Copyright © 2014 S.Çağlar Onur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include "lxctest.h" #include "memory_utils.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define NAME "device_add_remove_test" #define DEVICE "/dev/loop-control" int main(int argc, char *argv[]) { __do_close int fd_log = -EBADF; int ret = 1; struct lxc_log log = {}; struct lxc_container *c = NULL; char template[sizeof(P_tmpdir"/attach_XXXXXX")]; (void)strlcpy(template, P_tmpdir"/attach_XXXXXX", sizeof(template)); fd_log = lxc_make_tmpfile(template, false); if (fd_log < 0) { lxc_error("Failed to create temporary log file for container %s\n", NAME); exit(EXIT_FAILURE); } log.name = NAME; log.file = template; log.level = "TRACE"; log.prefix = "device_add_remove"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) goto out; c = lxc_container_new(NAME, NULL); if (!c) { fprintf(stderr, "Unable to instantiate container (%s)...\n", NAME); goto out; } if (!c->create(c, "busybox", NULL, NULL, 1, NULL)) { fprintf(stderr, "Creating the container (%s) failed...\n", NAME); goto out; } c->want_daemonize(c, true); if (!c->start(c, false, NULL)) { fprintf(stderr, "Starting the container (%s) failed...\n", NAME); goto out; } if (!c->add_device_node(c, DEVICE, DEVICE)) { fprintf(stderr, "Adding %s to the container (%s) failed...\n", DEVICE, NAME); goto out; } if (!c->remove_device_node(c, DEVICE, DEVICE)) { fprintf(stderr, "Removing %s from the container (%s) failed...\n", DEVICE, NAME); goto out; } if (!c->stop(c)) { fprintf(stderr, "Stopping the container (%s) failed...\n", NAME); goto out; } if (!c->destroy(c)) { fprintf(stderr, "Destroying the container (%s) failed...\n", NAME); goto out; } ret = 0; out: if (ret != 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd_log, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } } (void)unlink(template); if (c) lxc_container_put(c); return ret; } lxc-4.0.12/src/tests/reboot.c0000644061062106075000000000656014176403775012731 00000000000000/* * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "lxc/namespace.h" #include #include #include int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...); static int do_reboot(void *arg) { int *cmd = arg; if (reboot(*cmd)) printf("failed to reboot(%d): %s\n", *cmd, strerror(errno)); return 0; } static int test_reboot(int cmd, int sig) { long stack_size = 4096; void *stack = alloca(stack_size) + stack_size; int status; pid_t ret; ret = clone(do_reboot, stack, CLONE_NEWPID | SIGCHLD, &cmd); if (ret < 0) { printf("failed to clone: %s\n", strerror(errno)); return -1; } if (wait(&status) < 0) { printf("unexpected wait error: %s\n", strerror(errno)); return -1; } if (!WIFSIGNALED(status)) { if (sig != -1) printf("child process exited but was not signaled\n"); return -1; } if (WTERMSIG(status) != sig) { printf("signal termination is not the one expected\n"); return -1; } return 0; } static int have_reboot_patch(void) { FILE *f = fopen("/proc/sys/kernel/ctrl-alt-del", "r"); int ret; int v; if (!f) return 0; ret = fscanf(f, "%d", &v); fclose(f); if (ret != 1) return 0; ret = reboot(v ? LINUX_REBOOT_CMD_CAD_ON : LINUX_REBOOT_CMD_CAD_OFF); if (ret != -1) return 0; return 1; } int main(int argc, char *argv[]) { int status; if (getuid() != 0) { printf("Must run as root.\n"); return 1; } status = have_reboot_patch(); if (status != 0) { printf("Your kernel does not have the container reboot patch\n"); return 1; } status = test_reboot(LINUX_REBOOT_CMD_CAD_ON, -1); if (status >= 0) { printf("reboot(LINUX_REBOOT_CMD_CAD_ON) should have failed\n"); return 1; } printf("reboot(LINUX_REBOOT_CMD_CAD_ON) has failed as expected\n"); status = test_reboot(LINUX_REBOOT_CMD_RESTART, SIGHUP); if (status < 0) return 1; printf("reboot(LINUX_REBOOT_CMD_RESTART) succeed\n"); status = test_reboot(LINUX_REBOOT_CMD_RESTART2, SIGHUP); if (status < 0) return 1; printf("reboot(LINUX_REBOOT_CMD_RESTART2) succeed\n"); status = test_reboot(LINUX_REBOOT_CMD_HALT, SIGINT); if (status < 0) return 1; printf("reboot(LINUX_REBOOT_CMD_HALT) succeed\n"); status = test_reboot(LINUX_REBOOT_CMD_POWER_OFF, SIGINT); if (status < 0) return 1; printf("reboot(LINUX_REBOOT_CMD_POWERR_OFF) succeed\n"); printf("All tests passed\n"); return 0; } lxc-4.0.12/src/tests/parse_config_file.c0000644061062106075000000006420714176403775015077 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * Copyright © 2017 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "conf.h" #include "confile_utils.h" #include "lxc/state.h" #include "lxctest.h" #include "utils.h" static int set_get_compare_clear_save_load(struct lxc_container *c, const char *key, const char *value, const char *config_file, bool compare) { char retval[4096] = {0}; int ret; if (!c->set_config_item(c, key, value)) { lxc_error("failed to set config item \"%s\" to \"%s\"\n", key, value); return -1; } ret = c->get_config_item(c, key, retval, sizeof(retval)); if (ret < 0) { lxc_error("failed to get config item \"%s\"\n", key); return -1; } if (compare) { ret = strcmp(retval, value); if (ret != 0) { lxc_error( "expected value \"%s\" and retrieved value \"%s\" " "for config key \"%s\" do not match\n", value, retval, key); return -1; } } if (config_file) { if (!c->save_config(c, config_file)) { lxc_error("%s\n", "failed to save config file"); return -1; } c->clear_config(c); c->lxc_conf = NULL; if (!c->load_config(c, config_file)) { lxc_error("%s\n", "failed to load config file"); return -1; } } if (!c->clear_config_item(c, key)) { lxc_error("failed to clear config item \"%s\"\n", key); return -1; } c->clear_config(c); c->lxc_conf = NULL; return 0; } static int set_and_clear_complete_netdev(struct lxc_container *c) { if (!c->set_config_item(c, "lxc.net.1.type", "veth")) { lxc_error("%s\n", "lxc.net.1.type"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv4.address", "10.0.2.3/24")) { lxc_error("%s\n", "lxc.net.1.ipv4.address"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv4.gateway", "10.0.2.2")) { lxc_error("%s\n", "lxc.net.1.ipv4.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv4.gateway", "auto")) { lxc_error("%s\n", "lxc.net.1.ipv4.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv4.gateway", "dev")) { lxc_error("%s\n", "lxc.net.1.ipv4.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv6.address", "2003:db8:1:0:214:1234:fe0b:3596/64")) { lxc_error("%s\n", "lxc.net.1.ipv6.address"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv6.gateway", "2003:db8:1:0::1")) { lxc_error("%s\n", "lxc.net.1.ipv6.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv6.gateway", "auto")) { lxc_error("%s\n", "lxc.net.1.ipv6.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.ipv6.gateway", "dev")) { lxc_error("%s\n", "lxc.net.1.ipv6.gateway"); return -1; } if (!c->set_config_item(c, "lxc.net.1.flags", "up")) { lxc_error("%s\n", "lxc.net.1.flags"); return -1; } if (!c->set_config_item(c, "lxc.net.1.link", "br0")) { lxc_error("%s\n", "lxc.net.1.link"); return -1; } if (!c->set_config_item(c, "lxc.net.1.veth.pair", "bla")) { lxc_error("%s\n", "lxc.net.1.veth.pair"); return -1; } if (!c->set_config_item(c, "lxc.net.1.veth.ipv4.route", "192.0.2.1/32")) { lxc_error("%s\n", "lxc.net.1.veth.ipv4.route"); return -1; } if (!c->set_config_item(c, "lxc.net.1.veth.ipv6.route", "2001:db8::1/128")) { lxc_error("%s\n", "lxc.net.1.veth.ipv6.route"); return -1; } if (!c->set_config_item(c, "lxc.net.1.hwaddr", "52:54:00:80:7a:5d")) { lxc_error("%s\n", "lxc.net.1.hwaddr"); return -1; } if (!c->set_config_item(c, "lxc.net.1.mtu", "2000")) { lxc_error("%s\n", "lxc.net.1.mtu"); return -1; } if (!c->clear_config_item(c, "lxc.net.1")) { lxc_error("%s", "failed to clear \"lxc.net.1\"\n"); return -1; } c->clear_config(c); c->lxc_conf = NULL; return 0; } static int set_invalid_netdev(struct lxc_container *c) { if (c->set_config_item(c, "lxc.net.0.asdf", "veth")) { lxc_error("%s\n", "lxc.net.0.asdf should be invalid"); return -1; } if (c->set_config_item(c, "lxc.net.2147483647.type", "veth")) { lxc_error("%s\n", "lxc.net.2147483647.type should be invalid"); return -1; } if (c->set_config_item(c, "lxc.net.0.", "veth")) { lxc_error("%s\n", "lxc.net.0. should be invalid"); return -1; } c->clear_config(c); c->lxc_conf = NULL; return 0; } int test_idmap_parser(void) { size_t i; struct idmap_check { bool is_valid; const char *idmap; }; static struct idmap_check idmaps[] = { /* valid idmaps */ { true, "u 0 0 1" }, { true, "g 0 0 1" }, { true, "u 1 100001 999999999" }, { true, "g 1 100001 999999999" }, { true, "u 0 0 0" }, { true, "g 0 0 0" }, { true, "u 1000 165536 65536" }, { true, "g 999 999 1" }, { true, "u 0 5000 100000" }, { true, "g 577 789 5" }, { true, "u 65536 65536 1 " }, /* invalid idmaps */ { false, "1u 0 0 0" }, { false, "1g 0 0 0a" }, { false, "1 u 0 0 0" }, { false, "1g 0 0 0 1" }, { false, "1u a0 b0 c0 d1" }, { false, "1g 0 b0 0 d1" }, { false, "1u a0 0 c0 1" }, { false, "g -1 0 -10" }, { false, "a 1 0 10" }, { false, "u 1 1 0 10" }, { false, "g 1 0 10 z " }, }; for (i = 0; i < sizeof(idmaps) / sizeof(struct idmap_check); i++) { unsigned long hostid, nsid, range; char type; int ret; ret = parse_idmaps(idmaps[i].idmap, &type, &nsid, &hostid, &range); if ((ret < 0 && idmaps[i].is_valid) || (ret == 0 && !idmaps[i].is_valid)) { lxc_error("failed to parse idmap \"%s\"\n", idmaps[i].idmap); return -1; } } return 0; } static int set_get_compare_clear_save_load_network( struct lxc_container *c, const char *key, const char *value, const char *config_file, bool compare, const char *network_type) { char retval[4096] = {0}; int ret; if (!c->set_config_item(c, "lxc.net.0.type", network_type)) { lxc_error("%s\n", "lxc.net.0.type"); return -1; } if (!c->set_config_item(c, key, value)) { lxc_error("failed to set config item \"%s\" to \"%s\"\n", key, value); return -1; } ret = c->get_config_item(c, key, retval, sizeof(retval)); if (ret < 0) { lxc_error("failed to get config item \"%s\"\n", key); return -1; } if (compare) { ret = strcmp(retval, value); if (ret != 0) { lxc_error( "expected value \"%s\" and retrieved value \"%s\" " "for config key \"%s\" do not match\n", value, retval, key); return -1; } } if (config_file) { if (!c->save_config(c, config_file)) { lxc_error("%s\n", "failed to save config file"); return -1; } c->clear_config(c); c->lxc_conf = NULL; if (!c->load_config(c, config_file)) { lxc_error("%s\n", "failed to load config file"); return -1; } } if (!c->clear_config_item(c, key)) { lxc_error("failed to clear config item \"%s\"\n", key); return -1; } if (!c->clear_config_item(c, "lxc.net.0.type")) { lxc_error("%s\n", "lxc.net.0.type"); return -1; } c->clear_config(c); c->lxc_conf = NULL; return 0; } int main(int argc, char *argv[]) { int ret; struct lxc_container *c; int fd = -1, fret = EXIT_FAILURE; char tmpf[] = "lxc-parse-config-file-XXXXXX"; char retval[4096] = {0}; fd = lxc_make_tmpfile(tmpf, false); if (fd < 0) { lxc_error("%s\n", "Could not create temporary file"); exit(fret); } close(fd); c = lxc_container_new(tmpf, NULL); if (!c) { lxc_error("%s\n", "Failed to create new container"); exit(EXIT_FAILURE); } if (set_get_compare_clear_save_load(c, "lxc.arch", "x86_64", tmpf, true) < 0) { lxc_error("%s\n", "lxc.arch"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.pty.max", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.pty.max"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.tty.max", "4", tmpf, true) < 0) { lxc_error("%s\n", "lxc.tty.max"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.tty.dir", "not-dev", tmpf, true) < 0) { lxc_error("%s\n", "lxc.tty.dir"); goto non_test_error; } ret = set_get_compare_clear_save_load(c, "lxc.apparmor.profile", "unconfined", tmpf, true); #if HAVE_APPARMOR if (ret < 0) #else if (ret == 0) #endif { lxc_error("%s\n", "lxc.apparmor.profile"); goto non_test_error; } ret = set_get_compare_clear_save_load(c, "lxc.apparmor.allow_incomplete", "1", tmpf, true); #if HAVE_APPARMOR if (ret < 0) #else if (ret == 0) #endif { lxc_error("%s\n", "lxc.apparmor.allow_incomplete"); goto non_test_error; } ret = set_get_compare_clear_save_load(c, "lxc.selinux.context", "system_u:system_r:lxc_t:s0:c22", tmpf, true); #if HAVE_SELINUX if (ret < 0) #else if (ret == 0) #endif { lxc_error("%s\n", "lxc.selinux.context"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.cgroup.cpuset.cpus", "1-100", tmpf, false) < 0) { lxc_error("%s\n", "lxc.cgroup.cpuset.cpus"); goto non_test_error; } if (!c->set_config_item(c, "lxc.cgroup.cpuset.cpus", "1-100")) { lxc_error("%s\n", "failed to set config item \"lxc.cgroup.cpuset.cpus\" to \"1-100\""); return -1; } if (!c->set_config_item(c, "lxc.cgroup.memory.limit_in_bytes", "123456789")) { lxc_error("%s\n", "failed to set config item \"lxc.cgroup.memory.limit_in_bytes\" to \"123456789\""); return -1; } if (!c->get_config_item(c, "lxc.cgroup", retval, sizeof(retval))) { lxc_error("%s\n", "failed to get config item \"lxc.cgroup\""); return -1; } c->clear_config(c); c->lxc_conf = NULL; /* lxc.idmap * We can't really save the config here since save_config() wants to * chown the container's directory but we haven't created an on-disk * container. So let's test set-get-clear. */ if (set_get_compare_clear_save_load(c, "lxc.idmap", "u 0 100000 1000000000", NULL, false) < 0) { lxc_error("%s\n", "lxc.idmap"); goto non_test_error; } if (!c->set_config_item(c, "lxc.idmap", "u 1 100000 10000000")) { lxc_error("%s\n", "failed to set config item \"lxc.idmap\" to \"u 1 100000 10000000\""); return -1; } if (!c->set_config_item(c, "lxc.idmap", "g 1 100000 10000000")) { lxc_error("%s\n", "failed to set config item \"lxc.idmap\" to \"g 1 100000 10000000\""); return -1; } if (!c->get_config_item(c, "lxc.idmap", retval, sizeof(retval))) { lxc_error("%s\n", "failed to get config item \"lxc.idmap\""); return -1; } c->clear_config(c); c->lxc_conf = NULL; if (set_get_compare_clear_save_load(c, "lxc.log.level", "DEBUG", tmpf, true) < 0) { lxc_error("%s\n", "lxc.log.level"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.log.file", "/some/path", tmpf, true) < 0) { lxc_error("%s\n", "lxc.log.file"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.mount.fstab", "/some/path", NULL, true) < 0) { lxc_error("%s\n", "lxc.mount.fstab"); goto non_test_error; } /* lxc.mount.auto * Note that we cannot compare the values since the getter for * lxc.mount.auto does not preserve ordering. */ if (set_get_compare_clear_save_load(c, "lxc.mount.auto", "proc:rw sys:rw cgroup-full:rw", tmpf, false) < 0) { lxc_error("%s\n", "lxc.mount.auto"); goto non_test_error; } /* lxc.mount.entry * Note that we cannot compare the values since the getter for * lxc.mount.entry appends newlines. */ if (set_get_compare_clear_save_load(c, "lxc.mount.entry", "/dev/dri dev/dri none bind,optional,create=dir", tmpf, false) < 0) { lxc_error("%s\n", "lxc.mount.entry"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.rootfs.path", "/some/path", tmpf, true) < 0) { lxc_error("%s\n", "lxc.rootfs.path"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.rootfs.mount", "/some/path", tmpf, true) < 0) { lxc_error("%s\n", "lxc.rootfs.mount"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.rootfs.options", "ext4,discard", tmpf, true) < 0) { lxc_error("%s\n", "lxc.rootfs.options"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.uts.name", "the-shire", tmpf, true) < 0) { lxc_error("%s\n", "lxc.uts.name"); goto non_test_error; } if (set_get_compare_clear_save_load( c, "lxc.hook.pre-start", "/some/pre-start", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.pre-start"); goto non_test_error; } if (set_get_compare_clear_save_load( c, "lxc.hook.pre-mount", "/some/pre-mount", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.pre-mount"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.mount", "/some/mount", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.mount"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.autodev", "/some/autodev", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.autodev"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.start", "/some/start", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.start"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.stop", "/some/stop", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.stop"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.post-stop", "/some/post-stop", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.post-stop"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.clone", "/some/clone", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.clone"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.hook.destroy", "/some/destroy", tmpf, false) < 0) { lxc_error("%s\n", "lxc.hook.destroy"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.cap.drop", "sys_module mknod setuid net_raw", tmpf, false) < 0) { lxc_error("%s\n", "lxc.cap.drop"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.cap.keep", "sys_module mknod setuid net_raw", tmpf, false) < 0) { lxc_error("%s\n", "lxc.cap.keep"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.console.path", "none", tmpf, true) < 0) { lxc_error("%s\n", "lxc.console.path"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.console.logfile", "/some/logfile", tmpf, true) < 0) { lxc_error("%s\n", "lxc.console.logfile"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.seccomp.profile", "/some/seccomp/file", tmpf, true) < 0) { lxc_error("%s\n", "lxc.seccomp.profile"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.autodev.tmpfs.size", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.autodev.tmpfs.size"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.autodev", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.autodev"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.signal.halt", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.signal.halt"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.signal.reboot", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.signal.reboot"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.signal.stop", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.signal.stop"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.start.auto", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.start.auto"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.start.delay", "5", tmpf, true) < 0) { lxc_error("%s\n", "lxc.start.delay"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.start.order", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.start.order"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.log.syslog", "local0", tmpf, true) < 0) { lxc_error("%s\n", "lxc.log.syslog"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.monitor.unshare", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.monitor.unshare"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.group", "some,container,groups", tmpf, false) < 0) { lxc_error("%s\n", "lxc.group"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.environment", "FOO=BAR", tmpf, false) < 0) { lxc_error("%s\n", "lxc.environment"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.init.cmd", "/bin/bash", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init.cmd"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.init.uid", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init.uid"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.init.gid", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init.gid"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.ephemeral", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.ephemeral"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.no_new_privs", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.no_new_privs"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.sysctl.net.core.somaxconn", "256", tmpf, true) < 0) { lxc_error("%s\n", "lxc.sysctl.net.core.somaxconn"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.proc.oom_score_adj", "10", tmpf, true) < 0) { lxc_error("%s\n", "lxc.proc.oom_score_adj"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.prlimit.nofile", "65536", tmpf, true) < 0) { lxc_error("%s\n", "lxc.prlimit.nofile"); goto non_test_error; } if (test_idmap_parser() < 0) { lxc_error("%s\n", "failed to test parser for \"lxc.id_map\""); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.type", "veth", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.2.type", "none", tmpf, true)) { lxc_error("%s\n", "lxc.net.2.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.3.type", "empty", tmpf, true)) { lxc_error("%s\n", "lxc.net.3.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.4.type", "vlan", tmpf, true)) { lxc_error("%s\n", "lxc.net.4.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.type", "macvlan", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.type", "ipvlan", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.1000.type", "phys", tmpf, true)) { lxc_error("%s\n", "lxc.net.1000.type"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.flags", "up", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.flags"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.name", "eth0", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.name"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.link", "bla", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.link"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.macvlan.mode", "private", tmpf, true, "macvlan")) { lxc_error("%s\n", "lxc.net.0.macvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.macvlan.mode", "vepa", tmpf, true, "macvlan")) { lxc_error("%s\n", "lxc.net.0.macvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.macvlan.mode", "bridge", tmpf, true, "macvlan")) { lxc_error("%s\n", "lxc.net.0.macvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.mode", "l3", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.mode", "l3s", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.mode", "l2", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.mode"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.isolation", "bridge", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.isolation"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.isolation", "private", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.isolation"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.ipvlan.isolation", "vepa", tmpf, true, "ipvlan")) { lxc_error("%s\n", "lxc.net.0.ipvlan.isolation"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.pair", "clusterfuck", tmpf, true, "veth")) { lxc_error("%s\n", "lxc.net.0.veth.pair"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.ipv4.route", "192.0.2.1/32", tmpf, true, "veth")) { lxc_error("%s\n", "lxc.net.0.veth.ipv4.route"); return -1; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.ipv6.route", "2001:db8::1/128", tmpf, true, "veth")) { lxc_error("%s\n", "lxc.net.0.veth.ipv6.route"); return -1; } if (set_get_compare_clear_save_load(c, "lxc.net.0.script.up", "/some/up/path", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.script.up"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.script.down", "/some/down/path", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.script.down"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.hwaddr", "52:54:00:80:7a:5d", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.hwaddr"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.mtu", "2000", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.mtu"); goto non_test_error; } if (set_get_compare_clear_save_load_network(c, "lxc.net.0.vlan.id", "2", tmpf, true, "vlan")) { lxc_error("%s\n", "lxc.net.0.vlan.id"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv4.gateway", "10.0.2.2", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv4.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv4.gateway", "auto", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv4.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv4.gateway", "dev", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv4.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv6.gateway", "2003:db8:1::1", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv6.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv6.gateway", "auto", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv6.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv6.gateway", "dev", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv6.gateway"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv4.address", "10.0.2.3/24", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv4.address"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.net.0.ipv6.address", "2003:db8:1:0:214:1234:fe0b:3596/64", tmpf, true)) { lxc_error("%s\n", "lxc.net.0.ipv6.address"); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.cgroup.dir", "lxd", tmpf, true)) { lxc_error("%s\n", "lxc.cgroup.dir"); goto non_test_error; } if (set_and_clear_complete_netdev(c) < 0) { lxc_error("%s\n", "failed to clear whole network"); goto non_test_error; } if (set_invalid_netdev(c) < 0) { lxc_error("%s\n", "failed to reject invalid configuration"); goto non_test_error; } ret = set_get_compare_clear_save_load(c, "lxc.hook.version", "1", tmpf, true); if (ret < 0) { lxc_error("%s\n", "lxc.hook.version"); goto non_test_error; } if (c->set_config_item(c, "lxc.hook.version", "2")) { lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.hook.version\" to \"2\""); goto non_test_error; } if (!c->set_config_item(c, "lxc.monitor.signal.pdeath", "SIGKILL")) { lxc_error("%s\n", "Failed to set to set invalid config item \"lxc.monitor.signal.pdeath\" to \"SIGKILL\""); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.rootfs.managed", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.rootfs.managed"); goto non_test_error; } if (c->set_config_item(c, "lxc.notaconfigkey", "invalid")) { lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.notaconfigkey\" to \"invalid\""); return -1; } if (c->set_config_item(c, "lxc.log.file=", "./")) { lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.log.file\" to \"./\""); return -1; } if (c->set_config_item(c, "lxc.hook.versionasdfsadfsadf", "1")) { lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.hook.versionasdfsadfsadf\" to \"2\""); goto non_test_error; } if (set_get_compare_clear_save_load(c, "lxc.sched.core", "1", tmpf, true) < 0) { lxc_error("%s\n", "lxc.sched.core"); goto non_test_error; } fret = EXIT_SUCCESS; non_test_error: (void)unlink(tmpf); (void)rmdir(dirname(c->configfile)); lxc_container_put(c); exit(fret); } lxc-4.0.12/src/tests/shutdowntest.c0000644061062106075000000000515714176403775014213 00000000000000 /* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #define MYNAME "lxctest1" int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 1; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (!c->set_config_item(c, "lxc.net.0.type", "veth")) { fprintf(stderr, "%d: failed to set network type\n", __LINE__); goto out; } c->set_config_item(c, "lxc.net.0.link", "lxcbr0"); c->set_config_item(c, "lxc.net.0.flags", "up"); if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } if (!c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } c->clear_config(c); c->load_config(c, NULL); c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { fprintf(stderr, "%d: failed to start %s\n", __LINE__, MYNAME); goto out; } /* Wait for init to be ready for SIGPWR */ sleep(20); if (!c->shutdown(c, 120)) { fprintf(stderr, "%d: failed to shut down %s\n", __LINE__, MYNAME); if (!c->stop(c)) fprintf(stderr, "%d: failed to kill %s\n", __LINE__, MYNAME); goto out; } if (!c->destroy(c)) { fprintf(stderr, "%d: error deleting %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: if (c && c->is_defined(c)) c->destroy(c); lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/lxc-test-utils.c0000644061062106075000000004522414176403775014340 00000000000000/* * lxc: linux Container library * * Copyright © 2016 Canonical Ltd. * * Authors: * Christian Brauner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "confile_utils.h" #include "lxctest.h" #include "macro.h" #include "utils.h" void test_path_simplify(void) { char *s = "/A///B//C/D/E/"; char *t; t = path_simplify(s); if (!t) exit(EXIT_FAILURE); lxc_test_assert_abort(strcmp(t, "/A/B/C/D/E") == 0); free(t); s = "/A"; t = path_simplify(s); if (!t) exit(EXIT_FAILURE); lxc_test_assert_abort(strcmp(t, "/A") == 0); free(t); s = ""; t = path_simplify(s); if (!t) exit(EXIT_FAILURE); lxc_test_assert_abort(strcmp(t, "") == 0); free(t); s = "//"; t = path_simplify(s); if (!t) exit(EXIT_FAILURE); lxc_test_assert_abort(strcmp(t, "/") == 0); free(t); } /* /proc/int_as_str/ns/mnt\0 = (5 + 21 + 7 + 1) */ #define __MNTNS_LEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) void test_detect_ramfs_rootfs(void) { size_t i; int ret; int fret = EXIT_FAILURE; char path[__MNTNS_LEN]; int init_ns = -1; char tmpf1[] = "lxc-test-utils-XXXXXX"; char tmpf2[] = "lxc-test-utils-XXXXXX"; int fd1 = -1, fd2 = -1; FILE *fp1 = NULL, *fp2 = NULL; char *mountinfo[] = { "18 24 0:17 / /sys rw,nosuid,nodev,noexec,relatime shared:7 - sysfs sysfs rw", "19 24 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:13 - proc proc rw", "20 24 0:6 / /dev rw,nosuid,relatime shared:2 - devtmpfs udev rw,size=4019884k,nr_inodes=1004971,mode=755", "21 20 0:14 / /dev/pts rw,nosuid,noexec,relatime shared:3 - devpts devpts rw,gid=5,mode=620,ptmxmode=000", "22 24 0:18 / /run rw,nosuid,noexec,relatime shared:5 - tmpfs tmpfs rw,size=807912k,mode=755", /* This is what we care about. */ "24 0 8:2 / / rw - rootfs rootfs rw,size=1004396k,nr_inodes=251099", "25 18 0:12 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:8 - securityfs securityfs rw", "26 20 0:20 / /dev/shm rw,nosuid,nodev shared:4 - tmpfs tmpfs rw", "27 22 0:21 / /run/lock rw,nosuid,nodev,noexec,relatime shared:6 - tmpfs tmpfs rw,size=5120k", "28 18 0:22 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:9 - tmpfs tmpfs ro,mode=755", "29 28 0:23 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:10 - cgroup cgroup rw,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd", "30 18 0:24 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:11 - pstore pstore rw", "31 18 0:25 / /sys/firmware/efi/efivars rw,nosuid,nodev,noexec,relatime shared:12 - efivarfs efivarfs rw", "32 28 0:26 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime shared:14 - cgroup cgroup rw,cpu,cpuacct", "33 28 0:27 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime shared:15 - cgroup cgroup rw,net_cls,net_prio", "34 28 0:28 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,blkio", "35 28 0:29 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:17 - cgroup cgroup rw,freezer", "36 28 0:30 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:18 - cgroup cgroup rw,memory", "37 28 0:31 / /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:19 - cgroup cgroup rw,hugetlb", "38 28 0:32 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:20 - cgroup cgroup rw,cpuset", "39 28 0:33 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:21 - cgroup cgroup rw,devices", "40 28 0:34 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:22 - cgroup cgroup rw,pids", "41 28 0:35 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime shared:23 - cgroup cgroup rw,perf_event", "42 19 0:36 / /proc/sys/fs/binfmt_misc rw,relatime shared:24 - autofs systemd-1 rw,fd=32,pgrp=1,timeout=0,minproto=5,maxproto=5,direct", "43 18 0:7 / /sys/kernel/debug rw,relatime shared:25 - debugfs debugfs rw", "44 20 0:37 / /dev/hugepages rw,relatime shared:26 - hugetlbfs hugetlbfs rw", "45 20 0:16 / /dev/mqueue rw,relatime shared:27 - mqueue mqueue rw", "46 43 0:9 / /sys/kernel/debug/tracing rw,relatime shared:28 - tracefs tracefs rw", "76 18 0:38 / /sys/fs/fuse/connections rw,relatime shared:29 - fusectl fusectl rw", "78 24 8:1 / /boot/efi rw,relatime shared:30 - vfat /dev/sda1 rw,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro", }; ret = snprintf(path, __MNTNS_LEN, "/proc/self/ns/mnt"); if (ret < 0 || (size_t)ret >= __MNTNS_LEN) { lxc_error("%s\n", "Failed to create path with snprintf()."); goto non_test_error; } init_ns = open(path, O_RDONLY | O_CLOEXEC); if (init_ns < 0) { lxc_error("%s\n", "Failed to open initial mount namespace."); goto non_test_error; } if (unshare(CLONE_NEWNS) < 0) { lxc_error("%s\n", "Could not unshare mount namespace."); close(init_ns); init_ns = -1; goto non_test_error; } if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0) < 0) { lxc_error("Failed to remount / private: %s.\n", strerror(errno)); goto non_test_error; } fd1 = lxc_make_tmpfile(tmpf1, false); if (fd1 < 0) { lxc_error("%s\n", "Could not create temporary file."); goto non_test_error; } fd2 = lxc_make_tmpfile(tmpf2, false); if (fd2 < 0) { lxc_error("%s\n", "Could not create temporary file."); goto non_test_error; } fp1 = fdopen(fd1, "r+"); if (!fp1) { lxc_error("%s\n", "Could not fdopen() temporary file."); goto non_test_error; } fp2 = fdopen(fd2, "r+"); if (!fp2) { lxc_error("%s\n", "Could not fdopen() temporary file."); goto non_test_error; } /* Test if it correctly detects - rootfs rootfs */ for (i = 0; i < sizeof(mountinfo) / sizeof(mountinfo[0]); i++) { if (fprintf(fp1, "%s\n", mountinfo[i]) < 0) { lxc_error("Could not write \"%s\" to temporary file.", mountinfo[i]); goto non_test_error; } } fclose(fp1); fp1 = NULL; fd1 = -1; /* Test if it correctly fails to detect when no - rootfs rootfs */ for (i = 0; i < sizeof(mountinfo) / sizeof(mountinfo[0]); i++) { if (strcmp(mountinfo[i], "24 0 8:2 / / rw - rootfs rootfs rw,size=1004396k,nr_inodes=251099") == 0) continue; if (fprintf(fp2, "%s\n", mountinfo[i]) < 0) { lxc_error("Could not write \"%s\" to temporary file.", mountinfo[i]); goto non_test_error; } } fclose(fp2); fp2 = NULL; fd2 = -1; if (mount(tmpf1, "/proc/self/mountinfo", NULL, MS_BIND, 0) < 0) { lxc_error("%s\n", "Could not overmount \"/proc/self/mountinfo\"."); goto non_test_error; } lxc_test_assert_abort(detect_ramfs_rootfs()); if (mount(tmpf2, "/proc/self/mountinfo", NULL, MS_BIND, 0) < 0) { lxc_error("%s\n", "Could not overmount \"/proc/self/mountinfo\"."); goto non_test_error; } lxc_test_assert_abort(!detect_ramfs_rootfs()); fret = EXIT_SUCCESS; non_test_error: if (fp1) fclose(fp1); else if (fd1 > 0) close(fd1); if (fp2) fclose(fp2); else if (fd2 > 0) close(fd2); if (init_ns > 0) { if (setns(init_ns, 0) < 0) { lxc_error("Failed to switch back to initial mount namespace: %s.\n", strerror(errno)); fret = EXIT_FAILURE; } close(init_ns); } if (fret == EXIT_SUCCESS) return; exit(fret); } void test_lxc_safe_uint(void) { int ret; unsigned int n; char numstr[INTTYPE_TO_STRLEN(uint64_t)]; lxc_test_assert_abort((-EINVAL == lxc_safe_uint(" -123", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("-123", &n))); ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)UINT_MAX); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((0 == lxc_safe_uint(numstr, &n)) && n == UINT_MAX); ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)UINT_MAX + 1); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((-ERANGE == lxc_safe_uint(numstr, &n))); lxc_test_assert_abort((0 == lxc_safe_uint("1234345", &n)) && n == 1234345); lxc_test_assert_abort((0 == lxc_safe_uint(" 345", &n)) && n == 345); lxc_test_assert_abort((-EINVAL == lxc_safe_uint(" g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint(" 3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint(" 345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("g345 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("3g45 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("345g ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint("g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_uint(" g345", &n))); } void test_lxc_safe_int(void) { int ret; signed int n; char numstr[INTTYPE_TO_STRLEN(uint64_t)]; ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)INT_MAX); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((0 == lxc_safe_int(numstr, &n)) && n == INT_MAX); ret = snprintf(numstr, sizeof(numstr), "%" PRIu64, (uint64_t)INT_MAX + 1); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((-ERANGE == lxc_safe_int(numstr, &n))); ret = snprintf(numstr, sizeof(numstr), "%" PRId64, (int64_t)INT_MIN); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((0 == lxc_safe_int(numstr, &n)) && n == INT_MIN); ret = snprintf(numstr, sizeof(numstr), "%" PRId64, (int64_t)INT_MIN - 1); if (ret < 0 || ret >= sizeof(numstr)) exit(EXIT_FAILURE); lxc_test_assert_abort((-ERANGE == lxc_safe_int(numstr, &n))); lxc_test_assert_abort((0 == lxc_safe_int("1234345", &n)) && n == 1234345); lxc_test_assert_abort((0 == lxc_safe_int(" 345", &n)) && n == 345); lxc_test_assert_abort((0 == lxc_safe_int("-1234345", &n)) && n == -1234345); lxc_test_assert_abort((0 == lxc_safe_int(" -345", &n)) && n == -345); lxc_test_assert_abort((-EINVAL == lxc_safe_int(" g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int(" 3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int(" 345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("g345 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("3g45 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("345g ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int("g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_int(" g345", &n))); } void test_lxc_safe_long(void) { signed long int n; lxc_test_assert_abort((0 == lxc_safe_long("1234345", &n)) && n == 1234345); lxc_test_assert_abort((0 == lxc_safe_long(" 345", &n)) && n == 345); lxc_test_assert_abort((0 == lxc_safe_long("-1234345", &n)) && n == -1234345); lxc_test_assert_abort((0 == lxc_safe_long(" -345", &n)) && n == -345); lxc_test_assert_abort((-EINVAL == lxc_safe_long(" g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long(" 3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long(" 345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("g345", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("3g45", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("345g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("g345 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("3g45 ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("345g ", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long("g", &n))); lxc_test_assert_abort((-EINVAL == lxc_safe_long(" g345", &n))); } void test_lxc_string_replace(void) { char *s; s = lxc_string_replace("A", "A", "A"); lxc_test_assert_abort(strcmp(s, "A") == 0); free(s); s = lxc_string_replace("A", "AA", "A"); lxc_test_assert_abort(strcmp(s, "AA") == 0); free(s); s = lxc_string_replace("A", "AA", "BA"); lxc_test_assert_abort(strcmp(s, "BAA") == 0); free(s); s = lxc_string_replace("A", "AA", "BAB"); lxc_test_assert_abort(strcmp(s, "BAAB") == 0); free(s); s = lxc_string_replace("AA", "A", "AA"); lxc_test_assert_abort(strcmp(s, "A") == 0); free(s); s = lxc_string_replace("AA", "A", "BAA"); lxc_test_assert_abort(strcmp(s, "BA") == 0); free(s); s = lxc_string_replace("AA", "A", "BAAB"); lxc_test_assert_abort(strcmp(s, "BAB") == 0); free(s); s = lxc_string_replace("\"A\"A", "\"A\"", "B\"A\"AB"); lxc_test_assert_abort(strcmp(s, "B\"A\"B") == 0); free(s); } void test_lxc_string_in_array(void) { lxc_test_assert_abort(lxc_string_in_array("", (const char *[]){"", NULL})); lxc_test_assert_abort(!lxc_string_in_array("A", (const char *[]){"", NULL})); lxc_test_assert_abort(!lxc_string_in_array("AAA", (const char *[]){"", "3472", "jshH", NULL})); lxc_test_assert_abort(lxc_string_in_array("A", (const char *[]){"A", NULL})); lxc_test_assert_abort(lxc_string_in_array("A", (const char *[]){"A", "B", "C", NULL})); lxc_test_assert_abort(lxc_string_in_array("A", (const char *[]){"B", "A", "C", NULL})); lxc_test_assert_abort(lxc_string_in_array("ABC", (const char *[]){"ASD", "ATR", "ABC", NULL})); lxc_test_assert_abort(lxc_string_in_array("GHJ", (const char *[]){"AZIU", "WRT567B", "879C", "GHJ", "IUZ89", NULL})); lxc_test_assert_abort(lxc_string_in_array("XYZ", (const char *[]){"BERTA", "ARQWE(9", "C8Zhkd", "7U", "XYZ", "UOIZ9", "=)()", NULL})); } void test_parse_byte_size_string(void) { int ret; long long int n; ret = parse_byte_size_string("0", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"0\""); exit(EXIT_FAILURE); } if (n != 0) { lxc_error("%s\n", "Failed to parse \"0\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1\""); exit(EXIT_FAILURE); } if (n != 1) { lxc_error("%s\n", "Failed to parse \"1\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1 ", &n); if (ret == 0) { lxc_error("%s\n", "Failed to parse \"1 \""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1B", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1B\""); exit(EXIT_FAILURE); } if (n != 1) { lxc_error("%s\n", "Failed to parse \"1B\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1kB", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1kB\""); exit(EXIT_FAILURE); } if (n != 1024) { lxc_error("%s\n", "Failed to parse \"1kB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1MB", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1MB\""); exit(EXIT_FAILURE); } if (n != 1048576) { lxc_error("%s\n", "Failed to parse \"1MB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1TB", &n); if (ret == 0) { lxc_error("%s\n", "Failed to parse \"1TB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1 B", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1 B\""); exit(EXIT_FAILURE); } if (n != 1) { lxc_error("%s\n", "Failed to parse \"1 B\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1 kB", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1 kB\""); exit(EXIT_FAILURE); } if (n != 1024) { lxc_error("%s\n", "Failed to parse \"1 kB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1 MB", &n); if (ret < 0) { lxc_error("%s\n", "Failed to parse \"1 MB\""); exit(EXIT_FAILURE); } if (n != 1048576) { lxc_error("%s\n", "Failed to parse \"1 MB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("1 TB", &n); if (ret == 0) { lxc_error("%s\n", "Failed to parse \"1 TB\""); exit(EXIT_FAILURE); } ret = parse_byte_size_string("asdf", &n); if (ret == 0) { lxc_error("%s\n", "Failed to parse \"asdf\""); exit(EXIT_FAILURE); } } void test_lxc_config_net_is_hwaddr(void) { if (!lxc_config_net_is_hwaddr("lxc.net.0.hwaddr = 00:16:3e:04:65:b8\n")) exit(EXIT_FAILURE); if (lxc_config_net_is_hwaddr("lxc.net")) exit(EXIT_FAILURE); if (lxc_config_net_is_hwaddr("lxc.net.")) exit(EXIT_FAILURE); if (lxc_config_net_is_hwaddr("lxc.net.0.")) exit(EXIT_FAILURE); } void test_task_blocks_signal(void) { int ret; pid_t pid; pid = fork(); if (pid < 0) _exit(EXIT_FAILURE); if (pid == 0) { int i; sigset_t mask; int signals[] = {SIGBUS, SIGILL, SIGSEGV, SIGWINCH, SIGQUIT, SIGUSR1, SIGUSR2, SIGRTMIN + 3, SIGRTMIN + 4}; sigemptyset(&mask); for (i = 0; i < (sizeof(signals) / sizeof(signals[0])); i++) { ret = sigaddset(&mask, signals[i]); if (ret < 0) _exit(EXIT_FAILURE); } ret = pthread_sigmask(SIG_BLOCK, &mask, NULL); if (ret < 0) { lxc_error("%s\n", "Failed to block signals"); _exit(EXIT_FAILURE); } for (i = 0; i < (sizeof(signals) / sizeof(signals[0])); i++) { if (!task_blocks_signal(getpid(), signals[i])) { lxc_error("Failed to detect blocked signal " "(idx = %d, signal number = %d)\n", i, signals[i]); _exit(EXIT_FAILURE); } } if (task_blocks_signal(getpid(), SIGKILL)) { lxc_error("%s\n", "Falsely detected SIGKILL as blocked signal"); _exit(EXIT_FAILURE); } if (task_blocks_signal(getpid(), SIGSTOP)) { lxc_error("%s\n", "Falsely detected SIGSTOP as blocked signal"); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } ret = wait_for_pid(pid); if (ret < 0) _exit(EXIT_FAILURE); return; } void test_is_in_comm(void) { #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION lxc_test_assert_abort(is_in_comm("fuzz-lxc-") == 0); lxc_test_assert_abort(is_in_comm("lxc-test") == 1); lxc_test_assert_abort(is_in_comm("") == 1); #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */ } int main(int argc, char *argv[]) { test_lxc_string_replace(); test_lxc_string_in_array(); test_path_simplify(); test_detect_ramfs_rootfs(); test_lxc_safe_uint(); test_lxc_safe_int(); test_lxc_safe_long(); test_parse_byte_size_string(); test_lxc_config_net_is_hwaddr(); test_task_blocks_signal(); test_is_in_comm(); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/locktests.c0000644061062106075000000000657714176403775013462 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include "lxc/lxclock.h" #include "config.h" #include #include #include #include #include #include #define mycontainername "lxctest.sem" #define TIMEOUT_SECS 3 static void test_two_locks(void) { struct lxc_lock *l; pid_t pid; int ret, status; int p[2]; char c; if (pipe(p) < 0) exit(EXIT_FAILURE); if ((pid = fork()) < 0) exit(EXIT_FAILURE); if (pid == 0) { if (read(p[0], &c, 1) < 0) { perror("read"); exit(EXIT_FAILURE); } l = lxc_newlock("/tmp", "lxctest-sem"); if (!l) { fprintf(stderr, "%d: child: failed to create lock\n", __LINE__); exit(EXIT_FAILURE); } if (lxclock(l, 0) < 0) { fprintf(stderr, "%d: child: failed to grab lock\n", __LINE__); exit(EXIT_FAILURE); } fprintf(stderr, "%d: child: grabbed lock\n", __LINE__); exit(EXIT_SUCCESS); } l = lxc_newlock("/tmp", "lxctest-sem"); if (!l) { fprintf(stderr, "%d: failed to create lock\n", __LINE__); exit(EXIT_FAILURE); } if (lxclock(l, 0) < 0) { fprintf(stderr, "%d; failed to get lock\n", __LINE__); exit(EXIT_FAILURE); } if (write(p[1], "a", 1) < 0) { perror("write"); exit(EXIT_FAILURE); } sleep(3); ret = waitpid(pid, &status, WNOHANG); if (ret == pid) { // task exited if (WIFEXITED(status)) { printf("%d exited normally with exit code %d\n", pid, WEXITSTATUS(status)); if (WEXITSTATUS(status) != 0) exit(EXIT_FAILURE); } else printf("%d did not exit normally\n", pid); return; } else if (ret < 0) { perror("waitpid"); exit(EXIT_FAILURE); } kill(pid, SIGKILL); wait(&status); close(p[1]); close(p[0]); lxcunlock(l); lxc_putlock(l); } int main(int argc, char *argv[]) { int ret; struct lxc_lock *lock; lock = lxc_newlock(NULL, NULL); if (!lock) { fprintf(stderr, "%d: failed to get unnamed lock\n", __LINE__); exit(EXIT_FAILURE); } ret = lxclock(lock, 0); if (ret) { fprintf(stderr, "%d: failed to take unnamed lock (%d)\n", __LINE__, ret); exit(EXIT_FAILURE); } ret = lxcunlock(lock); if (ret) { fprintf(stderr, "%d: failed to put unnamed lock (%d)\n", __LINE__, ret); exit(EXIT_FAILURE); } lxc_putlock(lock); lock = lxc_newlock("/var/lib/lxc", mycontainername); if (!lock) { fprintf(stderr, "%d: failed to get lock\n", __LINE__); exit(EXIT_FAILURE); } struct stat sb; char *pathname = RUNTIME_PATH "/lxc/lock/var/lib/lxc/"; ret = stat(pathname, &sb); if (ret != 0) { fprintf(stderr, "%d: filename %s not created\n", __LINE__, pathname); exit(EXIT_FAILURE); } lxc_putlock(lock); test_two_locks(); fprintf(stderr, "all tests passed\n"); exit(ret); } lxc-4.0.12/src/tests/fuzz-lxc-cgroup-init.c0000644061062106075000000000202614176403775015450 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include "cgroups/cgroup.h" #include "conf.h" #include "confile.h" #include "lxctest.h" #include "utils.h" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { int fd = -1; char tmpf[] = "/tmp/fuzz-lxc-cgroup-init-XXXXXX"; struct lxc_conf *conf = NULL; int ret; struct cgroup_ops *ops; /* * 100Kb should probably be enough to trigger all the issues * we're interested in without any timeouts */ if (size > 102400) return 0; fd = lxc_make_tmpfile(tmpf, false); lxc_test_assert_abort(fd >= 0); lxc_write_nointr(fd, data, size); close(fd); conf = lxc_conf_init(); lxc_test_assert_abort(conf); /* Test cgroup_init() with valid config. */ ops = cgroup_init(conf); cgroup_exit(ops); ret = lxc_config_read(tmpf, conf, false); if (ret == 0) { /* Test cgroup_init() with likely garbage config. */ ops = cgroup_init(conf); cgroup_exit(ops); } lxc_conf_free(conf); (void) unlink(tmpf); return 0; } lxc-4.0.12/src/tests/createtest.c0000644061062106075000000000465314176403775013603 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #define MYNAME "lxctest1" int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 1; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (!c->set_config_item(c, "lxc.net.0.type", "veth")) { fprintf(stderr, "%d: failed to set network type\n", __LINE__); goto out; } c->set_config_item(c, "lxc.net.0.link", "lxcbr0"); c->set_config_item(c, "lxc.net.0.flags", "up"); if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a trusty container\n", __LINE__); goto out; } if (!c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } c->clear_config(c); c->load_config(c, NULL); c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { fprintf(stderr, "%d: failed to start %s\n", __LINE__, MYNAME); goto out; } if (!c->stop(c)) { fprintf(stderr, "%d: failed to stop %s\n", __LINE__, MYNAME); goto out; } if (!c->destroy(c)) { fprintf(stderr, "%d: error deleting %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/shortlived.c0000644061062106075000000001472314176403775013622 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * Copyright © 2017 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "lxctest.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define MYNAME "shortlived" static int destroy_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } static int create_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { int fd, i; const char *s; bool b; struct lxc_container *c; struct lxc_log log; char template[sizeof(P_tmpdir"/shortlived_XXXXXX")]; int ret = EXIT_FAILURE; (void)strlcpy(template, P_tmpdir"/shortlived_XXXXXX", sizeof(template)); i = lxc_make_tmpfile(template, false); if (i < 0) { lxc_error("Failed to create temporary log file for container %s\n", MYNAME); exit(EXIT_FAILURE); } else { lxc_debug("Using \"%s\" as temporary log file for container %s\n", template, MYNAME); close(i); } log.name = MYNAME; log.file = template; log.level = "TRACE"; log.prefix = "shortlived"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) exit(EXIT_FAILURE); /* test a real container */ c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%d: error creating lxc_container %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (create_container() < 0) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } b = c->is_defined(c); if (!b) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } s = c->state(c); if (!s || strcmp(s, "STOPPED")) { fprintf(stderr, "%d: %s is in state %s, not in STOPPED.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } b = c->load_config(c, NULL); if (!b) { fprintf(stderr, "%d: %s failed to read its config\n", __LINE__, c->name); goto out; } if (!c->set_config_item(c, "lxc.init.cmd", "echo hello")) { fprintf(stderr, "%d: failed setting lxc.init.cmd\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.execute.cmd", "echo hello")) { fprintf(stderr, "%d: failed setting lxc.execute.cmd\n", __LINE__); goto out; } c->want_daemonize(c, true); /* Test whether we can start a really short-lived daemonized container. */ for (i = 0; i < 10; i++) { if (!c->startl(c, 0, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } /* Test whether we can start a really short-lived daemonized container with lxc-init. */ for (i = 0; i < 10; i++) { if (!c->startl(c, 1, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } if (!c->set_config_item(c, "lxc.init.cmd", "you-shall-fail")) { fprintf(stderr, "%d: failed setting lxc.init.cmd\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.execute.cmd", "you-shall-fail")) { fprintf(stderr, "%d: failed setting lxc.init.cmd\n", __LINE__); goto out; } /* Test whether we can start a really short-lived daemonized container. */ for (i = 0; i < 10; i++) { if (c->startl(c, 0, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } /* Test whether we can start a really short-lived daemonized container with lxc-init. */ for (i = 0; i < 10; i++) { /* An container started with lxc-init will always start * successfully unless lxc-init has a bug. */ if (!c->startl(c, 1, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } c->stop(c); fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: if (c) { c->stop(c); destroy_container(); } lxc_container_put(c); if (ret != 0) { fd = open(template, O_RDONLY); if (fd >= 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } close(fd); } } unlink(template); exit(ret); } lxc-4.0.12/src/tests/lxc-test-cloneconfig0000755061062106075000000000661314176403775015247 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # # This is a test script for the lxc-user-nic program # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -e s=$(mktemp -d /tmp/lxctest-XXXXXX) DONE=0 verify_unchanged_number() { key=$1 desc=$2 n1=$(grep ^$key $CONTAINER_PATH/config | wc -l) n2=$(grep ^$key $CONTAINER2_PATH/config | wc -l) if [ $n1 -ne $n2 ]; then echo "Test $testnum failed" echo "unequal number of $desc" echo "Original has $n1, clone has $n2" false fi } cleanup() { lxc-destroy -n lxctestb || true lxc-destroy -n lxctestb2 || true rm -rf $s [ $DONE -eq 1 ] && echo "PASS" || echo "FAIL" } verify_numnics() { verify_unchanged_number lxc.net.0.type "network defs" } verify_hwaddr() { verify_unchanged_number lxc.net.0.hwaddr "hwaddr defs" grep ^lxc.net.0.hwaddr $CONTAINER_PATH/config | while read line; do addr=$(echo $line | awk -F= { print $2 }) echo "looking for $addr in $CONTAINER2_PATH/config" if grep -q $addr $CONTAINER2_PATH/config; then echo "Test $testnum failed" echo "hwaddr $addr was not changed" false fi done } verify_hooks() { verify_unchanged_number lxc.hook "hooks" grep ^lxc.hook $CONTAINER_PATH/config | while read line; do nline=${line/$CONTAINER_PATH/$CONTAINER2_PATH} if ! grep -q "$nline" $CONTAINER2_PATH/config; then echo "Test $testnum failed" echo "Failed to find $nline in:" cat $CONTAINER2_PATH/config fi done } trap cleanup EXIT # Simple nic cat > $s/1.conf << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 EOF # Simple nic with hwaddr; verify hwaddr changed cat > $s/2.conf << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 EOF # No nics, but nic from include cat > $s/1.include << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 lxc.hook.start = /bin/bash EOF cat > $s/3.conf << EOF lxc.include = $s/1.include EOF # No nics, one clone hook in /bin cat > $s/4.conf << EOF lxc.hook.start = /bin/bash EOF # Figure out container dirname # We need this in 5.conf lxc-destroy -n lxctestb || true lxc-create -t busybox -n lxctestb -B dir CONTAINER_PATH=$(dirname $(lxc-info -n lxctestb -c lxc.rootfs.path -H) | sed 's/dir://') lxc-destroy -n lxctestb # No nics, one clone hook in $container cat > $s/5.conf << EOF lxc.hook.start = $CONTAINER_PATH/x1 EOF CONTAINER2_PATH="${CONTAINER_PATH}2" testnum=1 for f in $s/*.conf; do echo "Test $testnum starting ($f)" lxc-create -t busybox -f $f -n lxctestb touch $CONTAINER_PATH/x1 lxc-copy -s -n lxctestb -N lxctestb2 # verify that # nics did not change verify_numnics # verify hwaddr, if any changed verify_hwaddr # verify hooks are correct verify_hooks lxc-destroy -n lxctestb2 || true lxc-destroy -n lxctestb || true testnum=$((testnum+1)) done DONE=1 lxc-4.0.12/src/tests/lxc-test-automount0000755061062106075000000001541114176403775015010 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # At the moment this only tests cgroup automount. Testing proc and # sys automounts would be worthwhile. [ -f /proc/self/ns/cgroup ] && exit 0 # cgmanager doesn't do the same cgroup filesystem mounting cgm ping && exit 0 set -ex cleanup() { set +e rmdir /sys/fs/cgroup/freezer/xx lxc-destroy -n lxc-test-automount -f if [ $PHASE != "done" ]; then echo "automount test failed at $PHASE" exit 1 fi echo "automount test passed" exit 0 } PHASE=setup trap cleanup EXIT rmdir /sys/fs/cgroup/freezer/xx || true lxc-destroy -n lxc-test-automount -f || true lxc-create -t busybox -n lxc-test-automount PHASE=no-cgroup echo "Starting phase $PHASE" config=/var/lib/lxc/lxc-test-automount/config sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 0 ] # Tests are as follows: # 1. check that freezer controller is mounted # 2. check that it is cgroupfs for cgroup-full (/cgroup.procs exists) or # tmpfs for cgroup # 3. check that root cgroup dir is readonly or not (try mkdir) # 4. check that the container's cgroup dir is readonly or not # 5. check that the container's cgroup dir is cgroupfs (/cgroup.procs exists) lxc-stop -n lxc-test-automount -k PHASE=cgroup:mixed echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx || ro=1 [ $ro -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -ne 1 ] lxc-stop -n lxc-test-automount -k PHASE=cgroup:ro echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup:ro proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx || ro=1 [ $ro -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -ne 1 ] lxc-stop -n lxc-test-automount -k PHASE=cgroup:rw echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup:rw proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 1 ] rmdir /proc/$pid/root/sys/fs/cgroup/freezer/xx ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx || ro=1 [ $ro -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -ne 1 ] # cgroup-full lxc-stop -n lxc-test-automount -k PHASE=cgroup-full:mixed echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup-full:mixed proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 1 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx || ro=1 [ $ro -ne 1 ] rmdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -ne 1 ] lxc-stop -n lxc-test-automount -k PHASE=cgroup-full:ro echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup-full:ro proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 1 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 0 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xy || ro=1 [ $ro -ne 0 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -ne 1 ] lxc-stop -n lxc-test-automount -k PHASE=cgroup-full:rw echo "Starting phase $PHASE" sed -i '/lxc.mount.auto/d' $config echo "lxc.mount.auto = cgroup-full:rw proc:mixed sys:mixed" >> $config lxc-start -n lxc-test-automount pid=$(lxc-info -n lxc-test-automount -p -H) cg=$(awk -F: '/freezer/ { print $3 }' /proc/$pid/cgroup) notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer || notfound=1 [ $notfound -ne 1 ] notfound=0 stat /proc/$pid/root/sys/fs/cgroup/freezer/cgroup.procs || notfound=1 [ $notfound -ne 1 ] ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/xx || ro=1 [ $ro -ne 1 ] rmdir /proc/$pid/root/sys/fs/cgroup/freezer/xx ro=0 mkdir /proc/$pid/root/sys/fs/cgroup/freezer/$cg/xx || ro=1 [ $ro -ne 1 ] notfound=0 /proc/$pid/root/sys/fs/cgroup/freezer/$cg/cgroup.procs || notfound=1 [ $notfound -eq 1 ] PHASE=done lxc-4.0.12/src/tests/lxc-test-autostart0000755061062106075000000000542414176403775015006 00000000000000#!/bin/sh # lxc: linux Container library # Authors: # Stéphane Graber # # This is a test script for lxc-autostart # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA DONE=0 cleanup() { lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true if [ $DONE -eq 0 ]; then echo "FAIL" exit 1 fi echo "PASS" } trap cleanup EXIT HUP INT TERM set -eu # Create a container CONTAINER_NAME=lxc-test-auto lxc-create -t busybox -n $CONTAINER_NAME -B dir CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://') cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak # Ensure it's not in lxc-autostart lxc-autostart -L | grep -q $CONTAINER_NAME && \ (echo "Container shouldn't be auto-started" && exit 1) # Mark it as auto-started and re-check echo "lxc.start.auto = 1" >> $CONTAINER_PATH/config lxc-autostart -L | grep -q $CONTAINER_NAME || \ (echo "Container should be auto-started" && exit 1) # Put it in a test group and set a delay echo "lxc.group = lxc-auto-test" >> $CONTAINER_PATH/config echo "lxc.start.delay = 5" >> $CONTAINER_PATH/config # Check that everything looks good if [ "$(lxc-autostart -L -g lxc-auto-test | grep $CONTAINER_NAME)" != "$CONTAINER_NAME 5" ]; then echo "Invalid autostart setting" && exit 1 fi # Start it lxc-autostart -g lxc-auto-test lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1) sleep 5 # Restart it lxc-autostart -g lxc-auto-test -r lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't restart" && exit 1) sleep 5 # When shutting down, the container calls sync. If the machine running # the test has a massive backlog, it can take minutes for the sync call to # finish, causing a test failure. # So try to reduce that by flushing everything to disk before we attempt # a container shutdown. sync # Shut it down lxc-autostart -g lxc-auto-test -s -t 120 lxc-wait -n $CONTAINER_NAME -t 120 -s STOPPED || (echo "Container didn't stop" && exit 1) # Kill it lxc-autostart -g lxc-auto-test -k lxc-wait -n $CONTAINER_NAME -t 60 -s STOPPED || (echo "Container didn't die" && exit 1) DONE=1 lxc-4.0.12/src/tests/mount_injection.c0000644061062106075000000002555414176403775014647 00000000000000/* mount_injection * * Copyright © 2018 Elizaveta Tretiakova . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "lxctest.h" #include "utils.h" #define NAME "mount_injection_test-" #define TEMPLATE P_tmpdir"/mount_injection_XXXXXX" struct mountinfo_data { const char *mount_root; const char *mount_point; const char *fstype; const char *mount_source; const char *message; bool should_be_present; }; static int comp_field(char *line, const char *str, int nfields) { char *p, *p2; int i, ret; if(!line) return -1; if (!str) return 0; for (p = line, i = 0; p && i < nfields; i++) p = strchr(p + 1, ' '); if (!p) return -1; p2 = strchr(p + 1, ' '); if (p2) *p2 = '\0'; ret = strcmp(p + 1, str); if (p2) *p2 = ' '; return ret; } static int find_in_proc_mounts(void *data) { char buf[LXC_LINELEN]; FILE *f; struct mountinfo_data *mdata = (struct mountinfo_data *)data; fprintf(stderr, "%s", mdata->message); f = fopen("/proc/self/mountinfo", "r"); if (!f) return 0; while (fgets(buf, LXC_LINELEN, f)) { char *buf2; /* checking mount_root is tricky since it will be prefixed with * whatever path was the source of the mount in the original * mount namespace. So only verify it when we know that root is * in fact "/". */ if (mdata->mount_root && comp_field(buf, mdata->mount_root, 3) != 0) continue; if (comp_field(buf, mdata->mount_point, 4) != 0) continue; if (!mdata->fstype || !mdata->mount_source) goto on_success; buf2 = strchr(buf, '-'); if (comp_field(buf2, mdata->fstype, 1) != 0 || comp_field(buf2, mdata->mount_source, 2) != 0) continue; on_success: fclose(f); fprintf(stderr, "PRESENT\n"); if (mdata->should_be_present) _exit(EXIT_SUCCESS); _exit(EXIT_FAILURE); } fclose(f); fprintf(stderr, "MISSING\n"); if (!mdata->should_be_present) _exit(EXIT_SUCCESS); _exit(EXIT_FAILURE); } static int check_containers_mountinfo(struct lxc_container *c, struct mountinfo_data *d) { pid_t pid; int ret = -1; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; ret = c->attach(c, find_in_proc_mounts, d, &attach_options, &pid); if (ret < 0) { fprintf(stderr, "Check of the container's mountinfo failed\n"); return ret; } ret = wait_for_pid(pid); if (ret < 0) fprintf(stderr, "Attached function failed\n"); return ret; } /* config_items: NULL-terminated array of config pairs */ static int perform_container_test(const char *name, const char *config_items[]) { int i; char *sret; char template_log[sizeof(TEMPLATE)], template_dir[sizeof(TEMPLATE)], device_message[4096], dir_message[4096], fs_message[4096]; struct lxc_container *c; struct lxc_mount mnt; struct lxc_log log; int ret = -1, dev_msg_size = sizeof("Check urandom device injected into "" - ") - 1 + strlen(name) + 1, dir_msg_size = sizeof("Check dir "" injected into "" - ") - 1 + sizeof(TEMPLATE) - 1 + strlen(name) + 1, fs_msg_size = sizeof("Check devtmpfs injected into "" - ") - 1 + strlen(name) + 1; struct mountinfo_data device = { .mount_root = "/urandom", .mount_point = "/mnt/mount_injection_test_urandom", .fstype = NULL, .mount_source = "/dev/urandom", .message = "", .should_be_present = true }, dir = { .mount_root = NULL, .mount_point = template_dir, .fstype = NULL, .mount_source = NULL, .message = "", .should_be_present = true }, fs = { .mount_root = "/", .mount_point = "/mnt/mount_injection_test_devtmpfs", .fstype = "devtmpfs", .mount_source = NULL, .message = "", .should_be_present = true }; /* Temp paths and messages setup */ strcpy(template_dir, TEMPLATE); sret = mkdtemp(template_dir); if (!sret) { lxc_error("Failed to create temporary src file for container %s\n", name); exit(EXIT_FAILURE); } ret = snprintf(device_message, dev_msg_size, "Check urandom device injected into %s - ", name); if (ret < 0 || ret >= dev_msg_size) { fprintf(stderr, "Failed to create message for dev\n"); exit(EXIT_FAILURE); } device.message = &device_message[0]; ret = snprintf(dir_message, dir_msg_size, "Check dir %s injected into %s - ", template_dir, name); if (ret < 0 || ret >= dir_msg_size) { fprintf(stderr, "Failed to create message for dir\n"); exit(EXIT_FAILURE); } dir.message = &dir_message[0]; ret = snprintf(fs_message, fs_msg_size, "Check devtmpfs injected into %s - ", name); if (ret < 0 || ret >= fs_msg_size) { fprintf(stderr, "Failed to create message for fs\n"); exit(EXIT_FAILURE); } fs.message = &fs_message[0]; /* Setup logging*/ strcpy(template_log, TEMPLATE); i = lxc_make_tmpfile(template_log, false); if (i < 0) { lxc_error("Failed to create temporary log file for container %s\n", name); exit(EXIT_FAILURE); } else { lxc_debug("Using \"%s\" as temporary log file for container %s\n", template_log, name); close(i); } log.name = name; log.file = template_log; log.level = "TRACE"; log.prefix = "mount-injection"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) exit(EXIT_FAILURE); /* Container setup */ c = lxc_container_new(name, NULL); if (!c) { fprintf(stderr, "Unable to instantiate container (%s)...\n", name); goto out; } if (c->is_defined(c)) { fprintf(stderr, "Container (%s) already exists\n", name); goto out; } for (i = 0; config_items[i]; i += 2) { if (!c->set_config_item(c, config_items[i], config_items[i + 1])) { fprintf(stderr, "Failed to set \"%s\" config option to \"%s\"\n", config_items[i], config_items[i + 1]); goto out; } } if (!c->create(c, "busybox", NULL, NULL, 1, NULL)) { fprintf(stderr, "Creating the container (%s) failed...\n", name); goto out; } c->want_daemonize(c, true); if (!c->start(c, false, NULL)) { fprintf(stderr, "Starting the container (%s) failed...\n", name); goto out; } mnt.version = LXC_MOUNT_API_V1; /* Check device mounted */ ret = c->mount(c, "/dev/urandom", "/mnt/mount_injection_test_urandom", NULL, MS_BIND, NULL, &mnt); if (ret < 0) { fprintf(stderr, "Failed to mount \"/dev/urandom\"\n"); goto out; } ret = check_containers_mountinfo(c, &device); if (ret < 0) goto out; /* Check device unmounted */ /* TODO: what about other umount flags? */ ret = c->umount(c, "/mnt/mount_injection_test_urandom", MNT_DETACH, &mnt); if (ret < 0) { fprintf(stderr, "Failed to umount2 \"/dev/urandom\"\n"); goto out; } device.message = "Unmounted \"/mnt/mount_injection_test_urandom\" -- should be missing now: "; device.should_be_present = false; ret = check_containers_mountinfo(c, &device); if (ret < 0) goto out; /* Check dir mounted */ ret = c->mount(c, template_dir, template_dir, NULL, MS_BIND, NULL, &mnt); if (ret < 0) { fprintf(stderr, "Failed to mount \"%s\"\n", template_dir); goto out; } ret = check_containers_mountinfo(c, &dir); if (ret < 0) goto out; /* Check dir unmounted */ /* TODO: what about other umount flags? */ ret = c->umount(c, template_dir, MNT_DETACH, &mnt); if (ret < 0) { fprintf(stderr, "Failed to umount2 \"%s\"\n", template_dir); goto out; } dir.message = "Unmounted dir -- should be missing now: "; dir.should_be_present = false; ret = check_containers_mountinfo(c, &dir); if (ret < 0) goto out; /* Check fs mounted */ ret = c->mount(c, NULL, "/mnt/mount_injection_test_devtmpfs", "devtmpfs", 0, NULL, &mnt); if (ret < 0) { fprintf(stderr, "Failed to mount devtmpfs\n"); goto out; } ret = check_containers_mountinfo(c, &fs); if (ret < 0) goto out; /* Check fs unmounted */ /* TODO: what about other umount flags? */ ret = c->umount(c, "/mnt/mount_injection_test_devtmpfs", MNT_DETACH, &mnt); if (ret < 0) { fprintf(stderr, "Failed to umount2 devtmpfs\n"); goto out; } fs.message = "Unmounted \"/mnt/mount_injection_test_devtmpfs\" -- should be missing now: "; fs.should_be_present = false; ret = check_containers_mountinfo(c, &fs); if (ret < 0) goto out; /* Finalize the container */ if (!c->stop(c)) { fprintf(stderr, "Stopping the container (%s) failed...\n", name); goto out; } if (!c->destroy(c)) { fprintf(stderr, "Destroying the container (%s) failed...\n", name); goto out; } ret = 0; out: lxc_container_put(c); if (ret != 0) { int fd; fd = open(template_log, O_RDONLY); if (fd >= 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } close(fd); } } unlink(template_log); unlink(template_dir); return ret; } static int do_priv_container_test(void) { const char *config_items[] = {"lxc.mount.auto", "shmounts:/tmp/mount_injection_test", NULL}; return perform_container_test(NAME"privileged", config_items); } static int do_unpriv_container_test(void) { const char *config_items[] = { "lxc.mount.auto", "shmounts:/tmp/mount_injection_test", NULL }; return perform_container_test(NAME"unprivileged", config_items); } static bool lxc_setup_shmount(const char *shmount_path) { int ret; ret = mkdir_p(shmount_path, 0711); if (ret < 0 && errno != EEXIST) { fprintf(stderr, "Failed to create directory \"%s\"\n", shmount_path); return false; } /* Prepare host mountpoint */ ret = mount("tmpfs", shmount_path, "tmpfs", 0, "size=100k,mode=0711"); if (ret < 0) { fprintf(stderr, "Failed to mount \"%s\"\n", shmount_path); return false; } ret = mount(shmount_path, shmount_path, "none", MS_REC | MS_SHARED, ""); if (ret < 0) { fprintf(stderr, "Failed to make shared \"%s\"\n", shmount_path); return false; } return true; } static void lxc_teardown_shmount(char *shmount_path) { (void)umount2(shmount_path, MNT_DETACH); (void)lxc_rm_rf(shmount_path); } int main(int argc, char *argv[]) { if (!lxc_setup_shmount("/tmp/mount_injection_test")) exit(EXIT_FAILURE); if (do_priv_container_test()) { fprintf(stderr, "Privileged mount injection test failed\n"); exit(EXIT_FAILURE); } if (do_unpriv_container_test()) { fprintf(stderr, "Unprivileged mount injection test failed\n"); exit(EXIT_FAILURE); } lxc_teardown_shmount("/tmp/mount_injection_test"); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/lxcpath.c0000644061062106075000000000432114176403775013073 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "memory_utils.h" #define MYNAME "lxctest1" #define TSTERR(x) do { \ fprintf(stderr, "%d: %s\n", __LINE__, x); \ } while (0) int main(int argc, char *argv[]) { struct lxc_container *c; const char *p1; __do_free char *p2 = NULL; int retval = -1; c = lxc_container_new(MYNAME, NULL); if (!c) { TSTERR("create using default path"); goto err; } p1 = c->get_config_path(c); p2 = c->config_file_name(c); if (!p1 || !p2 || strncmp(p1, p2, strlen(p1))) { TSTERR("Bad result for path names"); goto err; } #define CPATH "/boo" #define FPATH "/boo/lxctest1/config" if (!c->set_config_path(c, "/boo")) { TSTERR("Error setting custom path"); goto err; } p1 = c->get_config_path(c); free(p2); p2 = c->config_file_name(c); if (strcmp(p1, CPATH) || strcmp(p2, FPATH)) { TSTERR("Bad result for path names after set_config_path()"); goto err; } lxc_container_put(c); c = lxc_container_new(MYNAME, CPATH); if (!c) { TSTERR("create using custom path"); goto err; } p1 = c->get_config_path(c); free(p2); p2 = c->config_file_name(c); if (strcmp(p1, CPATH) || strcmp(p2, FPATH)) { TSTERR("Bad result for path names after create with custom path"); goto err; } retval = 0; err: lxc_container_put(c); return retval; } lxc-4.0.12/src/tests/list.c0000644061062106075000000000522714176403775012411 00000000000000/* list.c * * Copyright © 2013 Canonical, Inc * Author: Serge Hallyn * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include static void test_list_func(const char *lxcpath, const char *type, int (*func)(const char *path, char ***names, struct lxc_container ***cret)) { int i, n, n2; struct lxc_container **clist; char **names; printf("%-10s Counting containers\n", type); n = func(lxcpath, NULL, NULL); printf("%-10s Counted %d containers\n", type, n); printf("%-10s Get container struct only\n", type); n2 = func(lxcpath, NULL, &clist); if (n2 != n) printf("Warning: first call returned %d, second %d\n", n, n2); for (i = 0; i < n2; i++) { struct lxc_container *c = clist[i]; printf("%-10s Got container struct %s\n", type, c->name); lxc_container_put(c); } if (n2 > 0) { free(clist); clist = NULL; } printf("%-10s Get names only\n", type); n2 = func(lxcpath, &names, NULL); if (n2 != n) printf("Warning: first call returned %d, second %d\n", n, n2); for (i = 0; i < n2; i++) { printf("%-10s Got container name %s\n", type, names[i]); free(names[i]); } if (n2 > 0) { free(names); names = NULL; } printf("%-10s Get names and containers\n", type); n2 = func(lxcpath, &names, &clist); if (n2 != n) printf("Warning: first call returned %d, second %d\n", n, n2); for (i = 0; i < n2; i++) { struct lxc_container *c = clist[i]; printf("%-10s Got container struct %s, name %s\n", type, c->name, names[i]); if (strcmp(c->name, names[i])) fprintf(stderr, "ERROR: name mismatch!\n"); free(names[i]); lxc_container_put(c); } if (n2 > 0) { free(names); free(clist); } } int main(int argc, char *argv[]) { const char *lxcpath = NULL; if (argc > 1) lxcpath = argv[1]; test_list_func(lxcpath, "Defined:", list_defined_containers); test_list_func(lxcpath, "Active:", list_active_containers); test_list_func(lxcpath, "All:", list_all_containers); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/lxc-test-lxc-attach0000755061062106075000000001654514176403775015016 00000000000000#!/bin/sh # lxc: linux Container library # Authors: # Christian Brauner # # This is a test script for the lxc-attach program. It tests whether I/O # redirection and pty allocation works correctly. # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -e # NOTE: # lxc-attach allocates a pty on the host and attaches any standard file # descriptors that refer to a pty to it. Standard file descriptors which do not # refer to a pty are not attached. In order to determine whether lxc-attach # works correctly we test various methods of redirection on the host. E.g.: # # lxc-attach -n busy -- hostname < /dev/null # # This is done to check whether the file descriptor that gets redirected to # /dev/null is (a) left alone and (b) that lxc-attach does not fail. When # lxc-attach fails we know that it's behavior has been altered, e.g. by trying # to attach a standard file descriptor that does not refer to a pty. # The small table preceeding each test case show which standard file descriptors # we expect to be attached to a pty and which we expect to be redirected. E.g. # # stdin --> attached to pty # stdout --> attached to pty # stderr --> attached to pty allocate_pty="nopty" ATTACH_LOG=$(mktemp --dry-run) FAIL() { echo -n "Failed " >&2 echo "$*" >&2 cat "${ATTACH_LOG}" rm -f "${ATTACH_LOG}" || true lxc-destroy -n busy -f exit 1 } # Create a container, start it and wait for it to be in running state. lxc-create -t busybox -n busy -l trace -o "${ATTACH_LOG}" || FAIL "creating busybox container" lxc-start -n busy -d -l trace -o "${ATTACH_LOG}" || FAIL "starting busybox container" lxc-wait -n busy -s RUNNING -l trace -o "${ATTACH_LOG}" || FAIL "waiting for busybox container to run" if [ -t 0 ] && [ -t 1 ] && [ -t 2 ]; then allocate_pty="pty" echo "All standard file descriptors refer to a pty." echo "Tests for lxc-attach pty allocation and I/O redirection" echo "will be performed correctly." fi # stdin --> attached to pty # stdout --> attached to pty # stderr --> attached to pty for i in $(seq 1 100); do attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- hostname || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "lxc-attach -n busy -- hostname" fi done # stdin --> /dev/null # stdout --> attached to pty # stderr --> attached to pty attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- hostname < /dev/null || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "lxc-attach -n busy -- hostname < /dev/null" fi # stdin --> attached to pty # stdout --> /dev/null # stderr --> attached to pty attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- hostname > /dev/null || FAIL "to allocate or setup pty") if [ -n "$attach" ]; then FAIL "lxc-attach -n busy -- hostname > /dev/null" fi # stdin --> attached to pty # stdout --> attached to pty # stderr --> /dev/null attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- hostname 2> /dev/null || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "lxc-attach -n busy -- hostname 2> /dev/null < /dev/null" fi # stdin --> /dev/null # stdout --> attached to pty # stderr --> /dev/null attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- hostname 2> /dev/null < /dev/null || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "lxc-attach -n busy -- hostname 2> /dev/null < /dev/null" fi # Use a synthetic reproducer in container to produce output on stderr. stdout on # the host gets redirect to /dev/null. We should still be able to receive # containers output on stderr on the host. (The command is run in a subshell. # This allows us to redirect stderr to stdout for the subshell and capture the # output in the attach variable.) # stdin --> attached to pty # stdout --> /dev/null # stderr --> attached to pty attach=$( ( lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- sh -c 'hostname >&2' > /dev/null ) 2>&1 || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "lxc-attach -n busy -- sh -c 'hostname >&2' > /dev/null" fi # Use a synthetic reproducer in container to produce output on stderr. stderr on # the host gets redirect to /dev/null. We should not receive output on stderr on # the host. (The command is run in a subshell. This allows us to redirect stderr # to stdout for the subshell and capture the output in the attach variable.) # stdin --> attached to pty # stdout --> attach to pty # stderr --> /dev/null attach=$( ( lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- sh -c 'hostname >&2' 2> /dev/null ) 2>&1 || FAIL "to allocate or setup pty") if [ -n "$attach" ]; then FAIL "lxc-attach -n busy -- sh -c 'hostname >&2' 2> /dev/null" fi # stdin --> attached to pty # stdout --> /dev/null # stderr --> attached to pty # (As we expect the exit code of the command to be 1 we ignore it.) attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- sh -c 'rm 2>&1' > /dev/null || true) if [ -n "$attach" ]; then FAIL "lxc-attach -n busy -- sh -c 'rm 2>&1' > /dev/null" fi # - stdin --> attached to pty # - stdout --> attached to pty # - stderr --> /dev/null # (As we expect the exit code of the command to be 1 we ignore it.) attach=$(lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- sh -c 'rm 2>&1' 2> /dev/null || true) if [ -z "$attach" ]; then FAIL "lxc-attach -n busy -- sh -c 'rm 2>&1' 2> /dev/null" fi # stdin --> $in # stdout --> attached to pty # stderr --> attached to pty attach=$(echo hostname | lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- || FAIL "to allocate or setup pty") if [ "$attach" != "busy" ]; then FAIL "echo hostname | lxc-attach -n busy --" fi # stdin --> attached to pty # stdout --> $out # stderr --> $err out=$(mktemp /tmp/out_XXXX) err=$(mktemp /tmp/err_XXXX) trap "rm -f $out $err" EXIT INT QUIT PIPE lxc-attach -n busy -l trace -o "${ATTACH_LOG}" -- sh -c 'echo OUT; echo ERR >&2' > $out 2> $err || FAIL "to allocate or setup pty" outcontent=$(cat $out) errcontent=$(cat $err) if [ "$outcontent" != "OUT" ] || [ "$errcontent" != "ERR" ]; then FAIL "lxc-attach -n busy -- sh -c 'echo OUT; echo ERR >&2' > $out 2> $err" fi rm -f $out $err # stdin --> $in # stdout --> $out # stderr --> $err # (As we expect the exit code of the command to be 1 we ignore it.) out=$(mktemp /tmp/out_XXXX) err=$(mktemp /tmp/err_XXXX) trap "rm -f $out $err" EXIT INT QUIT PIPE echo "hostname; rm" | lxc-attach -n busy -l trace -o "${ATTACH_LOG}" > $out 2> $err || true outcontent=$(cat $out) errcontent=$(cat $err) if [ "$outcontent" != "busy" ] || [ -z "$errcontent" ]; then FAIL "echo 'hostname; rm' | lxc-attach -n busy > $out 2> $err" fi rm -f $out $err lxc-destroy -n busy -f rm -f "${ATTACH_LOG}" || true exit 0 lxc-4.0.12/src/tests/lxc-test-symlink0000755061062106075000000000500114176403775014435 00000000000000#!/bin/bash set -ex # lxc: linux Container library # Authors: # Serge Hallyn # # This is a regression test for symbolic links dirname=$(mktemp -d) fname=$(mktemp) fname2=$(mktemp) lxcpath=/var/lib/lxcsym1 cleanup() { lxc-destroy -P $lxcpath -f -n symtest1 || true rm -f $lxcpath rmdir $dirname || true rm -f $fname || true rm -f $fname2 || true } trap cleanup EXIT SIGHUP SIGINT SIGTERM testrun() { expected=$1 run=$2 pass="pass" lxc-start -P $lxcpath -n symtest1 -l trace -o $lxcpath/log || pass="fail" [ $pass = "pass" ] && lxc-wait -P $lxcpath -n symtest1 -t 10 -s RUNNING || pass="fail" if [ "$pass" != "$expected" ]; then echo "Test $run: expected $expected but container did not. Start log:" cat $lxcpath/log echo "FAIL: Test $run: expected $expected but container did not." false fi lxc-stop -P $lxcpath -n symtest1 -k || true } # make lxcpath a symlink - this should NOT cause failure ln -s /var/lib/lxc $lxcpath lxc-destroy -P $lxcpath -f -n symtest1 || true lxc-create -P $lxcpath -t busybox -n symtest1 cat >> /var/lib/lxc/symtest1/config << EOF lxc.mount.entry = $dirname opt/xxx/dir none bind,create=dir lxc.mount.entry = $fname opt/xxx/file none bind,create=file lxc.mount.entry = $fname2 opt/xxx/file2 none bind lxc.mount.entry = $dirname /var/lib/lxc/symtest1/rootfs/opt/xxx/dir2 none bind,create=dir EOF # Regular - should succeed mkdir -p /var/lib/lxc/symtest1/rootfs/opt/xxx touch /var/lib/lxc/symtest1/rootfs/opt/xxx/file2 testrun pass 1 # symlink - should fail rm -rf /var/lib/lxc/symtest1/rootfs/opt/xxx mkdir -p /var/lib/lxc/symtest1/rootfs/opt/xxx2 ln -s /var/lib/lxc/symtest1/rootfs/opt/xxx2 /var/lib/lxc/symtest1/rootfs/opt/xxx touch /var/lib/lxc/symtest1/rootfs/opt/xxx/file2 testrun fail 2 # final final symlink - should fail rm -rf $lxcpath/symtest1/rootfs/opt/xxx mkdir -p $lxcpath/symtest1/rootfs/opt/xxx mkdir -p $lxcpath/symtest1/rootfs/opt/xxx/dir touch $lxcpath/symtest1/rootfs/opt/xxx/file touch $lxcpath/symtest1/rootfs/opt/xxx/file2src ln -s $lxcpath/symtest1/rootfs/opt/xxx/file2src $lxcpath/symtest1/rootfs/opt/xxx/file2 testrun fail 3 # Ideally we'd also try a loop device, but that won't work in nested containers # anyway - TODO # what about /proc itself rm -rf $lxcpath/symtest1/rootfs/opt/xxx mkdir -p $lxcpath/symtest1/rootfs/opt/xxx touch $lxcpath/symtest1/rootfs/opt/xxx/file2 mv $lxcpath/symtest1/rootfs/proc $lxcpath/symtest1/rootfs/proc1 ln -s $lxcpath/symtest1/rootfs/proc1 $lxcpath/symtest1/rootfs/proc testrun fail 4 echo "all tests passed" lxc-4.0.12/src/tests/Makefile.in0000644061062106075000000100620114176404005013314 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_APPARMOR_TRUE@@ENABLE_TESTS_TRUE@am__append_1 = ../lxc/lsm/apparmor.c @ENABLE_SELINUX_TRUE@@ENABLE_TESTS_TRUE@am__append_2 = ../lxc/lsm/selinux.c @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_3 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_4 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_5 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_6 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_7 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_8 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_9 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_10 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_11 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_12 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_13 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_14 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_15 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_16 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_17 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_18 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_19 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_20 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_21 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_22 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_23 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_24 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_25 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_26 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_27 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_28 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_29 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_30 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_31 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_32 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_33 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_34 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_35 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_36 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_37 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_38 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_39 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_40 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_41 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_42 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_43 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_44 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_45 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_46 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_47 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_48 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_49 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_50 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_51 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_52 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_53 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_54 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_55 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_56 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_57 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_58 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_59 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_60 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_61 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_62 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_63 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_64 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_65 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_66 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_67 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_68 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_69 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_70 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_71 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_72 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_73 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_74 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_75 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_76 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_77 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_78 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_79 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_80 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_81 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_82 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_83 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_84 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_85 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_86 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_87 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_88 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_89 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_90 = ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_91 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_92 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_93 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_94 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_95 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_96 = ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_97 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_98 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_99 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_100 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_101 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_102 = ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_103 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_104 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_105 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_106 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_107 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_108 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_109 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_110 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_111 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_112 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_113 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_114 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_115 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_116 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_117 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_118 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_119 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_120 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_121 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_122 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_123 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_124 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_125 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_126 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_127 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_128 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_129 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_130 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_131 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_132 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_133 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_134 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_135 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_136 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_137 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_138 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_139 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_140 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_141 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_142 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_143 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_144 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_145 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_146 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_147 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_148 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_149 = ../lxc/seccomp.c ../lxc/lxcseccomp.h @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_150 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__append_151 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__append_152 = ../include/strlcat.c ../include/strlcat.h @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__append_153 = ../include/openpty.c ../include/openpty.h @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__append_154 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_155 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_156 = ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@am__append_157 = -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ @ENABLE_TESTS_TRUE@ -DLXCPATH=\"$(LXCPATH)\" \ @ENABLE_TESTS_TRUE@ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ @ENABLE_TESTS_TRUE@ -DLXCINITDIR=\"$(LXCINITDIR)\" \ @ENABLE_TESTS_TRUE@ -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ @ENABLE_TESTS_TRUE@ -DLOGPATH=\"$(LOGPATH)\" \ @ENABLE_TESTS_TRUE@ -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \ @ENABLE_TESTS_TRUE@ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ @ENABLE_TESTS_TRUE@ -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \ @ENABLE_TESTS_TRUE@ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \ @ENABLE_TESTS_TRUE@ -DSBINDIR=\"$(SBINDIR)\" \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src/include \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src/lxc \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src/lxc/cgroups \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src/lxc/tools \ @ENABLE_TESTS_TRUE@ -I $(top_srcdir)/src/lxc/storage \ @ENABLE_TESTS_TRUE@ -pthread @ENABLE_APPARMOR_TRUE@@ENABLE_TESTS_TRUE@am__append_158 = \ @ENABLE_APPARMOR_TRUE@@ENABLE_TESTS_TRUE@ -DHAVE_APPARMOR \ @ENABLE_APPARMOR_TRUE@@ENABLE_TESTS_TRUE@ -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__append_159 = -DHAVE_SECCOMP \ @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@ $(SECCOMP_CFLAGS) @ENABLE_SELINUX_TRUE@@ENABLE_TESTS_TRUE@am__append_160 = -DHAVE_SELINUX @ENABLE_TESTS_TRUE@bin_PROGRAMS = lxc-test-api-reboot$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-apparmor$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-arch-parse$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-attach$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-basic$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-capabilities$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-cgpath$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-clonetest$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-concurrent$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-config-jump-table$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-console$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-console-log$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-containertests$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-createtest$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-criu-check-feature$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-cve-2019-5736$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-destroytest$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-device-add-remove$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-getkeys$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-get_item$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-list$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-locktests$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-lxcpath$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-may-control$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-mount-injection$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-parse-config-file$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-proc-pid$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-raw-clone$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-reboot$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-rootfs-options$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-saveconfig$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-share-ns$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-shortlived$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-shutdowntest$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-snapshot$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-startone$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-state-server$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-sysctls$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-sys-mixed$(EXEEXT) \ @ENABLE_TESTS_TRUE@ lxc-test-utils$(EXEEXT) $(am__EXEEXT_1) @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@am__append_161 = lxc-test-automount \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-autostart \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-cloneconfig \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-createconfig \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-exit-code \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-no-new-privs \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-rootfs \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-procsys \ @ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-usernsexec @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@am__append_162 = lxc-test-lxc-attach \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-apparmor-mount \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-apparmor-generated \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-checkpoint-restore \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-snapdeps \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-symlink \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-unpriv \ @DISTRO_UBUNTU_TRUE@@ENABLE_TESTS_TRUE@@ENABLE_TOOLS_TRUE@ lxc-test-usernic @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am__append_163 = fuzz-lxc-cgroup-init \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ fuzz-lxc-config-read \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ fuzz-lxc-define-load @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am__append_164 = lxc-test-fuzzers subdir = src/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/acinclude.m4 \ $(top_srcdir)/config/attributes.m4 \ $(top_srcdir)/config/ax_pthread.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = lxc-test-usernic CONFIG_CLEAN_VPATH_FILES = @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am__EXEEXT_1 = fuzz-lxc-cgroup-init$(EXEEXT) \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ fuzz-lxc-config-read$(EXEEXT) \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ fuzz-lxc-define-load$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__fuzz_lxc_cgroup_init_SOURCES_DIST = fuzz-lxc-cgroup-init.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am_fuzz_lxc_cgroup_init_OBJECTS = fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.$(OBJEXT) fuzz_lxc_cgroup_init_OBJECTS = $(am_fuzz_lxc_cgroup_init_OBJECTS) @ENABLE_TESTS_TRUE@am__DEPENDENCIES_1 = ../lxc/liblxc.la @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_DEPENDENCIES = \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = fuzz_lxc_cgroup_init_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(fuzz_lxc_cgroup_init_CXXFLAGS) $(CXXFLAGS) \ $(fuzz_lxc_cgroup_init_LDFLAGS) $(LDFLAGS) -o $@ am__fuzz_lxc_config_read_SOURCES_DIST = fuzz-lxc-config-read.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am_fuzz_lxc_config_read_OBJECTS = fuzz_lxc_config_read-fuzz-lxc-config-read.$(OBJEXT) fuzz_lxc_config_read_OBJECTS = $(am_fuzz_lxc_config_read_OBJECTS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_DEPENDENCIES = \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) fuzz_lxc_config_read_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(fuzz_lxc_config_read_CXXFLAGS) $(CXXFLAGS) \ $(fuzz_lxc_config_read_LDFLAGS) $(LDFLAGS) -o $@ am__fuzz_lxc_define_load_SOURCES_DIST = fuzz-lxc-define-load.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@am_fuzz_lxc_define_load_OBJECTS = fuzz_lxc_define_load-fuzz-lxc-define-load.$(OBJEXT) fuzz_lxc_define_load_OBJECTS = $(am_fuzz_lxc_define_load_OBJECTS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_DEPENDENCIES = \ @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) fuzz_lxc_define_load_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(fuzz_lxc_define_load_CXXFLAGS) $(CXXFLAGS) \ $(fuzz_lxc_define_load_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_test_api_reboot_SOURCES_DIST = api_reboot.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h am__dirstamp = $(am__leading_dot)dirstamp @ENABLE_APPARMOR_TRUE@@ENABLE_TESTS_TRUE@am__objects_1 = ../lxc/lsm/apparmor.$(OBJEXT) @ENABLE_SELINUX_TRUE@@ENABLE_TESTS_TRUE@am__objects_2 = ../lxc/lsm/selinux.$(OBJEXT) @ENABLE_TESTS_TRUE@am__objects_3 = ../lxc/lsm/lsm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lsm/nop.$(OBJEXT) $(am__objects_1) \ @ENABLE_TESTS_TRUE@ $(am__objects_2) @ENABLE_SECCOMP_TRUE@@ENABLE_TESTS_TRUE@am__objects_4 = ../lxc/seccomp.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_STRCHRNUL_FALSE@am__objects_5 = ../include/strchrnul.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_STRLCPY_FALSE@am__objects_6 = ../include/strlcpy.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_STRLCAT_FALSE@am__objects_7 = ../include/strlcat.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_OPENPTY_FALSE@am__objects_8 = ../include/openpty.$(OBJEXT) @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@am__objects_9 = ../include/fexecve.$(OBJEXT) \ @ENABLE_TESTS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_GETGRGID_R_FALSE@am__objects_10 = ../include/getgrgid_r.$(OBJEXT) @ENABLE_TESTS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__objects_11 = ../include/prlimit.$(OBJEXT) @ENABLE_TESTS_TRUE@am_lxc_test_api_reboot_OBJECTS = \ @ENABLE_TESTS_TRUE@ api_reboot.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_api_reboot_OBJECTS = $(am_lxc_test_api_reboot_OBJECTS) lxc_test_api_reboot_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_api_reboot_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_apparmor_SOURCES_DIST = aa.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_apparmor_OBJECTS = aa.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_apparmor_OBJECTS = $(am_lxc_test_apparmor_OBJECTS) lxc_test_apparmor_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_apparmor_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_arch_parse_SOURCES_DIST = arch_parse.c lxctest.h \ ../lxc/lxc.h ../lxc/memory_utils.h @ENABLE_TESTS_TRUE@am_lxc_test_arch_parse_OBJECTS = \ @ENABLE_TESTS_TRUE@ arch_parse.$(OBJEXT) lxc_test_arch_parse_OBJECTS = $(am_lxc_test_arch_parse_OBJECTS) lxc_test_arch_parse_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_arch_parse_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_attach_SOURCES_DIST = attach.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_attach_OBJECTS = attach.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_attach_OBJECTS = $(am_lxc_test_attach_OBJECTS) lxc_test_attach_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_attach_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_basic_SOURCES_DIST = basic.c @ENABLE_TESTS_TRUE@am_lxc_test_basic_OBJECTS = basic.$(OBJEXT) lxc_test_basic_OBJECTS = $(am_lxc_test_basic_OBJECTS) lxc_test_basic_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_basic_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_capabilities_SOURCES_DIST = capabilities.c \ ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_capabilities_OBJECTS = \ @ENABLE_TESTS_TRUE@ capabilities.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_capabilities_OBJECTS = $(am_lxc_test_capabilities_OBJECTS) lxc_test_capabilities_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_capabilities_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_cgpath_SOURCES_DIST = cgpath.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_cgpath_OBJECTS = cgpath.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_cgpath_OBJECTS = $(am_lxc_test_cgpath_OBJECTS) lxc_test_cgpath_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_cgpath_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_clonetest_SOURCES_DIST = clonetest.c @ENABLE_TESTS_TRUE@am_lxc_test_clonetest_OBJECTS = \ @ENABLE_TESTS_TRUE@ clonetest.$(OBJEXT) lxc_test_clonetest_OBJECTS = $(am_lxc_test_clonetest_OBJECTS) lxc_test_clonetest_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_clonetest_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_concurrent_SOURCES_DIST = concurrent.c @ENABLE_TESTS_TRUE@am_lxc_test_concurrent_OBJECTS = \ @ENABLE_TESTS_TRUE@ concurrent.$(OBJEXT) lxc_test_concurrent_OBJECTS = $(am_lxc_test_concurrent_OBJECTS) lxc_test_concurrent_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_concurrent_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_config_jump_table_SOURCES_DIST = config_jump_table.c \ lxctest.h ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c \ ../lxc/caps.h ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_config_jump_table_OBJECTS = \ @ENABLE_TESTS_TRUE@ config_jump_table.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_config_jump_table_OBJECTS = \ $(am_lxc_test_config_jump_table_OBJECTS) lxc_test_config_jump_table_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_config_jump_table_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_console_SOURCES_DIST = console.c @ENABLE_TESTS_TRUE@am_lxc_test_console_OBJECTS = console.$(OBJEXT) lxc_test_console_OBJECTS = $(am_lxc_test_console_OBJECTS) lxc_test_console_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_console_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_console_log_SOURCES_DIST = console_log.c lxctest.h @ENABLE_TESTS_TRUE@am_lxc_test_console_log_OBJECTS = \ @ENABLE_TESTS_TRUE@ console_log.$(OBJEXT) lxc_test_console_log_OBJECTS = $(am_lxc_test_console_log_OBJECTS) lxc_test_console_log_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_console_log_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_containertests_SOURCES_DIST = containertests.c @ENABLE_TESTS_TRUE@am_lxc_test_containertests_OBJECTS = \ @ENABLE_TESTS_TRUE@ containertests.$(OBJEXT) lxc_test_containertests_OBJECTS = \ $(am_lxc_test_containertests_OBJECTS) lxc_test_containertests_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_containertests_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_createtest_SOURCES_DIST = createtest.c @ENABLE_TESTS_TRUE@am_lxc_test_createtest_OBJECTS = \ @ENABLE_TESTS_TRUE@ createtest.$(OBJEXT) lxc_test_createtest_OBJECTS = $(am_lxc_test_createtest_OBJECTS) lxc_test_createtest_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_createtest_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_criu_check_feature_SOURCES_DIST = criu_check_feature.c \ lxctest.h @ENABLE_TESTS_TRUE@am_lxc_test_criu_check_feature_OBJECTS = \ @ENABLE_TESTS_TRUE@ criu_check_feature.$(OBJEXT) lxc_test_criu_check_feature_OBJECTS = \ $(am_lxc_test_criu_check_feature_OBJECTS) lxc_test_criu_check_feature_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_criu_check_feature_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_cve_2019_5736_SOURCES_DIST = cve-2019-5736.c lxctest.h @ENABLE_TESTS_TRUE@am_lxc_test_cve_2019_5736_OBJECTS = \ @ENABLE_TESTS_TRUE@ cve-2019-5736.$(OBJEXT) lxc_test_cve_2019_5736_OBJECTS = $(am_lxc_test_cve_2019_5736_OBJECTS) lxc_test_cve_2019_5736_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_cve_2019_5736_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_destroytest_SOURCES_DIST = destroytest.c @ENABLE_TESTS_TRUE@am_lxc_test_destroytest_OBJECTS = \ @ENABLE_TESTS_TRUE@ destroytest.$(OBJEXT) lxc_test_destroytest_OBJECTS = $(am_lxc_test_destroytest_OBJECTS) lxc_test_destroytest_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_destroytest_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_device_add_remove_SOURCES_DIST = device_add_remove.c \ ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_device_add_remove_OBJECTS = \ @ENABLE_TESTS_TRUE@ device_add_remove.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_device_add_remove_OBJECTS = \ $(am_lxc_test_device_add_remove_OBJECTS) lxc_test_device_add_remove_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_device_add_remove_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_get_item_SOURCES_DIST = get_item.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_get_item_OBJECTS = get_item.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_get_item_OBJECTS = $(am_lxc_test_get_item_OBJECTS) lxc_test_get_item_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_get_item_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_getkeys_SOURCES_DIST = getkeys.c @ENABLE_TESTS_TRUE@am_lxc_test_getkeys_OBJECTS = getkeys.$(OBJEXT) lxc_test_getkeys_OBJECTS = $(am_lxc_test_getkeys_OBJECTS) lxc_test_getkeys_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_getkeys_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_list_SOURCES_DIST = list.c @ENABLE_TESTS_TRUE@am_lxc_test_list_OBJECTS = list.$(OBJEXT) lxc_test_list_OBJECTS = $(am_lxc_test_list_OBJECTS) lxc_test_list_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_list_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_locktests_SOURCES_DIST = locktests.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_locktests_OBJECTS = \ @ENABLE_TESTS_TRUE@ locktests.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_locktests_OBJECTS = $(am_lxc_test_locktests_OBJECTS) lxc_test_locktests_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_locktests_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_lxcpath_SOURCES_DIST = lxcpath.c @ENABLE_TESTS_TRUE@am_lxc_test_lxcpath_OBJECTS = lxcpath.$(OBJEXT) lxc_test_lxcpath_OBJECTS = $(am_lxc_test_lxcpath_OBJECTS) lxc_test_lxcpath_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_lxcpath_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_may_control_SOURCES_DIST = may_control.c @ENABLE_TESTS_TRUE@am_lxc_test_may_control_OBJECTS = \ @ENABLE_TESTS_TRUE@ may_control.$(OBJEXT) lxc_test_may_control_OBJECTS = $(am_lxc_test_may_control_OBJECTS) lxc_test_may_control_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_may_control_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_mount_injection_SOURCES_DIST = mount_injection.c \ lxctest.h ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c \ ../lxc/caps.h ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_mount_injection_OBJECTS = \ @ENABLE_TESTS_TRUE@ mount_injection.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_mount_injection_OBJECTS = \ $(am_lxc_test_mount_injection_OBJECTS) lxc_test_mount_injection_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_mount_injection_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_parse_config_file_SOURCES_DIST = parse_config_file.c \ lxctest.h ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c \ ../lxc/caps.h ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_parse_config_file_OBJECTS = \ @ENABLE_TESTS_TRUE@ parse_config_file.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_parse_config_file_OBJECTS = \ $(am_lxc_test_parse_config_file_OBJECTS) lxc_test_parse_config_file_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_parse_config_file_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_proc_pid_SOURCES_DIST = proc_pid.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_proc_pid_OBJECTS = proc_pid.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_proc_pid_OBJECTS = $(am_lxc_test_proc_pid_OBJECTS) lxc_test_proc_pid_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_proc_pid_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_raw_clone_SOURCES_DIST = lxc_raw_clone.c lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_raw_clone_OBJECTS = \ @ENABLE_TESTS_TRUE@ lxc_raw_clone.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_raw_clone_OBJECTS = $(am_lxc_test_raw_clone_OBJECTS) lxc_test_raw_clone_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_raw_clone_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_reboot_SOURCES_DIST = reboot.c @ENABLE_TESTS_TRUE@am_lxc_test_reboot_OBJECTS = reboot.$(OBJEXT) lxc_test_reboot_OBJECTS = $(am_lxc_test_reboot_OBJECTS) lxc_test_reboot_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_reboot_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_rootfs_options_SOURCES_DIST = rootfs_options.c \ ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_rootfs_options_OBJECTS = \ @ENABLE_TESTS_TRUE@ rootfs_options.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_rootfs_options_OBJECTS = \ $(am_lxc_test_rootfs_options_OBJECTS) lxc_test_rootfs_options_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_rootfs_options_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_saveconfig_SOURCES_DIST = saveconfig.c @ENABLE_TESTS_TRUE@am_lxc_test_saveconfig_OBJECTS = \ @ENABLE_TESTS_TRUE@ saveconfig.$(OBJEXT) lxc_test_saveconfig_OBJECTS = $(am_lxc_test_saveconfig_OBJECTS) lxc_test_saveconfig_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_saveconfig_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_share_ns_SOURCES_DIST = share_ns.c lxctest.h \ ../lxc/compiler.h ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h ../include/openpty.c \ ../include/openpty.h ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h \ ../include/getgrgid_r.c ../include/getgrgid_r.h \ ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_share_ns_OBJECTS = share_ns.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_share_ns_OBJECTS = $(am_lxc_test_share_ns_OBJECTS) lxc_test_share_ns_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_share_ns_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_shortlived_SOURCES_DIST = shortlived.c \ ../lxc/file_utils.c ../lxc/file_utils.h ../lxc/string_utils.c \ ../lxc/string_utils.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_shortlived_OBJECTS = \ @ENABLE_TESTS_TRUE@ shortlived.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_shortlived_OBJECTS = $(am_lxc_test_shortlived_OBJECTS) lxc_test_shortlived_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_shortlived_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_shutdowntest_SOURCES_DIST = shutdowntest.c @ENABLE_TESTS_TRUE@am_lxc_test_shutdowntest_OBJECTS = \ @ENABLE_TESTS_TRUE@ shutdowntest.$(OBJEXT) lxc_test_shutdowntest_OBJECTS = $(am_lxc_test_shutdowntest_OBJECTS) lxc_test_shutdowntest_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_shutdowntest_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_snapshot_SOURCES_DIST = snapshot.c @ENABLE_TESTS_TRUE@am_lxc_test_snapshot_OBJECTS = snapshot.$(OBJEXT) lxc_test_snapshot_OBJECTS = $(am_lxc_test_snapshot_OBJECTS) lxc_test_snapshot_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_snapshot_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_startone_SOURCES_DIST = startone.c @ENABLE_TESTS_TRUE@am_lxc_test_startone_OBJECTS = startone.$(OBJEXT) lxc_test_startone_OBJECTS = $(am_lxc_test_startone_OBJECTS) lxc_test_startone_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_startone_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_state_server_SOURCES_DIST = state_server.c lxctest.h \ ../lxc/compiler.h ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h ../include/openpty.c \ ../include/openpty.h ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h \ ../include/getgrgid_r.c ../include/getgrgid_r.h \ ../include/prlimit.c ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_state_server_OBJECTS = \ @ENABLE_TESTS_TRUE@ state_server.$(OBJEXT) $(am__objects_6) \ @ENABLE_TESTS_TRUE@ $(am__objects_7) $(am__objects_8) \ @ENABLE_TESTS_TRUE@ $(am__objects_9) $(am__objects_10) \ @ENABLE_TESTS_TRUE@ $(am__objects_11) lxc_test_state_server_OBJECTS = $(am_lxc_test_state_server_OBJECTS) lxc_test_state_server_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_state_server_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ ../lxc/liblxc.la am__lxc_test_sys_mixed_SOURCES_DIST = sys_mixed.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_sys_mixed_OBJECTS = \ @ENABLE_TESTS_TRUE@ sys_mixed.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_sys_mixed_OBJECTS = $(am_lxc_test_sys_mixed_OBJECTS) lxc_test_sys_mixed_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_sys_mixed_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_sysctls_SOURCES_DIST = sysctls.c ../lxc/af_unix.c \ ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_sysctls_OBJECTS = sysctls.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_sysctls_OBJECTS = $(am_lxc_test_sysctls_OBJECTS) lxc_test_sysctls_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_sysctls_DEPENDENCIES = ../lxc/liblxc.la am__lxc_test_utils_SOURCES_DIST = lxc-test-utils.c lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c ../lxc/cgroups/cgroup.c \ ../lxc/cgroups/cgroup.h ../lxc/cgroups/cgroup2_devices.c \ ../lxc/cgroups/cgroup2_devices.h ../lxc/cgroups/cgroup_utils.c \ ../lxc/cgroups/cgroup_utils.h ../lxc/commands.c \ ../lxc/commands.h ../lxc/commands_utils.c \ ../lxc/commands_utils.h ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h ../lxc/confile_utils.c \ ../lxc/confile_utils.h ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h ../lxc/log.c \ ../lxc/log.h ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h ../lxc/monitor.c \ ../lxc/monitor.h ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h ../lxc/network.c \ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h ../lxc/parse.c \ ../lxc/parse.h ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h ../lxc/start.c \ ../lxc/start.h ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ ../lxc/storage/nbd.h ../lxc/storage/overlay.c \ ../lxc/storage/overlay.h ../lxc/storage/rbd.c \ ../lxc/storage/rbd.h ../lxc/storage/rsync.c \ ../lxc/storage/rsync.h ../lxc/storage/storage.c \ ../lxc/storage/storage.h ../lxc/storage/storage_utils.c \ ../lxc/storage/storage_utils.h ../lxc/storage/zfs.c \ ../lxc/storage/zfs.h ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h ../lxc/terminal.c \ ../lxc/terminal.h ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ ../lxc/uuid.h ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c ../lxc/lsm/apparmor.c ../lxc/lsm/selinux.c \ ../lxc/seccomp.c ../lxc/lxcseccomp.h ../include/strchrnul.c \ ../include/strchrnul.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h \ ../include/openpty.c ../include/openpty.h ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/prlimit.c \ ../include/prlimit.h @ENABLE_TESTS_TRUE@am_lxc_test_utils_OBJECTS = \ @ENABLE_TESTS_TRUE@ lxc-test-utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/caps.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/conf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/error.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/log.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/network.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/nl.$(OBJEXT) ../lxc/parse.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/start.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/state.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/sync.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/utils.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.$(OBJEXT) $(am__objects_3) \ @ENABLE_TESTS_TRUE@ $(am__objects_4) $(am__objects_5) \ @ENABLE_TESTS_TRUE@ $(am__objects_6) $(am__objects_7) \ @ENABLE_TESTS_TRUE@ $(am__objects_8) $(am__objects_9) \ @ENABLE_TESTS_TRUE@ $(am__objects_10) $(am__objects_11) lxc_test_utils_OBJECTS = $(am_lxc_test_utils_OBJECTS) lxc_test_utils_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@lxc_test_utils_DEPENDENCIES = ../lxc/liblxc.la am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ../include/$(DEPDIR)/fexecve.Po \ ../include/$(DEPDIR)/getgrgid_r.Po \ ../include/$(DEPDIR)/lxcmntent.Po \ ../include/$(DEPDIR)/netns_ifaddrs.Po \ ../include/$(DEPDIR)/openpty.Po \ ../include/$(DEPDIR)/prlimit.Po \ ../include/$(DEPDIR)/strchrnul.Po \ ../include/$(DEPDIR)/strlcat.Po \ ../include/$(DEPDIR)/strlcpy.Po ../lxc/$(DEPDIR)/af_unix.Po \ ../lxc/$(DEPDIR)/caps.Po ../lxc/$(DEPDIR)/commands.Po \ ../lxc/$(DEPDIR)/commands_utils.Po ../lxc/$(DEPDIR)/conf.Po \ ../lxc/$(DEPDIR)/confile.Po ../lxc/$(DEPDIR)/confile_utils.Po \ ../lxc/$(DEPDIR)/error.Po ../lxc/$(DEPDIR)/file_utils.Po \ ../lxc/$(DEPDIR)/initutils.Po ../lxc/$(DEPDIR)/log.Po \ ../lxc/$(DEPDIR)/lxclock.Po ../lxc/$(DEPDIR)/mainloop.Po \ ../lxc/$(DEPDIR)/monitor.Po ../lxc/$(DEPDIR)/mount_utils.Po \ ../lxc/$(DEPDIR)/namespace.Po ../lxc/$(DEPDIR)/network.Po \ ../lxc/$(DEPDIR)/nl.Po ../lxc/$(DEPDIR)/parse.Po \ ../lxc/$(DEPDIR)/process_utils.Po ../lxc/$(DEPDIR)/ringbuf.Po \ ../lxc/$(DEPDIR)/seccomp.Po ../lxc/$(DEPDIR)/start.Po \ ../lxc/$(DEPDIR)/state.Po ../lxc/$(DEPDIR)/string_utils.Po \ ../lxc/$(DEPDIR)/sync.Po ../lxc/$(DEPDIR)/terminal.Po \ ../lxc/$(DEPDIR)/utils.Po ../lxc/$(DEPDIR)/uuid.Po \ ../lxc/cgroups/$(DEPDIR)/cgfsng.Po \ ../lxc/cgroups/$(DEPDIR)/cgroup.Po \ ../lxc/cgroups/$(DEPDIR)/cgroup2_devices.Po \ ../lxc/cgroups/$(DEPDIR)/cgroup_utils.Po \ ../lxc/lsm/$(DEPDIR)/apparmor.Po ../lxc/lsm/$(DEPDIR)/lsm.Po \ ../lxc/lsm/$(DEPDIR)/nop.Po ../lxc/lsm/$(DEPDIR)/selinux.Po \ ../lxc/storage/$(DEPDIR)/btrfs.Po \ ../lxc/storage/$(DEPDIR)/dir.Po \ ../lxc/storage/$(DEPDIR)/loop.Po \ ../lxc/storage/$(DEPDIR)/lvm.Po \ ../lxc/storage/$(DEPDIR)/nbd.Po \ ../lxc/storage/$(DEPDIR)/overlay.Po \ ../lxc/storage/$(DEPDIR)/rbd.Po \ ../lxc/storage/$(DEPDIR)/rsync.Po \ ../lxc/storage/$(DEPDIR)/storage.Po \ ../lxc/storage/$(DEPDIR)/storage_utils.Po \ ../lxc/storage/$(DEPDIR)/zfs.Po ./$(DEPDIR)/aa.Po \ ./$(DEPDIR)/api_reboot.Po ./$(DEPDIR)/arch_parse.Po \ ./$(DEPDIR)/attach.Po ./$(DEPDIR)/basic.Po \ ./$(DEPDIR)/capabilities.Po ./$(DEPDIR)/cgpath.Po \ ./$(DEPDIR)/clonetest.Po ./$(DEPDIR)/concurrent.Po \ ./$(DEPDIR)/config_jump_table.Po ./$(DEPDIR)/console.Po \ ./$(DEPDIR)/console_log.Po ./$(DEPDIR)/containertests.Po \ ./$(DEPDIR)/createtest.Po ./$(DEPDIR)/criu_check_feature.Po \ ./$(DEPDIR)/cve-2019-5736.Po ./$(DEPDIR)/destroytest.Po \ ./$(DEPDIR)/device_add_remove.Po \ ./$(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po \ ./$(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po \ ./$(DEPDIR)/fuzz_lxc_config_read-dummy.Po \ ./$(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po \ ./$(DEPDIR)/fuzz_lxc_define_load-dummy.Po \ ./$(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po \ ./$(DEPDIR)/get_item.Po ./$(DEPDIR)/getkeys.Po \ ./$(DEPDIR)/list.Po ./$(DEPDIR)/locktests.Po \ ./$(DEPDIR)/lxc-test-utils.Po ./$(DEPDIR)/lxc_raw_clone.Po \ ./$(DEPDIR)/lxcpath.Po ./$(DEPDIR)/may_control.Po \ ./$(DEPDIR)/mount_injection.Po \ ./$(DEPDIR)/parse_config_file.Po ./$(DEPDIR)/proc_pid.Po \ ./$(DEPDIR)/reboot.Po ./$(DEPDIR)/rootfs_options.Po \ ./$(DEPDIR)/saveconfig.Po ./$(DEPDIR)/share_ns.Po \ ./$(DEPDIR)/shortlived.Po ./$(DEPDIR)/shutdowntest.Po \ ./$(DEPDIR)/snapshot.Po ./$(DEPDIR)/startone.Po \ ./$(DEPDIR)/state_server.Po ./$(DEPDIR)/sys_mixed.Po \ ./$(DEPDIR)/sysctls.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(fuzz_lxc_cgroup_init_SOURCES) \ $(nodist_EXTRA_fuzz_lxc_cgroup_init_SOURCES) \ $(fuzz_lxc_config_read_SOURCES) \ $(nodist_EXTRA_fuzz_lxc_config_read_SOURCES) \ $(fuzz_lxc_define_load_SOURCES) \ $(nodist_EXTRA_fuzz_lxc_define_load_SOURCES) \ $(lxc_test_api_reboot_SOURCES) $(lxc_test_apparmor_SOURCES) \ $(lxc_test_arch_parse_SOURCES) $(lxc_test_attach_SOURCES) \ $(lxc_test_basic_SOURCES) $(lxc_test_capabilities_SOURCES) \ $(lxc_test_cgpath_SOURCES) $(lxc_test_clonetest_SOURCES) \ $(lxc_test_concurrent_SOURCES) \ $(lxc_test_config_jump_table_SOURCES) \ $(lxc_test_console_SOURCES) $(lxc_test_console_log_SOURCES) \ $(lxc_test_containertests_SOURCES) \ $(lxc_test_createtest_SOURCES) \ $(lxc_test_criu_check_feature_SOURCES) \ $(lxc_test_cve_2019_5736_SOURCES) \ $(lxc_test_destroytest_SOURCES) \ $(lxc_test_device_add_remove_SOURCES) \ $(lxc_test_get_item_SOURCES) $(lxc_test_getkeys_SOURCES) \ $(lxc_test_list_SOURCES) $(lxc_test_locktests_SOURCES) \ $(lxc_test_lxcpath_SOURCES) $(lxc_test_may_control_SOURCES) \ $(lxc_test_mount_injection_SOURCES) \ $(lxc_test_parse_config_file_SOURCES) \ $(lxc_test_proc_pid_SOURCES) $(lxc_test_raw_clone_SOURCES) \ $(lxc_test_reboot_SOURCES) $(lxc_test_rootfs_options_SOURCES) \ $(lxc_test_saveconfig_SOURCES) $(lxc_test_share_ns_SOURCES) \ $(lxc_test_shortlived_SOURCES) \ $(lxc_test_shutdowntest_SOURCES) $(lxc_test_snapshot_SOURCES) \ $(lxc_test_startone_SOURCES) $(lxc_test_state_server_SOURCES) \ $(lxc_test_sys_mixed_SOURCES) $(lxc_test_sysctls_SOURCES) \ $(lxc_test_utils_SOURCES) DIST_SOURCES = $(am__fuzz_lxc_cgroup_init_SOURCES_DIST) \ $(am__fuzz_lxc_config_read_SOURCES_DIST) \ $(am__fuzz_lxc_define_load_SOURCES_DIST) \ $(am__lxc_test_api_reboot_SOURCES_DIST) \ $(am__lxc_test_apparmor_SOURCES_DIST) \ $(am__lxc_test_arch_parse_SOURCES_DIST) \ $(am__lxc_test_attach_SOURCES_DIST) \ $(am__lxc_test_basic_SOURCES_DIST) \ $(am__lxc_test_capabilities_SOURCES_DIST) \ $(am__lxc_test_cgpath_SOURCES_DIST) \ $(am__lxc_test_clonetest_SOURCES_DIST) \ $(am__lxc_test_concurrent_SOURCES_DIST) \ $(am__lxc_test_config_jump_table_SOURCES_DIST) \ $(am__lxc_test_console_SOURCES_DIST) \ $(am__lxc_test_console_log_SOURCES_DIST) \ $(am__lxc_test_containertests_SOURCES_DIST) \ $(am__lxc_test_createtest_SOURCES_DIST) \ $(am__lxc_test_criu_check_feature_SOURCES_DIST) \ $(am__lxc_test_cve_2019_5736_SOURCES_DIST) \ $(am__lxc_test_destroytest_SOURCES_DIST) \ $(am__lxc_test_device_add_remove_SOURCES_DIST) \ $(am__lxc_test_get_item_SOURCES_DIST) \ $(am__lxc_test_getkeys_SOURCES_DIST) \ $(am__lxc_test_list_SOURCES_DIST) \ $(am__lxc_test_locktests_SOURCES_DIST) \ $(am__lxc_test_lxcpath_SOURCES_DIST) \ $(am__lxc_test_may_control_SOURCES_DIST) \ $(am__lxc_test_mount_injection_SOURCES_DIST) \ $(am__lxc_test_parse_config_file_SOURCES_DIST) \ $(am__lxc_test_proc_pid_SOURCES_DIST) \ $(am__lxc_test_raw_clone_SOURCES_DIST) \ $(am__lxc_test_reboot_SOURCES_DIST) \ $(am__lxc_test_rootfs_options_SOURCES_DIST) \ $(am__lxc_test_saveconfig_SOURCES_DIST) \ $(am__lxc_test_share_ns_SOURCES_DIST) \ $(am__lxc_test_shortlived_SOURCES_DIST) \ $(am__lxc_test_shutdowntest_SOURCES_DIST) \ $(am__lxc_test_snapshot_SOURCES_DIST) \ $(am__lxc_test_startone_SOURCES_DIST) \ $(am__lxc_test_state_server_SOURCES_DIST) \ $(am__lxc_test_sys_mixed_SOURCES_DIST) \ $(am__lxc_test_sysctls_SOURCES_DIST) \ $(am__lxc_test_utils_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/lxc-test-usernic.in \ $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ $(am__append_157) $(am__append_158) \ $(am__append_159) $(am__append_160) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ APPARMOR_CACHE_DIR = @APPARMOR_CACHE_DIR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CAP_LIBS = @CAP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFAULT_CGROUP_PATTERN = @DEFAULT_CGROUP_PATTERN@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOG_CFLAGS = @DLOG_CFLAGS@ DLOG_LIBS = @DLOG_LIBS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDIR = @LIBDIR@ LIBEXECDIR = @LIBEXECDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBURING_LIBS = @LIBURING_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALSTATEDIR = @LOCALSTATEDIR@ LOGPATH = @LOGPATH@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LXCBINHOOKDIR = @LXCBINHOOKDIR@ LXCHOOKDIR = @LXCHOOKDIR@ LXCINITDIR = @LXCINITDIR@ LXCPATH = @LXCPATH@ LXCROOTFSMOUNT = @LXCROOTFSMOUNT@ LXCTEMPLATECONFIG = @LXCTEMPLATECONFIG@ LXCTEMPLATEDIR = @LXCTEMPLATEDIR@ LXC_ABI = @LXC_ABI@ LXC_ABI_MAJOR = @LXC_ABI_MAJOR@ LXC_ABI_MICRO = @LXC_ABI_MICRO@ LXC_ABI_MINOR = @LXC_ABI_MINOR@ LXC_DEFAULT_CONFIG = @LXC_DEFAULT_CONFIG@ LXC_DEVEL = @LXC_DEVEL@ LXC_DISTRO_SYSCONF = @LXC_DISTRO_SYSCONF@ LXC_GENERATE_DATE = @LXC_GENERATE_DATE@ LXC_GLOBAL_CONF = @LXC_GLOBAL_CONF@ LXC_USERNIC_CONF = @LXC_USERNIC_CONF@ LXC_USERNIC_DB = @LXC_USERNIC_DB@ LXC_VERSION = @LXC_VERSION@ LXC_VERSION_BASE = @LXC_VERSION_BASE@ LXC_VERSION_BETA = @LXC_VERSION_BETA@ LXC_VERSION_MAJOR = @LXC_VERSION_MAJOR@ LXC_VERSION_MICRO = @LXC_VERSION_MICRO@ LXC_VERSION_MINOR = @LXC_VERSION_MINOR@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PREFIX = @PREFIX@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RUNTIME_PATH = @RUNTIME_PATH@ SBINDIR = @SBINDIR@ SECCOMP_CFLAGS = @SECCOMP_CFLAGS@ SECCOMP_LIBS = @SECCOMP_LIBS@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ db2xman = @db2xman@ docdir = @docdir@ docdtd = @docdtd@ dvidir = @dvidir@ exec_pamdir = @exec_pamdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @ENABLE_TESTS_TRUE@LDADD = ../lxc/liblxc.la \ @ENABLE_TESTS_TRUE@ @CAP_LIBS@ \ @ENABLE_TESTS_TRUE@ @OPENSSL_LIBS@ \ @ENABLE_TESTS_TRUE@ @SECCOMP_LIBS@ \ @ENABLE_TESTS_TRUE@ @SELINUX_LIBS@ \ @ENABLE_TESTS_TRUE@ @DLOG_LIBS@ \ @ENABLE_TESTS_TRUE@ @LIBURING_LIBS@ @ENABLE_TESTS_TRUE@LSM_SOURCES = ../lxc/lsm/lsm.c ../lxc/lsm/lsm.h \ @ENABLE_TESTS_TRUE@ ../lxc/lsm/nop.c $(am__append_1) \ @ENABLE_TESTS_TRUE@ $(am__append_2) @ENABLE_TESTS_TRUE@lxc_test_arch_parse_SOURCES = arch_parse.c \ @ENABLE_TESTS_TRUE@ lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/lxc.h \ @ENABLE_TESTS_TRUE@ ../lxc/memory_utils.h @ENABLE_TESTS_TRUE@lxc_test_api_reboot_SOURCES = api_reboot.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_3) $(am__append_4) \ @ENABLE_TESTS_TRUE@ $(am__append_5) $(am__append_6) \ @ENABLE_TESTS_TRUE@ $(am__append_7) $(am__append_8) \ @ENABLE_TESTS_TRUE@ $(am__append_9) $(am__append_10) @ENABLE_TESTS_TRUE@lxc_test_apparmor_SOURCES = aa.c ../lxc/af_unix.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.h ../lxc/caps.c \ @ENABLE_TESTS_TRUE@ ../lxc/caps.h ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_11) $(am__append_12) \ @ENABLE_TESTS_TRUE@ $(am__append_13) $(am__append_14) \ @ENABLE_TESTS_TRUE@ $(am__append_15) $(am__append_16) \ @ENABLE_TESTS_TRUE@ $(am__append_17) $(am__append_18) @ENABLE_TESTS_TRUE@lxc_test_attach_SOURCES = attach.c ../lxc/af_unix.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.h ../lxc/caps.c \ @ENABLE_TESTS_TRUE@ ../lxc/caps.h ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_19) $(am__append_20) \ @ENABLE_TESTS_TRUE@ $(am__append_21) $(am__append_22) \ @ENABLE_TESTS_TRUE@ $(am__append_23) $(am__append_24) \ @ENABLE_TESTS_TRUE@ $(am__append_25) $(am__append_26) @ENABLE_TESTS_TRUE@lxc_test_basic_SOURCES = basic.c @ENABLE_TESTS_TRUE@lxc_test_cgpath_SOURCES = cgpath.c ../lxc/af_unix.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.h ../lxc/caps.c \ @ENABLE_TESTS_TRUE@ ../lxc/caps.h ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_27) $(am__append_28) \ @ENABLE_TESTS_TRUE@ $(am__append_29) $(am__append_30) \ @ENABLE_TESTS_TRUE@ $(am__append_31) $(am__append_32) \ @ENABLE_TESTS_TRUE@ $(am__append_33) $(am__append_34) @ENABLE_TESTS_TRUE@lxc_test_clonetest_SOURCES = clonetest.c @ENABLE_TESTS_TRUE@lxc_test_concurrent_SOURCES = concurrent.c @ENABLE_TESTS_TRUE@lxc_test_config_jump_table_SOURCES = \ @ENABLE_TESTS_TRUE@ config_jump_table.c lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_35) $(am__append_36) \ @ENABLE_TESTS_TRUE@ $(am__append_37) $(am__append_38) \ @ENABLE_TESTS_TRUE@ $(am__append_39) $(am__append_40) \ @ENABLE_TESTS_TRUE@ $(am__append_41) $(am__append_42) @ENABLE_TESTS_TRUE@lxc_test_console_SOURCES = console.c @ENABLE_TESTS_TRUE@lxc_test_console_log_SOURCES = console_log.c lxctest.h @ENABLE_TESTS_TRUE@lxc_test_containertests_SOURCES = containertests.c @ENABLE_TESTS_TRUE@lxc_test_createtest_SOURCES = createtest.c @ENABLE_TESTS_TRUE@lxc_test_criu_check_feature_SOURCES = criu_check_feature.c lxctest.h @ENABLE_TESTS_TRUE@lxc_test_cve_2019_5736_SOURCES = cve-2019-5736.c lxctest.h @ENABLE_TESTS_TRUE@lxc_test_destroytest_SOURCES = destroytest.c @ENABLE_TESTS_TRUE@lxc_test_device_add_remove_SOURCES = \ @ENABLE_TESTS_TRUE@ device_add_remove.c ../lxc/af_unix.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.h ../lxc/caps.c \ @ENABLE_TESTS_TRUE@ ../lxc/caps.h ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_43) $(am__append_44) \ @ENABLE_TESTS_TRUE@ $(am__append_45) $(am__append_46) \ @ENABLE_TESTS_TRUE@ $(am__append_47) $(am__append_48) \ @ENABLE_TESTS_TRUE@ $(am__append_49) $(am__append_50) @ENABLE_TESTS_TRUE@lxc_test_getkeys_SOURCES = getkeys.c @ENABLE_TESTS_TRUE@lxc_test_get_item_SOURCES = get_item.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_51) $(am__append_52) \ @ENABLE_TESTS_TRUE@ $(am__append_53) $(am__append_54) \ @ENABLE_TESTS_TRUE@ $(am__append_55) $(am__append_56) \ @ENABLE_TESTS_TRUE@ $(am__append_57) $(am__append_58) @ENABLE_TESTS_TRUE@lxc_test_list_SOURCES = list.c @ENABLE_TESTS_TRUE@lxc_test_locktests_SOURCES = locktests.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_59) $(am__append_60) \ @ENABLE_TESTS_TRUE@ $(am__append_61) $(am__append_62) \ @ENABLE_TESTS_TRUE@ $(am__append_63) $(am__append_64) \ @ENABLE_TESTS_TRUE@ $(am__append_65) $(am__append_66) @ENABLE_TESTS_TRUE@lxc_test_lxcpath_SOURCES = lxcpath.c @ENABLE_TESTS_TRUE@lxc_test_may_control_SOURCES = may_control.c @ENABLE_TESTS_TRUE@lxc_test_mount_injection_SOURCES = \ @ENABLE_TESTS_TRUE@ mount_injection.c lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_67) $(am__append_68) \ @ENABLE_TESTS_TRUE@ $(am__append_69) $(am__append_70) \ @ENABLE_TESTS_TRUE@ $(am__append_71) $(am__append_72) \ @ENABLE_TESTS_TRUE@ $(am__append_73) $(am__append_74) @ENABLE_TESTS_TRUE@lxc_test_parse_config_file_SOURCES = \ @ENABLE_TESTS_TRUE@ parse_config_file.c lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_75) $(am__append_76) \ @ENABLE_TESTS_TRUE@ $(am__append_77) $(am__append_78) \ @ENABLE_TESTS_TRUE@ $(am__append_79) $(am__append_80) \ @ENABLE_TESTS_TRUE@ $(am__append_81) $(am__append_82) @ENABLE_TESTS_TRUE@lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \ @ENABLE_TESTS_TRUE@ lxctest.h ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_83) $(am__append_84) \ @ENABLE_TESTS_TRUE@ $(am__append_85) $(am__append_86) \ @ENABLE_TESTS_TRUE@ $(am__append_87) $(am__append_88) \ @ENABLE_TESTS_TRUE@ $(am__append_89) $(am__append_90) @ENABLE_TESTS_TRUE@lxc_test_reboot_SOURCES = reboot.c @ENABLE_TESTS_TRUE@lxc_test_saveconfig_SOURCES = saveconfig.c @ENABLE_TESTS_TRUE@lxc_test_share_ns_SOURCES = share_ns.c lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/compiler.h $(am__append_91) \ @ENABLE_TESTS_TRUE@ $(am__append_92) $(am__append_93) \ @ENABLE_TESTS_TRUE@ $(am__append_94) $(am__append_95) \ @ENABLE_TESTS_TRUE@ $(am__append_96) @ENABLE_TESTS_TRUE@lxc_test_shortlived_SOURCES = shortlived.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.c ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ $(am__append_97) $(am__append_98) \ @ENABLE_TESTS_TRUE@ $(am__append_99) $(am__append_100) \ @ENABLE_TESTS_TRUE@ $(am__append_101) $(am__append_102) @ENABLE_TESTS_TRUE@lxc_test_shutdowntest_SOURCES = shutdowntest.c @ENABLE_TESTS_TRUE@lxc_test_snapshot_SOURCES = snapshot.c @ENABLE_TESTS_TRUE@lxc_test_startone_SOURCES = startone.c @ENABLE_TESTS_TRUE@lxc_test_state_server_SOURCES = state_server.c \ @ENABLE_TESTS_TRUE@ lxctest.h ../lxc/compiler.h \ @ENABLE_TESTS_TRUE@ $(am__append_103) $(am__append_104) \ @ENABLE_TESTS_TRUE@ $(am__append_105) $(am__append_106) \ @ENABLE_TESTS_TRUE@ $(am__append_107) $(am__append_108) @ENABLE_TESTS_TRUE@lxc_test_utils_SOURCES = lxc-test-utils.c lxctest.h \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_109) $(am__append_110) \ @ENABLE_TESTS_TRUE@ $(am__append_111) $(am__append_112) \ @ENABLE_TESTS_TRUE@ $(am__append_113) $(am__append_114) \ @ENABLE_TESTS_TRUE@ $(am__append_115) $(am__append_116) @ENABLE_TESTS_TRUE@lxc_test_sys_mixed_SOURCES = sys_mixed.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_117) $(am__append_118) \ @ENABLE_TESTS_TRUE@ $(am__append_119) $(am__append_120) \ @ENABLE_TESTS_TRUE@ $(am__append_121) $(am__append_122) \ @ENABLE_TESTS_TRUE@ $(am__append_123) $(am__append_124) @ENABLE_TESTS_TRUE@lxc_test_rootfs_options_SOURCES = rootfs_options.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_125) $(am__append_126) \ @ENABLE_TESTS_TRUE@ $(am__append_127) $(am__append_128) \ @ENABLE_TESTS_TRUE@ $(am__append_129) $(am__append_130) \ @ENABLE_TESTS_TRUE@ $(am__append_131) $(am__append_132) @ENABLE_TESTS_TRUE@lxc_test_capabilities_SOURCES = capabilities.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_133) $(am__append_134) \ @ENABLE_TESTS_TRUE@ $(am__append_135) $(am__append_136) \ @ENABLE_TESTS_TRUE@ $(am__append_137) $(am__append_138) \ @ENABLE_TESTS_TRUE@ $(am__append_139) $(am__append_140) @ENABLE_TESTS_TRUE@lxc_test_sysctls_SOURCES = sysctls.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_141) $(am__append_142) \ @ENABLE_TESTS_TRUE@ $(am__append_143) $(am__append_144) \ @ENABLE_TESTS_TRUE@ $(am__append_145) $(am__append_146) \ @ENABLE_TESTS_TRUE@ $(am__append_147) $(am__append_148) @ENABLE_TESTS_TRUE@lxc_test_proc_pid_SOURCES = proc_pid.c \ @ENABLE_TESTS_TRUE@ ../lxc/af_unix.c ../lxc/af_unix.h \ @ENABLE_TESTS_TRUE@ ../lxc/caps.c ../lxc/caps.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgfsng.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup2_devices.h \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/cgroups/cgroup_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands.c ../lxc/commands.h \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/commands_utils.h ../lxc/conf.c \ @ENABLE_TESTS_TRUE@ ../lxc/conf.h ../lxc/confile.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile.h ../lxc/confile_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/confile_utils.h ../lxc/error.c \ @ENABLE_TESTS_TRUE@ ../lxc/error.h ../lxc/file_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/file_utils.h \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.c \ @ENABLE_TESTS_TRUE@ ../include/netns_ifaddrs.h \ @ENABLE_TESTS_TRUE@ ../lxc/initutils.c ../lxc/initutils.h \ @ENABLE_TESTS_TRUE@ ../lxc/log.c ../lxc/log.h ../lxc/lxclock.c \ @ENABLE_TESTS_TRUE@ ../lxc/lxclock.h ../lxc/mainloop.c \ @ENABLE_TESTS_TRUE@ ../lxc/mainloop.h ../lxc/monitor.c \ @ENABLE_TESTS_TRUE@ ../lxc/monitor.h ../lxc/mount_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/mount_utils.h ../lxc/namespace.c \ @ENABLE_TESTS_TRUE@ ../lxc/namespace.h ../lxc/network.c \ @ENABLE_TESTS_TRUE@ ../lxc/network.h ../lxc/nl.c ../lxc/nl.h \ @ENABLE_TESTS_TRUE@ ../lxc/parse.c ../lxc/parse.h \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/process_utils.h ../lxc/ringbuf.c \ @ENABLE_TESTS_TRUE@ ../lxc/ringbuf.h ../lxc/start.c \ @ENABLE_TESTS_TRUE@ ../lxc/start.h ../lxc/state.c \ @ENABLE_TESTS_TRUE@ ../lxc/state.h ../lxc/storage/btrfs.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/btrfs.h ../lxc/storage/dir.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/dir.h ../lxc/storage/loop.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/loop.h ../lxc/storage/lvm.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/lvm.h ../lxc/storage/nbd.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/nbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/overlay.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/rsync.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.c \ @ENABLE_TESTS_TRUE@ ../lxc/storage/storage_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ @ENABLE_TESTS_TRUE@ ../lxc/sync.c ../lxc/sync.h \ @ENABLE_TESTS_TRUE@ ../lxc/string_utils.c ../lxc/string_utils.h \ @ENABLE_TESTS_TRUE@ ../lxc/terminal.c ../lxc/terminal.h \ @ENABLE_TESTS_TRUE@ ../lxc/utils.c ../lxc/utils.h ../lxc/uuid.c \ @ENABLE_TESTS_TRUE@ ../lxc/uuid.h $(LSM_SOURCES) \ @ENABLE_TESTS_TRUE@ $(am__append_149) $(am__append_150) \ @ENABLE_TESTS_TRUE@ $(am__append_151) $(am__append_152) \ @ENABLE_TESTS_TRUE@ $(am__append_153) $(am__append_154) \ @ENABLE_TESTS_TRUE@ $(am__append_155) $(am__append_156) @ENABLE_TESTS_TRUE@bin_SCRIPTS = $(am__append_161) $(am__append_162) \ @ENABLE_TESTS_TRUE@ $(am__append_164) # https://google.github.io/oss-fuzz/getting-started/new-project-guide/#Requirements @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@nodist_EXTRA_fuzz_lxc_config_read_SOURCES = dummy.cxx @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_SOURCES = fuzz-lxc-config-read.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_CFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_CXXFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_LDFLAGS = $(AM_LDFLAGS) -static @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_config_read_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@nodist_EXTRA_fuzz_lxc_define_load_SOURCES = dummy.cxx @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_SOURCES = fuzz-lxc-define-load.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_CFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_CXXFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_LDFLAGS = $(AM_LDFLAGS) -static @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_define_load_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@nodist_EXTRA_fuzz_lxc_cgroup_init_SOURCES = dummy.cxx @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_SOURCES = fuzz-lxc-cgroup-init.c @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_CFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_CXXFLAGS = $(AM_CFLAGS) @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_LDFLAGS = $(AM_LDFLAGS) -static @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@fuzz_lxc_cgroup_init_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) EXTRA_DIST = arch_parse.c \ basic.c \ capabilities.c \ cgpath.c \ clonetest.c \ concurrent.c \ config_jump_table.c \ console.c \ console_log.c \ containertests.c \ createtest.c \ criu_check_feature.c \ cve-2019-5736.c \ destroytest.c \ device_add_remove.c \ get_item.c \ getkeys.c \ list.c \ locktests.c \ lxcpath.c \ lxc_raw_clone.c \ lxc-test-lxc-attach \ lxc-test-automount \ lxc-test-rootfs \ lxc-test-procsys \ lxc-test-autostart \ lxc-test-apparmor-mount \ lxc-test-apparmor-generated \ lxc-test-checkpoint-restore \ lxc-test-cloneconfig \ lxc-test-createconfig \ lxc-test-exit-code \ lxc-test-no-new-privs \ lxc-test-snapdeps \ lxc-test-symlink \ lxc-test-unpriv \ lxc-test-usernsexec \ lxc-test-utils.c \ may_control.c \ mount_injection.c \ parse_config_file.c \ proc_pid.c \ rootfs_options.c \ saveconfig.c \ shortlived.c \ shutdowntest.c \ snapshot.c \ startone.c \ state_server.c \ share_ns.c \ sysctls.c \ sys_mixed.c all: all-am .SUFFIXES: .SUFFIXES: .c .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): lxc-test-usernic: $(top_builddir)/config.status $(srcdir)/lxc-test-usernic.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list fuzz-lxc-cgroup-init$(EXEEXT): $(fuzz_lxc_cgroup_init_OBJECTS) $(fuzz_lxc_cgroup_init_DEPENDENCIES) $(EXTRA_fuzz_lxc_cgroup_init_DEPENDENCIES) @rm -f fuzz-lxc-cgroup-init$(EXEEXT) $(AM_V_CXXLD)$(fuzz_lxc_cgroup_init_LINK) $(fuzz_lxc_cgroup_init_OBJECTS) $(fuzz_lxc_cgroup_init_LDADD) $(LIBS) fuzz-lxc-config-read$(EXEEXT): $(fuzz_lxc_config_read_OBJECTS) $(fuzz_lxc_config_read_DEPENDENCIES) $(EXTRA_fuzz_lxc_config_read_DEPENDENCIES) @rm -f fuzz-lxc-config-read$(EXEEXT) $(AM_V_CXXLD)$(fuzz_lxc_config_read_LINK) $(fuzz_lxc_config_read_OBJECTS) $(fuzz_lxc_config_read_LDADD) $(LIBS) fuzz-lxc-define-load$(EXEEXT): $(fuzz_lxc_define_load_OBJECTS) $(fuzz_lxc_define_load_DEPENDENCIES) $(EXTRA_fuzz_lxc_define_load_DEPENDENCIES) @rm -f fuzz-lxc-define-load$(EXEEXT) $(AM_V_CXXLD)$(fuzz_lxc_define_load_LINK) $(fuzz_lxc_define_load_OBJECTS) $(fuzz_lxc_define_load_LDADD) $(LIBS) ../lxc/$(am__dirstamp): @$(MKDIR_P) ../lxc @: > ../lxc/$(am__dirstamp) ../lxc/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../lxc/$(DEPDIR) @: > ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/af_unix.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/caps.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/cgroups/$(am__dirstamp): @$(MKDIR_P) ../lxc/cgroups @: > ../lxc/cgroups/$(am__dirstamp) ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../lxc/cgroups/$(DEPDIR) @: > ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) ../lxc/cgroups/cgfsng.$(OBJEXT): ../lxc/cgroups/$(am__dirstamp) \ ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) ../lxc/cgroups/cgroup.$(OBJEXT): ../lxc/cgroups/$(am__dirstamp) \ ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) ../lxc/cgroups/cgroup2_devices.$(OBJEXT): \ ../lxc/cgroups/$(am__dirstamp) \ ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) ../lxc/cgroups/cgroup_utils.$(OBJEXT): ../lxc/cgroups/$(am__dirstamp) \ ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) ../lxc/commands.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/commands_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/conf.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/confile.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/confile_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/error.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/file_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../include/$(am__dirstamp): @$(MKDIR_P) ../include @: > ../include/$(am__dirstamp) ../include/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../include/$(DEPDIR) @: > ../include/$(DEPDIR)/$(am__dirstamp) ../include/netns_ifaddrs.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../lxc/initutils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/log.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/lxclock.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/mainloop.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/monitor.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/mount_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/namespace.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/network.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/nl.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/parse.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/process_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/ringbuf.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/start.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/state.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/$(am__dirstamp): @$(MKDIR_P) ../lxc/storage @: > ../lxc/storage/$(am__dirstamp) ../lxc/storage/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../lxc/storage/$(DEPDIR) @: > ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/btrfs.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/dir.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/loop.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/lvm.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/nbd.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/overlay.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/rbd.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/rsync.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/storage.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/storage_utils.$(OBJEXT): \ ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/storage/zfs.$(OBJEXT): ../lxc/storage/$(am__dirstamp) \ ../lxc/storage/$(DEPDIR)/$(am__dirstamp) ../lxc/sync.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/string_utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/terminal.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/utils.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/uuid.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../lxc/lsm/$(am__dirstamp): @$(MKDIR_P) ../lxc/lsm @: > ../lxc/lsm/$(am__dirstamp) ../lxc/lsm/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../lxc/lsm/$(DEPDIR) @: > ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) ../lxc/lsm/lsm.$(OBJEXT): ../lxc/lsm/$(am__dirstamp) \ ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) ../lxc/lsm/nop.$(OBJEXT): ../lxc/lsm/$(am__dirstamp) \ ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) ../lxc/lsm/apparmor.$(OBJEXT): ../lxc/lsm/$(am__dirstamp) \ ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) ../lxc/lsm/selinux.$(OBJEXT): ../lxc/lsm/$(am__dirstamp) \ ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) ../lxc/seccomp.$(OBJEXT): ../lxc/$(am__dirstamp) \ ../lxc/$(DEPDIR)/$(am__dirstamp) ../include/strchrnul.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/strlcpy.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/strlcat.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/openpty.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/fexecve.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/lxcmntent.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/getgrgid_r.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/prlimit.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) lxc-test-api-reboot$(EXEEXT): $(lxc_test_api_reboot_OBJECTS) $(lxc_test_api_reboot_DEPENDENCIES) $(EXTRA_lxc_test_api_reboot_DEPENDENCIES) @rm -f lxc-test-api-reboot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_api_reboot_OBJECTS) $(lxc_test_api_reboot_LDADD) $(LIBS) lxc-test-apparmor$(EXEEXT): $(lxc_test_apparmor_OBJECTS) $(lxc_test_apparmor_DEPENDENCIES) $(EXTRA_lxc_test_apparmor_DEPENDENCIES) @rm -f lxc-test-apparmor$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_apparmor_OBJECTS) $(lxc_test_apparmor_LDADD) $(LIBS) lxc-test-arch-parse$(EXEEXT): $(lxc_test_arch_parse_OBJECTS) $(lxc_test_arch_parse_DEPENDENCIES) $(EXTRA_lxc_test_arch_parse_DEPENDENCIES) @rm -f lxc-test-arch-parse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_arch_parse_OBJECTS) $(lxc_test_arch_parse_LDADD) $(LIBS) lxc-test-attach$(EXEEXT): $(lxc_test_attach_OBJECTS) $(lxc_test_attach_DEPENDENCIES) $(EXTRA_lxc_test_attach_DEPENDENCIES) @rm -f lxc-test-attach$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_attach_OBJECTS) $(lxc_test_attach_LDADD) $(LIBS) lxc-test-basic$(EXEEXT): $(lxc_test_basic_OBJECTS) $(lxc_test_basic_DEPENDENCIES) $(EXTRA_lxc_test_basic_DEPENDENCIES) @rm -f lxc-test-basic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_basic_OBJECTS) $(lxc_test_basic_LDADD) $(LIBS) lxc-test-capabilities$(EXEEXT): $(lxc_test_capabilities_OBJECTS) $(lxc_test_capabilities_DEPENDENCIES) $(EXTRA_lxc_test_capabilities_DEPENDENCIES) @rm -f lxc-test-capabilities$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_capabilities_OBJECTS) $(lxc_test_capabilities_LDADD) $(LIBS) lxc-test-cgpath$(EXEEXT): $(lxc_test_cgpath_OBJECTS) $(lxc_test_cgpath_DEPENDENCIES) $(EXTRA_lxc_test_cgpath_DEPENDENCIES) @rm -f lxc-test-cgpath$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_cgpath_OBJECTS) $(lxc_test_cgpath_LDADD) $(LIBS) lxc-test-clonetest$(EXEEXT): $(lxc_test_clonetest_OBJECTS) $(lxc_test_clonetest_DEPENDENCIES) $(EXTRA_lxc_test_clonetest_DEPENDENCIES) @rm -f lxc-test-clonetest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_clonetest_OBJECTS) $(lxc_test_clonetest_LDADD) $(LIBS) lxc-test-concurrent$(EXEEXT): $(lxc_test_concurrent_OBJECTS) $(lxc_test_concurrent_DEPENDENCIES) $(EXTRA_lxc_test_concurrent_DEPENDENCIES) @rm -f lxc-test-concurrent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_concurrent_OBJECTS) $(lxc_test_concurrent_LDADD) $(LIBS) lxc-test-config-jump-table$(EXEEXT): $(lxc_test_config_jump_table_OBJECTS) $(lxc_test_config_jump_table_DEPENDENCIES) $(EXTRA_lxc_test_config_jump_table_DEPENDENCIES) @rm -f lxc-test-config-jump-table$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_config_jump_table_OBJECTS) $(lxc_test_config_jump_table_LDADD) $(LIBS) lxc-test-console$(EXEEXT): $(lxc_test_console_OBJECTS) $(lxc_test_console_DEPENDENCIES) $(EXTRA_lxc_test_console_DEPENDENCIES) @rm -f lxc-test-console$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_console_OBJECTS) $(lxc_test_console_LDADD) $(LIBS) lxc-test-console-log$(EXEEXT): $(lxc_test_console_log_OBJECTS) $(lxc_test_console_log_DEPENDENCIES) $(EXTRA_lxc_test_console_log_DEPENDENCIES) @rm -f lxc-test-console-log$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_console_log_OBJECTS) $(lxc_test_console_log_LDADD) $(LIBS) lxc-test-containertests$(EXEEXT): $(lxc_test_containertests_OBJECTS) $(lxc_test_containertests_DEPENDENCIES) $(EXTRA_lxc_test_containertests_DEPENDENCIES) @rm -f lxc-test-containertests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_containertests_OBJECTS) $(lxc_test_containertests_LDADD) $(LIBS) lxc-test-createtest$(EXEEXT): $(lxc_test_createtest_OBJECTS) $(lxc_test_createtest_DEPENDENCIES) $(EXTRA_lxc_test_createtest_DEPENDENCIES) @rm -f lxc-test-createtest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_createtest_OBJECTS) $(lxc_test_createtest_LDADD) $(LIBS) lxc-test-criu-check-feature$(EXEEXT): $(lxc_test_criu_check_feature_OBJECTS) $(lxc_test_criu_check_feature_DEPENDENCIES) $(EXTRA_lxc_test_criu_check_feature_DEPENDENCIES) @rm -f lxc-test-criu-check-feature$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_criu_check_feature_OBJECTS) $(lxc_test_criu_check_feature_LDADD) $(LIBS) lxc-test-cve-2019-5736$(EXEEXT): $(lxc_test_cve_2019_5736_OBJECTS) $(lxc_test_cve_2019_5736_DEPENDENCIES) $(EXTRA_lxc_test_cve_2019_5736_DEPENDENCIES) @rm -f lxc-test-cve-2019-5736$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_cve_2019_5736_OBJECTS) $(lxc_test_cve_2019_5736_LDADD) $(LIBS) lxc-test-destroytest$(EXEEXT): $(lxc_test_destroytest_OBJECTS) $(lxc_test_destroytest_DEPENDENCIES) $(EXTRA_lxc_test_destroytest_DEPENDENCIES) @rm -f lxc-test-destroytest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_destroytest_OBJECTS) $(lxc_test_destroytest_LDADD) $(LIBS) lxc-test-device-add-remove$(EXEEXT): $(lxc_test_device_add_remove_OBJECTS) $(lxc_test_device_add_remove_DEPENDENCIES) $(EXTRA_lxc_test_device_add_remove_DEPENDENCIES) @rm -f lxc-test-device-add-remove$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_device_add_remove_OBJECTS) $(lxc_test_device_add_remove_LDADD) $(LIBS) lxc-test-get_item$(EXEEXT): $(lxc_test_get_item_OBJECTS) $(lxc_test_get_item_DEPENDENCIES) $(EXTRA_lxc_test_get_item_DEPENDENCIES) @rm -f lxc-test-get_item$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_get_item_OBJECTS) $(lxc_test_get_item_LDADD) $(LIBS) lxc-test-getkeys$(EXEEXT): $(lxc_test_getkeys_OBJECTS) $(lxc_test_getkeys_DEPENDENCIES) $(EXTRA_lxc_test_getkeys_DEPENDENCIES) @rm -f lxc-test-getkeys$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_getkeys_OBJECTS) $(lxc_test_getkeys_LDADD) $(LIBS) lxc-test-list$(EXEEXT): $(lxc_test_list_OBJECTS) $(lxc_test_list_DEPENDENCIES) $(EXTRA_lxc_test_list_DEPENDENCIES) @rm -f lxc-test-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_list_OBJECTS) $(lxc_test_list_LDADD) $(LIBS) lxc-test-locktests$(EXEEXT): $(lxc_test_locktests_OBJECTS) $(lxc_test_locktests_DEPENDENCIES) $(EXTRA_lxc_test_locktests_DEPENDENCIES) @rm -f lxc-test-locktests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_locktests_OBJECTS) $(lxc_test_locktests_LDADD) $(LIBS) lxc-test-lxcpath$(EXEEXT): $(lxc_test_lxcpath_OBJECTS) $(lxc_test_lxcpath_DEPENDENCIES) $(EXTRA_lxc_test_lxcpath_DEPENDENCIES) @rm -f lxc-test-lxcpath$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_lxcpath_OBJECTS) $(lxc_test_lxcpath_LDADD) $(LIBS) lxc-test-may-control$(EXEEXT): $(lxc_test_may_control_OBJECTS) $(lxc_test_may_control_DEPENDENCIES) $(EXTRA_lxc_test_may_control_DEPENDENCIES) @rm -f lxc-test-may-control$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_may_control_OBJECTS) $(lxc_test_may_control_LDADD) $(LIBS) lxc-test-mount-injection$(EXEEXT): $(lxc_test_mount_injection_OBJECTS) $(lxc_test_mount_injection_DEPENDENCIES) $(EXTRA_lxc_test_mount_injection_DEPENDENCIES) @rm -f lxc-test-mount-injection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_mount_injection_OBJECTS) $(lxc_test_mount_injection_LDADD) $(LIBS) lxc-test-parse-config-file$(EXEEXT): $(lxc_test_parse_config_file_OBJECTS) $(lxc_test_parse_config_file_DEPENDENCIES) $(EXTRA_lxc_test_parse_config_file_DEPENDENCIES) @rm -f lxc-test-parse-config-file$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_parse_config_file_OBJECTS) $(lxc_test_parse_config_file_LDADD) $(LIBS) lxc-test-proc-pid$(EXEEXT): $(lxc_test_proc_pid_OBJECTS) $(lxc_test_proc_pid_DEPENDENCIES) $(EXTRA_lxc_test_proc_pid_DEPENDENCIES) @rm -f lxc-test-proc-pid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_proc_pid_OBJECTS) $(lxc_test_proc_pid_LDADD) $(LIBS) lxc-test-raw-clone$(EXEEXT): $(lxc_test_raw_clone_OBJECTS) $(lxc_test_raw_clone_DEPENDENCIES) $(EXTRA_lxc_test_raw_clone_DEPENDENCIES) @rm -f lxc-test-raw-clone$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_raw_clone_OBJECTS) $(lxc_test_raw_clone_LDADD) $(LIBS) lxc-test-reboot$(EXEEXT): $(lxc_test_reboot_OBJECTS) $(lxc_test_reboot_DEPENDENCIES) $(EXTRA_lxc_test_reboot_DEPENDENCIES) @rm -f lxc-test-reboot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_reboot_OBJECTS) $(lxc_test_reboot_LDADD) $(LIBS) lxc-test-rootfs-options$(EXEEXT): $(lxc_test_rootfs_options_OBJECTS) $(lxc_test_rootfs_options_DEPENDENCIES) $(EXTRA_lxc_test_rootfs_options_DEPENDENCIES) @rm -f lxc-test-rootfs-options$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_rootfs_options_OBJECTS) $(lxc_test_rootfs_options_LDADD) $(LIBS) lxc-test-saveconfig$(EXEEXT): $(lxc_test_saveconfig_OBJECTS) $(lxc_test_saveconfig_DEPENDENCIES) $(EXTRA_lxc_test_saveconfig_DEPENDENCIES) @rm -f lxc-test-saveconfig$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_saveconfig_OBJECTS) $(lxc_test_saveconfig_LDADD) $(LIBS) lxc-test-share-ns$(EXEEXT): $(lxc_test_share_ns_OBJECTS) $(lxc_test_share_ns_DEPENDENCIES) $(EXTRA_lxc_test_share_ns_DEPENDENCIES) @rm -f lxc-test-share-ns$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_share_ns_OBJECTS) $(lxc_test_share_ns_LDADD) $(LIBS) lxc-test-shortlived$(EXEEXT): $(lxc_test_shortlived_OBJECTS) $(lxc_test_shortlived_DEPENDENCIES) $(EXTRA_lxc_test_shortlived_DEPENDENCIES) @rm -f lxc-test-shortlived$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_shortlived_OBJECTS) $(lxc_test_shortlived_LDADD) $(LIBS) lxc-test-shutdowntest$(EXEEXT): $(lxc_test_shutdowntest_OBJECTS) $(lxc_test_shutdowntest_DEPENDENCIES) $(EXTRA_lxc_test_shutdowntest_DEPENDENCIES) @rm -f lxc-test-shutdowntest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_shutdowntest_OBJECTS) $(lxc_test_shutdowntest_LDADD) $(LIBS) lxc-test-snapshot$(EXEEXT): $(lxc_test_snapshot_OBJECTS) $(lxc_test_snapshot_DEPENDENCIES) $(EXTRA_lxc_test_snapshot_DEPENDENCIES) @rm -f lxc-test-snapshot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_snapshot_OBJECTS) $(lxc_test_snapshot_LDADD) $(LIBS) lxc-test-startone$(EXEEXT): $(lxc_test_startone_OBJECTS) $(lxc_test_startone_DEPENDENCIES) $(EXTRA_lxc_test_startone_DEPENDENCIES) @rm -f lxc-test-startone$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_startone_OBJECTS) $(lxc_test_startone_LDADD) $(LIBS) lxc-test-state-server$(EXEEXT): $(lxc_test_state_server_OBJECTS) $(lxc_test_state_server_DEPENDENCIES) $(EXTRA_lxc_test_state_server_DEPENDENCIES) @rm -f lxc-test-state-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_state_server_OBJECTS) $(lxc_test_state_server_LDADD) $(LIBS) lxc-test-sys-mixed$(EXEEXT): $(lxc_test_sys_mixed_OBJECTS) $(lxc_test_sys_mixed_DEPENDENCIES) $(EXTRA_lxc_test_sys_mixed_DEPENDENCIES) @rm -f lxc-test-sys-mixed$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_sys_mixed_OBJECTS) $(lxc_test_sys_mixed_LDADD) $(LIBS) lxc-test-sysctls$(EXEEXT): $(lxc_test_sysctls_OBJECTS) $(lxc_test_sysctls_DEPENDENCIES) $(EXTRA_lxc_test_sysctls_DEPENDENCIES) @rm -f lxc-test-sysctls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_sysctls_OBJECTS) $(lxc_test_sysctls_LDADD) $(LIBS) lxc-test-utils$(EXEEXT): $(lxc_test_utils_OBJECTS) $(lxc_test_utils_DEPENDENCIES) $(EXTRA_lxc_test_utils_DEPENDENCIES) @rm -f lxc-test-utils$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lxc_test_utils_OBJECTS) $(lxc_test_utils_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../include/*.$(OBJEXT) -rm -f ../lxc/*.$(OBJEXT) -rm -f ../lxc/cgroups/*.$(OBJEXT) -rm -f ../lxc/lsm/*.$(OBJEXT) -rm -f ../lxc/storage/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/fexecve.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/getgrgid_r.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/lxcmntent.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/netns_ifaddrs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/openpty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/prlimit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strchrnul.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/af_unix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/caps.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/commands.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/commands_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/confile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/confile_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/file_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/initutils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/lxclock.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/mainloop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/monitor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/mount_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/namespace.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/network.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/nl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/process_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/ringbuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/seccomp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/start.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/state.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/string_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/sync.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/terminal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/$(DEPDIR)/uuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/cgroups/$(DEPDIR)/cgfsng.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/cgroups/$(DEPDIR)/cgroup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/cgroups/$(DEPDIR)/cgroup2_devices.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/cgroups/$(DEPDIR)/cgroup_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/lsm/$(DEPDIR)/apparmor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/lsm/$(DEPDIR)/lsm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/lsm/$(DEPDIR)/nop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/lsm/$(DEPDIR)/selinux.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/btrfs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/dir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/lvm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/nbd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/overlay.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/rbd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/rsync.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/storage.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/storage_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../lxc/storage/$(DEPDIR)/zfs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aa.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/api_reboot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch_parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cgpath.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clonetest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/concurrent.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config_jump_table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console_log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/containertests.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/createtest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/criu_check_feature.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cve-2019-5736.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/destroytest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/device_add_remove.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_config_read-dummy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_define_load-dummy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_item.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getkeys.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locktests.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxc-test-utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxc_raw_clone.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxcpath.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/may_control.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_injection.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_config_file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc_pid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rootfs_options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saveconfig.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/share_ns.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shortlived.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdowntest.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snapshot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/startone.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state_server.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_mixed.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysctls.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.o: fuzz-lxc-cgroup-init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CFLAGS) $(CFLAGS) -MT fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Tpo -c -o fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.o `test -f 'fuzz-lxc-cgroup-init.c' || echo '$(srcdir)/'`fuzz-lxc-cgroup-init.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Tpo $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-cgroup-init.c' object='fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.o `test -f 'fuzz-lxc-cgroup-init.c' || echo '$(srcdir)/'`fuzz-lxc-cgroup-init.c fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.obj: fuzz-lxc-cgroup-init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CFLAGS) $(CFLAGS) -MT fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Tpo -c -o fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.obj `if test -f 'fuzz-lxc-cgroup-init.c'; then $(CYGPATH_W) 'fuzz-lxc-cgroup-init.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-cgroup-init.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Tpo $(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-cgroup-init.c' object='fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.obj `if test -f 'fuzz-lxc-cgroup-init.c'; then $(CYGPATH_W) 'fuzz-lxc-cgroup-init.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-cgroup-init.c'; fi` fuzz_lxc_config_read-fuzz-lxc-config-read.o: fuzz-lxc-config-read.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CFLAGS) $(CFLAGS) -MT fuzz_lxc_config_read-fuzz-lxc-config-read.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Tpo -c -o fuzz_lxc_config_read-fuzz-lxc-config-read.o `test -f 'fuzz-lxc-config-read.c' || echo '$(srcdir)/'`fuzz-lxc-config-read.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Tpo $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-config-read.c' object='fuzz_lxc_config_read-fuzz-lxc-config-read.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_config_read-fuzz-lxc-config-read.o `test -f 'fuzz-lxc-config-read.c' || echo '$(srcdir)/'`fuzz-lxc-config-read.c fuzz_lxc_config_read-fuzz-lxc-config-read.obj: fuzz-lxc-config-read.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CFLAGS) $(CFLAGS) -MT fuzz_lxc_config_read-fuzz-lxc-config-read.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Tpo -c -o fuzz_lxc_config_read-fuzz-lxc-config-read.obj `if test -f 'fuzz-lxc-config-read.c'; then $(CYGPATH_W) 'fuzz-lxc-config-read.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-config-read.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Tpo $(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-config-read.c' object='fuzz_lxc_config_read-fuzz-lxc-config-read.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_config_read-fuzz-lxc-config-read.obj `if test -f 'fuzz-lxc-config-read.c'; then $(CYGPATH_W) 'fuzz-lxc-config-read.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-config-read.c'; fi` fuzz_lxc_define_load-fuzz-lxc-define-load.o: fuzz-lxc-define-load.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CFLAGS) $(CFLAGS) -MT fuzz_lxc_define_load-fuzz-lxc-define-load.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Tpo -c -o fuzz_lxc_define_load-fuzz-lxc-define-load.o `test -f 'fuzz-lxc-define-load.c' || echo '$(srcdir)/'`fuzz-lxc-define-load.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Tpo $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-define-load.c' object='fuzz_lxc_define_load-fuzz-lxc-define-load.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_define_load-fuzz-lxc-define-load.o `test -f 'fuzz-lxc-define-load.c' || echo '$(srcdir)/'`fuzz-lxc-define-load.c fuzz_lxc_define_load-fuzz-lxc-define-load.obj: fuzz-lxc-define-load.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CFLAGS) $(CFLAGS) -MT fuzz_lxc_define_load-fuzz-lxc-define-load.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Tpo -c -o fuzz_lxc_define_load-fuzz-lxc-define-load.obj `if test -f 'fuzz-lxc-define-load.c'; then $(CYGPATH_W) 'fuzz-lxc-define-load.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-define-load.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Tpo $(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fuzz-lxc-define-load.c' object='fuzz_lxc_define_load-fuzz-lxc-define-load.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CFLAGS) $(CFLAGS) -c -o fuzz_lxc_define_load-fuzz-lxc-define-load.obj `if test -f 'fuzz-lxc-define-load.c'; then $(CYGPATH_W) 'fuzz-lxc-define-load.c'; else $(CYGPATH_W) '$(srcdir)/fuzz-lxc-define-load.c'; fi` .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< fuzz_lxc_cgroup_init-dummy.o: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_cgroup_init-dummy.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Tpo -c -o fuzz_lxc_cgroup_init-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Tpo $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_cgroup_init-dummy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_cgroup_init-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx fuzz_lxc_cgroup_init-dummy.obj: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_cgroup_init-dummy.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Tpo -c -o fuzz_lxc_cgroup_init-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Tpo $(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_cgroup_init-dummy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_cgroup_init_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_cgroup_init-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` fuzz_lxc_config_read-dummy.o: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_config_read-dummy.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_config_read-dummy.Tpo -c -o fuzz_lxc_config_read-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_config_read-dummy.Tpo $(DEPDIR)/fuzz_lxc_config_read-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_config_read-dummy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_config_read-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx fuzz_lxc_config_read-dummy.obj: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_config_read-dummy.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_config_read-dummy.Tpo -c -o fuzz_lxc_config_read-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_config_read-dummy.Tpo $(DEPDIR)/fuzz_lxc_config_read-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_config_read-dummy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_config_read_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_config_read-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` fuzz_lxc_define_load-dummy.o: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_define_load-dummy.o -MD -MP -MF $(DEPDIR)/fuzz_lxc_define_load-dummy.Tpo -c -o fuzz_lxc_define_load-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_define_load-dummy.Tpo $(DEPDIR)/fuzz_lxc_define_load-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_define_load-dummy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_define_load-dummy.o `test -f 'dummy.cxx' || echo '$(srcdir)/'`dummy.cxx fuzz_lxc_define_load-dummy.obj: dummy.cxx @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CXXFLAGS) $(CXXFLAGS) -MT fuzz_lxc_define_load-dummy.obj -MD -MP -MF $(DEPDIR)/fuzz_lxc_define_load-dummy.Tpo -c -o fuzz_lxc_define_load-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/fuzz_lxc_define_load-dummy.Tpo $(DEPDIR)/fuzz_lxc_define_load-dummy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dummy.cxx' object='fuzz_lxc_define_load-dummy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fuzz_lxc_define_load_CXXFLAGS) $(CXXFLAGS) -c -o fuzz_lxc_define_load-dummy.obj `if test -f 'dummy.cxx'; then $(CYGPATH_W) 'dummy.cxx'; else $(CYGPATH_W) '$(srcdir)/dummy.cxx'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../include/$(DEPDIR)/$(am__dirstamp) -rm -f ../include/$(am__dirstamp) -rm -f ../lxc/$(DEPDIR)/$(am__dirstamp) -rm -f ../lxc/$(am__dirstamp) -rm -f ../lxc/cgroups/$(DEPDIR)/$(am__dirstamp) -rm -f ../lxc/cgroups/$(am__dirstamp) -rm -f ../lxc/lsm/$(DEPDIR)/$(am__dirstamp) -rm -f ../lxc/lsm/$(am__dirstamp) -rm -f ../lxc/storage/$(DEPDIR)/$(am__dirstamp) -rm -f ../lxc/storage/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -rm -f ../include/$(DEPDIR)/fexecve.Po -rm -f ../include/$(DEPDIR)/getgrgid_r.Po -rm -f ../include/$(DEPDIR)/lxcmntent.Po -rm -f ../include/$(DEPDIR)/netns_ifaddrs.Po -rm -f ../include/$(DEPDIR)/openpty.Po -rm -f ../include/$(DEPDIR)/prlimit.Po -rm -f ../include/$(DEPDIR)/strchrnul.Po -rm -f ../include/$(DEPDIR)/strlcat.Po -rm -f ../include/$(DEPDIR)/strlcpy.Po -rm -f ../lxc/$(DEPDIR)/af_unix.Po -rm -f ../lxc/$(DEPDIR)/caps.Po -rm -f ../lxc/$(DEPDIR)/commands.Po -rm -f ../lxc/$(DEPDIR)/commands_utils.Po -rm -f ../lxc/$(DEPDIR)/conf.Po -rm -f ../lxc/$(DEPDIR)/confile.Po -rm -f ../lxc/$(DEPDIR)/confile_utils.Po -rm -f ../lxc/$(DEPDIR)/error.Po -rm -f ../lxc/$(DEPDIR)/file_utils.Po -rm -f ../lxc/$(DEPDIR)/initutils.Po -rm -f ../lxc/$(DEPDIR)/log.Po -rm -f ../lxc/$(DEPDIR)/lxclock.Po -rm -f ../lxc/$(DEPDIR)/mainloop.Po -rm -f ../lxc/$(DEPDIR)/monitor.Po -rm -f ../lxc/$(DEPDIR)/mount_utils.Po -rm -f ../lxc/$(DEPDIR)/namespace.Po -rm -f ../lxc/$(DEPDIR)/network.Po -rm -f ../lxc/$(DEPDIR)/nl.Po -rm -f ../lxc/$(DEPDIR)/parse.Po -rm -f ../lxc/$(DEPDIR)/process_utils.Po -rm -f ../lxc/$(DEPDIR)/ringbuf.Po -rm -f ../lxc/$(DEPDIR)/seccomp.Po -rm -f ../lxc/$(DEPDIR)/start.Po -rm -f ../lxc/$(DEPDIR)/state.Po -rm -f ../lxc/$(DEPDIR)/string_utils.Po -rm -f ../lxc/$(DEPDIR)/sync.Po -rm -f ../lxc/$(DEPDIR)/terminal.Po -rm -f ../lxc/$(DEPDIR)/utils.Po -rm -f ../lxc/$(DEPDIR)/uuid.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgfsng.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup2_devices.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup_utils.Po -rm -f ../lxc/lsm/$(DEPDIR)/apparmor.Po -rm -f ../lxc/lsm/$(DEPDIR)/lsm.Po -rm -f ../lxc/lsm/$(DEPDIR)/nop.Po -rm -f ../lxc/lsm/$(DEPDIR)/selinux.Po -rm -f ../lxc/storage/$(DEPDIR)/btrfs.Po -rm -f ../lxc/storage/$(DEPDIR)/dir.Po -rm -f ../lxc/storage/$(DEPDIR)/loop.Po -rm -f ../lxc/storage/$(DEPDIR)/lvm.Po -rm -f ../lxc/storage/$(DEPDIR)/nbd.Po -rm -f ../lxc/storage/$(DEPDIR)/overlay.Po -rm -f ../lxc/storage/$(DEPDIR)/rbd.Po -rm -f ../lxc/storage/$(DEPDIR)/rsync.Po -rm -f ../lxc/storage/$(DEPDIR)/storage.Po -rm -f ../lxc/storage/$(DEPDIR)/storage_utils.Po -rm -f ../lxc/storage/$(DEPDIR)/zfs.Po -rm -f ./$(DEPDIR)/aa.Po -rm -f ./$(DEPDIR)/api_reboot.Po -rm -f ./$(DEPDIR)/arch_parse.Po -rm -f ./$(DEPDIR)/attach.Po -rm -f ./$(DEPDIR)/basic.Po -rm -f ./$(DEPDIR)/capabilities.Po -rm -f ./$(DEPDIR)/cgpath.Po -rm -f ./$(DEPDIR)/clonetest.Po -rm -f ./$(DEPDIR)/concurrent.Po -rm -f ./$(DEPDIR)/config_jump_table.Po -rm -f ./$(DEPDIR)/console.Po -rm -f ./$(DEPDIR)/console_log.Po -rm -f ./$(DEPDIR)/containertests.Po -rm -f ./$(DEPDIR)/createtest.Po -rm -f ./$(DEPDIR)/criu_check_feature.Po -rm -f ./$(DEPDIR)/cve-2019-5736.Po -rm -f ./$(DEPDIR)/destroytest.Po -rm -f ./$(DEPDIR)/device_add_remove.Po -rm -f ./$(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po -rm -f ./$(DEPDIR)/fuzz_lxc_config_read-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po -rm -f ./$(DEPDIR)/fuzz_lxc_define_load-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po -rm -f ./$(DEPDIR)/get_item.Po -rm -f ./$(DEPDIR)/getkeys.Po -rm -f ./$(DEPDIR)/list.Po -rm -f ./$(DEPDIR)/locktests.Po -rm -f ./$(DEPDIR)/lxc-test-utils.Po -rm -f ./$(DEPDIR)/lxc_raw_clone.Po -rm -f ./$(DEPDIR)/lxcpath.Po -rm -f ./$(DEPDIR)/may_control.Po -rm -f ./$(DEPDIR)/mount_injection.Po -rm -f ./$(DEPDIR)/parse_config_file.Po -rm -f ./$(DEPDIR)/proc_pid.Po -rm -f ./$(DEPDIR)/reboot.Po -rm -f ./$(DEPDIR)/rootfs_options.Po -rm -f ./$(DEPDIR)/saveconfig.Po -rm -f ./$(DEPDIR)/share_ns.Po -rm -f ./$(DEPDIR)/shortlived.Po -rm -f ./$(DEPDIR)/shutdowntest.Po -rm -f ./$(DEPDIR)/snapshot.Po -rm -f ./$(DEPDIR)/startone.Po -rm -f ./$(DEPDIR)/state_server.Po -rm -f ./$(DEPDIR)/sys_mixed.Po -rm -f ./$(DEPDIR)/sysctls.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ../include/$(DEPDIR)/fexecve.Po -rm -f ../include/$(DEPDIR)/getgrgid_r.Po -rm -f ../include/$(DEPDIR)/lxcmntent.Po -rm -f ../include/$(DEPDIR)/netns_ifaddrs.Po -rm -f ../include/$(DEPDIR)/openpty.Po -rm -f ../include/$(DEPDIR)/prlimit.Po -rm -f ../include/$(DEPDIR)/strchrnul.Po -rm -f ../include/$(DEPDIR)/strlcat.Po -rm -f ../include/$(DEPDIR)/strlcpy.Po -rm -f ../lxc/$(DEPDIR)/af_unix.Po -rm -f ../lxc/$(DEPDIR)/caps.Po -rm -f ../lxc/$(DEPDIR)/commands.Po -rm -f ../lxc/$(DEPDIR)/commands_utils.Po -rm -f ../lxc/$(DEPDIR)/conf.Po -rm -f ../lxc/$(DEPDIR)/confile.Po -rm -f ../lxc/$(DEPDIR)/confile_utils.Po -rm -f ../lxc/$(DEPDIR)/error.Po -rm -f ../lxc/$(DEPDIR)/file_utils.Po -rm -f ../lxc/$(DEPDIR)/initutils.Po -rm -f ../lxc/$(DEPDIR)/log.Po -rm -f ../lxc/$(DEPDIR)/lxclock.Po -rm -f ../lxc/$(DEPDIR)/mainloop.Po -rm -f ../lxc/$(DEPDIR)/monitor.Po -rm -f ../lxc/$(DEPDIR)/mount_utils.Po -rm -f ../lxc/$(DEPDIR)/namespace.Po -rm -f ../lxc/$(DEPDIR)/network.Po -rm -f ../lxc/$(DEPDIR)/nl.Po -rm -f ../lxc/$(DEPDIR)/parse.Po -rm -f ../lxc/$(DEPDIR)/process_utils.Po -rm -f ../lxc/$(DEPDIR)/ringbuf.Po -rm -f ../lxc/$(DEPDIR)/seccomp.Po -rm -f ../lxc/$(DEPDIR)/start.Po -rm -f ../lxc/$(DEPDIR)/state.Po -rm -f ../lxc/$(DEPDIR)/string_utils.Po -rm -f ../lxc/$(DEPDIR)/sync.Po -rm -f ../lxc/$(DEPDIR)/terminal.Po -rm -f ../lxc/$(DEPDIR)/utils.Po -rm -f ../lxc/$(DEPDIR)/uuid.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgfsng.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup2_devices.Po -rm -f ../lxc/cgroups/$(DEPDIR)/cgroup_utils.Po -rm -f ../lxc/lsm/$(DEPDIR)/apparmor.Po -rm -f ../lxc/lsm/$(DEPDIR)/lsm.Po -rm -f ../lxc/lsm/$(DEPDIR)/nop.Po -rm -f ../lxc/lsm/$(DEPDIR)/selinux.Po -rm -f ../lxc/storage/$(DEPDIR)/btrfs.Po -rm -f ../lxc/storage/$(DEPDIR)/dir.Po -rm -f ../lxc/storage/$(DEPDIR)/loop.Po -rm -f ../lxc/storage/$(DEPDIR)/lvm.Po -rm -f ../lxc/storage/$(DEPDIR)/nbd.Po -rm -f ../lxc/storage/$(DEPDIR)/overlay.Po -rm -f ../lxc/storage/$(DEPDIR)/rbd.Po -rm -f ../lxc/storage/$(DEPDIR)/rsync.Po -rm -f ../lxc/storage/$(DEPDIR)/storage.Po -rm -f ../lxc/storage/$(DEPDIR)/storage_utils.Po -rm -f ../lxc/storage/$(DEPDIR)/zfs.Po -rm -f ./$(DEPDIR)/aa.Po -rm -f ./$(DEPDIR)/api_reboot.Po -rm -f ./$(DEPDIR)/arch_parse.Po -rm -f ./$(DEPDIR)/attach.Po -rm -f ./$(DEPDIR)/basic.Po -rm -f ./$(DEPDIR)/capabilities.Po -rm -f ./$(DEPDIR)/cgpath.Po -rm -f ./$(DEPDIR)/clonetest.Po -rm -f ./$(DEPDIR)/concurrent.Po -rm -f ./$(DEPDIR)/config_jump_table.Po -rm -f ./$(DEPDIR)/console.Po -rm -f ./$(DEPDIR)/console_log.Po -rm -f ./$(DEPDIR)/containertests.Po -rm -f ./$(DEPDIR)/createtest.Po -rm -f ./$(DEPDIR)/criu_check_feature.Po -rm -f ./$(DEPDIR)/cve-2019-5736.Po -rm -f ./$(DEPDIR)/destroytest.Po -rm -f ./$(DEPDIR)/device_add_remove.Po -rm -f ./$(DEPDIR)/fuzz_lxc_cgroup_init-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_cgroup_init-fuzz-lxc-cgroup-init.Po -rm -f ./$(DEPDIR)/fuzz_lxc_config_read-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_config_read-fuzz-lxc-config-read.Po -rm -f ./$(DEPDIR)/fuzz_lxc_define_load-dummy.Po -rm -f ./$(DEPDIR)/fuzz_lxc_define_load-fuzz-lxc-define-load.Po -rm -f ./$(DEPDIR)/get_item.Po -rm -f ./$(DEPDIR)/getkeys.Po -rm -f ./$(DEPDIR)/list.Po -rm -f ./$(DEPDIR)/locktests.Po -rm -f ./$(DEPDIR)/lxc-test-utils.Po -rm -f ./$(DEPDIR)/lxc_raw_clone.Po -rm -f ./$(DEPDIR)/lxcpath.Po -rm -f ./$(DEPDIR)/may_control.Po -rm -f ./$(DEPDIR)/mount_injection.Po -rm -f ./$(DEPDIR)/parse_config_file.Po -rm -f ./$(DEPDIR)/proc_pid.Po -rm -f ./$(DEPDIR)/reboot.Po -rm -f ./$(DEPDIR)/rootfs_options.Po -rm -f ./$(DEPDIR)/saveconfig.Po -rm -f ./$(DEPDIR)/share_ns.Po -rm -f ./$(DEPDIR)/shortlived.Po -rm -f ./$(DEPDIR)/shutdowntest.Po -rm -f ./$(DEPDIR)/snapshot.Po -rm -f ./$(DEPDIR)/startone.Po -rm -f ./$(DEPDIR)/state_server.Po -rm -f ./$(DEPDIR)/sys_mixed.Po -rm -f ./$(DEPDIR)/sysctls.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-binSCRIPTS .PRECIOUS: Makefile @ENABLE_FUZZERS_TRUE@@ENABLE_TESTS_TRUE@LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer clean-local: rm -f lxc-test-utils-* rm -f lxc-parse-config-file-* # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lxc-4.0.12/src/tests/aa.c0000644061062106075000000001105514176403775012013 00000000000000/* liblxcapi * * Copyright 2014 Serge Hallyn . * Copyright 2014 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" /* Test apparmor rules */ #include #include "lxc/utils.h" #include #include #include #define MYNAME "test-aa" static void try_to_remove(void) { struct lxc_container *c; c = lxc_container_new(MYNAME, NULL); if (c) { if (c->is_defined(c)) c->destroy(c); lxc_container_put(c); } } static int test_attach_write_file(void* payload) { char *fnam = payload; FILE *f; f = fopen(fnam, "w"); if (f) { printf("yes\n"); fclose(f); fflush(NULL); return 1; } printf("no\n"); fflush(NULL); return 0; } /* * try opening a file attached to a container. Return 0 on open fail. Return * 1 if the file open succeeded. Return -1 if attach itself failed - perhaps an * older kernel. */ static int do_test_file_open(struct lxc_container *c, char *fnam) { int fret = -1; int ret; pid_t pid; int pipefd[2]; char result[1024]; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; ret = pipe(pipefd); if (ret < 0) { fprintf(stderr, "pipe failed %d\n", ret); return fret; } attach_options.stdout_fd = pipefd[1]; attach_options.attach_flags &= ~(LXC_ATTACH_LSM_EXEC|LXC_ATTACH_DROP_CAPABILITIES); attach_options.attach_flags |= LXC_ATTACH_LSM_NOW; ret = c->attach(c, test_attach_write_file, fnam, &attach_options, &pid); if (ret < 0) { fprintf(stderr, "attach failed\n"); goto err1; } ret = read(pipefd[0], result, sizeof(result)-1); if (ret < 0) { fprintf(stderr, "read failed %d\n", ret); goto err2; } fret = 1; if (strncmp(result, "no", 2) == 0) fret = 0; err2: (void)wait_for_pid(pid); err1: close(pipefd[0]); close(pipefd[1]); return fret; } char *files_to_allow[] = { "/sys/class/net/lo/ifalias", "/proc/sys/kernel/shmmax", NULL }; char *files_to_deny[] = { "/sys/kernel/uevent_helper", "/proc/sys/fs/file-nr", "/sys/kernel/mm/ksm/pages_to_scan", "/proc/sys/kernel/sysrq", NULL }; static bool test_aa_policy(struct lxc_container *c) { int i, ret; for (i = 0; files_to_deny[i]; i++) { ret = do_test_file_open(c, files_to_deny[i]); if (ret < 0) { fprintf(stderr, "attach failed; skipping test\n"); return true; } if (ret > 0) { fprintf(stderr, "failed - opened %s\n", files_to_deny[i]); return false; } fprintf(stderr, "passed with %s\n", files_to_deny[i]); } for (i = 0; files_to_allow[i]; i++) { ret = do_test_file_open(c, files_to_allow[i]); if (ret < 0) { fprintf(stderr, "attach failed; skipping test\n"); return true; } if (ret == 0) { fprintf(stderr, "failed - could not open %s\n", files_to_allow[i]); return false; } fprintf(stderr, "passed with %s\n", files_to_allow[i]); } return true; } int main(int argc, char *argv[]) { struct lxc_container *c; try_to_remove(); c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%s: %d: failed to load first container\n", __FILE__, __LINE__); exit(EXIT_FAILURE); } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto err; } if (!c->set_config_item(c, "lxc.net.0.type", "empty")) { fprintf(stderr, "%s: %d: failed to set network type\n", __FILE__, __LINE__); goto err; } c->save_config(c, NULL); if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%s: %d: failed to create container\n", __FILE__, __LINE__); goto err; } c->clear_config_item(c, "lxc.mount.auto"); c->set_config_item(c, "lxc.mount.entry", "proc proc proc"); c->set_config_item(c, "lxc.mount.entry", "sysfs sys sysfs"); c->save_config(c, NULL); c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { fprintf(stderr, "Error starting container\n"); goto err; } if (!test_aa_policy(c)) { c->stop(c); goto err; } c->stop(c); try_to_remove(); exit(EXIT_SUCCESS); err: try_to_remove(); exit(EXIT_FAILURE); } lxc-4.0.12/src/tests/config_jump_table.c0000644061062106075000000000442614176403775015105 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * Copyright © 2017 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "confile.h" #include "lxc/state.h" #include "lxctest.h" int main(int argc, char *argv[]) { int fulllen = 0, inlen = 0, ret = EXIT_FAILURE; char *key, *keys, *saveptr = NULL; fulllen = lxc_list_config_items(NULL, inlen); keys = malloc(sizeof(char) * fulllen + 1); if (!keys) { lxc_error("%s\n", "failed to allocate memory"); exit(ret); } if (lxc_list_config_items(keys, fulllen) != fulllen) { lxc_error("%s\n", "failed to retrieve configuration keys"); goto on_error; } for (key = strtok_r(keys, "\n", &saveptr); key != NULL; key = strtok_r(NULL, "\n", &saveptr)) { struct lxc_config_t *config; config = lxc_get_config(key); if (!config) { lxc_error("configuration key \"%s\" not implemented in " "jump table", key); goto on_error; } if (!config->set) { lxc_error("configuration key \"%s\" has no set method " "in jump table", key); goto on_error; } if (!config->get) { lxc_error("configuration key \"%s\" has no get method " "in jump table", key); goto on_error; } if (!config->clr) { lxc_error("configuration key \"%s\" has no clr (clear) " "method in jump table", key); goto on_error; } } ret = EXIT_SUCCESS; on_error: free(keys); exit(ret); } lxc-4.0.12/src/tests/capabilities.c0000644061062106075000000001364214176403775014067 00000000000000/* liblxcapi * * Copyright © 2021 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "lxccontainer.h" #include "attach_options.h" #include "caps.h" #include "lxctest.h" #include "utils.h" #if HAVE_LIBCAP __u32 *cap_bset_bits = NULL; __u32 last_cap = 0; static int capabilities_allow(void *payload) { for (__u32 cap = 0; cap <= last_cap; cap++) { bool bret; if (!is_set(cap, cap_bset_bits)) continue; if (cap == CAP_MKNOD) bret = cap_get_bound(cap) == CAP_SET; else bret = cap_get_bound(cap) != CAP_SET; if (!bret) { lxc_error("Capability %d unexpectedly raised or lowered\n", cap); return EXIT_FAILURE; } } return EXIT_SUCCESS; } static int capabilities_deny(void *payload) { for (__u32 cap = 0; cap <= last_cap; cap++) { bool bret; if (!is_set(cap, cap_bset_bits)) continue; if (cap == CAP_MKNOD) bret = cap_get_bound(cap) != CAP_SET; else bret = cap_get_bound(cap) == CAP_SET; if (!bret) { lxc_error("Capability %d unexpectedly raised or lowered\n", cap); return EXIT_FAILURE; } } return EXIT_SUCCESS; } static int run(int (*test)(void *), bool allow) { int fd_log = -EBADF, fret = -1; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; int ret; pid_t pid; struct lxc_container *c; struct lxc_log log; char template[sizeof(P_tmpdir"/capabilities_XXXXXX")]; (void)strlcpy(template, P_tmpdir"/capabilities_XXXXXX", sizeof(template)); fd_log = lxc_make_tmpfile(template, false); if (fd_log < 0) { lxc_error("%s", "Failed to create temporary log file for container \"capabilities\""); return fret; } log.name = "capabilities"; log.file = template; log.level = "TRACE"; log.prefix = "capabilities"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) return fret; c = lxc_container_new("capabilities", NULL); if (!c) { lxc_error("%s\n", "Failed to create container \"capabilities\""); return fret; } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"capabilities\" is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"capabilities\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"capabilities\" is not defined"); goto on_error_destroy; } if (!c->clear_config_item(c, "lxc.cap.drop")) { lxc_error("%s\n", "Failed to clear config item \"lxc.cap.drop\""); goto on_error_destroy; } if (!c->clear_config_item(c, "lxc.cap.keep")) { lxc_error("%s\n", "Failed to clear config item \"lxc.cap.drop\""); goto on_error_destroy; } if (allow) { if (!c->set_config_item(c, "lxc.cap.keep", "mknod")) { lxc_error("%s\n", "Failed to set config item \"lxc.cap.keep=mknod\""); goto on_error_destroy; } } else { if (!c->set_config_item(c, "lxc.cap.drop", "mknod")) { lxc_error("%s\n", "Failed to set config item \"lxc.cap.drop=mknod\""); goto on_error_destroy; } } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"capabilities\" daemonized"); goto on_error_destroy; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"capabilities\" daemonized"); goto on_error_destroy; } ret = c->attach(c, test, NULL, &attach_options, &pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container \"capabilities\""); goto on_error_stop; } ret = wait_for_pid(pid); if (ret) { lxc_error("%s\n", "Function \"capabilities\" failed"); goto on_error_stop; } fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"capabilities\""); on_error_destroy: if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"capabilities\""); on_error_put: lxc_container_put(c); if (fret == EXIT_SUCCESS) { lxc_debug("All capability %s tests passed\n", allow ? "allow" : "deny"); } else { int fd; fd = open(template, O_RDONLY); if (fd >= 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } close(fd); } } (void)unlink(template); return fret; } static void __attribute__((constructor)) capabilities_init(void) { int ret; __u32 nr_u32; ret = lxc_caps_last_cap(&last_cap); if (ret || last_cap > 200) _exit(EXIT_FAILURE); nr_u32 = BITS_TO_LONGS(last_cap); cap_bset_bits = zalloc(nr_u32 * sizeof(__u32)); if (!cap_bset_bits) _exit(EXIT_FAILURE); for (__u32 cap_bit = 0; cap_bit <= last_cap; cap_bit++) { if (prctl(PR_CAPBSET_READ, prctl_arg(cap_bit)) == 0) continue; set_bit(cap_bit, cap_bset_bits); } } static void __attribute__((destructor)) capabilities_exit(void) { free(cap_bset_bits); } int main(int argc, char *argv[]) { if (run(capabilities_allow, true)) exit(EXIT_FAILURE); if (run(capabilities_deny, false)) exit(EXIT_FAILURE); exit(EXIT_SUCCESS); } #else /* !HAVE_LIBCAP */ int main(int argc, char *argv[]) { lxc_debug("%s\n", "Capabilities not supported. Skipping."); exit(EXIT_SUCCESS); } #endif lxc-4.0.12/src/tests/basic.c0000644061062106075000000000236514176403775012517 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include "lxctest.h" int main(int argc, char *argv[]) { int ret; struct lxc_container *c; c = lxc_container_new("init-pid", NULL); if (!c) exit(EXIT_FAILURE); ret = c->init_pid(c); c->destroy(c); lxc_container_put(c); /* Return value needs to be -1. Any other negative error code is to be * considered invalid. */ if (ret != -1) exit(EXIT_FAILURE); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/lxc-test-unpriv0000755061062106075000000001451414176403775014303 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # # This is a test script for unprivileged containers # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # This test assumes an Ubuntu host if [ $(id -u) -ne 0 ]; then echo "ERROR: Must run as root." exit 1 fi # Test if we're using an overlayfs module that handles symlinks correctly. If # not, we skip these tests since overlay clones will not work correctly. if modprobe -q overlayfs; then TMPDIR=$(mktemp -d) MOUNTDIR="${TMPDIR}/ovl_symlink_test" mkdir ${MOUNTDIR} mount -t tmpfs none ${MOUNTDIR} mkdir ${MOUNTDIR}/{lowerdir,upperdir,workdir,overlayfs} mount -t overlayfs -o lowerdir="${MOUNTDIR}/lowerdir",upperdir="${MOUNTDIR}/upperdir",workdir="${MOUNTDIR}/workdir" none "${MOUNTDIR}/overlayfs" CORRECT_LINK_TARGET="${MOUNTDIR}/overlayfs/placeholder_file" exec 9> "${CORRECT_LINK_TARGET}" DETECTED_LINK_TARGET=$(readlink -q /proc/$$/fd/9) # cleanup exec 9>&- umount "${MOUNTDIR}/overlayfs" umount ${MOUNTDIR} rmdir ${MOUNTDIR} # This overlay module does not correctly handle symlinks, so skip the # tests. if [ "${DETECTED_LINK_TARGET}" != "${CORRECT_LINK_TARGET}" ]; then exit 0 fi fi command -v newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } DONE=0 UNPRIV_LOG=$(mktemp --dry-run) cleanup() { cd / if [ $DONE -eq 0 ]; then cat "${UNPRIV_LOG}" fi rm -f "${UNPRIV_LOG}" || true run_cmd lxc-stop -n c2 -k -l trace -o "${UNPRIV_LOG}" || true run_cmd lxc-stop -n c1 -k -l trace -o "${UNPRIV_LOG}" || true pkill -u $(id -u $TUSER) -9 || true sed -i '/lxcunpriv/d' /run/lxc/nics /etc/lxc/lxc-usernet sed -i '/^lxcunpriv:/d' /etc/subuid /etc/subgid rm -Rf $HDIR /run/user/$(id -u $TUSER) deluser $TUSER if [ $DONE -eq 0 ]; then echo "FAIL" exit 1 fi echo "PASS" } run_cmd() { sudo -i -u $TUSER \ env http_proxy=${http_proxy:-} https_proxy=${https_proxy:-} \ XDG_RUNTIME_DIR=/run/user/$(id -u $TUSER) ASAN_OPTIONS=${ASAN_OPTIONS:-} \ UBSAN_OPTIONS=${UBSAN_OPTIONS:-} $* } # create a test user TUSER=lxcunpriv HDIR=/home/$TUSER trap cleanup EXIT SIGHUP SIGINT SIGTERM set -eu id $TUSER &> /dev/null && deluser -q --remove-home $TUSER useradd $TUSER mkdir -p $HDIR echo "$TUSER veth lxcbr0 2" >> /etc/lxc/lxc-usernet sed -i '/^lxcunpriv:/d' /etc/subuid /etc/subgid usermod -v 910000-919999 -w 910000-919999 $TUSER mkdir -p $HDIR/.config/lxc/ cat > $HDIR/.config/lxc/default.conf << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 lxc.idmap = u 0 910000 9999 lxc.idmap = g 0 910000 9999 EOF chown -R $TUSER: $HDIR mkdir -p /run/user/$(id -u $TUSER) chown -R $TUSER: /run/user/$(id -u $TUSER) cd $HDIR if command -v cgm >/dev/null 2>&1; then cgm create all $TUSER cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER) cgm movepid all $TUSER $$ elif [ -e /sys/fs/cgroup/cgmanager/sock ]; then for d in $(cut -d : -f 2 /proc/self/cgroup); do dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Create \ string:$d string:$TUSER >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.Chown \ string:$d string:$TUSER int32:$(id -u $TUSER) int32:$(id -g $TUSER) >/dev/null dbus-send --print-reply --address=unix:path=/sys/fs/cgroup/cgmanager/sock \ --type=method_call /org/linuxcontainers/cgmanager org.linuxcontainers.cgmanager0_0.MovePid \ string:$d string:$TUSER int32:$$ >/dev/null done else for d in /sys/fs/cgroup/*; do [ "$d" = "/sys/fs/cgroup/unified" ] && continue [ -f $d/cgroup.clone_children ] && echo 1 > $d/cgroup.clone_children [ ! -d $d/lxctest ] && mkdir $d/lxctest chown -R $TUSER: $d/lxctest echo $$ > $d/lxctest/tasks done fi run_cmd lxc-create -t busybox -n c1 -l trace -o "${UNPRIV_LOG}" # Make sure we can start it - twice for count in $(seq 1 2); do run_cmd lxc-start -n c1 -d -l trace -o "${UNPRIV_LOG}" p1=$(run_cmd lxc-info -n c1 -p -H -l trace -o "${UNPRIV_LOG}") [ "$p1" != "-1" ] || { echo "Failed to start container c1 (run $count)"; false; } run_cmd lxc-info -n c1 -l trace -o "${UNPRIV_LOG}" run_cmd lxc-attach -n c1 -l trace -o "${UNPRIV_LOG}" -- /bin/true run_cmd lxc-stop -n c1 -k -l trace -o "${UNPRIV_LOG}" done run_cmd lxc-copy -s -n c1 -N c2 -l trace -o "${UNPRIV_LOG}" run_cmd lxc-start -n c2 -d -l trace -o "${UNPRIV_LOG}" p1=$(run_cmd lxc-info -n c2 -p -H -l trace -o "${UNPRIV_LOG}") [ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; } run_cmd lxc-stop -n c2 -k -l trace -o "${UNPRIV_LOG}" if command -v cgm >/dev/null 2>&1; then echo "Testing containers under different cgroups per subsystem" run_cmd cgm create freezer x1/x2 cgm movepid freezer x1 $$ run_cmd lxc-start -n c1 -d -l trace -o "${UNPRIV_LOG}" p1=$(run_cmd lxc-info -n c1 -p -H -l trace -o "${UNPRIV_LOG}") [ "$p1" != "-1" ] || { echo "Failed to start container c1"; false; } run_cmd lxc-info -n c1 -l trace -o "${UNPRIV_LOG}" run_cmd lxc-attach -n c1 -l trace -o "${UNPRIV_LOG}" -- /bin/true run_cmd lxc-cgroup -n c1 freezer.state -l trace -o "${UNPRIV_LOG}" echo "Testing lxc-attach and lxc-cgroup from different cgroup" cgm movepid freezer x2 $$ run_cmd lxc-attach -n c1 -l trace -o "${UNPRIV_LOG}" -- /bin/true run_cmd lxc-cgroup -n c1 -l trace -o "${UNPRIV_LOG}" freezer.state run_cmd lxc-cgroup -n c1 -l trace -o "${UNPRIV_LOG}" memory.limit_in_bytes fi DONE=1 lxc-4.0.12/src/tests/console.c0000644061062106075000000001046714176403775013102 00000000000000/* liblxcapi * * Copyright © 2013 Oracle. * * Authors: * Dwight Engen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #define TTYCNT 4 #define TTYCNT_STR "4" #define TSTNAME "lxcconsoletest" #define MAXCONSOLES 512 #define TSTERR(fmt, ...) do { \ fprintf(stderr, "%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \ } while (0) static void test_console_close_all(int ttyfd[MAXCONSOLES], int ptxfd[MAXCONSOLES]) { int i; for (i = 0; i < MAXCONSOLES; i++) { if (ptxfd[i] != -1) { close(ptxfd[i]); ptxfd[i] = -1; } if (ttyfd[i] != -1) { close(ttyfd[i]); ttyfd[i] = -1; } } } static int test_console_running_container(struct lxc_container *c) { int nrconsoles, i, ret = -1; int ttynum [MAXCONSOLES]; int ttyfd [MAXCONSOLES]; int ptxfd[MAXCONSOLES]; for (i = 0; i < MAXCONSOLES; i++) ttynum[i] = ttyfd[i] = ptxfd[i] = -1; ttynum[0] = 1; ret = c->console_getfd(c, &ttynum[0], &ptxfd[0]); if (ret < 0) { TSTERR("console allocate failed"); goto err1; } ttyfd[0] = ret; if (ttynum[0] != 1) { TSTERR("console allocate got bad ttynum %d", ttynum[0]); goto err2; } /* attempt to alloc same ttynum */ ret = c->console_getfd(c, &ttynum[0], &ptxfd[1]); if (ret != -1) { TSTERR("console allocate should fail for allocated ttynum %d", ttynum[0]); goto err2; } close(ptxfd[0]); ptxfd[0] = -1; close(ttyfd[0]); ttyfd[0] = -1; /* ensure we can allocate all consoles, we do this a few times to * show that the closes are freeing up the allocated slots */ for (i = 0; i < 10; i++) { for (nrconsoles = 0; nrconsoles < MAXCONSOLES; nrconsoles++) { ret = c->console_getfd(c, &ttynum[nrconsoles], &ptxfd[nrconsoles]); if (ret < 0) break; ttyfd[nrconsoles] = ret; } if (nrconsoles != TTYCNT) { TSTERR("didn't allocate all consoles %d != %d", nrconsoles, TTYCNT); goto err2; } test_console_close_all(ttyfd, ptxfd); } ret = 0; err2: test_console_close_all(ttyfd, ptxfd); err1: return ret; } /* test_container: test console function * * @lxcpath : the lxcpath in which to create the container * @group : name of the container group or NULL for default "lxc" * @name : name of the container * @template : template to use when creating the container */ static int test_console(const char *lxcpath, const char *group, const char *name, const char *template) { int ret; struct lxc_container *c = NULL; if (lxcpath) { ret = mkdir(lxcpath, 0755); if (ret < 0 && errno != EEXIST) { TSTERR("failed to mkdir %s %s", lxcpath, strerror(errno)); goto out1; } } ret = -1; if ((c = lxc_container_new(name, lxcpath)) == NULL) { TSTERR("instantiating container %s", name); goto out1; } if (c->is_defined(c)) { c->stop(c); c->destroy(c); c = lxc_container_new(name, lxcpath); } if (!c->createl(c, template, NULL, NULL, 0, NULL)) { TSTERR("creating container %s", name); goto out2; } c->load_config(c, NULL); c->set_config_item(c, "lxc.tty.max", TTYCNT_STR); c->set_config_item(c, "lxc.pty.max", "1024"); c->save_config(c, NULL); c->want_daemonize(c, true); if (!c->startl(c, 0, NULL)) { TSTERR("starting container %s", name); goto out3; } ret = test_console_running_container(c); c->stop(c); out3: c->destroy(c); out2: lxc_container_put(c); out1: return ret; } int main(int argc, char *argv[]) { int ret; ret = test_console(NULL, NULL, TSTNAME, "busybox"); if (ret < 0) goto err1; ret = test_console("/var/lib/lxctest2", NULL, TSTNAME, "busybox"); if (ret < 0) goto err1; printf("All tests passed\n"); err1: return ret; } lxc-4.0.12/src/tests/getkeys.c0000644061062106075000000001076314176403775013112 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "lxc/state.h" #define MYNAME "lxctest1" int main(int argc, char *argv[]) { struct lxc_container *c; int len, ret; char v3[2048]; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } c->set_config_item(c, "lxc.net.0.type", "veth"); len = c->get_keys(c, NULL, NULL, 0); if (len < 0) { fprintf(stderr, "%d: failed to get length of all keys (%d)\n", __LINE__, len); ret = 1; goto out; } ret = c->get_keys(c, NULL, v3, len+1); if (ret != len) { fprintf(stderr, "%d: failed to get keys (%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.net.0", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get nic 0 keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys for nic 1 returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.apparmor", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.selinux", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.mount", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.rootfs", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.uts", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.hook", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.cap", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.console", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.seccomp", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.signal", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.start", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.monitor", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = c->get_keys(c, "lxc.cgroup", v3, 2000); if (ret < 0) { fprintf(stderr, "%d: failed to get keys(%d)\n", __LINE__, ret); ret = 1; goto out; } printf("get_keys returned %d\n%s", ret, v3); ret = 0; out: lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/Makefile.am0000644061062106075000000016666114176403775013340 00000000000000if ENABLE_TESTS LDADD = ../lxc/liblxc.la \ @CAP_LIBS@ \ @OPENSSL_LIBS@ \ @SECCOMP_LIBS@ \ @SELINUX_LIBS@ \ @DLOG_LIBS@ \ @LIBURING_LIBS@ LSM_SOURCES = ../lxc/lsm/lsm.c \ ../lxc/lsm/lsm.h \ ../lxc/lsm/nop.c if ENABLE_APPARMOR LSM_SOURCES += ../lxc/lsm/apparmor.c endif if ENABLE_SELINUX LSM_SOURCES += ../lxc/lsm/selinux.c endif lxc_test_arch_parse_SOURCES = arch_parse.c \ lxctest.h \ ../lxc/lxc.h \ ../lxc/memory_utils.h lxc_test_api_reboot_SOURCES = api_reboot.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_api_reboot_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_api_reboot_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_api_reboot_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_api_reboot_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_api_reboot_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_api_reboot_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_api_reboot_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_api_reboot_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_apparmor_SOURCES = aa.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_apparmor_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_apparmor_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_apparmor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_apparmor_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_apparmor_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_apparmor_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_apparmor_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_apparmor_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_attach_SOURCES = attach.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_attach_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_attach_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_attach_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_attach_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_attach_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_attach_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_attach_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_attach_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_basic_SOURCES = basic.c lxc_test_cgpath_SOURCES = cgpath.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_cgpath_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_cgpath_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_cgpath_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_cgpath_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_cgpath_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_cgpath_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_cgpath_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_cgpath_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_clonetest_SOURCES = clonetest.c lxc_test_concurrent_SOURCES = concurrent.c lxc_test_config_jump_table_SOURCES = config_jump_table.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_config_jump_table_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_config_jump_table_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_config_jump_table_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_config_jump_table_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_config_jump_table_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_config_jump_table_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_config_jump_table_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_config_jump_table_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_console_SOURCES = console.c lxc_test_console_log_SOURCES = console_log.c lxctest.h lxc_test_containertests_SOURCES = containertests.c lxc_test_createtest_SOURCES = createtest.c lxc_test_criu_check_feature_SOURCES = criu_check_feature.c lxctest.h lxc_test_cve_2019_5736_SOURCES = cve-2019-5736.c lxctest.h lxc_test_destroytest_SOURCES = destroytest.c lxc_test_device_add_remove_SOURCES = device_add_remove.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_device_add_remove_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_device_add_remove_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_device_add_remove_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_device_add_remove_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_device_add_remove_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_device_add_remove_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_device_add_remove_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_device_add_remove_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_getkeys_SOURCES = getkeys.c lxc_test_get_item_SOURCES = get_item.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_get_item_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_get_item_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_get_item_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_get_item_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_get_item_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_get_item_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_get_item_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_get_item_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_list_SOURCES = list.c lxc_test_locktests_SOURCES = locktests.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_locktests_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_locktests_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_locktests_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_locktests_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_locktests_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_locktests_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_locktests_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_locktests_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_lxcpath_SOURCES = lxcpath.c lxc_test_may_control_SOURCES = may_control.c lxc_test_mount_injection_SOURCES = mount_injection.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_mount_injection_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_mount_injection_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_mount_injection_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_mount_injection_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_mount_injection_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_mount_injection_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_mount_injection_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_mount_injection_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_parse_config_file_SOURCES = parse_config_file.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_parse_config_file_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_parse_config_file_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_parse_config_file_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_parse_config_file_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_parse_config_file_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_parse_config_file_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_parse_config_file_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_parse_config_file_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_raw_clone_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_raw_clone_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_raw_clone_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_raw_clone_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_raw_clone_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_raw_clone_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_raw_clone_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_raw_clone_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_reboot_SOURCES = reboot.c lxc_test_saveconfig_SOURCES = saveconfig.c lxc_test_share_ns_SOURCES = share_ns.c \ lxctest.h \ ../lxc/compiler.h if !HAVE_STRLCPY lxc_test_share_ns_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_share_ns_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_share_ns_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_share_ns_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_share_ns_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_share_ns_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_shortlived_SOURCES = shortlived.c \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../lxc/string_utils.c ../lxc/string_utils.h if !HAVE_STRLCPY lxc_test_shortlived_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_shortlived_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_shortlived_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_shortlived_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_shortlived_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_shortlived_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_shutdowntest_SOURCES = shutdowntest.c lxc_test_snapshot_SOURCES = snapshot.c lxc_test_startone_SOURCES = startone.c lxc_test_state_server_SOURCES = state_server.c \ lxctest.h \ ../lxc/compiler.h if !HAVE_STRLCPY lxc_test_state_server_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_state_server_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_state_server_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_state_server_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_state_server_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_state_server_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_utils_SOURCES = lxc-test-utils.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_utils_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_utils_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_utils_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_utils_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_utils_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_utils_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_utils_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_utils_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_sys_mixed_SOURCES = sys_mixed.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_sys_mixed_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_sys_mixed_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_sys_mixed_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_sys_mixed_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_sys_mixed_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_sys_mixed_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_sys_mixed_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_sys_mixed_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_rootfs_options_SOURCES = rootfs_options.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_rootfs_options_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_rootfs_options_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_rootfs_options_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_rootfs_options_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_rootfs_options_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_rootfs_options_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_rootfs_options_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_rootfs_options_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_capabilities_SOURCES = capabilities.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_capabilities_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_capabilities_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_capabilities_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_capabilities_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_capabilities_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_capabilities_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_capabilities_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_capabilities_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_sysctls_SOURCES = sysctls.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_sysctls_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_sysctls_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_sysctls_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_sysctls_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_sysctls_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_sysctls_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_sysctls_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_sysctls_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif lxc_test_proc_pid_SOURCES = proc_pid.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ ../lxc/cgroups/cgfsng.c \ ../lxc/cgroups/cgroup.c ../lxc/cgroups/cgroup.h \ ../lxc/cgroups/cgroup2_devices.c ../lxc/cgroups/cgroup2_devices.h \ ../lxc/cgroups/cgroup_utils.c ../lxc/cgroups/cgroup_utils.h \ ../lxc/commands.c ../lxc/commands.h \ ../lxc/commands_utils.c ../lxc/commands_utils.h \ ../lxc/conf.c ../lxc/conf.h \ ../lxc/confile.c ../lxc/confile.h \ ../lxc/confile_utils.c ../lxc/confile_utils.h \ ../lxc/error.c ../lxc/error.h \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ ../lxc/initutils.c ../lxc/initutils.h \ ../lxc/log.c ../lxc/log.h \ ../lxc/lxclock.c ../lxc/lxclock.h \ ../lxc/mainloop.c ../lxc/mainloop.h \ ../lxc/monitor.c ../lxc/monitor.h \ ../lxc/mount_utils.c ../lxc/mount_utils.h \ ../lxc/namespace.c ../lxc/namespace.h \ ../lxc/network.c ../lxc/network.h \ ../lxc/nl.c ../lxc/nl.h \ ../lxc/parse.c ../lxc/parse.h \ ../lxc/process_utils.c ../lxc/process_utils.h \ ../lxc/ringbuf.c ../lxc/ringbuf.h \ ../lxc/start.c ../lxc/start.h \ ../lxc/state.c ../lxc/state.h \ ../lxc/storage/btrfs.c ../lxc/storage/btrfs.h \ ../lxc/storage/dir.c ../lxc/storage/dir.h \ ../lxc/storage/loop.c ../lxc/storage/loop.h \ ../lxc/storage/lvm.c ../lxc/storage/lvm.h \ ../lxc/storage/nbd.c ../lxc/storage/nbd.h \ ../lxc/storage/overlay.c ../lxc/storage/overlay.h \ ../lxc/storage/rbd.c ../lxc/storage/rbd.h \ ../lxc/storage/rsync.c ../lxc/storage/rsync.h \ ../lxc/storage/storage.c ../lxc/storage/storage.h \ ../lxc/storage/storage_utils.c ../lxc/storage/storage_utils.h \ ../lxc/storage/zfs.c ../lxc/storage/zfs.h \ ../lxc/sync.c ../lxc/sync.h \ ../lxc/string_utils.c ../lxc/string_utils.h \ ../lxc/terminal.c ../lxc/terminal.h \ ../lxc/utils.c ../lxc/utils.h \ ../lxc/uuid.c ../lxc/uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_test_proc_pid_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_test_proc_pid_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_test_proc_pid_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_test_proc_pid_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_test_proc_pid_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_test_proc_pid_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_test_proc_pid_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_test_proc_pid_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif AM_CFLAGS += -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ -DLXCPATH=\"$(LXCPATH)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ -DLXCINITDIR=\"$(LXCINITDIR)\" \ -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ -DLOGPATH=\"$(LOGPATH)\" \ -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \ -DSBINDIR=\"$(SBINDIR)\" \ -I $(top_srcdir)/src \ -I $(top_srcdir)/src/include \ -I $(top_srcdir)/src/lxc \ -I $(top_srcdir)/src/lxc/cgroups \ -I $(top_srcdir)/src/lxc/tools \ -I $(top_srcdir)/src/lxc/storage \ -pthread if ENABLE_APPARMOR AM_CFLAGS += -DHAVE_APPARMOR AM_CFLAGS += -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" endif if ENABLE_SECCOMP AM_CFLAGS += -DHAVE_SECCOMP \ $(SECCOMP_CFLAGS) endif if ENABLE_SELINUX AM_CFLAGS += -DHAVE_SELINUX endif bin_PROGRAMS = lxc-test-api-reboot \ lxc-test-apparmor \ lxc-test-arch-parse \ lxc-test-attach \ lxc-test-basic \ lxc-test-capabilities \ lxc-test-cgpath \ lxc-test-clonetest \ lxc-test-concurrent \ lxc-test-config-jump-table \ lxc-test-console \ lxc-test-console-log \ lxc-test-containertests \ lxc-test-createtest \ lxc-test-criu-check-feature \ lxc-test-cve-2019-5736 \ lxc-test-destroytest \ lxc-test-device-add-remove \ lxc-test-getkeys \ lxc-test-get_item \ lxc-test-list \ lxc-test-locktests \ lxc-test-lxcpath \ lxc-test-may-control \ lxc-test-mount-injection \ lxc-test-parse-config-file \ lxc-test-proc-pid \ lxc-test-raw-clone \ lxc-test-reboot \ lxc-test-rootfs-options \ lxc-test-saveconfig \ lxc-test-share-ns \ lxc-test-shortlived \ lxc-test-shutdowntest \ lxc-test-snapshot \ lxc-test-startone \ lxc-test-state-server \ lxc-test-sysctls \ lxc-test-sys-mixed \ lxc-test-utils bin_SCRIPTS = if ENABLE_TOOLS bin_SCRIPTS += lxc-test-automount \ lxc-test-autostart \ lxc-test-cloneconfig \ lxc-test-createconfig \ lxc-test-exit-code \ lxc-test-no-new-privs \ lxc-test-rootfs \ lxc-test-procsys \ lxc-test-usernsexec if DISTRO_UBUNTU bin_SCRIPTS += lxc-test-lxc-attach \ lxc-test-apparmor-mount \ lxc-test-apparmor-generated \ lxc-test-checkpoint-restore \ lxc-test-snapdeps \ lxc-test-symlink \ lxc-test-unpriv \ lxc-test-usernic endif endif if ENABLE_FUZZERS LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer # https://google.github.io/oss-fuzz/getting-started/new-project-guide/#Requirements nodist_EXTRA_fuzz_lxc_config_read_SOURCES = dummy.cxx fuzz_lxc_config_read_SOURCES = fuzz-lxc-config-read.c fuzz_lxc_config_read_CFLAGS = $(AM_CFLAGS) fuzz_lxc_config_read_CXXFLAGS = $(AM_CFLAGS) fuzz_lxc_config_read_LDFLAGS = $(AM_LDFLAGS) -static fuzz_lxc_config_read_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) nodist_EXTRA_fuzz_lxc_define_load_SOURCES = dummy.cxx fuzz_lxc_define_load_SOURCES = fuzz-lxc-define-load.c fuzz_lxc_define_load_CFLAGS = $(AM_CFLAGS) fuzz_lxc_define_load_CXXFLAGS = $(AM_CFLAGS) fuzz_lxc_define_load_LDFLAGS = $(AM_LDFLAGS) -static fuzz_lxc_define_load_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) nodist_EXTRA_fuzz_lxc_cgroup_init_SOURCES = dummy.cxx fuzz_lxc_cgroup_init_SOURCES = fuzz-lxc-cgroup-init.c fuzz_lxc_cgroup_init_CFLAGS = $(AM_CFLAGS) fuzz_lxc_cgroup_init_CXXFLAGS = $(AM_CFLAGS) fuzz_lxc_cgroup_init_LDFLAGS = $(AM_LDFLAGS) -static fuzz_lxc_cgroup_init_LDADD = $(LDADD) $(LIB_FUZZING_ENGINE) bin_PROGRAMS += fuzz-lxc-cgroup-init \ fuzz-lxc-config-read \ fuzz-lxc-define-load bin_SCRIPTS += lxc-test-fuzzers endif endif EXTRA_DIST = arch_parse.c \ basic.c \ capabilities.c \ cgpath.c \ clonetest.c \ concurrent.c \ config_jump_table.c \ console.c \ console_log.c \ containertests.c \ createtest.c \ criu_check_feature.c \ cve-2019-5736.c \ destroytest.c \ device_add_remove.c \ get_item.c \ getkeys.c \ list.c \ locktests.c \ lxcpath.c \ lxc_raw_clone.c \ lxc-test-lxc-attach \ lxc-test-automount \ lxc-test-rootfs \ lxc-test-procsys \ lxc-test-autostart \ lxc-test-apparmor-mount \ lxc-test-apparmor-generated \ lxc-test-checkpoint-restore \ lxc-test-cloneconfig \ lxc-test-createconfig \ lxc-test-exit-code \ lxc-test-no-new-privs \ lxc-test-snapdeps \ lxc-test-symlink \ lxc-test-unpriv \ lxc-test-usernsexec \ lxc-test-utils.c \ may_control.c \ mount_injection.c \ parse_config_file.c \ proc_pid.c \ rootfs_options.c \ saveconfig.c \ shortlived.c \ shutdowntest.c \ snapshot.c \ startone.c \ state_server.c \ share_ns.c \ sysctls.c \ sys_mixed.c clean-local: rm -f lxc-test-utils-* rm -f lxc-parse-config-file-* lxc-4.0.12/src/tests/may_control.c0000644061062106075000000000245114176403775013760 00000000000000/* control.c * * Copyright © 2013 Canonical, Inc * Author: Serge Hallyn * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include static void usage(const char *me) { printf("Usage: %s name [lxcpath]\n", me); exit(EXIT_SUCCESS); } int main(int argc, char *argv[]) { const char *lxcpath = NULL, *name; bool may = false; struct lxc_container *c; if (argc < 2) usage(argv[0]); name = argv[1]; if (argc == 3) lxcpath = argv[2]; c = lxc_container_new(name, lxcpath); if (c) may = c->may_control(c); printf("You may%s control %s\n", may ? "" : " not", name); exit(may ? 0 : 1); } lxc-4.0.12/src/tests/lxc-test-usernsexec0000755061062106075000000002433614176403775015147 00000000000000#!/bin/bash # # This is a bash test case to test lxc-usernsexec. # It basically supports usring lxc-usernsexec to execute itself # and then create files and check that their ownership is as expected. # # It requires that the current user has at least 1 value in subuid and /etc/subgid TEMP_D="" VERBOSITY=0 set -f fail() { echo "$@" 1>&2; exit 1; } error() { echo "$@" 1>&2; } skip() { error "SKIP:" "$@" exit 0 } debug() { local level=${1}; shift; [ "${level}" -gt "${VERBOSITY}" ] && return error "${@}" } collect_owners() { # collect_owners([--dir=dir], file1, file2 ...) # set _RET to a space delimited array of # :owner:group :owner:group ... local out="" ret="" dir="" if [ "${1#--dir=}" != "$1" ]; then dir="${1#--dir=}" shift fi for arg in "$@"; do # drop the :* so that input can be same as touch_files. out=$(stat --format "%n:%u:%g" "${dir}${arg}") || { error "failed to stat ${arg}" return 1; } ret="$ret ${out##*/}" done _RET="${ret# }" } cleanup() { if [ -d "$TEMP_D" ]; then rm -Rf "$TEMP_D" fi } touch_files() { # touch_files tok [tok ...] # tok is filename:chown_id:chown_gid # if chown_id or chown_gid is empty, then chown will do the right thing # and only change the provided value. local args="" tok="" fname="" uidgid="" args=( "$@" ) for tok in "$@"; do fname=${tok%%:*} uidgid=${tok#$fname} uidgid=${uidgid#:} : > "$fname" || { error "failed to create $fname"; return 1; } [ -z "$uidgid" ] && continue chown $uidgid "$fname" || { error "failed to chmod '$uidgid' $fname ($?)"; return 1; } done } inside_cleanup() { local f="" rm -f "${FILES[@]}" echo "$STATUS" >&5 echo "$STATUS" >&6 } set_files() { local x="" FILES=( ) for x in "$@"; do FILES[${#FILES[@]}]="${x%%:*}" done } inside() { # this what gets run inside the usernsexec environment. # basically expects arguments of :uid:gid # it will create the file, and then chmod it to the provided uid:gid # it writes to file descriptor 5 a single line with space delimited # exit_value uid gid [:: ... ] STATUS=127 trap inside_cleanup EXIT local uid="" gid="" x="" uid=$(id -u) || fail "failed execution of id -u" gid=$(id -g) || fail "failed execution of id -g" set_files "$@" touch_files "$@" || fail "failed to create files" collect_owners "${FILES[@]}" || fail "failed to collect owners" result="$_RET" # tell caller we are done. echo "0" "$uid" "$gid" "$result" >&5 STATUS=0 # let the caller do things while the files are around. read -t 30 x <&6 exit } runtest() { # runtest(mydir, nsexec_args, [inside [...]]) # - use 'mydir' as a working dir. # - execute lxc-usernsexec $nsexec_args -- inside # # write to stdout # exit_value inside_exit_value inside_uid:inside_gid # # where results are a list of space separated # filename:uid:gid # for each file passed in inside_args [ $# -ge 3 ] || { error "runtest expects 2 args"; return 1; } local mydir="$1" nsexec_args="$2" shift 2 local ret inside_owners t="" KIDPID="" mkfifo "${mydir}/5" && exec 5<>"${mydir}/5" || return mkfifo "${mydir}/6" && exec 6<>"${mydir}/6" || return mkdir --mode=777 "${mydir}/work" || return cd "${mydir}/work" set_files "$@" local results="" oresults="" iresults="" iuid="" igid="" n=0 error "$" $USERNSEXEC ${nsexec_args} -- "$MYPATH" inside "$*" ${USERNSEXEC} ${nsexec_args} -- "$MYPATH" inside "$@" & KIDPID=$! [ -d "/proc/$KIDPID" ] || { wait $KIDPID fail "kid $KIDPID died quickly $?" } # if lxc-usernsexec fails to execute MYPATH inside, then # the read below would timeout. To avoid a long timeout, # we do a short timeout and check the pid is alive. while ! read -t 1 ret iuid igid inside_owners <&5; do n=$((n+1)) if [ ! -d "/proc/$KIDPID" ]; then wait $KIDPID fail "kid $KIDPID is gone $?" fi [ $n -ge 30 ] && fail "child never wrote to pipe" done iresults=( $inside_owners ) collect_owners "--dir=${mydir}/work/" "${FILES[@]}" || return oresults=( $_RET ) echo 0 >&6 wait ret=$? results=( ) for((i=0;i<${#iresults[@]};i++)); do results[$i]="${oresults[$i]}:${iresults[$i]#*:}" done echo 0 $ret "$iuid:$igid" "${results[@]}" } runcheck() { local name="$1" expected="$2" nsexec_args="$3" found="" shift 3 mkdir "${TEMP_D}/$name" || fail "failed mkdir /$name.d" local err="${TEMP_D}/$name.err" out=$("$MYPATH" runtest "${TEMP_D}/$name" "$nsexec_args" "$@" 2>"$err") || { error "$name: FAIL - runtest failed $?" [ -n "$out" ] && error " $out" sed 's,^, ,' "$err" 1>&2 ERRORS="${ERRORS} $name" return 1 } set -- $out local parentrc=$1 kidrc=$2 iuidgid="$3" found="" shift 3 found="$*" [ "$parentrc" = "0" -a "$kidrc" = "0" ] || { error "$name: FAIL - parentrc=$parentrc kidrc=$kidrc found=$found" ERRORS="${ERRORS} $name" return 1 } [ "$expected" = "$found" ] && { error "$name: PASS" PASS="${PASSES} $name" return 0 } echo "$name: FAIL expected '$expected' != found '$found'" FAILS="${FAILS} $name" return 1 } setup_Usage() { cat <> /etc/subuid || { error "failed to add $asuser to /etc/subuid" } fi subgid=$(awk -F: '$1 == n { print $2; exit(0); }' "n=$asuser" /etc/subgid) || { error "failed to read /etc/subgid for $asuser" return 1 } if [ -n "$subgid" ]; then debug 1 "$asuser already had subgid=$subgid" else debug 1 "adding $asuser:$create_subgid to /etc/subgid" echo "$asuser:$create_subgid" >> /etc/subgid || { error "failed to add $asuser to /etc/subgid" } fi debug 0 "as $asuser executing ${MYPATH} ${pt_args[*]}" sudo -Hu "$asuser" ASAN_OPTIONS=${ASAN_OPTIONS:-} UBSAN_OPTIONS=${UBSAN_OPTIONS:-} "${MYPATH}" "${pt_args[@]}" } USERNSEXEC=${USERNSEXEC:-lxc-usernsexec} MYPATH=$(readlink -f "$0") || { echo "failed to get full path to self: $0"; exit 1; } export MYPATH if [ "$1" = "inside" ]; then shift inside "$@" exit elif [ "$1" = "runtest" ]; then shift runtest "$@" exit elif [ "$1" = "setup_and_run" ]; then shift setup_and_run "$@" exit fi name=$(id --user --name) || fail "failed to get username" if [ "$name" = "root" ]; then setup_and_run "$@" exit fi subuid=$(awk -F: '$1 == n { print $2; exit(0); }' "n=$name" /etc/subuid) && [ -n "$subuid" ] || fail "did not find $name in /etc/subuid" subgid=$(awk -F: '$1 == n { print $2; exit(0); }' "n=$name" /etc/subgid) && [ -n "$subgid" ] || fail "did not find $name in /etc/subgid" uid=$(id --user) || fail "failed to get uid" gid=$(id --group) || fail "failed to get gid" mapuid="u:0:$uid:1" mapgid="g:0:$gid:1" ver=$(dpkg-query --show lxc-utils | awk '{print $2}') error "uid=$uid gid=$gid name=$name subuid=$subuid subgid=$subgid ver=$ver" error "lxc-utils=$ver kver=$(uname -r)" error "USERNSEXEC=$USERNSEXEC" TEMP_D=$(mktemp -d) trap cleanup EXIT PASSES=""; FAILS=""; ERRORS="" runcheck nouidgid "f0:$subuid:$subgid:0:0" "" f0 runcheck myuidgid "f0:$uid:$gid:0:0" \ "-m$mapuid -m$mapgid" f0 runcheck subuidgid \ "f0:$subuid:$subgid:0:0" \ "-mu:0:$subuid:1 -mg:0:$subgid:1" f0:0:0 runcheck bothsets "f0:$uid:$gid:0:0 f1:$subuid:$subgid:1:1 f2:$uid:$subgid:0:1" \ "-m$mapuid -m$mapgid -mu:1:$subuid:1 -mg:1:$subgid:1" \ f0 f1:1:1 f2::1 runcheck mismatch "f0:$uid:$subgid:0:0 f1:$subuid:$gid:15:31" \ "-mu:0:$uid:1 -mg:0:$subgid:1 -mu:15:$subuid:1 -mg:31:$gid:1" \ f0 f1:15:31 FAILS=${FAILS# } ERRORS=${ERRORS# } PASSES=${PASSES# } [ -z "${FAILS}" ] || error "FAILS: ${FAILS}" [ -z "${ERRORS}" ] || error "ERRORS: ${ERRORS}" [ -z "${FAILS}" -a -z "${ERRORS}" ] || exit 1 exit 0 lxc-4.0.12/src/tests/lxc-test-rootfs0000755061062106075000000000331314176403775014267 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Feng Li # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -ex cleanup() { set +e lxc-destroy -n lxc-test-rootfs -f if [ $PHASE != "done" ]; then echo "rootfs test failed at $PHASE" exit 1 fi echo "rootfs test passed" exit 0 } PHASE=setup trap cleanup EXIT lxc-destroy -n lxc-test-rootfs -f || true lxc-create -t busybox -n lxc-test-rootfs PHASE=ro_rootfs echo "Starting phase $PHASE" config=/var/lib/lxc/lxc-test-rootfs/config sed -i '/lxc.rootfs.options/d' $config echo "lxc.rootfs.options = ro" >> $config lxc-start -n lxc-test-rootfs pid=$(lxc-info -n lxc-test-rootfs -p -H) ro=0 mkdir /proc/$pid/root/rotest || ro=1 [ $ro -ne 0 ] lxc-stop -n lxc-test-rootfs -k PHASE=rw_rootfs echo "Starting phase $PHASE" sed -i '/lxc.rootfs.options/d' $config echo "lxc.rootfs.options = rw" >> $config lxc-start -n lxc-test-rootfs pid=$(lxc-info -n lxc-test-rootfs -p -H) ro=0 mkdir /proc/$pid/root/rwtest || ro=1 [ $ro -ne 1 ] rmdir /proc/$pid/root/rwtest ro=0 PHASE=done lxc-4.0.12/src/tests/lxc-test-no-new-privs0000755061062106075000000000405614176403775015324 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Christian Brauner # # This is a test script for PR_SET_NO_NEW_PRIVS # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -eux DONE=0 cleanup() { cd / lxc-destroy -n c1 -f || true if [ $DONE -eq 0 ]; then echo "FAIL" exit 1 fi echo "PASS" } trap cleanup EXIT SIGHUP SIGINT SIGTERM if [ ! -d /etc/lxc ]; then mkdir -p /etc/lxc/ cat > /etc/lxc/default.conf << EOF lxc.net.0.type = veth lxc.net.0.link = lxcbr0 EOF fi lxc-create -t busybox -n c1 echo "lxc.no_new_privs = 1" >> /var/lib/lxc/c1/config lxc-start -n c1 p1=$(lxc-info -n c1 -p -H) [ "$p1" != "-1" ] || { echo "Failed to start container c1"; false; } lxc-attach -n c1 --clear-env -- mkdir -p /home/ubuntu lxc-attach -n c1 --clear-env -- /bin/sh -c "cat <> /etc/passwd ubuntu:x:1000:1000:ubuntu:/home/ubuntu:/bin/sh EOF" # Check that lxc-attach obeys PR_SET_NO_NEW_PRIVS when it is set. ! lxc-attach -n c1 --clear-env --uid 1000 --gid 1000 -- ping -c 1 127.0.0.1 || { echo "Managed to ping localhost"; false; } lxc-stop -n c1 -k # Check that lxc-attach obeys PR_SET_NO_NEW_PRIVS when it is not set. sed -i 's/lxc.no_new_privs = 1/lxc.no_new_privs = 0/' /var/lib/lxc/c1/config lxc-start -n c1 lxc-attach -n c1 --clear-env --uid 1000 --gid 1000 -- ping -c 1 127.0.0.1 || { echo "Managed to ping localhost"; false; } lxc-stop -n c1 -k DONE=1 lxc-4.0.12/src/tests/lxc-test-apparmor-generated0000755061062106075000000000420414176403775016530 00000000000000#!/bin/sh # lxc: linux Container library # This is a test script for generated apparmor profiles # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA if ! command -v apparmor_parser >/dev/null 2>&1; then echo 'SKIP: test for generated apparmor profiles: apparmor_parser missing' fi exit 0 DONE=0 LOGFILE="/tmp/lxc-test-$$.log" cleanup() { lxc-destroy -n $CONTAINER_NAME >/dev/null 2>&1 || true if [ $DONE -eq 0 ]; then [ -f "$LOGFILE" ] && cat "$LOGFILE" >&2 rm -f "$LOGFILE" echo "FAIL" exit 1 fi rm -f "$LOGFILE" echo "PASS" } trap cleanup EXIT HUP INT TERM set -eu # Create a container CONTAINER_NAME=lxc-test-apparmor-generated lxc-create -t busybox -n $CONTAINER_NAME -B dir CONTAINER_PATH=$(dirname $(lxc-info -n $CONTAINER_NAME -c lxc.rootfs.path -H) | sed -e 's/dir://') cp $CONTAINER_PATH/config $CONTAINER_PATH/config.bak # Set the profile to be auto-generated echo "lxc.apparmor.profile = generated" >> $CONTAINER_PATH/config # Start it lxc-start -n $CONTAINER_NAME -lDEBUG -o "$LOGFILE" lxc-wait -n $CONTAINER_NAME -t 5 -s RUNNING || (echo "Container didn't start" && exit 1) pid=$(lxc-info -p -H -n $CONTAINER_NAME) profile=$(cat /proc/$pid/attr/current) expected_profile="lxc-${CONTAINER_NAME}_//&:lxc-${CONTAINER_NAME}_<-var-lib-lxc>:unconfined (enforce)" lxc-stop -n $CONTAINER_NAME -k if [ "x$profile" != "x$expected_profile" ]; then echo "FAIL: container was in profile $profile" >&2 echo "expected profile: $expected_profile" >&2 exit 1 fi DONE=1 lxc-4.0.12/src/tests/destroytest.c0000644061062106075000000000467314176403775014033 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #define MYNAME "lxctest1" static int create_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 1; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (create_container()) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } if (!c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } if (!c->destroy(c)) { fprintf(stderr, "%d: error deleting %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/get_item.c0000644061062106075000000004644614176403775013243 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "lxc/state.h" #include "lxctest.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define MYNAME "lxctest1" int main(int argc, char *argv[]) { int ret; struct lxc_container *c; int fret = EXIT_FAILURE; char v1[2], v2[256], v3[2048]; if ((c = lxc_container_new("testxyz", NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); exit(EXIT_FAILURE); } /* EXPECT SUCCESS: lxc.log.syslog with valid value. */ if (!c->set_config_item(c, "lxc.log.syslog", "local0")) { lxc_error("%s\n", "Failed to set lxc.log.syslog.\n"); goto out; } ret = c->get_config_item(c, "lxc.log.syslog", v2, 255); if (ret < 0) { lxc_error("Failed to retrieve lxc.log.syslog: %d.\n", ret); goto out; } if (strcmp(v2, "local0") != 0) { lxc_error("Expected: local0 == %s.\n", v2); goto out; } lxc_debug("Retrieving value for lxc.log.syslog correctly returned: %s.\n", v2); /* EXPECT FAILURE: lxc.log.syslog with invalid value. */ if (c->set_config_item(c, "lxc.log.syslog", "NONSENSE")) { lxc_error("%s\n", "Succeeded int setting lxc.log.syslog to invalid value \"NONSENSE\".\n"); goto out; } lxc_debug("%s\n", "Successfully failed to set lxc.log.syslog to invalid value.\n"); if (!c->set_config_item(c, "lxc.hook.pre-start", "hi there")) { fprintf(stderr, "%d: failed to set hook.pre-start\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.hook.pre-start", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.hook.pre-start) returned %d\n", __LINE__, ret); goto out; } fprintf(stderr, "lxc.hook.pre-start returned %d %s\n", ret, v2); ret = c->get_config_item(c, "lxc.net", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item returned %d\n", __LINE__, ret); goto out; } fprintf(stderr, "%d: get_config_item(lxc.net) returned %d %s\n", __LINE__, ret, v2); if (!c->set_config_item(c, "lxc.tty.max", "4")) { fprintf(stderr, "%d: failed to set tty\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.tty.max", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.tty) returned %d\n", __LINE__, ret); goto out; } fprintf(stderr, "lxc.tty returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.arch", "x86")) { fprintf(stderr, "%d: failed to set arch\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.arch", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.arch) returned %d\n", __LINE__, ret); goto out; } printf("lxc.arch returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.init.uid", "100")) { fprintf(stderr, "%d: failed to set init_uid\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.init.uid", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.init_uid) returned %d\n", __LINE__, ret); goto out; } printf("lxc.init_uid returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.init.gid", "100")) { fprintf(stderr, "%d: failed to set init_gid\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.init.gid", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.init_gid) returned %d\n", __LINE__, ret); goto out; } printf("lxc.init_gid returned %d %s\n", ret, v2); #define HNAME "hostname1" // demonstrate proper usage: char *alloced; int len; if (!c->set_config_item(c, "lxc.uts.name", HNAME)) { fprintf(stderr, "%d: failed to set utsname\n", __LINE__); goto out; } len = c->get_config_item(c, "lxc.uts.name", NULL, 0); // query the size of the string if (len < 0) { fprintf(stderr, "%d: get_config_item(lxc.utsname) returned %d\n", __LINE__, len); goto out; } printf("lxc.utsname returned %d\n", len); // allocate the length of string + 1 for trailing \0 alloced = malloc(len+1); if (!alloced) { fprintf(stderr, "%d: failed to allocate %d bytes for utsname\n", __LINE__, len); goto out; } // now pass in the malloc'd array, and pass in length of string + 1: again // because we need room for the trailing \0 ret = c->get_config_item(c, "lxc.uts.name", alloced, len+1); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.utsname) returned %d\n", __LINE__, ret); goto out; } if (strcmp(alloced, HNAME) != 0 || ret != len) { fprintf(stderr, "lxc.utsname returned wrong value: %d %s not %d %s\n", ret, alloced, len, HNAME); goto out; } printf("lxc.utsname returned %d %s\n", len, alloced); free(alloced); if (!c->set_config_item(c, "lxc.mount.entry", "hi there")) { fprintf(stderr, "%d: failed to set mount.entry\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.mount.entry", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.mount.entry) returned %d\n", __LINE__, ret); goto out; } printf("lxc.mount.entry returned %d %s\n", ret, v2); ret = c->get_config_item(c, "lxc.prlimit", v3, 2047); if (ret != 0) { fprintf(stderr, "%d: get_config_item(limit) returned %d\n", __LINE__, ret); goto out; } if (!c->set_config_item(c, "lxc.prlimit.nofile", "1234:unlimited")) { fprintf(stderr, "%d: failed to set limit.nofile\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.prlimit.nofile", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.prlimit.nofile) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "1234:unlimited")) { fprintf(stderr, "%d: lxc.prlimit.nofile returned wrong value: %d %s not 14 1234:unlimited\n", __LINE__, ret, v2); goto out; } printf("lxc.prlimit.nofile returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.prlimit.stack", "unlimited")) { fprintf(stderr, "%d: failed to set limit.stack\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.prlimit.stack", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.prlimit.stack) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "unlimited")) { fprintf(stderr, "%d: lxc.prlimit.stack returned wrong value: %d %s not 9 unlimited\n", __LINE__, ret, v2); goto out; } printf("lxc.prlimit.stack returned %d %s\n", ret, v2); #define LIMIT_STACK "lxc.prlimit.stack = unlimited\n" #define ALL_LIMITS "lxc.prlimit.nofile = 1234:unlimited\n" LIMIT_STACK ret = c->get_config_item(c, "lxc.prlimit", v3, 2047); if (ret != sizeof(ALL_LIMITS)-1) { fprintf(stderr, "%d: get_config_item(limit) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, ALL_LIMITS)) { fprintf(stderr, "%d: lxc.prlimit returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(ALL_LIMITS)-1, ALL_LIMITS); goto out; } printf("lxc.prlimit returned %d %s\n", ret, v3); if (!c->clear_config_item(c, "lxc.prlimit.nofile")) { fprintf(stderr, "%d: failed clearing limit.nofile\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.prlimit", v3, 2047); if (ret != sizeof(LIMIT_STACK)-1) { fprintf(stderr, "%d: get_config_item(limit) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, LIMIT_STACK)) { fprintf(stderr, "%d: lxc.prlimit returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(LIMIT_STACK)-1, LIMIT_STACK); goto out; } printf("lxc.prlimit returned %d %s\n", ret, v3); #define SYSCTL_SOMAXCONN "lxc.sysctl.net.core.somaxconn = 256\n" #define ALL_SYSCTLS "lxc.sysctl.net.ipv4.ip_forward = 1\n" SYSCTL_SOMAXCONN ret = c->get_config_item(c, "lxc.sysctl", v3, 2047); if (ret != 0) { fprintf(stderr, "%d: get_config_item(sysctl) returned %d\n", __LINE__, ret); goto out; } if (!c->set_config_item(c, "lxc.sysctl.net.ipv4.ip_forward", "1")) { fprintf(stderr, "%d: failed to set lxc.sysctl.net.ipv4.ip_forward\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.sysctl.net.ipv4.ip_forward", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.sysctl.net.ipv4.ip_forward) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "1")) { fprintf(stderr, "%d: lxc.sysctl.net.ipv4.ip_forward returned wrong value: %d %s not 1\n", __LINE__, ret, v2); goto out; } printf("lxc.sysctl.net.ipv4.ip_forward returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.sysctl.net.core.somaxconn", "256")) { fprintf(stderr, "%d: failed to set lxc.sysctl.net.core.somaxconn\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.sysctl.net.core.somaxconn", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.sysctl.net.core.somaxconn) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "256")) { fprintf(stderr, "%d: lxc.sysctl.net.core.somaxconn returned wrong value: %d %s not 256\n", __LINE__, ret, v2); goto out; } printf("lxc.sysctl.net.core.somaxconn returned %d %s\n", ret, v2); ret = c->get_config_item(c, "lxc.sysctl", v3, 2047); if (ret != sizeof(ALL_SYSCTLS)-1) { fprintf(stderr, "%d: get_config_item(sysctl) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, ALL_SYSCTLS)) { fprintf(stderr, "%d: lxc.sysctl returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(ALL_SYSCTLS) - 1, ALL_SYSCTLS); goto out; } printf("lxc.sysctl returned %d %s\n", ret, v3); if (!c->clear_config_item(c, "lxc.sysctl.net.ipv4.ip_forward")) { fprintf(stderr, "%d: failed clearing lxc.sysctl.net.ipv4.ip_forward\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.sysctl", v3, 2047); if (ret != sizeof(SYSCTL_SOMAXCONN) - 1) { fprintf(stderr, "%d: get_config_item(sysctl) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, SYSCTL_SOMAXCONN)) { fprintf(stderr, "%d: lxc.sysctl returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(SYSCTL_SOMAXCONN) - 1, SYSCTL_SOMAXCONN); goto out; } printf("lxc.sysctl returned %d %s\n", ret, v3); #define PROC_OOM_SCORE_ADJ "lxc.proc.oom_score_adj = 10\n" #define ALL_PROCS "lxc.proc.setgroups = allow\n" PROC_OOM_SCORE_ADJ ret = c->get_config_item(c, "lxc.proc", v3, 2047); if (ret != 0) { fprintf(stderr, "%d: get_config_item(proc) returned %d\n", __LINE__, ret); goto out; } if (!c->set_config_item(c, "lxc.proc.setgroups", "allow")) { fprintf(stderr, "%d: failed to set lxc.proc.setgroups\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.proc.setgroups", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.proc.setgroups) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "allow")) { fprintf(stderr, "%d: lxc.proc.setgroups returned wrong value: %d %s not 10\n", __LINE__, ret, v2); goto out; } printf("lxc.proc.setgroups returned %d %s\n", ret, v2); if (!c->set_config_item(c, "lxc.proc.oom_score_adj", "10")) { fprintf(stderr, "%d: failed to set lxc.proc.oom_score_adj\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.proc.oom_score_adj", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.proc.oom_score_adj) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v2, "10")) { fprintf(stderr, "%d: lxc.proc.oom_score_adj returned wrong value: %d %s not 10\n", __LINE__, ret, v2); goto out; } printf("lxc.proc.oom_score_adj returned %d %s\n", ret, v2); ret = c->get_config_item(c, "lxc.proc", v3, 2047); if (ret != sizeof(ALL_PROCS)-1) { fprintf(stderr, "%d: get_config_item(proc) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, ALL_PROCS)) { fprintf(stderr, "%d: lxc.proc returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(ALL_PROCS) - 1, ALL_PROCS); goto out; } printf("lxc.proc returned %d %s\n", ret, v3); if (!c->clear_config_item(c, "lxc.proc.setgroups")) { fprintf(stderr, "%d: failed clearing lxc.proc.setgroups\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.proc", v3, 2047); if (ret < 0) { fprintf(stderr, "%d: get_config_item(proc) returned %d\n", __LINE__, ret); goto out; } if (strcmp(v3, PROC_OOM_SCORE_ADJ)) { fprintf(stderr, "%d: lxc.proc returned wrong value: %d %s not %d %s\n", __LINE__, ret, v3, (int)sizeof(PROC_OOM_SCORE_ADJ) - 1, PROC_OOM_SCORE_ADJ); goto out; } printf("lxc.proc returned %d %s\n", ret, v3); #if HAVE_APPARMOR if (!c->set_config_item(c, "lxc.apparmor.profile", "unconfined")) { fprintf(stderr, "%d: failed to set aa_profile\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.apparmor.profile", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.aa_profile) returned %d\n", __LINE__, ret); goto out; } printf("lxc.aa_profile returned %d %s\n", ret, v2); #endif lxc_container_put(c); // new test with real container if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); goto out; } c->destroy(c); lxc_container_put(c); if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); goto out; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a trusty container\n", __LINE__); goto out; } lxc_container_put(c); /* XXX TODO load_config needs to clear out any old config first */ if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); goto out; } ret = c->get_config_item(c, "lxc.cap.drop", NULL, 300); if (ret < 5 || ret > 255) { fprintf(stderr, "%d: get_config_item(lxc.cap.drop) with NULL returned %d\n", __LINE__, ret); goto out; } ret = c->get_config_item(c, "lxc.cap.drop", v1, 1); if (ret < 5 || ret > 255) { fprintf(stderr, "%d: get_config_item(lxc.cap.drop) returned %d\n", __LINE__, ret); goto out; } ret = c->get_config_item(c, "lxc.cap.drop", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.cap.drop) returned %d %s\n", __LINE__, ret, v2); goto out; } printf("%d: get_config_item(lxc.cap.drop) returned %d %s\n", __LINE__, ret, v2); ret = c->get_config_item(c, "lxc.net", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item(lxc.net) returned %d\n", __LINE__, ret); goto out; } printf("%d: get_config_item(lxc.net) returned %d %s\n", __LINE__, ret, v2); if (!c->set_config_item(c, "lxc.net.0.type", "veth")) { fprintf(stderr, "%d: failed to set lxc.net.0.type\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.net.0.link", "lxcbr0")) { fprintf(stderr, "%d: failed to set network.link\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.net.0.flags", "up")) { fprintf(stderr, "%d: failed to set network.flags\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.net.0.hwaddr", "00:16:3e:xx:xx:xx")) { fprintf(stderr, "%d: failed to set network.hwaddr\n", __LINE__); goto out; } if (!c->set_config_item(c, "lxc.net.0.ipv4.address", "10.2.3.4")) { fprintf(stderr, "%d: failed to set ipv4\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.net.0.ipv4.address", v2, 255); if (ret <= 0) { fprintf(stderr, "%d: lxc.net.0.ipv4 returned %d\n", __LINE__, ret); goto out; } if (!c->clear_config_item(c, "lxc.net.0.ipv4.address")) { fprintf(stderr, "%d: failed clearing all ipv4 entries\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.net.0.ipv4.address", v2, 255); if (ret != 0) { fprintf(stderr, "%d: after clearing ipv4 entries get_item(lxc.network.0.ipv4 returned %d\n", __LINE__, ret); goto out; } if (!c->set_config_item(c, "lxc.net.0.ipv4.gateway", "10.2.3.254")) { fprintf(stderr, "%d: failed to set ipv4.gateway\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.net.0.ipv4.gateway", v2, 255); if (ret <= 0) { fprintf(stderr, "%d: lxc.net.0.ipv4.gateway returned %d\n", __LINE__, ret); goto out; } if (!c->set_config_item(c, "lxc.net.0.ipv4.gateway", "")) { fprintf(stderr, "%d: failed clearing ipv4.gateway\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.net.0.ipv4.gateway", v2, 255); if (ret != 0) { fprintf(stderr, "%d: after clearing ipv4.gateway get_item(lxc.network.0.ipv4.gateway returned %d\n", __LINE__, ret); goto out; } ret = c->get_config_item(c, "lxc.net.0.link", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item returned %d\n", __LINE__, ret); goto out; } printf("%d: get_config_item (link) returned %d %s\n", __LINE__, ret, v2); ret = c->get_config_item(c, "lxc.net.0.name", v2, 255); if (ret < 0) { fprintf(stderr, "%d: get_config_item returned %d\n", __LINE__, ret); goto out; } printf("%d: get_config_item (name) returned %d %s\n", __LINE__, ret, v2); if (!c->clear_config_item(c, "lxc.net")) { fprintf(stderr, "%d: clear_config_item failed\n", __LINE__); goto out; } ret = c->get_config_item(c, "lxc.net", v2, 255); if (ret != 0) { fprintf(stderr, "%d: network was not actually cleared (get_network returned %d)\n", __LINE__, ret); goto out; } ret = c->get_config_item(c, "lxc.cgroup", v3, 2047); if (ret < 0) { fprintf(stderr, "%d: get_config_item(cgroup.devices) returned %d\n", __LINE__, ret); goto out; } printf("%d: get_config_item (cgroup.devices) returned %d %s\n", __LINE__, ret, v3); ret = c->get_config_item(c, "lxc.cgroup.devices.allow", v3, 2047); if (ret < 0) { fprintf(stderr, "%d: get_config_item(cgroup.devices.devices.allow) returned %d\n", __LINE__, ret); goto out; } printf("%d: get_config_item (cgroup.devices.devices.allow) returned %d %s\n", __LINE__, ret, v3); if (!c->clear_config_item(c, "lxc.cgroup")) { fprintf(stderr, "%d: failed clearing lxc.cgroup\n", __LINE__); goto out; } if (!c->clear_config_item(c, "lxc.cap.drop")) { fprintf(stderr, "%d: failed clearing lxc.cap.drop\n", __LINE__); goto out; } if (!c->clear_config_item(c, "lxc.mount.entry")) { fprintf(stderr, "%d: failed clearing lxc.mount.entry\n", __LINE__); goto out; } if (!c->clear_config_item(c, "lxc.hook")) { fprintf(stderr, "%d: failed clearing lxc.hook\n", __LINE__); goto out; } if (!lxc_config_item_is_supported("lxc.arch")) { fprintf(stderr, "%d: failed to report \"lxc.arch\" as supported configuration item\n", __LINE__); goto out; } if (lxc_config_item_is_supported("lxc.nonsense")) { fprintf(stderr, "%d: failed to detect \"lxc.nonsense\" as unsupported configuration item\n", __LINE__); goto out; } if (lxc_config_item_is_supported("lxc.arch.nonsense")) { fprintf(stderr, "%d: failed to detect \"lxc.arch.nonsense\" as unsupported configuration item\n", __LINE__); goto out; } if (c->set_config_item(c, "lxc.notaconfigkey", "invalid")) { fprintf(stderr, "%d: Managed to set \"lxc.notaconfigkey\"\n", __LINE__); goto out; } printf("All get_item tests passed\n"); fret = EXIT_SUCCESS; out: if (c) { c->destroy(c); lxc_container_put(c); } exit(fret); } lxc-4.0.12/src/tests/lxctest.h0000644061062106075000000000441314176403775013125 00000000000000/* * lxc: linux Container library * * Copyright © 2016 Canonical Ltd. * * Authors: * Christian Brauner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __LXC_TEST_H_ #define __LXC_TEST_H_ #include "config.h" #include #include #include #define lxc_debug_stream(stream, format, ...) \ do { \ fprintf(stream, "%s: %d: %s: " format "\n", __FILE__, \ __LINE__, __func__, ##__VA_ARGS__); \ } while (false) #define lxc_error(format, ...) lxc_debug_stream(stderr, format, ##__VA_ARGS__) #define lxc_debug(format, ...) lxc_debug_stream(stdout, format, ##__VA_ARGS__) #define lxc_test_assert_stringify(expression, stringify_expression) \ do { \ if (!(expression)) { \ fprintf(stderr, "%s: %s: %d: %s\n", __FILE__, \ __func__, __LINE__, stringify_expression); \ abort(); \ } \ } while (false) #define lxc_test_assert_abort(expression) lxc_test_assert_stringify(expression, #expression) #define test_error_ret(__ret__, format, ...) \ ({ \ typeof(__ret__) __internal_ret__ = (__ret__); \ fprintf(stderr, format, ##__VA_ARGS__); \ __internal_ret__; \ }) #endif /* __LXC_TEST_H */ lxc-4.0.12/src/tests/cve-2019-5736.c0000644061062106075000000001060114176403775013176 00000000000000/* liblxcapi * * Copyright © 2019 Christian Brauner . * Copyright © 2019 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "lxctest.h" #include "utils.h" #define MYNAME "shortlived" static int destroy_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } static int create_container(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { int i; const char *s; bool b; struct lxc_container *c; int ret = EXIT_FAILURE; /* test a real container */ c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%d: error creating lxc_container %s\n", __LINE__, MYNAME); goto out; } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } if (create_container() < 0) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } b = c->is_defined(c); if (!b) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } s = c->state(c); if (!s || strcmp(s, "STOPPED")) { fprintf(stderr, "%d: %s is in state %s, not in STOPPED.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } b = c->load_config(c, NULL); if (!b) { fprintf(stderr, "%d: %s failed to read its config\n", __LINE__, c->name); goto out; } if (!c->set_config_item(c, "lxc.init.cmd", "echo hello")) { fprintf(stderr, "%d: failed setting lxc.init.cmd\n", __LINE__); goto out; } c->want_daemonize(c, true); if (setenv("LXC_MEMFD_REXEC", "1", 1)) { fprintf(stderr, "%d: failed to set LXC_MEMFD_REXEC evironment variable\n", __LINE__); goto out; } /* Test whether we can start a really short-lived daemonized container. */ for (i = 0; i < 10; i++) { if (!c->startl(c, 0, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } /* Test whether we can start a really short-lived daemonized container with lxc-init. */ for (i = 0; i < 10; i++) { if (!c->startl(c, 1, NULL)) { fprintf(stderr, "%d: %s failed to start on %dth iteration\n", __LINE__, c->name, i); goto out; } if (!c->wait(c, "STOPPED", 30)) { fprintf(stderr, "%d: %s failed to wait on %dth iteration\n", __LINE__, c->name, i); goto out; } } c->stop(c); fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = EXIT_SUCCESS; out: if (c) { c->stop(c); destroy_container(); } lxc_container_put(c); exit(ret); } lxc-4.0.12/src/tests/lxc-test-createconfig0000755061062106075000000000232514176403775015406 00000000000000#!/bin/bash # lxc: linux Container library # Authors: # Serge Hallyn # # This is a test script for the lxc-user-nic program # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA set -e s=$(mktemp -d /tmp/lxctest-XXXXXX) f="$s/in.conf" cleanup() { lxc-destroy -n lxctestc || true rm -rf $s } trap cleanup EXIT cat > $f << EOF lxc.net.0.type = veth lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx EOF lxc-create -t busybox -f $f -n lxctestc grep -q "xx:xx" /var/lib/lxc/lxctestc/config && { echo "hwaddr not expanded"; exit 1; } echo "Success" lxc-4.0.12/src/tests/sysctls.c0000644061062106075000000001016314176403775013135 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include "lxccontainer.h" #include "attach_options.h" #include "lxctest.h" #include "utils.h" #define CONTAINER_NAME "test-proc-sys" #define SYSCTL_PATH "/proc/sys/net/ipv4/ip_forward" #define SYSCTL_CONFIG_KEY "lxc.sysctl.net.ipv4.ip_forward" #define SYSCTL_CONFIG_VALUE "1" static int check_sysctls(void *payload) { __do_close int fd = -EBADF; char buf[INTTYPE_TO_STRLEN(__u64)]; ssize_t ret; fd = open(SYSCTL_PATH, O_RDONLY | O_CLOEXEC | O_NOFOLLOW); if (fd < 0) { lxc_error("Failed to open " SYSCTL_PATH); return EXIT_FAILURE; } ret = lxc_read_nointr(fd, buf, sizeof(buf)); if (ret < 0 || (size_t)ret >= sizeof(buf)) { lxc_error("Failed to read " SYSCTL_PATH); return EXIT_FAILURE; } buf[ret] = '\0'; remove_trailing_newlines(buf); if (!strequal(buf, SYSCTL_CONFIG_VALUE)) { lxc_error("Unexpected value %s for " SYSCTL_PATH, buf); return EXIT_FAILURE; } return EXIT_SUCCESS; } int main(int argc, char *argv[]) { int fd_log = -EBADF, fret = EXIT_FAILURE; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; int ret; pid_t pid; struct lxc_container *c; struct lxc_log log; char template[sizeof(P_tmpdir "/" CONTAINER_NAME "_XXXXXX")]; if (!file_exists(SYSCTL_PATH)) { lxc_debug("The sysctl path \"" SYSCTL_PATH "\" needed for this test does not exist. Skipping"); exit(EXIT_SUCCESS); } (void)strlcpy(template, P_tmpdir "/" CONTAINER_NAME "_XXXXXX", sizeof(template)); fd_log = lxc_make_tmpfile(template, false); if (fd_log < 0) { lxc_error("%s", "Failed to create temporary log file for container \"capabilities\""); return fret; } log.name = CONTAINER_NAME; log.file = template; log.level = "TRACE"; log.prefix = CONTAINER_NAME; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) exit(fret); c = lxc_container_new(CONTAINER_NAME, NULL); if (!c) { lxc_error("%s", "Failed to create container " CONTAINER_NAME); exit(fret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container " CONTAINER_NAME " is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container " CONTAINER_NAME); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container " CONTAINER_NAME " is not defined"); goto on_error_destroy; } if (!c->set_config_item(c, "lxc.mount.auto", "proc:rw")) { lxc_error("%s\n", "Failed to set config item \"lxc.mount.auto=proc:rw\""); goto on_error_destroy; } if (!c->clear_config_item(c, SYSCTL_CONFIG_KEY)) { lxc_error("%s\n", "Failed to clear config item \"" SYSCTL_CONFIG_KEY "\""); goto on_error_destroy; } if (!c->set_config_item(c, SYSCTL_CONFIG_KEY, SYSCTL_CONFIG_VALUE)) { lxc_error("%s\n", "Failed to set config item \"" SYSCTL_CONFIG_KEY "\""); goto on_error_destroy; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container " CONTAINER_NAME " daemonized"); goto on_error_destroy; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container " CONTAINER_NAME " daemonized"); goto on_error_destroy; } /* Leave some time for the container to write something to the log. */ sleep(2); ret = c->attach(c, check_sysctls, NULL, &attach_options, &pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container " CONTAINER_NAME); goto on_error_stop; } ret = wait_for_pid(pid); if (ret < 0) { lxc_error("%s\n", "Function "CONTAINER_NAME" failed"); goto on_error_stop; } fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container " CONTAINER_NAME); on_error_destroy: if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container " CONTAINER_NAME); on_error_put: lxc_container_put(c); if (fret == EXIT_SUCCESS) { lxc_debug("All sysctl tests passed\n"); } else { char buf[4096]; ssize_t buflen; while ((buflen = read(fd_log, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } } close_prot_errno_disarm(fd_log); (void)unlink(template); exit(fret); } lxc-4.0.12/src/tests/clonetest.c0000644061062106075000000001053514176403775013434 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #define MYNAME "clonetest1" #define MYNAME2 "clonetest2" int main(int argc, char *argv[]) { struct lxc_container *c = NULL, *c2 = NULL, *c3 = NULL; int ret = 1; c = lxc_container_new(MYNAME, NULL); c2 = lxc_container_new(MYNAME2, NULL); if (c) { c->destroy(c); lxc_container_put(c); c = NULL; } if (c2) { c2->destroy(c2); lxc_container_put(c2); c2 = NULL; } if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "%d: error opening lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } c->save_config(c, NULL); if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { fprintf(stderr, "%d: failed to create a container\n", __LINE__); goto out; } c->load_config(c, NULL); if (!c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } c2 = c->clone(c, MYNAME2, NULL, 0, NULL, NULL, 0, NULL); if (!c2) { fprintf(stderr, "%d: %s clone returned NULL\n", __LINE__, MYNAME2); goto out; } if (!c2->is_defined(c2)) { fprintf(stderr, "%d: %s not defined after clone\n", __LINE__, MYNAME2); goto out; } fprintf(stderr, "directory backing store tests passed\n"); // now test with lvm // Only do this if clonetestlvm1 exists - user has to set this up // in advance c2->destroy(c2); lxc_container_put(c2); c->destroy(c); lxc_container_put(c); c = NULL; c2 = lxc_container_new("clonetestlvm2", NULL); if (c2) { if (c2->is_defined(c2)) c2->destroy(c2); lxc_container_put(c2); } c2 = lxc_container_new("clonetest-o1", NULL); if (c2) { if (c2->is_defined(c2)) c2->destroy(c2); lxc_container_put(c2); } c2 = lxc_container_new("clonetest-o2", NULL); if (c2) { if (c2->is_defined(c2)) c2->destroy(c2); lxc_container_put(c2); } c2 = NULL; // lvm-copied c = lxc_container_new("clonetestlvm1", NULL); if (!c) { fprintf(stderr, "failed loading clonetestlvm1\n"); goto out; } if (!c->is_defined(c)) { fprintf(stderr, "clonetestlvm1 does not exist, skipping lvm tests\n"); ret = 0; goto out; } if ((c2 = c->clone(c, "clonetestlvm2", NULL, 0, NULL, NULL, 0, NULL)) == NULL) { fprintf(stderr, "lvm clone failed\n"); goto out; } lxc_container_put(c2); // lvm-snapshot c2 = lxc_container_new("clonetestlvm3", NULL); if (c2) { if (c2->is_defined(c2)) c2->destroy(c2); lxc_container_put(c2); c2 = NULL; } if ((c2 = c->clone(c, "clonetestlvm3", NULL, LXC_CLONE_SNAPSHOT, NULL, NULL, 0, NULL)) == NULL) { fprintf(stderr, "lvm clone failed\n"); goto out; } lxc_container_put(c2); lxc_container_put(c); c = c2 = NULL; if ((c = lxc_container_new(MYNAME, NULL)) == NULL) { fprintf(stderr, "error opening original container for overlay test\n"); goto out; } // Now create an overlayfs clone of a dir-backed container if ((c2 = c->clone(c, "clonetest-o1", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL)) == NULL) { fprintf(stderr, "overlayfs clone of dir failed\n"); goto out; } // Now create an overlayfs clone of the overlayfs clone if ((c3 = c2->clone(c2, "clonetest-o2", NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL)) == NULL) { fprintf(stderr, "overlayfs clone of overlayfs failed\n"); goto out; } fprintf(stderr, "all clone tests passed for %s\n", c->name); ret = 0; out: if (c3) { lxc_container_put(c3); } if (c2) { c2->destroy(c2); lxc_container_put(c2); } if (c) { c->destroy(c); lxc_container_put(c); } exit(ret); } lxc-4.0.12/src/tests/lxc_raw_clone.c0000644061062106075000000001354514176403775014257 00000000000000/* * lxc: linux Container library * * Copyright © 2017 Canonical Ltd. * * Authors: * Christian Brauner * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "cgroups/cgroup_utils.h" #include "lxctest.h" #include "namespace.h" #include "process_utils.h" #include "utils.h" int main(int argc, char *argv[]) { int status; pid_t pid; int flags = 0; pid = lxc_raw_clone(CLONE_PARENT_SETTID, NULL); if (pid >= 0 || pid != -EINVAL) { lxc_error("%s\n", "Calling lxc_raw_clone(CLONE_PARENT_SETTID) " "should not be possible"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_CHILD_SETTID, NULL); if (pid >= 0 || pid != -EINVAL) { lxc_error("%s\n", "Calling lxc_raw_clone(CLONE_CHILD_SETTID) " "should not be possible"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_CHILD_CLEARTID, NULL); if (pid >= 0 || pid != -EINVAL) { lxc_error("%s\n", "Calling lxc_raw_clone(CLONE_CHILD_CLEARTID) " "should not be possible"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_SETTLS, NULL); if (pid >= 0 || pid != -EINVAL) { lxc_error("%s\n", "Calling lxc_raw_clone(CLONE_SETTLS) should " "not be possible"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_VM, NULL); if (pid >= 0 || pid != -EINVAL) { lxc_error("%s\n", "Calling lxc_raw_clone(CLONE_VM) should " "not be possible"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(0, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(0)"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_SUCCESS)"); exit(EXIT_SUCCESS); } status = wait_for_pid(pid); if (status != 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(0, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(0)"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_FAILURE)"); exit(EXIT_FAILURE); } status = wait_for_pid(pid); if (status == 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } flags |= CLONE_NEWUSER; if (cgns_supported()) flags |= CLONE_NEWCGROUP; flags |= CLONE_NEWNS; flags |= CLONE_NEWIPC; flags |= CLONE_NEWNET; flags |= CLONE_NEWIPC; flags |= CLONE_NEWPID; flags |= CLONE_NEWUTS; pid = lxc_raw_clone(flags, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_NEWUSER " "| CLONE_NEWCGROUP | CLONE_NEWNS | " "CLONE_NEWIPC | CLONE_NEWNET | CLONE_NEWIPC " "| CLONE_NEWPID | CLONE_NEWUTS);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_SUCCESS)"); exit(EXIT_SUCCESS); } status = wait_for_pid(pid); if (status != 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(flags, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_NEWUSER " "| CLONE_NEWCGROUP | CLONE_NEWNS | " "CLONE_NEWIPC | CLONE_NEWNET | CLONE_NEWIPC " "| CLONE_NEWPID | CLONE_NEWUTS);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_FAILURE)"); exit(EXIT_FAILURE); } status = wait_for_pid(pid); if (status == 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_VFORK, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_VFORK);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_SUCCESS)"); exit(EXIT_SUCCESS); } status = wait_for_pid(pid); if (status != 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_VFORK, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_VFORK);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_FAILURE)"); exit(EXIT_FAILURE); } status = wait_for_pid(pid); if (status == 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_FILES, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_FILES);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_SUCCESS)"); exit(EXIT_SUCCESS); } status = wait_for_pid(pid); if (status != 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } pid = lxc_raw_clone(CLONE_FILES, NULL); if (pid < 0) { lxc_error("%s\n", "Failed to call lxc_raw_clone(CLONE_FILES);"); exit(EXIT_FAILURE); } if (pid == 0) { lxc_error("%s\n", "Child will exit(EXIT_FAILURE)"); exit(EXIT_FAILURE); } status = wait_for_pid(pid); if (status == 0) { lxc_error("%s\n", "Failed to retrieve correct exit status"); exit(EXIT_FAILURE); } lxc_debug("%s\n", "All lxc_raw_clone() tests successful"); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/arch_parse.c0000644061062106075000000000406714176403775013546 00000000000000/* liblxcapi * * Copyright © 2021 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include "lxc/lxccontainer.h" #include "lxctest.h" #include "../lxc/lxc.h" #include "../lxc/memory_utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif static const char *const arches[] = { "arm", "armel", "armhf", "armv7l", "athlon", "i386", "i486", "i586", "i686", "linux32", "mips", "mipsel", "ppc", "powerpc", "x86", "aarch64", "amd64", "arm64", "linux64", "mips64", "mips64el", "ppc64", "ppc64el", "ppc64le", "powerpc64", "riscv64", "s390x", "x86_64", }; static bool parse_valid_architectures(void) { __put_lxc_container struct lxc_container *c = NULL; c = lxc_container_new("parse-arch", NULL); if (!c) return test_error_ret(false, "Failed to create container \"parse_arch\""); for (size_t i = 0; i < ARRAY_SIZE(arches); i++) { const char *arch = arches[i]; if (!c->set_config_item(c, "lxc.arch", arch)) return test_error_ret(false, "Failed to set \"lxc.arch=%s\"", arch); if (!c->clear_config_item(c, "lxc.arch")) return test_error_ret(false, "Failed to clear \"lxc.arch=%s\"", arch); } return true; } int main(int argc, char *argv[]) { if (!parse_valid_architectures()) exit(EXIT_FAILURE); exit(EXIT_SUCCESS); } lxc-4.0.12/src/tests/snapshot.c0000644061062106075000000001147414176403775013276 00000000000000/* liblxcapi * * Copyright © 2013 Serge Hallyn . * Copyright © 2013 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include "lxc/lxc.h" #define MYNAME "snapxxx1" #define MYNAME2 "snapxxx3" #define RESTNAME "snapxxx2" static void try_to_remove(void) { struct lxc_container *c; c = lxc_container_new(RESTNAME, NULL); if (c) { c->snapshot_destroy_all(c); if (c->is_defined(c)) c->destroy(c); lxc_container_put(c); } c = lxc_container_new(MYNAME2, NULL); if (c) { c->destroy_with_snapshots(c); lxc_container_put(c); } c = lxc_container_new(MYNAME, NULL); if (c) { c->snapshot_destroy_all(c); if (c->is_defined(c)) c->destroy(c); lxc_container_put(c); } } int main(int argc, char *argv[]) { int i, n, ret; char path[1024]; struct stat sb; struct lxc_snapshot *s; struct lxc_container *c, *c2 = NULL; char *template = "busybox"; if (argc > 1) template = argv[1]; try_to_remove(); c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%s: %d: failed to load first container\n", __FILE__, __LINE__); exit(EXIT_FAILURE); } if (c->is_defined(c)) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); (void) c->destroy_with_snapshots(c); } if (!c->set_config_item(c, "lxc.net.0.type", "empty")) { fprintf(stderr, "%s: %d: failed to set network type\n", __FILE__, __LINE__); goto err; } c->save_config(c, NULL); if (!c->createl(c, template, NULL, NULL, 0, NULL)) { fprintf(stderr, "%s: %d: failed to create %s container\n", __FILE__, __LINE__, template); goto err; } c->load_config(c, NULL); if (c->snapshot(c, NULL) != 0) { fprintf(stderr, "%s: %d: failed to create snapshot\n", __FILE__, __LINE__); goto err; } // rootfs should be ${lxcpath}${lxcname}/snaps/snap0/rootfs ret = snprintf(path, 1024, "%s/%s/snaps/snap0/rootfs", lxc_get_global_config_item("lxc.lxcpath"), MYNAME); if (ret < 0 || (size_t)ret >= 1024) { fprintf(stderr, "%s: %d: failed to create string\n", __FILE__, __LINE__); goto err; } ret = stat(path, &sb); if (ret != 0) { fprintf(stderr, "%s: %d: snapshot was not actually created\n", __FILE__, __LINE__); goto err; } n = c->snapshot_list(c, &s); if (n < 1) { fprintf(stderr, "%s: %d: failed listing containers\n", __FILE__, __LINE__); goto err; } if (strcmp(s->name, "snap0") != 0) { fprintf(stderr, "%s: %d: snapshot had bad name\n", __FILE__, __LINE__); goto err; } for (i=0; isnapshot_restore(c, "snap0", RESTNAME)) { fprintf(stderr, "%s: %d: failed to restore snapshot\n", __FILE__, __LINE__); goto err; } if (!c->snapshot_destroy(c, "snap0")) { fprintf(stderr, "%s: %d: failed to destroy snapshot\n", __FILE__, __LINE__); goto err; } c2 = lxc_container_new(RESTNAME, NULL); if (!c2 || !c2->is_defined(c2)) { fprintf(stderr, "%s: %d: external snapshot restore failed\n", __FILE__, __LINE__); goto err; } lxc_container_put(c2); c2 = c->clone(c, MYNAME2, NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL); if (!c2) { fprintf(stderr, "%d: %s overlayfs clone failed\n", __LINE__, MYNAME2); goto good; } if (c2->snapshot(c2, NULL) != 0) { fprintf(stderr, "%s: %d: failed to create snapshot\n", __FILE__, __LINE__); goto err; } n = c2->snapshot_list(c2, &s); if (n < 1) { fprintf(stderr, "%s: %d: failed listing containers\n", __FILE__, __LINE__); goto err; } if (strcmp(s->name, "snap0") != 0) { fprintf(stderr, "%s: %d: snapshot had bad name\n", __FILE__, __LINE__); goto err; } for (i=0; isnapshot_restore(c2, "snap0", NULL)) { fprintf(stderr, "%s: %d: failed to restore overlayfs snapshot\n", __FILE__, __LINE__); goto err; } if (!c2->snapshot_destroy(c2, "snap0")) { fprintf(stderr, "%s: %d: failed to destroy overlayfs snapshot\n", __FILE__, __LINE__); goto err; } good: lxc_container_put(c); try_to_remove(); printf("All tests passed\n"); exit(EXIT_SUCCESS); err: lxc_container_put(c); try_to_remove(); fprintf(stderr, "Exiting on error\n"); exit(EXIT_FAILURE); } lxc-4.0.12/src/tests/attach.c0000644061062106075000000002444314176403775012703 00000000000000/* liblxcapi * * Copyright © 2013 Oracle. * * Authors: * Dwight Engen * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include "lxctest.h" #include "utils.h" #include "lsm/lsm.h" #include #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define TSTNAME "lxc-attach-test" #define TSTOUT(fmt, ...) do { \ fprintf(stdout, fmt, ##__VA_ARGS__); fflush(NULL); \ } while (0) #define TSTERR(fmt, ...) do { \ fprintf(stderr, "%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); fflush(NULL); \ } while (0) static const char *lsm_config_key = NULL; static const char *lsm_label = NULL; struct lsm_ops *lsm_ops; static void test_lsm_detect(void) { if (lsm_ops->enabled(lsm_ops)) { if (!strcmp(lsm_ops->name, "SELinux")) { lsm_config_key = "lxc.selinux.context"; lsm_label = "unconfined_u:unconfined_r:lxc_t:s0-s0:c0.c1023"; } else if (!strcmp(lsm_ops->name, "AppArmor")) { lsm_config_key = "lxc.apparmor.profile"; if (file_exists("/proc/self/ns/cgroup")) lsm_label = "lxc-container-default-cgns"; else lsm_label = "lxc-container-default"; } else { TSTERR("unknown lsm %s enabled, add test code here", lsm_ops->name); exit(EXIT_FAILURE); } } } #if HAVE_APPARMOR || HAVE_SELINUX static void test_attach_lsm_set_config(struct lxc_container *ct) { ct->load_config(ct, NULL); ct->set_config_item(ct, lsm_config_key, lsm_label); ct->save_config(ct, NULL); } static int test_attach_lsm_func_func(void* payload) { TSTOUT("%s", lsm_ops->process_label_get(lsm_ops, syscall(SYS_getpid))); return 0; } static int test_attach_lsm_func(struct lxc_container *ct) { int ret; pid_t pid; int pipefd[2]; char result[1024]; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; TSTOUT("Testing attach lsm label with func...\n"); ret = pipe(pipefd); if (ret < 0) { TSTERR("pipe failed %d", ret); return ret; } attach_options.stdout_fd = pipefd[1]; attach_options.attach_flags &= ~(LXC_ATTACH_LSM_EXEC|LXC_ATTACH_DROP_CAPABILITIES); attach_options.attach_flags |= LXC_ATTACH_LSM_NOW; ret = ct->attach(ct, test_attach_lsm_func_func, NULL, &attach_options, &pid); if (ret < 0) { TSTERR("attach failed"); goto err1; } ret = read(pipefd[0], result, sizeof(result)-1); if (ret < 0) { TSTERR("read failed %d", ret); goto err2; } result[ret] = '\0'; if (strcmp(lsm_label, result)) { TSTERR("LSM label mismatch expected:%s got:%s", lsm_label, result); ret = -1; goto err2; } ret = 0; err2: (void)wait_for_pid(pid); err1: close(pipefd[0]); close(pipefd[1]); return ret; } static int test_attach_lsm_cmd(struct lxc_container *ct) { int ret; pid_t pid; int pipefd[2]; char result[1024]; char *space; char *argv[] = {"cat", "/proc/self/attr/current", NULL}; lxc_attach_command_t command = {"cat", argv}; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; TSTOUT("Testing attach lsm label with cmd...\n"); ret = pipe(pipefd); if (ret < 0) { TSTERR("pipe failed %d", ret); return ret; } attach_options.stdout_fd = pipefd[1]; ret = ct->attach(ct, lxc_attach_run_command, &command, &attach_options, &pid); if (ret < 0) { TSTERR("attach failed"); goto err1; } ret = read(pipefd[0], result, sizeof(result)-1); if (ret < 0) { TSTERR("read failed %d", ret); goto err2; } result[ret] = '\0'; space = strchr(result, '\n'); if (space) *space = '\0'; space = strchr(result, ' '); if (space) *space = '\0'; ret = -1; if (strcmp(lsm_label, result)) { TSTERR("LSM label mismatch expected:%s got:%s", lsm_label, result); goto err2; } ret = 0; err2: (void)wait_for_pid(pid); err1: close(pipefd[0]); close(pipefd[1]); return ret; } #else static void test_attach_lsm_set_config(struct lxc_container *ct) {} static int test_attach_lsm_func(struct lxc_container *ct) { return 0; } static int test_attach_lsm_cmd(struct lxc_container *ct) { return 0; } #endif /* HAVE_APPARMOR || HAVE_SELINUX */ static int test_attach_func_func(void* payload) { TSTOUT("%d", (int)syscall(SYS_getpid)); return 0; } static int test_attach_func(struct lxc_container *ct) { int ret; pid_t pid,nspid; int pipefd[2]; char result[1024]; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; TSTOUT("Testing attach with func...\n"); /* XXX: We can't just use &nspid and have test_attach_func_func fill * it in because the function doesn't run in our process context but * in a fork()ed from us context. We read the result through a pipe. */ ret = pipe(pipefd); if (ret < 0) { TSTERR("pipe failed %d", ret); return ret; } attach_options.stdout_fd = pipefd[1]; ret = ct->attach(ct, test_attach_func_func, NULL, &attach_options, &pid); if (ret < 0) { TSTERR("attach failed"); goto err1; } ret = read(pipefd[0], result, sizeof(result)-1); if (ret < 0) { TSTERR("read failed %d", ret); goto err2; } result[ret] = '\0'; /* There is a small chance the pid is reused inside the NS, so we * just print it and don't actually do this check * * if (pid == nspid) TSTERR(...) */ nspid = atoi(result); TSTOUT("Pid:%d in NS:%d\n", pid, nspid); ret = 0; err2: (void)wait_for_pid(pid); err1: close(pipefd[0]); close(pipefd[1]); return ret; } static int test_attach_cmd(struct lxc_container *ct) { int ret; pid_t pid; char *argv[] = {"cmp", "-s", "/sbin/init", "/bin/busybox", NULL}; lxc_attach_command_t command = {"cmp", argv}; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; TSTOUT("Testing attach with success command...\n"); ret = ct->attach(ct, lxc_attach_run_command, &command, &attach_options, &pid); if (ret < 0) { TSTERR("attach failed"); return ret; } ret = wait_for_pid(pid); if (ret < 0) { TSTERR("attach success command got bad return %d", ret); return ret; } TSTOUT("Testing attach with failure command...\n"); argv[2] = "/etc/fstab"; ret = ct->attach(ct, lxc_attach_run_command, &command, &attach_options, &pid); if (ret < 0) { TSTERR("attach failed"); return ret; } ret = wait_for_pid(pid); if (ret == 0) { TSTERR("attach failure command got bad return %d", ret); return -1; } return 0; } /* test_ct_destroy: stop and destroy the test container * * @ct : the container */ static void test_ct_destroy(struct lxc_container *ct) { ct->stop(ct); ct->destroy(ct); lxc_container_put(ct); } /* test_ct_create: create and start test container * * @lxcpath : the lxcpath in which to create the container * @group : name of the container group or NULL for default "lxc" * @name : name of the container * @template : template to use when creating the container */ static struct lxc_container *test_ct_create(const char *lxcpath, const char *group, const char *name, const char *template) { int ret; struct lxc_container *ct = NULL; if (lxcpath) { ret = mkdir(lxcpath, 0755); if (ret < 0 && errno != EEXIST) { TSTERR("failed to mkdir %s %s", lxcpath, strerror(errno)); goto out1; } } if ((ct = lxc_container_new(name, lxcpath)) == NULL) { TSTERR("instantiating container %s", name); goto out1; } if (ct->is_defined(ct)) { test_ct_destroy(ct); ct = lxc_container_new(name, lxcpath); } if (!ct->createl(ct, template, NULL, NULL, 0, NULL)) { TSTERR("creating container %s", name); goto out2; } if (lsm_ops->enabled(lsm_ops)) test_attach_lsm_set_config(ct); ct->want_daemonize(ct, true); if (!ct->startl(ct, 0, NULL)) { TSTERR("starting container %s", name); goto out2; } return ct; out2: test_ct_destroy(ct); ct = NULL; out1: return ct; } static int test_attach(const char *lxcpath, const char *name, const char *template) { int ret = -1; struct lxc_container *ct; TSTOUT("Testing attach with on lxcpath:%s\n", lxcpath ? lxcpath : ""); ct = test_ct_create(lxcpath, NULL, name, template); if (!ct) goto err1; ret = test_attach_cmd(ct); if (ret < 0) { TSTERR("attach cmd test failed"); goto err2; } ret = test_attach_func(ct); if (ret < 0) { TSTERR("attach func test failed"); goto err2; } if (lsm_ops->enabled(lsm_ops)) { ret = test_attach_lsm_cmd(ct); if (ret < 0) { TSTERR("attach lsm cmd test failed"); goto err2; } ret = test_attach_lsm_func(ct); if (ret < 0) { TSTERR("attach lsm func test failed"); goto err2; } } ret = 0; err2: test_ct_destroy(ct); err1: return ret; } int main(int argc, char *argv[]) { int i, ret; struct lxc_log log; char template[sizeof(P_tmpdir"/attach_XXXXXX")]; int fret = EXIT_FAILURE; (void)strlcpy(template, P_tmpdir"/attach_XXXXXX", sizeof(template)); lsm_ops = lsm_init_static(); i = lxc_make_tmpfile(template, false); if (i < 0) { lxc_error("Failed to create temporary log file for container %s\n", TSTNAME); exit(EXIT_FAILURE); } else { lxc_debug("Using \"%s\" as temporary log file for container %s\n", template, TSTNAME); close(i); } log.name = TSTNAME; log.file = template; log.level = "TRACE"; log.prefix = "attach"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) goto on_error; test_lsm_detect(); ret = test_attach(NULL, TSTNAME, "busybox"); if (ret < 0) goto on_error; TSTOUT("\n"); ret = test_attach(LXCPATH "/alternate-path-test", TSTNAME, "busybox"); if (ret < 0) goto on_error; TSTOUT("All tests passed\n"); fret = EXIT_SUCCESS; on_error: if (fret != EXIT_SUCCESS) { int fd; fd = open(template, O_RDONLY); if (fd >= 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } close(fd); } } (void)rmdir(LXCPATH "/alternate-path-test"); (void)unlink(template); exit(fret); } lxc-4.0.12/src/tests/containertests.c0000644061062106075000000001426214176403775014502 00000000000000/* liblxcapi * * Copyright © 2012 Serge Hallyn . * Copyright © 2012 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "lxc/state.h" #define MYNAME "lxctest1" static int destroy_busybox(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-destroy", "lxc-destroy", "-f", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } static int create_busybox(void) { int status, ret; pid_t pid = fork(); if (pid < 0) { perror("fork"); return -1; } if (pid == 0) { execlp("lxc-create", "lxc-create", "-t", "busybox", "-n", MYNAME, NULL); exit(EXIT_FAILURE); } again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; perror("waitpid"); return -1; } if (ret != pid) goto again; if (!WIFEXITED(status)) { // did not exit normally fprintf(stderr, "%d: lxc-create exited abnormally\n", __LINE__); return -1; } return WEXITSTATUS(status); } int main(int argc, char *argv[]) { struct lxc_container *c; int ret = 0; const char *s; bool b; char *str; ret = 1; /* test refcounting */ c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%d: error creating lxc_container %s\n", __LINE__, MYNAME); goto out; } if (!lxc_container_get(c)) { fprintf(stderr, "%d: error getting refcount\n", __LINE__); goto out; } /* peek in, inappropriately, make sure refcount is a we'd like */ if (c->numthreads != 2) { fprintf(stderr, "%d: refcount is %d, not %d\n", __LINE__, c->numthreads, 2); goto out; } if (strcmp(c->name, MYNAME) != 0) { fprintf(stderr, "%d: container has wrong name (%s not %s)\n", __LINE__, c->name, MYNAME); goto out; } str = c->config_file_name(c); #define CONFIGFNAM LXCPATH "/" MYNAME "/config" if (str && strcmp(str, CONFIGFNAM)) { fprintf(stderr, "%d: got wrong config file name (%s, not %s)\n", __LINE__, str, CONFIGFNAM); goto out; } free(str); free(c->configfile); c->configfile = NULL; str = c->config_file_name(c); if (str) { fprintf(stderr, "%d: config file name was not NULL as it should have been\n", __LINE__); goto out; } ret = lxc_container_put(c); if (ret < 0) { fprintf(stderr, "%d: c is invalid pointer\n", __LINE__); ret = 1; goto out; } else if (ret == 1) { fprintf(stderr, "%d: c was freed on non-final put\n", __LINE__); c = NULL; goto out; } if (c->numthreads != 1) { fprintf(stderr, "%d: refcount is %d, not %d\n", __LINE__, c->numthreads, 1); goto out; } if (lxc_container_put(c) != 1) { fprintf(stderr, "%d: c was not freed on final put\n", __LINE__); goto out; } /* test a real container */ c = lxc_container_new(MYNAME, NULL); if (!c) { fprintf(stderr, "%d: error creating lxc_container %s\n", __LINE__, MYNAME); ret = 1; goto out; } b = c->is_defined(c); if (b) { fprintf(stderr, "%d: %s thought it was defined\n", __LINE__, MYNAME); goto out; } s = c->state(c); if (s && strcmp(s, "STOPPED") != 0) { // liblxc says a container is STOPPED if it doesn't exist. That's because // the container may be an application container - it's not wrong, just // sometimes unintuitive. fprintf(stderr, "%d: %s thinks it is in state %s\n", __LINE__, c->name, s); goto out; } // create a container // the liblxc api does not support creation - it probably will eventually, // but not yet. // So we just call out to lxc-create. We'll create a busybox container. ret = create_busybox(); if (ret) { fprintf(stderr, "%d: failed to create a busybox container\n", __LINE__); goto out; } b = c->is_defined(c); if (!b) { fprintf(stderr, "%d: %s thought it was not defined\n", __LINE__, MYNAME); goto out; } s = c->state(c); if (!s || strcmp(s, "STOPPED")) { fprintf(stderr, "%d: %s is in state %s, not in STOPPED.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } b = c->load_config(c, NULL); if (!b) { fprintf(stderr, "%d: %s failed to read its config\n", __LINE__, c->name); goto out; } // test wait states int numstates = lxc_get_wait_states(NULL); if (numstates != MAX_STATE) { fprintf(stderr, "%d: lxc_get_wait_states gave %d not %d\n", __LINE__, numstates, MAX_STATE); goto out; } const char **sstr = malloc(numstates * sizeof(const char *)); numstates = lxc_get_wait_states(sstr); int i; for (i=0; iwant_daemonize(c, true); if (!c->startl(c, 0, NULL, NULL)) { fprintf(stderr, "%d: %s failed to start daemonized\n", __LINE__, c->name); goto out; } if (!c->wait(c, "RUNNING", -1)) { fprintf(stderr, "%d: failed waiting for state RUNNING\n", __LINE__); goto out; } sleep(3); s = c->state(c); if (!s || strcmp(s, "RUNNING")) { fprintf(stderr, "%d: %s is in state %s, not in RUNNING.\n", __LINE__, c->name, s ? s : "undefined"); goto out; } fprintf(stderr, "all lxc_container tests passed for %s\n", c->name); ret = 0; out: if (c) { c->stop(c); destroy_busybox(); lxc_container_put(c); } exit(ret); } lxc-4.0.12/src/tests/api_reboot.c0000644061062106075000000001032114176403775013550 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "lxc/lxccontainer.h" #include "lxctest.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #define TSTNAME "lxc-api-reboot" int main(int argc, char *argv[]) { int i; struct lxc_container *c; int ret = EXIT_FAILURE; struct lxc_log log; char template[sizeof(P_tmpdir"/reboot_XXXXXX")]; (void)strlcpy(template, P_tmpdir"/reboot_XXXXXX", sizeof(template)); i = lxc_make_tmpfile(template, false); if (i < 0) { lxc_error("Failed to create temporary log file for container %s\n", TSTNAME); exit(EXIT_FAILURE); } else { lxc_debug("Using \"%s\" as temporary log file for container %s\n", template, TSTNAME); close(i); } log.name = TSTNAME; log.file = template; log.level = "TRACE"; log.prefix = "reboot"; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) exit(ret); /* Test that the reboot() API function properly waits for containers to * restart. */ c = lxc_container_new(TSTNAME, NULL); if (!c) { lxc_error("%s", "Failed to create container \"reboot\""); exit(ret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"reboot\" is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"reboot\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"reboot\" is not defined"); goto on_error_put; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"reboot\""); goto on_error_stop; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"reboot\" daemonized"); goto on_error_stop; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"reboot\" daemonized"); goto on_error_stop; } /* reboot 10 times */ for (i = 0; i < 10; i++) { /* Give the init system some time to setup it's signal handlers * otherwise we will wait indefinitely. */ sleep(5); if (!c->reboot2(c, 60 * 5)) { lxc_error("%s\n", "Failed to reboot container \"reboot\""); goto on_error_stop; } if (!c->is_running(c)) { lxc_error("%s\n", "Failed to reboot container \"reboot\""); goto on_error_stop; } lxc_debug("%s\n", "Container \"reboot\" rebooted successfully"); } /* Give the init system some time to setup it's signal handlers * otherwise we will wait indefinitely. */ sleep(5); /* Test non-blocking reboot2() */ if (!c->reboot2(c, 0)) { lxc_error("%s\n", "Failed to request non-blocking reboot of container \"reboot\""); goto on_error_stop; } lxc_debug("%s\n", "Non-blocking reboot of container \"reboot\" succeeded"); ret = EXIT_SUCCESS; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"reboot\""); if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"reboot\""); on_error_put: lxc_container_put(c); if (ret == EXIT_SUCCESS) { lxc_debug("%s\n", "All reboot tests passed"); } else { int fd; fd = open(template, O_RDONLY); if (fd >= 0) { char buf[4096]; ssize_t buflen; while ((buflen = read(fd, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } close(fd); } } (void)unlink(template); exit(ret); } lxc-4.0.12/src/tests/state_server.c0000644061062106075000000000725114176403775014143 00000000000000/* liblxcapi * * Copyright © 2017 Christian Brauner . * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "lxc/lxccontainer.h" #include "lxctest.h" #include "../lxc/compiler.h" struct thread_args { int thread_id; int timeout; bool success; struct lxc_container *c; }; __noreturn static void *state_wrapper(void *data) { struct thread_args *args = data; lxc_debug("Starting state server thread %d\n", args->thread_id); args->success = args->c->shutdown(args->c, args->timeout); lxc_debug("State server thread %d with shutdown timeout %d returned \"%s\"\n", args->thread_id, args->timeout, args->success ? "SUCCESS" : "FAILED"); pthread_exit(NULL); } int main(int argc, char *argv[]) { int i, j; pthread_attr_t attr; pthread_t threads[10]; struct thread_args args[10]; struct lxc_container *c; int ret = EXIT_FAILURE; c = lxc_container_new("state-server", NULL); if (!c) { lxc_error("%s", "Failed to create container \"state-server\""); exit(ret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container \"state-server\" is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container \"state-server\""); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container \"state-server\" is not defined"); goto on_error_put; } c->clear_config(c); if (!c->load_config(c, NULL)) { lxc_error("%s\n", "Failed to load config for container \"state-server\""); goto on_error_stop; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container \"state-server\" daemonized"); goto on_error_stop; } pthread_attr_init(&attr); for (j = 0; j < 10; j++) { lxc_debug("Starting state server test iteration %d\n", j); if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container \"state-server\" daemonized"); goto on_error_stop; } sleep(5); for (i = 0; i < 10; i++) { args[i].thread_id = i; args[i].c = c; args[i].timeout = -1; /* test non-blocking shutdown request */ if (i == 0) args[i].timeout = 0; ret = pthread_create(&threads[i], &attr, state_wrapper, (void *) &args[i]); if (ret != 0) goto on_error_stop; } for (i = 0; i < 10; i++) { ret = pthread_join(threads[i], NULL); if (ret != 0) goto on_error_stop; if (!args[i].success) { lxc_error("State server thread %d failed\n", args[i].thread_id); goto on_error_stop; } } } ret = EXIT_SUCCESS; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container \"state-server\""); if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container \"state-server\""); on_error_put: lxc_container_put(c); if (ret == EXIT_SUCCESS) lxc_debug("%s\n", "All state server tests passed"); exit(ret); } lxc-4.0.12/src/tests/fuzz-lxc-define-load.c0000644061062106075000000000251314176403775015360 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include "conf.h" #include "confile.h" #include "lxctest.h" #include "utils.h" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { __do_free char *new_str = NULL; struct lxc_container *c = NULL; struct lxc_list defines; struct lxc_list *it; __do_close int devnull_fd = -EBADF; if (size > 102400) return 0; c = lxc_container_new("FUZZ", NULL); lxc_test_assert_abort(c); new_str = (char *)malloc(size+1); lxc_test_assert_abort(new_str); memcpy(new_str, data, size); new_str[size] = '\0'; lxc_list_init(&defines); if (lxc_config_define_add(&defines, new_str) < 0) goto out; if (!lxc_config_define_load(&defines, c)) goto out; devnull_fd = open_devnull(); lxc_test_assert_abort(devnull_fd >= 0); lxc_list_for_each(it, &defines) { __do_free char *val = NULL; struct new_config_item *config_item = it->elem; int len; len = c->get_config_item(c, config_item->key, NULL, 0); if (len < 0) continue; val = (char *)malloc(len + 1); lxc_test_assert_abort(val); if (c->get_config_item(c, config_item->key, val, len + 1) != len) continue; if (len > 0) dprintf(devnull_fd, "[%s/%s]\n", config_item->key, val); } out: lxc_container_put(c); lxc_config_define_free(&defines); return 0; } lxc-4.0.12/src/tests/proc_pid.c0000644061062106075000000001015214176403775013226 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include "lxccontainer.h" #include "attach_options.h" #include "lxctest.h" #include "utils.h" #define CONTAINER_NAME "test-proc-pid" #define PROC_INIT_PATH "/proc/1/oom_score_adj" #define PROC_SELF_PATH "/proc/self/oom_score_adj" static int check_oom_score_adj(void *payload) { __do_close int fd = -EBADF; char buf[INTTYPE_TO_STRLEN(__s64)]; ssize_t ret; fd = open(PROC_INIT_PATH, O_RDONLY | O_CLOEXEC | O_NOFOLLOW); if (fd < 0) { lxc_error("Failed to open " PROC_INIT_PATH); return EXIT_FAILURE; } ret = lxc_read_nointr(fd, buf, sizeof(buf)); if (ret < 0 || (size_t)ret >= sizeof(buf)) { lxc_error("Failed to read " PROC_INIT_PATH); return EXIT_FAILURE; } buf[ret] = '\0'; remove_trailing_newlines(buf); if (!strequal(buf, "-1000")) { lxc_error("Unexpected value %s for " PROC_INIT_PATH, buf); return EXIT_FAILURE; } return EXIT_SUCCESS; } int main(int argc, char *argv[]) { int fd_log = -EBADF, fret = EXIT_FAILURE; lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT; int ret; pid_t pid; struct lxc_container *c; struct lxc_log log; char template[sizeof(P_tmpdir "/" CONTAINER_NAME "_XXXXXX")]; if (!file_exists(PROC_SELF_PATH)) { lxc_debug("The sysctl path \"" PROC_SELF_PATH "\" needed for this test does not exist. Skipping"); exit(EXIT_SUCCESS); } (void)strlcpy(template, P_tmpdir "/" CONTAINER_NAME "_XXXXXX", sizeof(template)); fd_log = lxc_make_tmpfile(template, false); if (fd_log < 0) { lxc_error("%s", "Failed to create temporary log file for container \"capabilities\""); return fret; } log.name = CONTAINER_NAME; log.file = template; log.level = "TRACE"; log.prefix = CONTAINER_NAME; log.quiet = false; log.lxcpath = NULL; if (lxc_log_init(&log)) exit(fret); c = lxc_container_new(CONTAINER_NAME, NULL); if (!c) { lxc_error("%s", "Failed to create container " CONTAINER_NAME); exit(fret); } if (c->is_defined(c)) { lxc_error("%s\n", "Container " CONTAINER_NAME " is defined"); goto on_error_put; } if (!c->createl(c, "busybox", NULL, NULL, 0, NULL)) { lxc_error("%s\n", "Failed to create busybox container " CONTAINER_NAME); goto on_error_put; } if (!c->is_defined(c)) { lxc_error("%s\n", "Container " CONTAINER_NAME " is not defined"); goto on_error_destroy; } if (!c->set_config_item(c, "lxc.mount.auto", "proc:rw")) { lxc_error("%s\n", "Failed to set config item \"lxc.mount.auto=proc:rw\""); goto on_error_destroy; } if (!c->clear_config_item(c, "lxc.proc.oom_score_adj")) { lxc_error("%s\n", "Failed to clear config item \"lxc.proc.oom_score_adj\""); goto on_error_destroy; } if (!c->set_config_item(c, "lxc.proc.oom_score_adj", "-1000")) { lxc_error("%s\n", "Failed to set config item \"lxc.proc.oom_score_adj=-1000\""); goto on_error_destroy; } if (!c->want_daemonize(c, true)) { lxc_error("%s\n", "Failed to mark container " CONTAINER_NAME " daemonized"); goto on_error_destroy; } if (!c->startl(c, 0, NULL)) { lxc_error("%s\n", "Failed to start container " CONTAINER_NAME " daemonized"); goto on_error_destroy; } /* Leave some time for the container to write something to the log. */ sleep(2); ret = c->attach(c, check_oom_score_adj, NULL, &attach_options, &pid); if (ret < 0) { lxc_error("%s\n", "Failed to run function in container " CONTAINER_NAME); goto on_error_stop; } ret = wait_for_pid(pid); if (ret < 0) { lxc_error("%s\n", "Function "CONTAINER_NAME" failed"); goto on_error_stop; } fret = 0; on_error_stop: if (c->is_running(c) && !c->stop(c)) lxc_error("%s\n", "Failed to stop container " CONTAINER_NAME); on_error_destroy: if (!c->destroy(c)) lxc_error("%s\n", "Failed to destroy container " CONTAINER_NAME); on_error_put: lxc_container_put(c); if (fret == EXIT_SUCCESS) { lxc_debug("All \"/proc/\" tests passed\n"); } else { char buf[4096]; ssize_t buflen; while ((buflen = read(fd_log, buf, 1024)) > 0) { buflen = write(STDERR_FILENO, buf, buflen); if (buflen <= 0) break; } } close_prot_errno_disarm(fd_log); (void)unlink(template); exit(fret); } lxc-4.0.12/src/include/0000755061062106075000000000000014176404015011611 500000000000000lxc-4.0.12/src/include/bpf.h0000644061062106075000000056721214176403775012502 00000000000000/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. */ #ifndef _UAPI__LINUX_BPF_H__ #define _UAPI__LINUX_BPF_H__ #include #include "bpf_common.h" /* Extended instruction set based on top of classic BPF */ /* instruction classes */ #define BPF_JMP32 0x06 /* jmp mode in word width */ #define BPF_ALU64 0x07 /* alu mode in double word width */ /* ld/ldx fields */ #define BPF_DW 0x18 /* double word (64-bit) */ #define BPF_XADD 0xc0 /* exclusive add */ /* alu/jmp fields */ #define BPF_MOV 0xb0 /* mov reg to reg */ #define BPF_ARSH 0xc0 /* sign extending arithmetic shift right */ /* change endianness of a register */ #define BPF_END 0xd0 /* flags for endianness conversion: */ #define BPF_TO_LE 0x00 /* convert to little-endian */ #define BPF_TO_BE 0x08 /* convert to big-endian */ #define BPF_FROM_LE BPF_TO_LE #define BPF_FROM_BE BPF_TO_BE /* jmp encodings */ #define BPF_JNE 0x50 /* jump != */ #define BPF_JLT 0xa0 /* LT is unsigned, '<' */ #define BPF_JLE 0xb0 /* LE is unsigned, '<=' */ #define BPF_JSGT 0x60 /* SGT is signed '>', GT in x86 */ #define BPF_JSGE 0x70 /* SGE is signed '>=', GE in x86 */ #define BPF_JSLT 0xc0 /* SLT is signed, '<' */ #define BPF_JSLE 0xd0 /* SLE is signed, '<=' */ #define BPF_CALL 0x80 /* function call */ #define BPF_EXIT 0x90 /* function return */ /* Register numbers */ enum { BPF_REG_0 = 0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4, BPF_REG_5, BPF_REG_6, BPF_REG_7, BPF_REG_8, BPF_REG_9, BPF_REG_10, __MAX_BPF_REG, }; /* BPF has 10 general purpose 64-bit registers and stack frame. */ #define MAX_BPF_REG __MAX_BPF_REG struct bpf_insn { __u8 code; /* opcode */ __u8 dst_reg:4; /* dest register */ __u8 src_reg:4; /* source register */ __s16 off; /* signed offset */ __s32 imm; /* signed immediate constant */ }; /* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */ struct bpf_lpm_trie_key { __u32 prefixlen; /* up to 32 for AF_INET, 128 for AF_INET6 */ __u8 data[0]; /* Arbitrary size */ }; struct bpf_cgroup_storage_key { __u64 cgroup_inode_id; /* cgroup inode id */ __u32 attach_type; /* program attach type */ }; union bpf_iter_link_info { struct { __u32 map_fd; } map; }; /* BPF syscall commands, see bpf(2) man-page for details. */ enum bpf_cmd { BPF_MAP_CREATE, BPF_MAP_LOOKUP_ELEM, BPF_MAP_UPDATE_ELEM, BPF_MAP_DELETE_ELEM, BPF_MAP_GET_NEXT_KEY, BPF_PROG_LOAD, BPF_OBJ_PIN, BPF_OBJ_GET, BPF_PROG_ATTACH, BPF_PROG_DETACH, BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID, BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID, BPF_OBJ_GET_INFO_BY_FD, BPF_PROG_QUERY, BPF_RAW_TRACEPOINT_OPEN, BPF_BTF_LOAD, BPF_BTF_GET_FD_BY_ID, BPF_TASK_FD_QUERY, BPF_MAP_LOOKUP_AND_DELETE_ELEM, BPF_MAP_FREEZE, BPF_BTF_GET_NEXT_ID, BPF_MAP_LOOKUP_BATCH, BPF_MAP_LOOKUP_AND_DELETE_BATCH, BPF_MAP_UPDATE_BATCH, BPF_MAP_DELETE_BATCH, BPF_LINK_CREATE, BPF_LINK_UPDATE, BPF_LINK_GET_FD_BY_ID, BPF_LINK_GET_NEXT_ID, BPF_ENABLE_STATS, BPF_ITER_CREATE, BPF_LINK_DETACH, BPF_PROG_BIND_MAP, }; enum bpf_map_type { BPF_MAP_TYPE_UNSPEC, BPF_MAP_TYPE_HASH, BPF_MAP_TYPE_ARRAY, BPF_MAP_TYPE_PROG_ARRAY, BPF_MAP_TYPE_PERF_EVENT_ARRAY, BPF_MAP_TYPE_PERCPU_HASH, BPF_MAP_TYPE_PERCPU_ARRAY, BPF_MAP_TYPE_STACK_TRACE, BPF_MAP_TYPE_CGROUP_ARRAY, BPF_MAP_TYPE_LRU_HASH, BPF_MAP_TYPE_LRU_PERCPU_HASH, BPF_MAP_TYPE_LPM_TRIE, BPF_MAP_TYPE_ARRAY_OF_MAPS, BPF_MAP_TYPE_HASH_OF_MAPS, BPF_MAP_TYPE_DEVMAP, BPF_MAP_TYPE_SOCKMAP, BPF_MAP_TYPE_CPUMAP, BPF_MAP_TYPE_XSKMAP, BPF_MAP_TYPE_SOCKHASH, BPF_MAP_TYPE_CGROUP_STORAGE, BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE, BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK, BPF_MAP_TYPE_SK_STORAGE, BPF_MAP_TYPE_DEVMAP_HASH, BPF_MAP_TYPE_STRUCT_OPS, BPF_MAP_TYPE_RINGBUF, BPF_MAP_TYPE_INODE_STORAGE, BPF_MAP_TYPE_TASK_STORAGE, }; /* Note that tracing related programs such as * BPF_PROG_TYPE_{KPROBE,TRACEPOINT,PERF_EVENT,RAW_TRACEPOINT} * are not subject to a stable API since kernel internal data * structures can change from release to release and may * therefore break existing tracing BPF programs. Tracing BPF * programs correspond to /a/ specific kernel which is to be * analyzed, and not /a/ specific kernel /and/ all future ones. */ enum bpf_prog_type { BPF_PROG_TYPE_UNSPEC, BPF_PROG_TYPE_SOCKET_FILTER, BPF_PROG_TYPE_KPROBE, BPF_PROG_TYPE_SCHED_CLS, BPF_PROG_TYPE_SCHED_ACT, BPF_PROG_TYPE_TRACEPOINT, BPF_PROG_TYPE_XDP, BPF_PROG_TYPE_PERF_EVENT, BPF_PROG_TYPE_CGROUP_SKB, BPF_PROG_TYPE_CGROUP_SOCK, BPF_PROG_TYPE_LWT_IN, BPF_PROG_TYPE_LWT_OUT, BPF_PROG_TYPE_LWT_XMIT, BPF_PROG_TYPE_SOCK_OPS, BPF_PROG_TYPE_SK_SKB, BPF_PROG_TYPE_CGROUP_DEVICE, BPF_PROG_TYPE_SK_MSG, BPF_PROG_TYPE_RAW_TRACEPOINT, BPF_PROG_TYPE_CGROUP_SOCK_ADDR, BPF_PROG_TYPE_LWT_SEG6LOCAL, BPF_PROG_TYPE_LIRC_MODE2, BPF_PROG_TYPE_SK_REUSEPORT, BPF_PROG_TYPE_FLOW_DISSECTOR, BPF_PROG_TYPE_CGROUP_SYSCTL, BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE, BPF_PROG_TYPE_CGROUP_SOCKOPT, BPF_PROG_TYPE_TRACING, BPF_PROG_TYPE_STRUCT_OPS, BPF_PROG_TYPE_EXT, BPF_PROG_TYPE_LSM, BPF_PROG_TYPE_SK_LOOKUP, }; enum bpf_attach_type { BPF_CGROUP_INET_INGRESS, BPF_CGROUP_INET_EGRESS, BPF_CGROUP_INET_SOCK_CREATE, BPF_CGROUP_SOCK_OPS, BPF_SK_SKB_STREAM_PARSER, BPF_SK_SKB_STREAM_VERDICT, BPF_CGROUP_DEVICE, BPF_SK_MSG_VERDICT, BPF_CGROUP_INET4_BIND, BPF_CGROUP_INET6_BIND, BPF_CGROUP_INET4_CONNECT, BPF_CGROUP_INET6_CONNECT, BPF_CGROUP_INET4_POST_BIND, BPF_CGROUP_INET6_POST_BIND, BPF_CGROUP_UDP4_SENDMSG, BPF_CGROUP_UDP6_SENDMSG, BPF_LIRC_MODE2, BPF_FLOW_DISSECTOR, BPF_CGROUP_SYSCTL, BPF_CGROUP_UDP4_RECVMSG, BPF_CGROUP_UDP6_RECVMSG, BPF_CGROUP_GETSOCKOPT, BPF_CGROUP_SETSOCKOPT, BPF_TRACE_RAW_TP, BPF_TRACE_FENTRY, BPF_TRACE_FEXIT, BPF_MODIFY_RETURN, BPF_LSM_MAC, BPF_TRACE_ITER, BPF_CGROUP_INET4_GETPEERNAME, BPF_CGROUP_INET6_GETPEERNAME, BPF_CGROUP_INET4_GETSOCKNAME, BPF_CGROUP_INET6_GETSOCKNAME, BPF_XDP_DEVMAP, BPF_CGROUP_INET_SOCK_RELEASE, BPF_XDP_CPUMAP, BPF_SK_LOOKUP, BPF_XDP, __MAX_BPF_ATTACH_TYPE }; #define MAX_BPF_ATTACH_TYPE __MAX_BPF_ATTACH_TYPE enum bpf_link_type { BPF_LINK_TYPE_UNSPEC = 0, BPF_LINK_TYPE_RAW_TRACEPOINT = 1, BPF_LINK_TYPE_TRACING = 2, BPF_LINK_TYPE_CGROUP = 3, BPF_LINK_TYPE_ITER = 4, BPF_LINK_TYPE_NETNS = 5, BPF_LINK_TYPE_XDP = 6, MAX_BPF_LINK_TYPE, }; /* cgroup-bpf attach flags used in BPF_PROG_ATTACH command * * NONE(default): No further bpf programs allowed in the subtree. * * BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program, * the program in this cgroup yields to sub-cgroup program. * * BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program, * that cgroup program gets run in addition to the program in this cgroup. * * Only one program is allowed to be attached to a cgroup with * NONE or BPF_F_ALLOW_OVERRIDE flag. * Attaching another program on top of NONE or BPF_F_ALLOW_OVERRIDE will * release old program and attach the new one. Attach flags has to match. * * Multiple programs are allowed to be attached to a cgroup with * BPF_F_ALLOW_MULTI flag. They are executed in FIFO order * (those that were attached first, run first) * The programs of sub-cgroup are executed first, then programs of * this cgroup and then programs of parent cgroup. * When children program makes decision (like picking TCP CA or sock bind) * parent program has a chance to override it. * * With BPF_F_ALLOW_MULTI a new program is added to the end of the list of * programs for a cgroup. Though it's possible to replace an old program at * any position by also specifying BPF_F_REPLACE flag and position itself in * replace_bpf_fd attribute. Old program at this position will be released. * * A cgroup with MULTI or OVERRIDE flag allows any attach flags in sub-cgroups. * A cgroup with NONE doesn't allow any programs in sub-cgroups. * Ex1: * cgrp1 (MULTI progs A, B) -> * cgrp2 (OVERRIDE prog C) -> * cgrp3 (MULTI prog D) -> * cgrp4 (OVERRIDE prog E) -> * cgrp5 (NONE prog F) * the event in cgrp5 triggers execution of F,D,A,B in that order. * if prog F is detached, the execution is E,D,A,B * if prog F and D are detached, the execution is E,A,B * if prog F, E and D are detached, the execution is C,A,B * * All eligible programs are executed regardless of return code from * earlier programs. */ #define BPF_F_ALLOW_OVERRIDE (1U << 0) #define BPF_F_ALLOW_MULTI (1U << 1) #define BPF_F_REPLACE (1U << 2) /* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the * verifier will perform strict alignment checking as if the kernel * has been built with CONFIG_EFFICIENT_UNALIGNED_ACCESS not set, * and NET_IP_ALIGN defined to 2. */ #define BPF_F_STRICT_ALIGNMENT (1U << 0) /* If BPF_F_ANY_ALIGNMENT is used in BPF_PROF_LOAD command, the * verifier will allow any alignment whatsoever. On platforms * with strict alignment requirements for loads ands stores (such * as sparc and mips) the verifier validates that all loads and * stores provably follow this requirement. This flag turns that * checking and enforcement off. * * It is mostly used for testing when we want to validate the * context and memory access aspects of the verifier, but because * of an unaligned access the alignment check would trigger before * the one we are interested in. */ #define BPF_F_ANY_ALIGNMENT (1U << 1) /* BPF_F_TEST_RND_HI32 is used in BPF_PROG_LOAD command for testing purpose. * Verifier does sub-register def/use analysis and identifies instructions whose * def only matters for low 32-bit, high 32-bit is never referenced later * through implicit zero extension. Therefore verifier notifies JIT back-ends * that it is safe to ignore clearing high 32-bit for these instructions. This * saves some back-ends a lot of code-gen. However such optimization is not * necessary on some arches, for example x86_64, arm64 etc, whose JIT back-ends * hence hasn't used verifier's analysis result. But, we really want to have a * way to be able to verify the correctness of the described optimization on * x86_64 on which testsuites are frequently exercised. * * So, this flag is introduced. Once it is set, verifier will randomize high * 32-bit for those instructions who has been identified as safe to ignore them. * Then, if verifier is not doing correct analysis, such randomization will * regress tests to expose bugs. */ #define BPF_F_TEST_RND_HI32 (1U << 2) /* The verifier internal test flag. Behavior is undefined */ #define BPF_F_TEST_STATE_FREQ (1U << 3) /* If BPF_F_SLEEPABLE is used in BPF_PROG_LOAD command, the verifier will * restrict map and helper usage for such programs. Sleepable BPF programs can * only be attached to hooks where kernel execution context allows sleeping. * Such programs are allowed to use helpers that may sleep like * bpf_copy_from_user(). */ #define BPF_F_SLEEPABLE (1U << 4) /* When BPF ldimm64's insn[0].src_reg != 0 then this can have * the following extensions: * * insn[0].src_reg: BPF_PSEUDO_MAP_FD * insn[0].imm: map fd * insn[1].imm: 0 * insn[0].off: 0 * insn[1].off: 0 * ldimm64 rewrite: address of map * verifier type: CONST_PTR_TO_MAP */ #define BPF_PSEUDO_MAP_FD 1 /* insn[0].src_reg: BPF_PSEUDO_MAP_VALUE * insn[0].imm: map fd * insn[1].imm: offset into value * insn[0].off: 0 * insn[1].off: 0 * ldimm64 rewrite: address of map[0]+offset * verifier type: PTR_TO_MAP_VALUE */ #define BPF_PSEUDO_MAP_VALUE 2 /* insn[0].src_reg: BPF_PSEUDO_BTF_ID * insn[0].imm: kernel btd id of VAR * insn[1].imm: 0 * insn[0].off: 0 * insn[1].off: 0 * ldimm64 rewrite: address of the kernel variable * verifier type: PTR_TO_BTF_ID or PTR_TO_MEM, depending on whether the var * is struct/union. */ #define BPF_PSEUDO_BTF_ID 3 /* when bpf_call->src_reg == BPF_PSEUDO_CALL, bpf_call->imm == pc-relative * offset to another bpf function */ #define BPF_PSEUDO_CALL 1 /* flags for BPF_MAP_UPDATE_ELEM command */ enum { BPF_ANY = 0, /* create new element or update existing */ BPF_NOEXIST = 1, /* create new element if it didn't exist */ BPF_EXIST = 2, /* update existing element */ BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */ }; /* flags for BPF_MAP_CREATE command */ enum { BPF_F_NO_PREALLOC = (1U << 0), /* Instead of having one common LRU list in the * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list * which can scale and perform better. * Note, the LRU nodes (including free nodes) cannot be moved * across different LRU lists. */ BPF_F_NO_COMMON_LRU = (1U << 1), /* Specify numa node during map creation */ BPF_F_NUMA_NODE = (1U << 2), /* Flags for accessing BPF object from syscall side. */ BPF_F_RDONLY = (1U << 3), BPF_F_WRONLY = (1U << 4), /* Flag for stack_map, store build_id+offset instead of pointer */ BPF_F_STACK_BUILD_ID = (1U << 5), /* Zero-initialize hash function seed. This should only be used for testing. */ BPF_F_ZERO_SEED = (1U << 6), /* Flags for accessing BPF object from program side. */ BPF_F_RDONLY_PROG = (1U << 7), BPF_F_WRONLY_PROG = (1U << 8), /* Clone map from listener for newly accepted socket */ BPF_F_CLONE = (1U << 9), /* Enable memory-mapping BPF map */ BPF_F_MMAPABLE = (1U << 10), /* Share perf_event among processes */ BPF_F_PRESERVE_ELEMS = (1U << 11), /* Create a map that is suitable to be an inner map with dynamic max entries */ BPF_F_INNER_MAP = (1U << 12), }; /* Flags for BPF_PROG_QUERY. */ /* Query effective (directly attached + inherited from ancestor cgroups) * programs that will be executed for events within a cgroup. * attach_flags with this flag are returned only for directly attached programs. */ #define BPF_F_QUERY_EFFECTIVE (1U << 0) /* Flags for BPF_PROG_TEST_RUN */ /* If set, run the test on the cpu specified by bpf_attr.test.cpu */ #define BPF_F_TEST_RUN_ON_CPU (1U << 0) /* type for BPF_ENABLE_STATS */ enum bpf_stats_type { /* enabled run_time_ns and run_cnt */ BPF_STATS_RUN_TIME = 0, }; enum bpf_stack_build_id_status { /* user space need an empty entry to identify end of a trace */ BPF_STACK_BUILD_ID_EMPTY = 0, /* with valid build_id and offset */ BPF_STACK_BUILD_ID_VALID = 1, /* couldn't get build_id, fallback to ip */ BPF_STACK_BUILD_ID_IP = 2, }; #define BPF_BUILD_ID_SIZE 20 struct bpf_stack_build_id { __s32 status; unsigned char build_id[BPF_BUILD_ID_SIZE]; union { __u64 offset; __u64 ip; }; }; #define BPF_OBJ_NAME_LEN 16U union bpf_attr { struct { /* anonymous struct used by BPF_MAP_CREATE command */ __u32 map_type; /* one of enum bpf_map_type */ __u32 key_size; /* size of key in bytes */ __u32 value_size; /* size of value in bytes */ __u32 max_entries; /* max number of entries in a map */ __u32 map_flags; /* BPF_MAP_CREATE related * flags defined above. */ __u32 inner_map_fd; /* fd pointing to the inner map */ __u32 numa_node; /* numa node (effective only if * BPF_F_NUMA_NODE is set). */ char map_name[BPF_OBJ_NAME_LEN]; __u32 map_ifindex; /* ifindex of netdev to create on */ __u32 btf_fd; /* fd pointing to a BTF type data */ __u32 btf_key_type_id; /* BTF type_id of the key */ __u32 btf_value_type_id; /* BTF type_id of the value */ __u32 btf_vmlinux_value_type_id;/* BTF type_id of a kernel- * struct stored as the * map value */ }; struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */ __u32 map_fd; __aligned_u64 key; union { __aligned_u64 value; __aligned_u64 next_key; }; __u64 flags; }; struct { /* struct used by BPF_MAP_*_BATCH commands */ __aligned_u64 in_batch; /* start batch, * NULL to start from beginning */ __aligned_u64 out_batch; /* output: next start batch */ __aligned_u64 keys; __aligned_u64 values; __u32 count; /* input/output: * input: # of key/value * elements * output: # of filled elements */ __u32 map_fd; __u64 elem_flags; __u64 flags; } batch; struct { /* anonymous struct used by BPF_PROG_LOAD command */ __u32 prog_type; /* one of enum bpf_prog_type */ __u32 insn_cnt; __aligned_u64 insns; __aligned_u64 license; __u32 log_level; /* verbosity level of verifier */ __u32 log_size; /* size of user buffer */ __aligned_u64 log_buf; /* user supplied buffer */ __u32 kern_version; /* not used */ __u32 prog_flags; char prog_name[BPF_OBJ_NAME_LEN]; __u32 prog_ifindex; /* ifindex of netdev to prep for */ /* For some prog types expected attach type must be known at * load time to verify attach type specific parts of prog * (context accesses, allowed helpers, etc). */ __u32 expected_attach_type; __u32 prog_btf_fd; /* fd pointing to BTF type data */ __u32 func_info_rec_size; /* userspace bpf_func_info size */ __aligned_u64 func_info; /* func info */ __u32 func_info_cnt; /* number of bpf_func_info records */ __u32 line_info_rec_size; /* userspace bpf_line_info size */ __aligned_u64 line_info; /* line info */ __u32 line_info_cnt; /* number of bpf_line_info records */ __u32 attach_btf_id; /* in-kernel BTF type id to attach to */ union { /* valid prog_fd to attach to bpf prog */ __u32 attach_prog_fd; /* or valid module BTF object fd or 0 to attach to vmlinux */ __u32 attach_btf_obj_fd; }; }; struct { /* anonymous struct used by BPF_OBJ_* commands */ __aligned_u64 pathname; __u32 bpf_fd; __u32 file_flags; }; struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */ __u32 target_fd; /* container object to attach to */ __u32 attach_bpf_fd; /* eBPF program to attach */ __u32 attach_type; __u32 attach_flags; __u32 replace_bpf_fd; /* previously attached eBPF * program to replace if * BPF_F_REPLACE is used */ }; struct { /* anonymous struct used by BPF_PROG_TEST_RUN command */ __u32 prog_fd; __u32 retval; __u32 data_size_in; /* input: len of data_in */ __u32 data_size_out; /* input/output: len of data_out * returns ENOSPC if data_out * is too small. */ __aligned_u64 data_in; __aligned_u64 data_out; __u32 repeat; __u32 duration; __u32 ctx_size_in; /* input: len of ctx_in */ __u32 ctx_size_out; /* input/output: len of ctx_out * returns ENOSPC if ctx_out * is too small. */ __aligned_u64 ctx_in; __aligned_u64 ctx_out; __u32 flags; __u32 cpu; } test; struct { /* anonymous struct used by BPF_*_GET_*_ID */ union { __u32 start_id; __u32 prog_id; __u32 map_id; __u32 btf_id; __u32 link_id; }; __u32 next_id; __u32 open_flags; }; struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */ __u32 bpf_fd; __u32 info_len; __aligned_u64 info; } info; struct { /* anonymous struct used by BPF_PROG_QUERY command */ __u32 target_fd; /* container object to query */ __u32 attach_type; __u32 query_flags; __u32 attach_flags; __aligned_u64 prog_ids; __u32 prog_cnt; } query; struct { /* anonymous struct used by BPF_RAW_TRACEPOINT_OPEN command */ __u64 name; __u32 prog_fd; } raw_tracepoint; struct { /* anonymous struct for BPF_BTF_LOAD */ __aligned_u64 btf; __aligned_u64 btf_log_buf; __u32 btf_size; __u32 btf_log_size; __u32 btf_log_level; }; struct { __u32 pid; /* input: pid */ __u32 fd; /* input: fd */ __u32 flags; /* input: flags */ __u32 buf_len; /* input/output: buf len */ __aligned_u64 buf; /* input/output: * tp_name for tracepoint * symbol for kprobe * filename for uprobe */ __u32 prog_id; /* output: prod_id */ __u32 fd_type; /* output: BPF_FD_TYPE_* */ __u64 probe_offset; /* output: probe_offset */ __u64 probe_addr; /* output: probe_addr */ } task_fd_query; struct { /* struct used by BPF_LINK_CREATE command */ __u32 prog_fd; /* eBPF program to attach */ union { __u32 target_fd; /* object to attach to */ __u32 target_ifindex; /* target ifindex */ }; __u32 attach_type; /* attach type */ __u32 flags; /* extra flags */ union { __u32 target_btf_id; /* btf_id of target to attach to */ struct { __aligned_u64 iter_info; /* extra bpf_iter_link_info */ __u32 iter_info_len; /* iter_info length */ }; }; } link_create; struct { /* struct used by BPF_LINK_UPDATE command */ __u32 link_fd; /* link fd */ /* new program fd to update link with */ __u32 new_prog_fd; __u32 flags; /* extra flags */ /* expected link's program fd; is specified only if * BPF_F_REPLACE flag is set in flags */ __u32 old_prog_fd; } link_update; struct { __u32 link_fd; } link_detach; struct { /* struct used by BPF_ENABLE_STATS command */ __u32 type; } enable_stats; struct { /* struct used by BPF_ITER_CREATE command */ __u32 link_fd; __u32 flags; } iter_create; struct { /* struct used by BPF_PROG_BIND_MAP command */ __u32 prog_fd; __u32 map_fd; __u32 flags; /* extra flags */ } prog_bind_map; } __attribute__((aligned(8))); /* The description below is an attempt at providing documentation to eBPF * developers about the multiple available eBPF helper functions. It can be * parsed and used to produce a manual page. The workflow is the following, * and requires the rst2man utility: * * $ ./scripts/bpf_helpers_doc.py \ * --filename include/uapi/linux/bpf.h > /tmp/bpf-helpers.rst * $ rst2man /tmp/bpf-helpers.rst > /tmp/bpf-helpers.7 * $ man /tmp/bpf-helpers.7 * * Note that in order to produce this external documentation, some RST * formatting is used in the descriptions to get "bold" and "italics" in * manual pages. Also note that the few trailing white spaces are * intentional, removing them would break paragraphs for rst2man. * * Start of BPF helper function descriptions: * * void *bpf_map_lookup_elem(struct bpf_map *map, const void *key) * Description * Perform a lookup in *map* for an entry associated to *key*. * Return * Map value associated to *key*, or **NULL** if no entry was * found. * * long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags) * Description * Add or update the value of the entry associated to *key* in * *map* with *value*. *flags* is one of: * * **BPF_NOEXIST** * The entry for *key* must not exist in the map. * **BPF_EXIST** * The entry for *key* must already exist in the map. * **BPF_ANY** * No condition on the existence of the entry for *key*. * * Flag value **BPF_NOEXIST** cannot be used for maps of types * **BPF_MAP_TYPE_ARRAY** or **BPF_MAP_TYPE_PERCPU_ARRAY** (all * elements always exist), the helper would return an error. * Return * 0 on success, or a negative error in case of failure. * * long bpf_map_delete_elem(struct bpf_map *map, const void *key) * Description * Delete entry with *key* from *map*. * Return * 0 on success, or a negative error in case of failure. * * long bpf_probe_read(void *dst, u32 size, const void *unsafe_ptr) * Description * For tracing programs, safely attempt to read *size* bytes from * kernel space address *unsafe_ptr* and store the data in *dst*. * * Generally, use **bpf_probe_read_user**\ () or * **bpf_probe_read_kernel**\ () instead. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_ktime_get_ns(void) * Description * Return the time elapsed since system boot, in nanoseconds. * Does not include time the system was suspended. * See: **clock_gettime**\ (**CLOCK_MONOTONIC**) * Return * Current *ktime*. * * long bpf_trace_printk(const char *fmt, u32 fmt_size, ...) * Description * This helper is a "printk()-like" facility for debugging. It * prints a message defined by format *fmt* (of size *fmt_size*) * to file *\/sys/kernel/debug/tracing/trace* from DebugFS, if * available. It can take up to three additional **u64** * arguments (as an eBPF helpers, the total number of arguments is * limited to five). * * Each time the helper is called, it appends a line to the trace. * Lines are discarded while *\/sys/kernel/debug/tracing/trace* is * open, use *\/sys/kernel/debug/tracing/trace_pipe* to avoid this. * The format of the trace is customizable, and the exact output * one will get depends on the options set in * *\/sys/kernel/debug/tracing/trace_options* (see also the * *README* file under the same directory). However, it usually * defaults to something like: * * :: * * telnet-470 [001] .N.. 419421.045894: 0x00000001: * * In the above: * * * ``telnet`` is the name of the current task. * * ``470`` is the PID of the current task. * * ``001`` is the CPU number on which the task is * running. * * In ``.N..``, each character refers to a set of * options (whether irqs are enabled, scheduling * options, whether hard/softirqs are running, level of * preempt_disabled respectively). **N** means that * **TIF_NEED_RESCHED** and **PREEMPT_NEED_RESCHED** * are set. * * ``419421.045894`` is a timestamp. * * ``0x00000001`` is a fake value used by BPF for the * instruction pointer register. * * ```` is the message formatted with * *fmt*. * * The conversion specifiers supported by *fmt* are similar, but * more limited than for printk(). They are **%d**, **%i**, * **%u**, **%x**, **%ld**, **%li**, **%lu**, **%lx**, **%lld**, * **%lli**, **%llu**, **%llx**, **%p**, **%s**. No modifier (size * of field, padding with zeroes, etc.) is available, and the * helper will return **-EINVAL** (but print nothing) if it * encounters an unknown specifier. * * Also, note that **bpf_trace_printk**\ () is slow, and should * only be used for debugging purposes. For this reason, a notice * block (spanning several lines) is printed to kernel logs and * states that the helper should not be used "for production use" * the first time this helper is used (or more precisely, when * **trace_printk**\ () buffers are allocated). For passing values * to user space, perf events should be preferred. * Return * The number of bytes written to the buffer, or a negative error * in case of failure. * * u32 bpf_get_prandom_u32(void) * Description * Get a pseudo-random number. * * From a security point of view, this helper uses its own * pseudo-random internal state, and cannot be used to infer the * seed of other random functions in the kernel. However, it is * essential to note that the generator used by the helper is not * cryptographically secure. * Return * A random 32-bit unsigned value. * * u32 bpf_get_smp_processor_id(void) * Description * Get the SMP (symmetric multiprocessing) processor id. Note that * all programs run with preemption disabled, which means that the * SMP processor id is stable during all the execution of the * program. * Return * The SMP id of the processor running the program. * * long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags) * Description * Store *len* bytes from address *from* into the packet * associated to *skb*, at *offset*. *flags* are a combination of * **BPF_F_RECOMPUTE_CSUM** (automatically recompute the * checksum for the packet after storing the bytes) and * **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\ * **->swhash** and *skb*\ **->l4hash** to 0). * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_l3_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 size) * Description * Recompute the layer 3 (e.g. IP) checksum for the packet * associated to *skb*. Computation is incremental, so the helper * must know the former value of the header field that was * modified (*from*), the new value of this field (*to*), and the * number of bytes (2 or 4) for this field, stored in *size*. * Alternatively, it is possible to store the difference between * the previous and the new values of the header field in *to*, by * setting *from* and *size* to 0. For both methods, *offset* * indicates the location of the IP checksum within the packet. * * This helper works in combination with **bpf_csum_diff**\ (), * which does not update the checksum in-place, but offers more * flexibility and can handle sizes larger than 2 or 4 for the * checksum to update. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_l4_csum_replace(struct sk_buff *skb, u32 offset, u64 from, u64 to, u64 flags) * Description * Recompute the layer 4 (e.g. TCP, UDP or ICMP) checksum for the * packet associated to *skb*. Computation is incremental, so the * helper must know the former value of the header field that was * modified (*from*), the new value of this field (*to*), and the * number of bytes (2 or 4) for this field, stored on the lowest * four bits of *flags*. Alternatively, it is possible to store * the difference between the previous and the new values of the * header field in *to*, by setting *from* and the four lowest * bits of *flags* to 0. For both methods, *offset* indicates the * location of the IP checksum within the packet. In addition to * the size of the field, *flags* can be added (bitwise OR) actual * flags. With **BPF_F_MARK_MANGLED_0**, a null checksum is left * untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and * for updates resulting in a null checksum the value is set to * **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates * the checksum is to be computed against a pseudo-header. * * This helper works in combination with **bpf_csum_diff**\ (), * which does not update the checksum in-place, but offers more * flexibility and can handle sizes larger than 2 or 4 for the * checksum to update. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_tail_call(void *ctx, struct bpf_map *prog_array_map, u32 index) * Description * This special helper is used to trigger a "tail call", or in * other words, to jump into another eBPF program. The same stack * frame is used (but values on stack and in registers for the * caller are not accessible to the callee). This mechanism allows * for program chaining, either for raising the maximum number of * available eBPF instructions, or to execute given programs in * conditional blocks. For security reasons, there is an upper * limit to the number of successive tail calls that can be * performed. * * Upon call of this helper, the program attempts to jump into a * program referenced at index *index* in *prog_array_map*, a * special map of type **BPF_MAP_TYPE_PROG_ARRAY**, and passes * *ctx*, a pointer to the context. * * If the call succeeds, the kernel immediately runs the first * instruction of the new program. This is not a function call, * and it never returns to the previous program. If the call * fails, then the helper has no effect, and the caller continues * to run its subsequent instructions. A call can fail if the * destination program for the jump does not exist (i.e. *index* * is superior to the number of entries in *prog_array_map*), or * if the maximum number of tail calls has been reached for this * chain of programs. This limit is defined in the kernel by the * macro **MAX_TAIL_CALL_CNT** (not accessible to user space), * which is currently set to 32. * Return * 0 on success, or a negative error in case of failure. * * long bpf_clone_redirect(struct sk_buff *skb, u32 ifindex, u64 flags) * Description * Clone and redirect the packet associated to *skb* to another * net device of index *ifindex*. Both ingress and egress * interfaces can be used for redirection. The **BPF_F_INGRESS** * value in *flags* is used to make the distinction (ingress path * is selected if the flag is present, egress path otherwise). * This is the only flag supported for now. * * In comparison with **bpf_redirect**\ () helper, * **bpf_clone_redirect**\ () has the associated cost of * duplicating the packet buffer, but this can be executed out of * the eBPF program. Conversely, **bpf_redirect**\ () is more * efficient, but it is handled through an action code where the * redirection happens only after the eBPF program has returned. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_get_current_pid_tgid(void) * Return * A 64-bit integer containing the current tgid and pid, and * created as such: * *current_task*\ **->tgid << 32 \|** * *current_task*\ **->pid**. * * u64 bpf_get_current_uid_gid(void) * Return * A 64-bit integer containing the current GID and UID, and * created as such: *current_gid* **<< 32 \|** *current_uid*. * * long bpf_get_current_comm(void *buf, u32 size_of_buf) * Description * Copy the **comm** attribute of the current task into *buf* of * *size_of_buf*. The **comm** attribute contains the name of * the executable (excluding the path) for the current task. The * *size_of_buf* must be strictly positive. On success, the * helper makes sure that the *buf* is NUL-terminated. On failure, * it is filled with zeroes. * Return * 0 on success, or a negative error in case of failure. * * u32 bpf_get_cgroup_classid(struct sk_buff *skb) * Description * Retrieve the classid for the current task, i.e. for the net_cls * cgroup to which *skb* belongs. * * This helper can be used on TC egress path, but not on ingress. * * The net_cls cgroup provides an interface to tag network packets * based on a user-provided identifier for all traffic coming from * the tasks belonging to the related cgroup. See also the related * kernel documentation, available from the Linux sources in file * *Documentation/admin-guide/cgroup-v1/net_cls.rst*. * * The Linux kernel has two versions for cgroups: there are * cgroups v1 and cgroups v2. Both are available to users, who can * use a mixture of them, but note that the net_cls cgroup is for * cgroup v1 only. This makes it incompatible with BPF programs * run on cgroups, which is a cgroup-v2-only feature (a socket can * only hold data for one version of cgroups at a time). * * This helper is only available is the kernel was compiled with * the **CONFIG_CGROUP_NET_CLASSID** configuration option set to * "**y**" or to "**m**". * Return * The classid, or 0 for the default unconfigured classid. * * long bpf_skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci) * Description * Push a *vlan_tci* (VLAN tag control information) of protocol * *vlan_proto* to the packet associated to *skb*, then update * the checksum. Note that if *vlan_proto* is different from * **ETH_P_8021Q** and **ETH_P_8021AD**, it is considered to * be **ETH_P_8021Q**. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_vlan_pop(struct sk_buff *skb) * Description * Pop a VLAN header from the packet associated to *skb*. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_get_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) * Description * Get tunnel metadata. This helper takes a pointer *key* to an * empty **struct bpf_tunnel_key** of **size**, that will be * filled with tunnel metadata for the packet associated to *skb*. * The *flags* can be set to **BPF_F_TUNINFO_IPV6**, which * indicates that the tunnel is based on IPv6 protocol instead of * IPv4. * * The **struct bpf_tunnel_key** is an object that generalizes the * principal parameters used by various tunneling protocols into a * single struct. This way, it can be used to easily make a * decision based on the contents of the encapsulation header, * "summarized" in this struct. In particular, it holds the IP * address of the remote end (IPv4 or IPv6, depending on the case) * in *key*\ **->remote_ipv4** or *key*\ **->remote_ipv6**. Also, * this struct exposes the *key*\ **->tunnel_id**, which is * generally mapped to a VNI (Virtual Network Identifier), making * it programmable together with the **bpf_skb_set_tunnel_key**\ * () helper. * * Let's imagine that the following code is part of a program * attached to the TC ingress interface, on one end of a GRE * tunnel, and is supposed to filter out all messages coming from * remote ends with IPv4 address other than 10.0.0.1: * * :: * * int ret; * struct bpf_tunnel_key key = {}; * * ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); * if (ret < 0) * return TC_ACT_SHOT; // drop packet * * if (key.remote_ipv4 != 0x0a000001) * return TC_ACT_SHOT; // drop packet * * return TC_ACT_OK; // accept packet * * This interface can also be used with all encapsulation devices * that can operate in "collect metadata" mode: instead of having * one network device per specific configuration, the "collect * metadata" mode only requires a single device where the * configuration can be extracted from this helper. * * This can be used together with various tunnels such as VXLan, * Geneve, GRE or IP in IP (IPIP). * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_set_tunnel_key(struct sk_buff *skb, struct bpf_tunnel_key *key, u32 size, u64 flags) * Description * Populate tunnel metadata for packet associated to *skb.* The * tunnel metadata is set to the contents of *key*, of *size*. The * *flags* can be set to a combination of the following values: * * **BPF_F_TUNINFO_IPV6** * Indicate that the tunnel is based on IPv6 protocol * instead of IPv4. * **BPF_F_ZERO_CSUM_TX** * For IPv4 packets, add a flag to tunnel metadata * indicating that checksum computation should be skipped * and checksum set to zeroes. * **BPF_F_DONT_FRAGMENT** * Add a flag to tunnel metadata indicating that the * packet should not be fragmented. * **BPF_F_SEQ_NUMBER** * Add a flag to tunnel metadata indicating that a * sequence number should be added to tunnel header before * sending the packet. This flag was added for GRE * encapsulation, but might be used with other protocols * as well in the future. * * Here is a typical usage on the transmit path: * * :: * * struct bpf_tunnel_key key; * populate key ... * bpf_skb_set_tunnel_key(skb, &key, sizeof(key), 0); * bpf_clone_redirect(skb, vxlan_dev_ifindex, 0); * * See also the description of the **bpf_skb_get_tunnel_key**\ () * helper for additional information. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_perf_event_read(struct bpf_map *map, u64 flags) * Description * Read the value of a perf event counter. This helper relies on a * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of * the perf event counter is selected when *map* is updated with * perf event file descriptors. The *map* is an array whose size * is the number of available CPUs, and each cell contains a value * relative to one CPU. The value to retrieve is indicated by * *flags*, that contains the index of the CPU to look up, masked * with **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to * **BPF_F_CURRENT_CPU** to indicate that the value for the * current CPU should be retrieved. * * Note that before Linux 4.13, only hardware perf event can be * retrieved. * * Also, be aware that the newer helper * **bpf_perf_event_read_value**\ () is recommended over * **bpf_perf_event_read**\ () in general. The latter has some ABI * quirks where error and counter value are used as a return code * (which is wrong to do since ranges may overlap). This issue is * fixed with **bpf_perf_event_read_value**\ (), which at the same * time provides more features over the **bpf_perf_event_read**\ * () interface. Please refer to the description of * **bpf_perf_event_read_value**\ () for details. * Return * The value of the perf event counter read from the map, or a * negative error code in case of failure. * * long bpf_redirect(u32 ifindex, u64 flags) * Description * Redirect the packet to another net device of index *ifindex*. * This helper is somewhat similar to **bpf_clone_redirect**\ * (), except that the packet is not cloned, which provides * increased performance. * * Except for XDP, both ingress and egress interfaces can be used * for redirection. The **BPF_F_INGRESS** value in *flags* is used * to make the distinction (ingress path is selected if the flag * is present, egress path otherwise). Currently, XDP only * supports redirection to the egress interface, and accepts no * flag at all. * * The same effect can also be attained with the more generic * **bpf_redirect_map**\ (), which uses a BPF map to store the * redirect target instead of providing it directly to the helper. * Return * For XDP, the helper returns **XDP_REDIRECT** on success or * **XDP_ABORTED** on error. For other program types, the values * are **TC_ACT_REDIRECT** on success or **TC_ACT_SHOT** on * error. * * u32 bpf_get_route_realm(struct sk_buff *skb) * Description * Retrieve the realm or the route, that is to say the * **tclassid** field of the destination for the *skb*. The * identifier retrieved is a user-provided tag, similar to the * one used with the net_cls cgroup (see description for * **bpf_get_cgroup_classid**\ () helper), but here this tag is * held by a route (a destination entry), not by a task. * * Retrieving this identifier works with the clsact TC egress hook * (see also **tc-bpf(8)**), or alternatively on conventional * classful egress qdiscs, but not on TC ingress path. In case of * clsact TC egress hook, this has the advantage that, internally, * the destination entry has not been dropped yet in the transmit * path. Therefore, the destination entry does not need to be * artificially held via **netif_keep_dst**\ () for a classful * qdisc until the *skb* is freed. * * This helper is available only if the kernel was compiled with * **CONFIG_IP_ROUTE_CLASSID** configuration option. * Return * The realm of the route for the packet associated to *skb*, or 0 * if none was found. * * long bpf_perf_event_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf * event must have the following attributes: **PERF_SAMPLE_RAW** * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. * * The *flags* are used to indicate the index in *map* for which * the value must be put, masked with **BPF_F_INDEX_MASK**. * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** * to indicate that the index of the current CPU core should be * used. * * The value to write, of *size*, is passed through eBPF stack and * pointed by *data*. * * The context of the program *ctx* needs also be passed to the * helper. * * On user space, a program willing to read the values needs to * call **perf_event_open**\ () on the perf event (either for * one or for all CPUs) and to store the file descriptor into the * *map*. This must be done before the eBPF program can send data * into it. An example is available in file * *samples/bpf/trace_output_user.c* in the Linux kernel source * tree (the eBPF program counterpart is in * *samples/bpf/trace_output_kern.c*). * * **bpf_perf_event_output**\ () achieves better performance * than **bpf_trace_printk**\ () for sharing data with user * space, and is much better suitable for streaming data from eBPF * programs. * * Note that this helper is not restricted to tracing use cases * and can be used with programs attached to TC or XDP as well, * where it allows for passing data to user space listeners. Data * can be: * * * Only custom structs, * * Only the packet payload, or * * A combination of both. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len) * Description * This helper was provided as an easy way to load data from a * packet. It can be used to load *len* bytes from *offset* from * the packet associated to *skb*, into the buffer pointed by * *to*. * * Since Linux 4.7, usage of this helper has mostly been replaced * by "direct packet access", enabling packet data to be * manipulated with *skb*\ **->data** and *skb*\ **->data_end** * pointing respectively to the first byte of packet data and to * the byte after the last byte of packet data. However, it * remains useful if one wishes to read large quantities of data * at once from a packet into the eBPF stack. * Return * 0 on success, or a negative error in case of failure. * * long bpf_get_stackid(void *ctx, struct bpf_map *map, u64 flags) * Description * Walk a user or a kernel stack and return its id. To achieve * this, the helper needs *ctx*, which is a pointer to the context * on which the tracing program is executed, and a pointer to a * *map* of type **BPF_MAP_TYPE_STACK_TRACE**. * * The last argument, *flags*, holds the number of stack frames to * skip (from 0 to 255), masked with * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set * a combination of the following flags: * * **BPF_F_USER_STACK** * Collect a user space stack instead of a kernel stack. * **BPF_F_FAST_STACK_CMP** * Compare stacks by hash only. * **BPF_F_REUSE_STACKID** * If two different stacks hash into the same *stackid*, * discard the old one. * * The stack id retrieved is a 32 bit long integer handle which * can be further combined with other data (including other stack * ids) and used as a key into maps. This can be useful for * generating a variety of graphs (such as flame graphs or off-cpu * graphs). * * For walking a stack, this helper is an improvement over * **bpf_probe_read**\ (), which can be used with unrolled loops * but is not efficient and consumes a lot of eBPF instructions. * Instead, **bpf_get_stackid**\ () can collect up to * **PERF_MAX_STACK_DEPTH** both kernel and user frames. Note that * this limit can be controlled with the **sysctl** program, and * that it should be manually increased in order to profile long * user stacks (such as stacks for Java programs). To do so, use: * * :: * * # sysctl kernel.perf_event_max_stack= * Return * The positive or null stack id on success, or a negative error * in case of failure. * * s64 bpf_csum_diff(__be32 *from, u32 from_size, __be32 *to, u32 to_size, __wsum seed) * Description * Compute a checksum difference, from the raw buffer pointed by * *from*, of length *from_size* (that must be a multiple of 4), * towards the raw buffer pointed by *to*, of size *to_size* * (same remark). An optional *seed* can be added to the value * (this can be cascaded, the seed may come from a previous call * to the helper). * * This is flexible enough to be used in several ways: * * * With *from_size* == 0, *to_size* > 0 and *seed* set to * checksum, it can be used when pushing new data. * * With *from_size* > 0, *to_size* == 0 and *seed* set to * checksum, it can be used when removing data from a packet. * * With *from_size* > 0, *to_size* > 0 and *seed* set to 0, it * can be used to compute a diff. Note that *from_size* and * *to_size* do not need to be equal. * * This helper can be used in combination with * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ (), to * which one can feed in the difference computed with * **bpf_csum_diff**\ (). * Return * The checksum result, or a negative error code in case of * failure. * * long bpf_skb_get_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) * Description * Retrieve tunnel options metadata for the packet associated to * *skb*, and store the raw tunnel option data to the buffer *opt* * of *size*. * * This helper can be used with encapsulation devices that can * operate in "collect metadata" mode (please refer to the related * note in the description of **bpf_skb_get_tunnel_key**\ () for * more details). A particular example where this can be used is * in combination with the Geneve encapsulation protocol, where it * allows for pushing (with **bpf_skb_get_tunnel_opt**\ () helper) * and retrieving arbitrary TLVs (Type-Length-Value headers) from * the eBPF program. This allows for full customization of these * headers. * Return * The size of the option data retrieved. * * long bpf_skb_set_tunnel_opt(struct sk_buff *skb, void *opt, u32 size) * Description * Set tunnel options metadata for the packet associated to *skb* * to the option data contained in the raw buffer *opt* of *size*. * * See also the description of the **bpf_skb_get_tunnel_opt**\ () * helper for additional information. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_change_proto(struct sk_buff *skb, __be16 proto, u64 flags) * Description * Change the protocol of the *skb* to *proto*. Currently * supported are transition from IPv4 to IPv6, and from IPv6 to * IPv4. The helper takes care of the groundwork for the * transition, including resizing the socket buffer. The eBPF * program is expected to fill the new headers, if any, via * **skb_store_bytes**\ () and to recompute the checksums with * **bpf_l3_csum_replace**\ () and **bpf_l4_csum_replace**\ * (). The main case for this helper is to perform NAT64 * operations out of an eBPF program. * * Internally, the GSO type is marked as dodgy so that headers are * checked and segments are recalculated by the GSO/GRO engine. * The size for GSO target is adapted as well. * * All values for *flags* are reserved for future usage, and must * be left at zero. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_change_type(struct sk_buff *skb, u32 type) * Description * Change the packet type for the packet associated to *skb*. This * comes down to setting *skb*\ **->pkt_type** to *type*, except * the eBPF program does not have a write access to *skb*\ * **->pkt_type** beside this helper. Using a helper here allows * for graceful handling of errors. * * The major use case is to change incoming *skb*s to * **PACKET_HOST** in a programmatic way instead of having to * recirculate via **redirect**\ (..., **BPF_F_INGRESS**), for * example. * * Note that *type* only allows certain values. At this time, they * are: * * **PACKET_HOST** * Packet is for us. * **PACKET_BROADCAST** * Send packet to all. * **PACKET_MULTICAST** * Send packet to group. * **PACKET_OTHERHOST** * Send packet to someone else. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_under_cgroup(struct sk_buff *skb, struct bpf_map *map, u32 index) * Description * Check whether *skb* is a descendant of the cgroup2 held by * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. * Return * The return value depends on the result of the test, and can be: * * * 0, if the *skb* failed the cgroup2 descendant test. * * 1, if the *skb* succeeded the cgroup2 descendant test. * * A negative error code, if an error occurred. * * u32 bpf_get_hash_recalc(struct sk_buff *skb) * Description * Retrieve the hash of the packet, *skb*\ **->hash**. If it is * not set, in particular if the hash was cleared due to mangling, * recompute this hash. Later accesses to the hash can be done * directly with *skb*\ **->hash**. * * Calling **bpf_set_hash_invalid**\ (), changing a packet * prototype with **bpf_skb_change_proto**\ (), or calling * **bpf_skb_store_bytes**\ () with the * **BPF_F_INVALIDATE_HASH** are actions susceptible to clear * the hash and to trigger a new computation for the next call to * **bpf_get_hash_recalc**\ (). * Return * The 32-bit hash. * * u64 bpf_get_current_task(void) * Return * A pointer to the current task struct. * * long bpf_probe_write_user(void *dst, const void *src, u32 len) * Description * Attempt in a safe way to write *len* bytes from the buffer * *src* to *dst* in memory. It only works for threads that are in * user context, and *dst* must be a valid user space address. * * This helper should not be used to implement any kind of * security mechanism because of TOC-TOU attacks, but rather to * debug, divert, and manipulate execution of semi-cooperative * processes. * * Keep in mind that this feature is meant for experiments, and it * has a risk of crashing the system and running programs. * Therefore, when an eBPF program using this helper is attached, * a warning including PID and process name is printed to kernel * logs. * Return * 0 on success, or a negative error in case of failure. * * long bpf_current_task_under_cgroup(struct bpf_map *map, u32 index) * Description * Check whether the probe is being run is the context of a given * subset of the cgroup2 hierarchy. The cgroup2 to test is held by * *map* of type **BPF_MAP_TYPE_CGROUP_ARRAY**, at *index*. * Return * The return value depends on the result of the test, and can be: * * * 0, if current task belongs to the cgroup2. * * 1, if current task does not belong to the cgroup2. * * A negative error code, if an error occurred. * * long bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) * Description * Resize (trim or grow) the packet associated to *skb* to the * new *len*. The *flags* are reserved for future usage, and must * be left at zero. * * The basic idea is that the helper performs the needed work to * change the size of the packet, then the eBPF program rewrites * the rest via helpers like **bpf_skb_store_bytes**\ (), * **bpf_l3_csum_replace**\ (), **bpf_l3_csum_replace**\ () * and others. This helper is a slow path utility intended for * replies with control messages. And because it is targeted for * slow path, the helper itself can afford to be slow: it * implicitly linearizes, unclones and drops offloads from the * *skb*. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_pull_data(struct sk_buff *skb, u32 len) * Description * Pull in non-linear data in case the *skb* is non-linear and not * all of *len* are part of the linear section. Make *len* bytes * from *skb* readable and writable. If a zero value is passed for * *len*, then the whole length of the *skb* is pulled. * * This helper is only needed for reading and writing with direct * packet access. * * For direct packet access, testing that offsets to access * are within packet boundaries (test on *skb*\ **->data_end**) is * susceptible to fail if offsets are invalid, or if the requested * data is in non-linear parts of the *skb*. On failure the * program can just bail out, or in the case of a non-linear * buffer, use a helper to make the data available. The * **bpf_skb_load_bytes**\ () helper is a first solution to access * the data. Another one consists in using **bpf_skb_pull_data** * to pull in once the non-linear parts, then retesting and * eventually access the data. * * At the same time, this also makes sure the *skb* is uncloned, * which is a necessary condition for direct write. As this needs * to be an invariant for the write part only, the verifier * detects writes and adds a prologue that is calling * **bpf_skb_pull_data()** to effectively unclone the *skb* from * the very beginning in case it is indeed cloned. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * s64 bpf_csum_update(struct sk_buff *skb, __wsum csum) * Description * Add the checksum *csum* into *skb*\ **->csum** in case the * driver has supplied a checksum for the entire packet into that * field. Return an error otherwise. This helper is intended to be * used in combination with **bpf_csum_diff**\ (), in particular * when the checksum needs to be updated after data has been * written into the packet through direct packet access. * Return * The checksum on success, or a negative error code in case of * failure. * * void bpf_set_hash_invalid(struct sk_buff *skb) * Description * Invalidate the current *skb*\ **->hash**. It can be used after * mangling on headers through direct packet access, in order to * indicate that the hash is outdated and to trigger a * recalculation the next time the kernel tries to access this * hash or when the **bpf_get_hash_recalc**\ () helper is called. * * long bpf_get_numa_node_id(void) * Description * Return the id of the current NUMA node. The primary use case * for this helper is the selection of sockets for the local NUMA * node, when the program is attached to sockets using the * **SO_ATTACH_REUSEPORT_EBPF** option (see also **socket(7)**), * but the helper is also available to other eBPF program types, * similarly to **bpf_get_smp_processor_id**\ (). * Return * The id of current NUMA node. * * long bpf_skb_change_head(struct sk_buff *skb, u32 len, u64 flags) * Description * Grows headroom of packet associated to *skb* and adjusts the * offset of the MAC header accordingly, adding *len* bytes of * space. It automatically extends and reallocates memory as * required. * * This helper can be used on a layer 3 *skb* to push a MAC header * for redirection into a layer 2 device. * * All values for *flags* are reserved for future usage, and must * be left at zero. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_xdp_adjust_head(struct xdp_buff *xdp_md, int delta) * Description * Adjust (move) *xdp_md*\ **->data** by *delta* bytes. Note that * it is possible to use a negative value for *delta*. This helper * can be used to prepare the packet for pushing or popping * headers. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_probe_read_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe kernel address * *unsafe_ptr* to *dst*. See **bpf_probe_read_kernel_str**\ () for * more details. * * Generally, use **bpf_probe_read_user_str**\ () or * **bpf_probe_read_kernel_str**\ () instead. * Return * On success, the strictly positive length of the string, * including the trailing NUL character. On error, a negative * value. * * u64 bpf_get_socket_cookie(struct sk_buff *skb) * Description * If the **struct sk_buff** pointed by *skb* has a known socket, * retrieve the cookie (generated by the kernel) of this socket. * If no cookie has been set yet, generate a new cookie. Once * generated, the socket cookie remains stable for the life of the * socket. This helper can be useful for monitoring per socket * networking traffic statistics as it provides a global socket * identifier that can be assumed unique. * Return * A 8-byte long non-decreasing number on success, or 0 if the * socket field is missing inside *skb*. * * u64 bpf_get_socket_cookie(struct bpf_sock_addr *ctx) * Description * Equivalent to bpf_get_socket_cookie() helper that accepts * *skb*, but gets socket from **struct bpf_sock_addr** context. * Return * A 8-byte long non-decreasing number. * * u64 bpf_get_socket_cookie(struct bpf_sock_ops *ctx) * Description * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts * *skb*, but gets socket from **struct bpf_sock_ops** context. * Return * A 8-byte long non-decreasing number. * * u32 bpf_get_socket_uid(struct sk_buff *skb) * Return * The owner UID of the socket associated to *skb*. If the socket * is **NULL**, or if it is not a full socket (i.e. if it is a * time-wait or a request socket instead), **overflowuid** value * is returned (note that **overflowuid** might also be the actual * UID value for the socket). * * long bpf_set_hash(struct sk_buff *skb, u32 hash) * Description * Set the full hash for *skb* (set the field *skb*\ **->hash**) * to value *hash*. * Return * 0 * * long bpf_setsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen) * Description * Emulate a call to **setsockopt()** on the socket associated to * *bpf_socket*, which must be a full socket. The *level* at * which the option resides and the name *optname* of the option * must be specified, see **setsockopt(2)** for more information. * The option value of length *optlen* is pointed by *optval*. * * *bpf_socket* should be one of the following: * * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** * and **BPF_CGROUP_INET6_CONNECT**. * * This helper actually implements a subset of **setsockopt()**. * It supports the following *level*\ s: * * * **SOL_SOCKET**, which supports the following *optname*\ s: * **SO_RCVBUF**, **SO_SNDBUF**, **SO_MAX_PACING_RATE**, * **SO_PRIORITY**, **SO_RCVLOWAT**, **SO_MARK**, * **SO_BINDTODEVICE**, **SO_KEEPALIVE**. * * **IPPROTO_TCP**, which supports the following *optname*\ s: * **TCP_CONGESTION**, **TCP_BPF_IW**, * **TCP_BPF_SNDCWND_CLAMP**, **TCP_SAVE_SYN**, * **TCP_KEEPIDLE**, **TCP_KEEPINTVL**, **TCP_KEEPCNT**, * **TCP_SYNCNT**, **TCP_USER_TIMEOUT**, **TCP_NOTSENT_LOWAT**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_adjust_room(struct sk_buff *skb, s32 len_diff, u32 mode, u64 flags) * Description * Grow or shrink the room for data in the packet associated to * *skb* by *len_diff*, and according to the selected *mode*. * * By default, the helper will reset any offloaded checksum * indicator of the skb to CHECKSUM_NONE. This can be avoided * by the following flag: * * * **BPF_F_ADJ_ROOM_NO_CSUM_RESET**: Do not reset offloaded * checksum data of the skb to CHECKSUM_NONE. * * There are two supported modes at this time: * * * **BPF_ADJ_ROOM_MAC**: Adjust room at the mac layer * (room space is added or removed below the layer 2 header). * * * **BPF_ADJ_ROOM_NET**: Adjust room at the network layer * (room space is added or removed below the layer 3 header). * * The following flags are supported at this time: * * * **BPF_F_ADJ_ROOM_FIXED_GSO**: Do not adjust gso_size. * Adjusting mss in this way is not allowed for datagrams. * * * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV4**, * **BPF_F_ADJ_ROOM_ENCAP_L3_IPV6**: * Any new space is reserved to hold a tunnel header. * Configure skb offsets and other fields accordingly. * * * **BPF_F_ADJ_ROOM_ENCAP_L4_GRE**, * **BPF_F_ADJ_ROOM_ENCAP_L4_UDP**: * Use with ENCAP_L3 flags to further specify the tunnel type. * * * **BPF_F_ADJ_ROOM_ENCAP_L2**\ (*len*): * Use with ENCAP_L3/L4 flags to further specify the tunnel * type; *len* is the length of the inner MAC header. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags) * Description * Redirect the packet to the endpoint referenced by *map* at * index *key*. Depending on its type, this *map* can contain * references to net devices (for forwarding packets through other * ports), or to CPUs (for redirecting XDP frames to another CPU; * but this is only implemented for native XDP (with driver * support) as of this writing). * * The lower two bits of *flags* are used as the return code if * the map lookup fails. This is so that the return value can be * one of the XDP program return codes up to **XDP_TX**, as chosen * by the caller. Any higher bits in the *flags* argument must be * unset. * * See also **bpf_redirect**\ (), which only supports redirecting * to an ifindex, but doesn't require a map to do so. * Return * **XDP_REDIRECT** on success, or the value of the two lower bits * of the *flags* argument on error. * * long bpf_sk_redirect_map(struct sk_buff *skb, struct bpf_map *map, u32 key, u64 flags) * Description * Redirect the packet to the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and * egress interfaces can be used for redirection. The * **BPF_F_INGRESS** value in *flags* is used to make the * distinction (ingress path is selected if the flag is present, * egress path otherwise). This is the only flag supported for now. * Return * **SK_PASS** on success, or **SK_DROP** on error. * * long bpf_sock_map_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) * Description * Add an entry to, or update a *map* referencing sockets. The * *skops* is used as a new value for the entry associated to * *key*. *flags* is one of: * * **BPF_NOEXIST** * The entry for *key* must not exist in the map. * **BPF_EXIST** * The entry for *key* must already exist in the map. * **BPF_ANY** * No condition on the existence of the entry for *key*. * * If the *map* has eBPF programs (parser and verdict), those will * be inherited by the socket being added. If the socket is * already attached to eBPF programs, this results in an error. * Return * 0 on success, or a negative error in case of failure. * * long bpf_xdp_adjust_meta(struct xdp_buff *xdp_md, int delta) * Description * Adjust the address pointed by *xdp_md*\ **->data_meta** by * *delta* (which can be positive or negative). Note that this * operation modifies the address stored in *xdp_md*\ **->data**, * so the latter must be loaded only after the helper has been * called. * * The use of *xdp_md*\ **->data_meta** is optional and programs * are not required to use it. The rationale is that when the * packet is processed with XDP (e.g. as DoS filter), it is * possible to push further meta data along with it before passing * to the stack, and to give the guarantee that an ingress eBPF * program attached as a TC classifier on the same device can pick * this up for further post-processing. Since TC works with socket * buffers, it remains possible to set from XDP the **mark** or * **priority** pointers, or other pointers for the socket buffer. * Having this scratch space generic and programmable allows for * more flexibility as the user is free to store whatever meta * data they need. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_perf_event_read_value(struct bpf_map *map, u64 flags, struct bpf_perf_event_value *buf, u32 buf_size) * Description * Read the value of a perf event counter, and store it into *buf* * of size *buf_size*. This helper relies on a *map* of type * **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. The nature of the perf event * counter is selected when *map* is updated with perf event file * descriptors. The *map* is an array whose size is the number of * available CPUs, and each cell contains a value relative to one * CPU. The value to retrieve is indicated by *flags*, that * contains the index of the CPU to look up, masked with * **BPF_F_INDEX_MASK**. Alternatively, *flags* can be set to * **BPF_F_CURRENT_CPU** to indicate that the value for the * current CPU should be retrieved. * * This helper behaves in a way close to * **bpf_perf_event_read**\ () helper, save that instead of * just returning the value observed, it fills the *buf* * structure. This allows for additional data to be retrieved: in * particular, the enabled and running times (in *buf*\ * **->enabled** and *buf*\ **->running**, respectively) are * copied. In general, **bpf_perf_event_read_value**\ () is * recommended over **bpf_perf_event_read**\ (), which has some * ABI issues and provides fewer functionalities. * * These values are interesting, because hardware PMU (Performance * Monitoring Unit) counters are limited resources. When there are * more PMU based perf events opened than available counters, * kernel will multiplex these events so each event gets certain * percentage (but not all) of the PMU time. In case that * multiplexing happens, the number of samples or counter value * will not reflect the case compared to when no multiplexing * occurs. This makes comparison between different runs difficult. * Typically, the counter value should be normalized before * comparing to other experiments. The usual normalization is done * as follows. * * :: * * normalized_counter = counter * t_enabled / t_running * * Where t_enabled is the time enabled for event and t_running is * the time running for event since last normalization. The * enabled and running times are accumulated since the perf event * open. To achieve scaling factor between two invocations of an * eBPF program, users can use CPU id as the key (which is * typical for perf array usage model) to remember the previous * value and do the calculation inside the eBPF program. * Return * 0 on success, or a negative error in case of failure. * * long bpf_perf_prog_read_value(struct bpf_perf_event_data *ctx, struct bpf_perf_event_value *buf, u32 buf_size) * Description * For en eBPF program attached to a perf event, retrieve the * value of the event counter associated to *ctx* and store it in * the structure pointed by *buf* and of size *buf_size*. Enabled * and running times are also stored in the structure (see * description of helper **bpf_perf_event_read_value**\ () for * more details). * Return * 0 on success, or a negative error in case of failure. * * long bpf_getsockopt(void *bpf_socket, int level, int optname, void *optval, int optlen) * Description * Emulate a call to **getsockopt()** on the socket associated to * *bpf_socket*, which must be a full socket. The *level* at * which the option resides and the name *optname* of the option * must be specified, see **getsockopt(2)** for more information. * The retrieved value is stored in the structure pointed by * *opval* and of length *optlen*. * * *bpf_socket* should be one of the following: * * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**. * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT** * and **BPF_CGROUP_INET6_CONNECT**. * * This helper actually implements a subset of **getsockopt()**. * It supports the following *level*\ s: * * * **IPPROTO_TCP**, which supports *optname* * **TCP_CONGESTION**. * * **IPPROTO_IP**, which supports *optname* **IP_TOS**. * * **IPPROTO_IPV6**, which supports *optname* **IPV6_TCLASS**. * Return * 0 on success, or a negative error in case of failure. * * long bpf_override_return(struct pt_regs *regs, u64 rc) * Description * Used for error injection, this helper uses kprobes to override * the return value of the probed function, and to set it to *rc*. * The first argument is the context *regs* on which the kprobe * works. * * This helper works by setting the PC (program counter) * to an override function which is run in place of the original * probed function. This means the probed function is not run at * all. The replacement function just returns with the required * value. * * This helper has security implications, and thus is subject to * restrictions. It is only available if the kernel was compiled * with the **CONFIG_BPF_KPROBE_OVERRIDE** configuration * option, and in this case it only works on functions tagged with * **ALLOW_ERROR_INJECTION** in the kernel code. * * Also, the helper is only available for the architectures having * the CONFIG_FUNCTION_ERROR_INJECTION option. As of this writing, * x86 architecture is the only one to support this feature. * Return * 0 * * long bpf_sock_ops_cb_flags_set(struct bpf_sock_ops *bpf_sock, int argval) * Description * Attempt to set the value of the **bpf_sock_ops_cb_flags** field * for the full TCP socket associated to *bpf_sock_ops* to * *argval*. * * The primary use of this field is to determine if there should * be calls to eBPF programs of type * **BPF_PROG_TYPE_SOCK_OPS** at various points in the TCP * code. A program of the same type can change its value, per * connection and as necessary, when the connection is * established. This field is directly accessible for reading, but * this helper must be used for updates in order to return an * error if an eBPF program tries to set a callback that is not * supported in the current kernel. * * *argval* is a flag array which can combine these flags: * * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out) * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission) * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change) * * **BPF_SOCK_OPS_RTT_CB_FLAG** (every RTT) * * Therefore, this function can be used to clear a callback flag by * setting the appropriate bit to zero. e.g. to disable the RTO * callback: * * **bpf_sock_ops_cb_flags_set(bpf_sock,** * **bpf_sock->bpf_sock_ops_cb_flags & ~BPF_SOCK_OPS_RTO_CB_FLAG)** * * Here are some examples of where one could call such eBPF * program: * * * When RTO fires. * * When a packet is retransmitted. * * When the connection terminates. * * When a packet is sent. * * When a packet is received. * Return * Code **-EINVAL** if the socket is not a full TCP socket; * otherwise, a positive number containing the bits that could not * be set is returned (which comes down to 0 if all bits were set * as required). * * long bpf_msg_redirect_map(struct sk_msg_buff *msg, struct bpf_map *map, u32 key, u64 flags) * Description * This helper is used in programs implementing policies at the * socket level. If the message *msg* is allowed to pass (i.e. if * the verdict eBPF program returns **SK_PASS**), redirect it to * the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKMAP**) at index *key*. Both ingress and * egress interfaces can be used for redirection. The * **BPF_F_INGRESS** value in *flags* is used to make the * distinction (ingress path is selected if the flag is present, * egress path otherwise). This is the only flag supported for now. * Return * **SK_PASS** on success, or **SK_DROP** on error. * * long bpf_msg_apply_bytes(struct sk_msg_buff *msg, u32 bytes) * Description * For socket policies, apply the verdict of the eBPF program to * the next *bytes* (number of bytes) of message *msg*. * * For example, this helper can be used in the following cases: * * * A single **sendmsg**\ () or **sendfile**\ () system call * contains multiple logical messages that the eBPF program is * supposed to read and for which it should apply a verdict. * * An eBPF program only cares to read the first *bytes* of a * *msg*. If the message has a large payload, then setting up * and calling the eBPF program repeatedly for all bytes, even * though the verdict is already known, would create unnecessary * overhead. * * When called from within an eBPF program, the helper sets a * counter internal to the BPF infrastructure, that is used to * apply the last verdict to the next *bytes*. If *bytes* is * smaller than the current data being processed from a * **sendmsg**\ () or **sendfile**\ () system call, the first * *bytes* will be sent and the eBPF program will be re-run with * the pointer for start of data pointing to byte number *bytes* * **+ 1**. If *bytes* is larger than the current data being * processed, then the eBPF verdict will be applied to multiple * **sendmsg**\ () or **sendfile**\ () calls until *bytes* are * consumed. * * Note that if a socket closes with the internal counter holding * a non-zero value, this is not a problem because data is not * being buffered for *bytes* and is sent as it is received. * Return * 0 * * long bpf_msg_cork_bytes(struct sk_msg_buff *msg, u32 bytes) * Description * For socket policies, prevent the execution of the verdict eBPF * program for message *msg* until *bytes* (byte number) have been * accumulated. * * This can be used when one needs a specific number of bytes * before a verdict can be assigned, even if the data spans * multiple **sendmsg**\ () or **sendfile**\ () calls. The extreme * case would be a user calling **sendmsg**\ () repeatedly with * 1-byte long message segments. Obviously, this is bad for * performance, but it is still valid. If the eBPF program needs * *bytes* bytes to validate a header, this helper can be used to * prevent the eBPF program to be called again until *bytes* have * been accumulated. * Return * 0 * * long bpf_msg_pull_data(struct sk_msg_buff *msg, u32 start, u32 end, u64 flags) * Description * For socket policies, pull in non-linear data from user space * for *msg* and set pointers *msg*\ **->data** and *msg*\ * **->data_end** to *start* and *end* bytes offsets into *msg*, * respectively. * * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a * *msg* it can only parse data that the (**data**, **data_end**) * pointers have already consumed. For **sendmsg**\ () hooks this * is likely the first scatterlist element. But for calls relying * on the **sendpage** handler (e.g. **sendfile**\ ()) this will * be the range (**0**, **0**) because the data is shared with * user space and by default the objective is to avoid allowing * user space to modify data while (or after) eBPF verdict is * being decided. This helper can be used to pull in data and to * set the start and end pointer to given values. Data will be * copied if necessary (i.e. if data was not linear and if start * and end pointers do not point to the same chunk). * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * * All values for *flags* are reserved for future usage, and must * be left at zero. * Return * 0 on success, or a negative error in case of failure. * * long bpf_bind(struct bpf_sock_addr *ctx, struct sockaddr *addr, int addr_len) * Description * Bind the socket associated to *ctx* to the address pointed by * *addr*, of length *addr_len*. This allows for making outgoing * connection from the desired IP address, which can be useful for * example when all processes inside a cgroup should use one * single IP address on a host that has multiple IP configured. * * This helper works for IPv4 and IPv6, TCP and UDP sockets. The * domain (*addr*\ **->sa_family**) must be **AF_INET** (or * **AF_INET6**). It's advised to pass zero port (**sin_port** * or **sin6_port**) which triggers IP_BIND_ADDRESS_NO_PORT-like * behavior and lets the kernel efficiently pick up an unused * port as long as 4-tuple is unique. Passing non-zero port might * lead to degraded performance. * Return * 0 on success, or a negative error in case of failure. * * long bpf_xdp_adjust_tail(struct xdp_buff *xdp_md, int delta) * Description * Adjust (move) *xdp_md*\ **->data_end** by *delta* bytes. It is * possible to both shrink and grow the packet tail. * Shrink done via *delta* being a negative integer. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_skb_get_xfrm_state(struct sk_buff *skb, u32 index, struct bpf_xfrm_state *xfrm_state, u32 size, u64 flags) * Description * Retrieve the XFRM state (IP transform framework, see also * **ip-xfrm(8)**) at *index* in XFRM "security path" for *skb*. * * The retrieved value is stored in the **struct bpf_xfrm_state** * pointed by *xfrm_state* and of length *size*. * * All values for *flags* are reserved for future usage, and must * be left at zero. * * This helper is available only if the kernel was compiled with * **CONFIG_XFRM** configuration option. * Return * 0 on success, or a negative error in case of failure. * * long bpf_get_stack(void *ctx, void *buf, u32 size, u64 flags) * Description * Return a user or a kernel stack in bpf program provided buffer. * To achieve this, the helper needs *ctx*, which is a pointer * to the context on which the tracing program is executed. * To store the stacktrace, the bpf program provides *buf* with * a nonnegative *size*. * * The last argument, *flags*, holds the number of stack frames to * skip (from 0 to 255), masked with * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set * the following flags: * * **BPF_F_USER_STACK** * Collect a user space stack instead of a kernel stack. * **BPF_F_USER_BUILD_ID** * Collect buildid+offset instead of ips for user stack, * only valid if **BPF_F_USER_STACK** is also specified. * * **bpf_get_stack**\ () can collect up to * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject * to sufficient large buffer size. Note that * this limit can be controlled with the **sysctl** program, and * that it should be manually increased in order to profile long * user stacks (such as stacks for Java programs). To do so, use: * * :: * * # sysctl kernel.perf_event_max_stack= * Return * A non-negative value equal to or less than *size* on success, * or a negative error in case of failure. * * long bpf_skb_load_bytes_relative(const void *skb, u32 offset, void *to, u32 len, u32 start_header) * Description * This helper is similar to **bpf_skb_load_bytes**\ () in that * it provides an easy way to load *len* bytes from *offset* * from the packet associated to *skb*, into the buffer pointed * by *to*. The difference to **bpf_skb_load_bytes**\ () is that * a fifth argument *start_header* exists in order to select a * base offset to start from. *start_header* can be one of: * * **BPF_HDR_START_MAC** * Base offset to load data from is *skb*'s mac header. * **BPF_HDR_START_NET** * Base offset to load data from is *skb*'s network header. * * In general, "direct packet access" is the preferred method to * access packet data, however, this helper is in particular useful * in socket filters where *skb*\ **->data** does not always point * to the start of the mac header and where "direct packet access" * is not available. * Return * 0 on success, or a negative error in case of failure. * * long bpf_fib_lookup(void *ctx, struct bpf_fib_lookup *params, int plen, u32 flags) * Description * Do FIB lookup in kernel tables using parameters in *params*. * If lookup is successful and result shows packet is to be * forwarded, the neighbor tables are searched for the nexthop. * If successful (ie., FIB lookup shows forwarding and nexthop * is resolved), the nexthop address is returned in ipv4_dst * or ipv6_dst based on family, smac is set to mac address of * egress device, dmac is set to nexthop mac address, rt_metric * is set to metric from route (IPv4/IPv6 only), and ifindex * is set to the device index of the nexthop from the FIB lookup. * * *plen* argument is the size of the passed in struct. * *flags* argument can be a combination of one or more of the * following values: * * **BPF_FIB_LOOKUP_DIRECT** * Do a direct table lookup vs full lookup using FIB * rules. * **BPF_FIB_LOOKUP_OUTPUT** * Perform lookup from an egress perspective (default is * ingress). * * *ctx* is either **struct xdp_md** for XDP programs or * **struct sk_buff** tc cls_act programs. * Return * * < 0 if any input argument is invalid * * 0 on success (packet is forwarded, nexthop neighbor exists) * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the * packet is not forwarded or needs assist from full stack * * long bpf_sock_hash_update(struct bpf_sock_ops *skops, struct bpf_map *map, void *key, u64 flags) * Description * Add an entry to, or update a sockhash *map* referencing sockets. * The *skops* is used as a new value for the entry associated to * *key*. *flags* is one of: * * **BPF_NOEXIST** * The entry for *key* must not exist in the map. * **BPF_EXIST** * The entry for *key* must already exist in the map. * **BPF_ANY** * No condition on the existence of the entry for *key*. * * If the *map* has eBPF programs (parser and verdict), those will * be inherited by the socket being added. If the socket is * already attached to eBPF programs, this results in an error. * Return * 0 on success, or a negative error in case of failure. * * long bpf_msg_redirect_hash(struct sk_msg_buff *msg, struct bpf_map *map, void *key, u64 flags) * Description * This helper is used in programs implementing policies at the * socket level. If the message *msg* is allowed to pass (i.e. if * the verdict eBPF program returns **SK_PASS**), redirect it to * the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and * egress interfaces can be used for redirection. The * **BPF_F_INGRESS** value in *flags* is used to make the * distinction (ingress path is selected if the flag is present, * egress path otherwise). This is the only flag supported for now. * Return * **SK_PASS** on success, or **SK_DROP** on error. * * long bpf_sk_redirect_hash(struct sk_buff *skb, struct bpf_map *map, void *key, u64 flags) * Description * This helper is used in programs implementing policies at the * skb socket level. If the sk_buff *skb* is allowed to pass (i.e. * if the verdict eBPF program returns **SK_PASS**), redirect it * to the socket referenced by *map* (of type * **BPF_MAP_TYPE_SOCKHASH**) using hash *key*. Both ingress and * egress interfaces can be used for redirection. The * **BPF_F_INGRESS** value in *flags* is used to make the * distinction (ingress path is selected if the flag is present, * egress otherwise). This is the only flag supported for now. * Return * **SK_PASS** on success, or **SK_DROP** on error. * * long bpf_lwt_push_encap(struct sk_buff *skb, u32 type, void *hdr, u32 len) * Description * Encapsulate the packet associated to *skb* within a Layer 3 * protocol header. This header is provided in the buffer at * address *hdr*, with *len* its size in bytes. *type* indicates * the protocol of the header and can be one of: * * **BPF_LWT_ENCAP_SEG6** * IPv6 encapsulation with Segment Routing Header * (**struct ipv6_sr_hdr**). *hdr* only contains the SRH, * the IPv6 header is computed by the kernel. * **BPF_LWT_ENCAP_SEG6_INLINE** * Only works if *skb* contains an IPv6 packet. Insert a * Segment Routing Header (**struct ipv6_sr_hdr**) inside * the IPv6 header. * **BPF_LWT_ENCAP_IP** * IP encapsulation (GRE/GUE/IPIP/etc). The outer header * must be IPv4 or IPv6, followed by zero or more * additional headers, up to **LWT_BPF_MAX_HEADROOM** * total bytes in all prepended headers. Please note that * if **skb_is_gso**\ (*skb*) is true, no more than two * headers can be prepended, and the inner header, if * present, should be either GRE or UDP/GUE. * * **BPF_LWT_ENCAP_SEG6**\ \* types can be called by BPF programs * of type **BPF_PROG_TYPE_LWT_IN**; **BPF_LWT_ENCAP_IP** type can * be called by bpf programs of types **BPF_PROG_TYPE_LWT_IN** and * **BPF_PROG_TYPE_LWT_XMIT**. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_lwt_seg6_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len) * Description * Store *len* bytes from address *from* into the packet * associated to *skb*, at *offset*. Only the flags, tag and TLVs * inside the outermost IPv6 Segment Routing Header can be * modified through this helper. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_lwt_seg6_adjust_srh(struct sk_buff *skb, u32 offset, s32 delta) * Description * Adjust the size allocated to TLVs in the outermost IPv6 * Segment Routing Header contained in the packet associated to * *skb*, at position *offset* by *delta* bytes. Only offsets * after the segments are accepted. *delta* can be as well * positive (growing) as negative (shrinking). * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_lwt_seg6_action(struct sk_buff *skb, u32 action, void *param, u32 param_len) * Description * Apply an IPv6 Segment Routing action of type *action* to the * packet associated to *skb*. Each action takes a parameter * contained at address *param*, and of length *param_len* bytes. * *action* can be one of: * * **SEG6_LOCAL_ACTION_END_X** * End.X action: Endpoint with Layer-3 cross-connect. * Type of *param*: **struct in6_addr**. * **SEG6_LOCAL_ACTION_END_T** * End.T action: Endpoint with specific IPv6 table lookup. * Type of *param*: **int**. * **SEG6_LOCAL_ACTION_END_B6** * End.B6 action: Endpoint bound to an SRv6 policy. * Type of *param*: **struct ipv6_sr_hdr**. * **SEG6_LOCAL_ACTION_END_B6_ENCAP** * End.B6.Encap action: Endpoint bound to an SRv6 * encapsulation policy. * Type of *param*: **struct ipv6_sr_hdr**. * * A call to this helper is susceptible to change the underlying * packet buffer. Therefore, at load time, all checks on pointers * previously done by the verifier are invalidated and must be * performed again, if the helper is used in combination with * direct packet access. * Return * 0 on success, or a negative error in case of failure. * * long bpf_rc_repeat(void *ctx) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded repeat key message. This delays * the generation of a key up event for previously generated * key down event. * * Some IR protocols like NEC have a special IR message for * repeating last button, for when a button is held down. * * The *ctx* should point to the lirc sample as passed into * the program. * * This helper is only available is the kernel was compiled with * the **CONFIG_BPF_LIRC_MODE2** configuration option set to * "**y**". * Return * 0 * * long bpf_rc_keydown(void *ctx, u32 protocol, u64 scancode, u32 toggle) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded key press with *scancode*, * *toggle* value in the given *protocol*. The scancode will be * translated to a keycode using the rc keymap, and reported as * an input key down event. After a period a key up event is * generated. This period can be extended by calling either * **bpf_rc_keydown**\ () again with the same values, or calling * **bpf_rc_repeat**\ (). * * Some protocols include a toggle bit, in case the button was * released and pressed again between consecutive scancodes. * * The *ctx* should point to the lirc sample as passed into * the program. * * The *protocol* is the decoded protocol number (see * **enum rc_proto** for some predefined values). * * This helper is only available is the kernel was compiled with * the **CONFIG_BPF_LIRC_MODE2** configuration option set to * "**y**". * Return * 0 * * u64 bpf_skb_cgroup_id(struct sk_buff *skb) * Description * Return the cgroup v2 id of the socket associated with the *skb*. * This is roughly similar to the **bpf_get_cgroup_classid**\ () * helper for cgroup v1 by providing a tag resp. identifier that * can be matched on or used for map lookups e.g. to implement * policy. The cgroup v2 id of a given path in the hierarchy is * exposed in user space through the f_handle API in order to get * to the same 64-bit id. * * This helper can be used on TC egress path, but not on ingress, * and is available only if the kernel was compiled with the * **CONFIG_SOCK_CGROUP_DATA** configuration option. * Return * The id is returned or 0 in case the id could not be retrieved. * * u64 bpf_get_current_cgroup_id(void) * Return * A 64-bit integer containing the current cgroup id based * on the cgroup within which the current task is running. * * void *bpf_get_local_storage(void *map, u64 flags) * Description * Get the pointer to the local storage area. * The type and the size of the local storage is defined * by the *map* argument. * The *flags* meaning is specific for each map type, * and has to be 0 for cgroup local storage. * * Depending on the BPF program type, a local storage area * can be shared between multiple instances of the BPF program, * running simultaneously. * * A user should care about the synchronization by himself. * For example, by using the **BPF_STX_XADD** instruction to alter * the shared data. * Return * A pointer to the local storage area. * * long bpf_sk_select_reuseport(struct sk_reuseport_md *reuse, struct bpf_map *map, void *key, u64 flags) * Description * Select a **SO_REUSEPORT** socket from a * **BPF_MAP_TYPE_REUSEPORT_ARRAY** *map*. * It checks the selected socket is matching the incoming * request in the socket buffer. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_skb_ancestor_cgroup_id(struct sk_buff *skb, int ancestor_level) * Description * Return id of cgroup v2 that is ancestor of cgroup associated * with the *skb* at the *ancestor_level*. The root cgroup is at * *ancestor_level* zero and each step down the hierarchy * increments the level. If *ancestor_level* == level of cgroup * associated with *skb*, then return value will be same as that * of **bpf_skb_cgroup_id**\ (). * * The helper is useful to implement policies based on cgroups * that are upper in hierarchy than immediate cgroup associated * with *skb*. * * The format of returned id and helper limitations are same as in * **bpf_skb_cgroup_id**\ (). * Return * The id is returned or 0 in case the id could not be retrieved. * * struct bpf_sock *bpf_sk_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) * Description * Look for TCP socket matching *tuple*, optionally in a child * network namespace *netns*. The return value must be checked, * and if non-**NULL**, released via **bpf_sk_release**\ (). * * The *ctx* should point to the context of the program, such as * the skb or socket (depending on the hook in use). This is used * to determine the base network namespace for the lookup. * * *tuple_size* must be one of: * * **sizeof**\ (*tuple*\ **->ipv4**) * Look for an IPv4 socket. * **sizeof**\ (*tuple*\ **->ipv6**) * Look for an IPv6 socket. * * If the *netns* is a negative signed 32-bit integer, then the * socket lookup table in the netns associated with the *ctx* * will be used. For the TC hooks, this is the netns of the device * in the skb. For socket hooks, this is the netns of the socket. * If *netns* is any other signed 32-bit value greater than or * equal to zero then it specifies the ID of the netns relative to * the netns associated with the *ctx*. *netns* values beyond the * range of 32-bit integers are reserved for future use. * * All values for *flags* are reserved for future usage, and must * be left at zero. * * This helper is available only if the kernel was compiled with * **CONFIG_NET** configuration option. * Return * Pointer to **struct bpf_sock**, or **NULL** in case of failure. * For sockets with reuseport option, the **struct bpf_sock** * result is from *reuse*\ **->socks**\ [] using the hash of the * tuple. * * struct bpf_sock *bpf_sk_lookup_udp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) * Description * Look for UDP socket matching *tuple*, optionally in a child * network namespace *netns*. The return value must be checked, * and if non-**NULL**, released via **bpf_sk_release**\ (). * * The *ctx* should point to the context of the program, such as * the skb or socket (depending on the hook in use). This is used * to determine the base network namespace for the lookup. * * *tuple_size* must be one of: * * **sizeof**\ (*tuple*\ **->ipv4**) * Look for an IPv4 socket. * **sizeof**\ (*tuple*\ **->ipv6**) * Look for an IPv6 socket. * * If the *netns* is a negative signed 32-bit integer, then the * socket lookup table in the netns associated with the *ctx* * will be used. For the TC hooks, this is the netns of the device * in the skb. For socket hooks, this is the netns of the socket. * If *netns* is any other signed 32-bit value greater than or * equal to zero then it specifies the ID of the netns relative to * the netns associated with the *ctx*. *netns* values beyond the * range of 32-bit integers are reserved for future use. * * All values for *flags* are reserved for future usage, and must * be left at zero. * * This helper is available only if the kernel was compiled with * **CONFIG_NET** configuration option. * Return * Pointer to **struct bpf_sock**, or **NULL** in case of failure. * For sockets with reuseport option, the **struct bpf_sock** * result is from *reuse*\ **->socks**\ [] using the hash of the * tuple. * * long bpf_sk_release(void *sock) * Description * Release the reference held by *sock*. *sock* must be a * non-**NULL** pointer that was returned from * **bpf_sk_lookup_xxx**\ (). * Return * 0 on success, or a negative error in case of failure. * * long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags) * Description * Push an element *value* in *map*. *flags* is one of: * * **BPF_EXIST** * If the queue/stack is full, the oldest element is * removed to make room for this. * Return * 0 on success, or a negative error in case of failure. * * long bpf_map_pop_elem(struct bpf_map *map, void *value) * Description * Pop an element from *map*. * Return * 0 on success, or a negative error in case of failure. * * long bpf_map_peek_elem(struct bpf_map *map, void *value) * Description * Get an element from *map* without removing it. * Return * 0 on success, or a negative error in case of failure. * * long bpf_msg_push_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) * Description * For socket policies, insert *len* bytes into *msg* at offset * *start*. * * If a program of type **BPF_PROG_TYPE_SK_MSG** is run on a * *msg* it may want to insert metadata or options into the *msg*. * This can later be read and used by any of the lower layer BPF * hooks. * * This helper may fail if under memory pressure (a malloc * fails) in these cases BPF programs will get an appropriate * error and BPF programs will need to handle them. * Return * 0 on success, or a negative error in case of failure. * * long bpf_msg_pop_data(struct sk_msg_buff *msg, u32 start, u32 len, u64 flags) * Description * Will remove *len* bytes from a *msg* starting at byte *start*. * This may result in **ENOMEM** errors under certain situations if * an allocation and copy are required due to a full ring buffer. * However, the helper will try to avoid doing the allocation * if possible. Other errors can occur if input parameters are * invalid either due to *start* byte not being valid part of *msg* * payload and/or *pop* value being to large. * Return * 0 on success, or a negative error in case of failure. * * long bpf_rc_pointer_rel(void *ctx, s32 rel_x, s32 rel_y) * Description * This helper is used in programs implementing IR decoding, to * report a successfully decoded pointer movement. * * The *ctx* should point to the lirc sample as passed into * the program. * * This helper is only available is the kernel was compiled with * the **CONFIG_BPF_LIRC_MODE2** configuration option set to * "**y**". * Return * 0 * * long bpf_spin_lock(struct bpf_spin_lock *lock) * Description * Acquire a spinlock represented by the pointer *lock*, which is * stored as part of a value of a map. Taking the lock allows to * safely update the rest of the fields in that value. The * spinlock can (and must) later be released with a call to * **bpf_spin_unlock**\ (\ *lock*\ ). * * Spinlocks in BPF programs come with a number of restrictions * and constraints: * * * **bpf_spin_lock** objects are only allowed inside maps of * types **BPF_MAP_TYPE_HASH** and **BPF_MAP_TYPE_ARRAY** (this * list could be extended in the future). * * BTF description of the map is mandatory. * * The BPF program can take ONE lock at a time, since taking two * or more could cause dead locks. * * Only one **struct bpf_spin_lock** is allowed per map element. * * When the lock is taken, calls (either BPF to BPF or helpers) * are not allowed. * * The **BPF_LD_ABS** and **BPF_LD_IND** instructions are not * allowed inside a spinlock-ed region. * * The BPF program MUST call **bpf_spin_unlock**\ () to release * the lock, on all execution paths, before it returns. * * The BPF program can access **struct bpf_spin_lock** only via * the **bpf_spin_lock**\ () and **bpf_spin_unlock**\ () * helpers. Loading or storing data into the **struct * bpf_spin_lock** *lock*\ **;** field of a map is not allowed. * * To use the **bpf_spin_lock**\ () helper, the BTF description * of the map value must be a struct and have **struct * bpf_spin_lock** *anyname*\ **;** field at the top level. * Nested lock inside another struct is not allowed. * * The **struct bpf_spin_lock** *lock* field in a map value must * be aligned on a multiple of 4 bytes in that value. * * Syscall with command **BPF_MAP_LOOKUP_ELEM** does not copy * the **bpf_spin_lock** field to user space. * * Syscall with command **BPF_MAP_UPDATE_ELEM**, or update from * a BPF program, do not update the **bpf_spin_lock** field. * * **bpf_spin_lock** cannot be on the stack or inside a * networking packet (it can only be inside of a map values). * * **bpf_spin_lock** is available to root only. * * Tracing programs and socket filter programs cannot use * **bpf_spin_lock**\ () due to insufficient preemption checks * (but this may change in the future). * * **bpf_spin_lock** is not allowed in inner maps of map-in-map. * Return * 0 * * long bpf_spin_unlock(struct bpf_spin_lock *lock) * Description * Release the *lock* previously locked by a call to * **bpf_spin_lock**\ (\ *lock*\ ). * Return * 0 * * struct bpf_sock *bpf_sk_fullsock(struct bpf_sock *sk) * Description * This helper gets a **struct bpf_sock** pointer such * that all the fields in this **bpf_sock** can be accessed. * Return * A **struct bpf_sock** pointer on success, or **NULL** in * case of failure. * * struct bpf_tcp_sock *bpf_tcp_sock(struct bpf_sock *sk) * Description * This helper gets a **struct bpf_tcp_sock** pointer from a * **struct bpf_sock** pointer. * Return * A **struct bpf_tcp_sock** pointer on success, or **NULL** in * case of failure. * * long bpf_skb_ecn_set_ce(struct sk_buff *skb) * Description * Set ECN (Explicit Congestion Notification) field of IP header * to **CE** (Congestion Encountered) if current value is **ECT** * (ECN Capable Transport). Otherwise, do nothing. Works with IPv6 * and IPv4. * Return * 1 if the **CE** flag is set (either by the current helper call * or because it was already present), 0 if it is not set. * * struct bpf_sock *bpf_get_listener_sock(struct bpf_sock *sk) * Description * Return a **struct bpf_sock** pointer in **TCP_LISTEN** state. * **bpf_sk_release**\ () is unnecessary and not allowed. * Return * A **struct bpf_sock** pointer on success, or **NULL** in * case of failure. * * struct bpf_sock *bpf_skc_lookup_tcp(void *ctx, struct bpf_sock_tuple *tuple, u32 tuple_size, u64 netns, u64 flags) * Description * Look for TCP socket matching *tuple*, optionally in a child * network namespace *netns*. The return value must be checked, * and if non-**NULL**, released via **bpf_sk_release**\ (). * * This function is identical to **bpf_sk_lookup_tcp**\ (), except * that it also returns timewait or request sockets. Use * **bpf_sk_fullsock**\ () or **bpf_tcp_sock**\ () to access the * full structure. * * This helper is available only if the kernel was compiled with * **CONFIG_NET** configuration option. * Return * Pointer to **struct bpf_sock**, or **NULL** in case of failure. * For sockets with reuseport option, the **struct bpf_sock** * result is from *reuse*\ **->socks**\ [] using the hash of the * tuple. * * long bpf_tcp_check_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) * Description * Check whether *iph* and *th* contain a valid SYN cookie ACK for * the listening socket in *sk*. * * *iph* points to the start of the IPv4 or IPv6 header, while * *iph_len* contains **sizeof**\ (**struct iphdr**) or * **sizeof**\ (**struct ip6hdr**). * * *th* points to the start of the TCP header, while *th_len* * contains **sizeof**\ (**struct tcphdr**). * Return * 0 if *iph* and *th* are a valid SYN cookie ACK, or a negative * error otherwise. * * long bpf_sysctl_get_name(struct bpf_sysctl *ctx, char *buf, size_t buf_len, u64 flags) * Description * Get name of sysctl in /proc/sys/ and copy it into provided by * program buffer *buf* of size *buf_len*. * * The buffer is always NUL terminated, unless it's zero-sized. * * If *flags* is zero, full name (e.g. "net/ipv4/tcp_mem") is * copied. Use **BPF_F_SYSCTL_BASE_NAME** flag to copy base name * only (e.g. "tcp_mem"). * Return * Number of character copied (not including the trailing NUL). * * **-E2BIG** if the buffer wasn't big enough (*buf* will contain * truncated name in this case). * * long bpf_sysctl_get_current_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) * Description * Get current value of sysctl as it is presented in /proc/sys * (incl. newline, etc), and copy it as a string into provided * by program buffer *buf* of size *buf_len*. * * The whole value is copied, no matter what file position user * space issued e.g. sys_read at. * * The buffer is always NUL terminated, unless it's zero-sized. * Return * Number of character copied (not including the trailing NUL). * * **-E2BIG** if the buffer wasn't big enough (*buf* will contain * truncated name in this case). * * **-EINVAL** if current value was unavailable, e.g. because * sysctl is uninitialized and read returns -EIO for it. * * long bpf_sysctl_get_new_value(struct bpf_sysctl *ctx, char *buf, size_t buf_len) * Description * Get new value being written by user space to sysctl (before * the actual write happens) and copy it as a string into * provided by program buffer *buf* of size *buf_len*. * * User space may write new value at file position > 0. * * The buffer is always NUL terminated, unless it's zero-sized. * Return * Number of character copied (not including the trailing NUL). * * **-E2BIG** if the buffer wasn't big enough (*buf* will contain * truncated name in this case). * * **-EINVAL** if sysctl is being read. * * long bpf_sysctl_set_new_value(struct bpf_sysctl *ctx, const char *buf, size_t buf_len) * Description * Override new value being written by user space to sysctl with * value provided by program in buffer *buf* of size *buf_len*. * * *buf* should contain a string in same form as provided by user * space on sysctl write. * * User space may write new value at file position > 0. To override * the whole sysctl value file position should be set to zero. * Return * 0 on success. * * **-E2BIG** if the *buf_len* is too big. * * **-EINVAL** if sysctl is being read. * * long bpf_strtol(const char *buf, size_t buf_len, u64 flags, long *res) * Description * Convert the initial part of the string from buffer *buf* of * size *buf_len* to a long integer according to the given base * and save the result in *res*. * * The string may begin with an arbitrary amount of white space * (as determined by **isspace**\ (3)) followed by a single * optional '**-**' sign. * * Five least significant bits of *flags* encode base, other bits * are currently unused. * * Base must be either 8, 10, 16 or 0 to detect it automatically * similar to user space **strtol**\ (3). * Return * Number of characters consumed on success. Must be positive but * no more than *buf_len*. * * **-EINVAL** if no valid digits were found or unsupported base * was provided. * * **-ERANGE** if resulting value was out of range. * * long bpf_strtoul(const char *buf, size_t buf_len, u64 flags, unsigned long *res) * Description * Convert the initial part of the string from buffer *buf* of * size *buf_len* to an unsigned long integer according to the * given base and save the result in *res*. * * The string may begin with an arbitrary amount of white space * (as determined by **isspace**\ (3)). * * Five least significant bits of *flags* encode base, other bits * are currently unused. * * Base must be either 8, 10, 16 or 0 to detect it automatically * similar to user space **strtoul**\ (3). * Return * Number of characters consumed on success. Must be positive but * no more than *buf_len*. * * **-EINVAL** if no valid digits were found or unsupported base * was provided. * * **-ERANGE** if resulting value was out of range. * * void *bpf_sk_storage_get(struct bpf_map *map, void *sk, void *value, u64 flags) * Description * Get a bpf-local-storage from a *sk*. * * Logically, it could be thought of getting the value from * a *map* with *sk* as the **key**. From this * perspective, the usage is not much different from * **bpf_map_lookup_elem**\ (*map*, **&**\ *sk*) except this * helper enforces the key must be a full socket and the map must * be a **BPF_MAP_TYPE_SK_STORAGE** also. * * Underneath, the value is stored locally at *sk* instead of * the *map*. The *map* is used as the bpf-local-storage * "type". The bpf-local-storage "type" (i.e. the *map*) is * searched against all bpf-local-storages residing at *sk*. * * *sk* is a kernel **struct sock** pointer for LSM program. * *sk* is a **struct bpf_sock** pointer for other program types. * * An optional *flags* (**BPF_SK_STORAGE_GET_F_CREATE**) can be * used such that a new bpf-local-storage will be * created if one does not exist. *value* can be used * together with **BPF_SK_STORAGE_GET_F_CREATE** to specify * the initial value of a bpf-local-storage. If *value* is * **NULL**, the new bpf-local-storage will be zero initialized. * Return * A bpf-local-storage pointer is returned on success. * * **NULL** if not found or there was an error in adding * a new bpf-local-storage. * * long bpf_sk_storage_delete(struct bpf_map *map, void *sk) * Description * Delete a bpf-local-storage from a *sk*. * Return * 0 on success. * * **-ENOENT** if the bpf-local-storage cannot be found. * **-EINVAL** if sk is not a fullsock (e.g. a request_sock). * * long bpf_send_signal(u32 sig) * Description * Send signal *sig* to the process of the current task. * The signal may be delivered to any of this process's threads. * Return * 0 on success or successfully queued. * * **-EBUSY** if work queue under nmi is full. * * **-EINVAL** if *sig* is invalid. * * **-EPERM** if no permission to send the *sig*. * * **-EAGAIN** if bpf program can try again. * * s64 bpf_tcp_gen_syncookie(void *sk, void *iph, u32 iph_len, struct tcphdr *th, u32 th_len) * Description * Try to issue a SYN cookie for the packet with corresponding * IP/TCP headers, *iph* and *th*, on the listening socket in *sk*. * * *iph* points to the start of the IPv4 or IPv6 header, while * *iph_len* contains **sizeof**\ (**struct iphdr**) or * **sizeof**\ (**struct ip6hdr**). * * *th* points to the start of the TCP header, while *th_len* * contains the length of the TCP header. * Return * On success, lower 32 bits hold the generated SYN cookie in * followed by 16 bits which hold the MSS value for that cookie, * and the top 16 bits are unused. * * On failure, the returned value is one of the following: * * **-EINVAL** SYN cookie cannot be issued due to error * * **-ENOENT** SYN cookie should not be issued (no SYN flood) * * **-EOPNOTSUPP** kernel configuration does not enable SYN cookies * * **-EPROTONOSUPPORT** IP packet version is not 4 or 6 * * long bpf_skb_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf * event must have the following attributes: **PERF_SAMPLE_RAW** * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. * * The *flags* are used to indicate the index in *map* for which * the value must be put, masked with **BPF_F_INDEX_MASK**. * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** * to indicate that the index of the current CPU core should be * used. * * The value to write, of *size*, is passed through eBPF stack and * pointed by *data*. * * *ctx* is a pointer to in-kernel struct sk_buff. * * This helper is similar to **bpf_perf_event_output**\ () but * restricted to raw_tracepoint bpf programs. * Return * 0 on success, or a negative error in case of failure. * * long bpf_probe_read_user(void *dst, u32 size, const void *unsafe_ptr) * Description * Safely attempt to read *size* bytes from user space address * *unsafe_ptr* and store the data in *dst*. * Return * 0 on success, or a negative error in case of failure. * * long bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr) * Description * Safely attempt to read *size* bytes from kernel space address * *unsafe_ptr* and store the data in *dst*. * Return * 0 on success, or a negative error in case of failure. * * long bpf_probe_read_user_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe user address * *unsafe_ptr* to *dst*. The *size* should include the * terminating NUL byte. In case the string length is smaller than * *size*, the target is not padded with further NUL bytes. If the * string length is larger than *size*, just *size*-1 bytes are * copied and the last byte is set to NUL. * * On success, the length of the copied string is returned. This * makes this helper useful in tracing programs for reading * strings, and more importantly to get its length at runtime. See * the following snippet: * * :: * * SEC("kprobe/sys_open") * void bpf_sys_open(struct pt_regs *ctx) * { * char buf[PATHLEN]; // PATHLEN is defined to 256 * int res = bpf_probe_read_user_str(buf, sizeof(buf), * ctx->di); * * // Consume buf, for example push it to * // userspace via bpf_perf_event_output(); we * // can use res (the string length) as event * // size, after checking its boundaries. * } * * In comparison, using **bpf_probe_read_user**\ () helper here * instead to read the string would require to estimate the length * at compile time, and would often result in copying more memory * than necessary. * * Another useful use case is when parsing individual process * arguments or individual environment variables navigating * *current*\ **->mm->arg_start** and *current*\ * **->mm->env_start**: using this helper and the return value, * one can quickly iterate at the right offset of the memory area. * Return * On success, the strictly positive length of the string, * including the trailing NUL character. On error, a negative * value. * * long bpf_probe_read_kernel_str(void *dst, u32 size, const void *unsafe_ptr) * Description * Copy a NUL terminated string from an unsafe kernel address *unsafe_ptr* * to *dst*. Same semantics as with **bpf_probe_read_user_str**\ () apply. * Return * On success, the strictly positive length of the string, including * the trailing NUL character. On error, a negative value. * * long bpf_tcp_send_ack(void *tp, u32 rcv_nxt) * Description * Send out a tcp-ack. *tp* is the in-kernel struct **tcp_sock**. * *rcv_nxt* is the ack_seq to be sent out. * Return * 0 on success, or a negative error in case of failure. * * long bpf_send_signal_thread(u32 sig) * Description * Send signal *sig* to the thread corresponding to the current task. * Return * 0 on success or successfully queued. * * **-EBUSY** if work queue under nmi is full. * * **-EINVAL** if *sig* is invalid. * * **-EPERM** if no permission to send the *sig*. * * **-EAGAIN** if bpf program can try again. * * u64 bpf_jiffies64(void) * Description * Obtain the 64bit jiffies * Return * The 64 bit jiffies * * long bpf_read_branch_records(struct bpf_perf_event_data *ctx, void *buf, u32 size, u64 flags) * Description * For an eBPF program attached to a perf event, retrieve the * branch records (**struct perf_branch_entry**) associated to *ctx* * and store it in the buffer pointed by *buf* up to size * *size* bytes. * Return * On success, number of bytes written to *buf*. On error, a * negative value. * * The *flags* can be set to **BPF_F_GET_BRANCH_RECORDS_SIZE** to * instead return the number of bytes required to store all the * branch entries. If this flag is set, *buf* may be NULL. * * **-EINVAL** if arguments invalid or **size** not a multiple * of **sizeof**\ (**struct perf_branch_entry**\ ). * * **-ENOENT** if architecture does not support branch records. * * long bpf_get_ns_current_pid_tgid(u64 dev, u64 ino, struct bpf_pidns_info *nsdata, u32 size) * Description * Returns 0 on success, values for *pid* and *tgid* as seen from the current * *namespace* will be returned in *nsdata*. * Return * 0 on success, or one of the following in case of failure: * * **-EINVAL** if dev and inum supplied don't match dev_t and inode number * with nsfs of current task, or if dev conversion to dev_t lost high bits. * * **-ENOENT** if pidns does not exists for the current task. * * long bpf_xdp_output(void *ctx, struct bpf_map *map, u64 flags, void *data, u64 size) * Description * Write raw *data* blob into a special BPF perf event held by * *map* of type **BPF_MAP_TYPE_PERF_EVENT_ARRAY**. This perf * event must have the following attributes: **PERF_SAMPLE_RAW** * as **sample_type**, **PERF_TYPE_SOFTWARE** as **type**, and * **PERF_COUNT_SW_BPF_OUTPUT** as **config**. * * The *flags* are used to indicate the index in *map* for which * the value must be put, masked with **BPF_F_INDEX_MASK**. * Alternatively, *flags* can be set to **BPF_F_CURRENT_CPU** * to indicate that the index of the current CPU core should be * used. * * The value to write, of *size*, is passed through eBPF stack and * pointed by *data*. * * *ctx* is a pointer to in-kernel struct xdp_buff. * * This helper is similar to **bpf_perf_eventoutput**\ () but * restricted to raw_tracepoint bpf programs. * Return * 0 on success, or a negative error in case of failure. * * u64 bpf_get_netns_cookie(void *ctx) * Description * Retrieve the cookie (generated by the kernel) of the network * namespace the input *ctx* is associated with. The network * namespace cookie remains stable for its lifetime and provides * a global identifier that can be assumed unique. If *ctx* is * NULL, then the helper returns the cookie for the initial * network namespace. The cookie itself is very similar to that * of **bpf_get_socket_cookie**\ () helper, but for network * namespaces instead of sockets. * Return * A 8-byte long opaque number. * * u64 bpf_get_current_ancestor_cgroup_id(int ancestor_level) * Description * Return id of cgroup v2 that is ancestor of the cgroup associated * with the current task at the *ancestor_level*. The root cgroup * is at *ancestor_level* zero and each step down the hierarchy * increments the level. If *ancestor_level* == level of cgroup * associated with the current task, then return value will be the * same as that of **bpf_get_current_cgroup_id**\ (). * * The helper is useful to implement policies based on cgroups * that are upper in hierarchy than immediate cgroup associated * with the current task. * * The format of returned id and helper limitations are same as in * **bpf_get_current_cgroup_id**\ (). * Return * The id is returned or 0 in case the id could not be retrieved. * * long bpf_sk_assign(struct sk_buff *skb, void *sk, u64 flags) * Description * Helper is overloaded depending on BPF program type. This * description applies to **BPF_PROG_TYPE_SCHED_CLS** and * **BPF_PROG_TYPE_SCHED_ACT** programs. * * Assign the *sk* to the *skb*. When combined with appropriate * routing configuration to receive the packet towards the socket, * will cause *skb* to be delivered to the specified socket. * Subsequent redirection of *skb* via **bpf_redirect**\ (), * **bpf_clone_redirect**\ () or other methods outside of BPF may * interfere with successful delivery to the socket. * * This operation is only valid from TC ingress path. * * The *flags* argument must be zero. * Return * 0 on success, or a negative error in case of failure: * * **-EINVAL** if specified *flags* are not supported. * * **-ENOENT** if the socket is unavailable for assignment. * * **-ENETUNREACH** if the socket is unreachable (wrong netns). * * **-EOPNOTSUPP** if the operation is not supported, for example * a call from outside of TC ingress. * * **-ESOCKTNOSUPPORT** if the socket type is not supported * (reuseport). * * long bpf_sk_assign(struct bpf_sk_lookup *ctx, struct bpf_sock *sk, u64 flags) * Description * Helper is overloaded depending on BPF program type. This * description applies to **BPF_PROG_TYPE_SK_LOOKUP** programs. * * Select the *sk* as a result of a socket lookup. * * For the operation to succeed passed socket must be compatible * with the packet description provided by the *ctx* object. * * L4 protocol (**IPPROTO_TCP** or **IPPROTO_UDP**) must * be an exact match. While IP family (**AF_INET** or * **AF_INET6**) must be compatible, that is IPv6 sockets * that are not v6-only can be selected for IPv4 packets. * * Only TCP listeners and UDP unconnected sockets can be * selected. *sk* can also be NULL to reset any previous * selection. * * *flags* argument can combination of following values: * * * **BPF_SK_LOOKUP_F_REPLACE** to override the previous * socket selection, potentially done by a BPF program * that ran before us. * * * **BPF_SK_LOOKUP_F_NO_REUSEPORT** to skip * load-balancing within reuseport group for the socket * being selected. * * On success *ctx->sk* will point to the selected socket. * * Return * 0 on success, or a negative errno in case of failure. * * * **-EAFNOSUPPORT** if socket family (*sk->family*) is * not compatible with packet family (*ctx->family*). * * * **-EEXIST** if socket has been already selected, * potentially by another program, and * **BPF_SK_LOOKUP_F_REPLACE** flag was not specified. * * * **-EINVAL** if unsupported flags were specified. * * * **-EPROTOTYPE** if socket L4 protocol * (*sk->protocol*) doesn't match packet protocol * (*ctx->protocol*). * * * **-ESOCKTNOSUPPORT** if socket is not in allowed * state (TCP listening or UDP unconnected). * * u64 bpf_ktime_get_boot_ns(void) * Description * Return the time elapsed since system boot, in nanoseconds. * Does include the time the system was suspended. * See: **clock_gettime**\ (**CLOCK_BOOTTIME**) * Return * Current *ktime*. * * long bpf_seq_printf(struct seq_file *m, const char *fmt, u32 fmt_size, const void *data, u32 data_len) * Description * **bpf_seq_printf**\ () uses seq_file **seq_printf**\ () to print * out the format string. * The *m* represents the seq_file. The *fmt* and *fmt_size* are for * the format string itself. The *data* and *data_len* are format string * arguments. The *data* are a **u64** array and corresponding format string * values are stored in the array. For strings and pointers where pointees * are accessed, only the pointer values are stored in the *data* array. * The *data_len* is the size of *data* in bytes. * * Formats **%s**, **%p{i,I}{4,6}** requires to read kernel memory. * Reading kernel memory may fail due to either invalid address or * valid address but requiring a major memory fault. If reading kernel memory * fails, the string for **%s** will be an empty string, and the ip * address for **%p{i,I}{4,6}** will be 0. Not returning error to * bpf program is consistent with what **bpf_trace_printk**\ () does for now. * Return * 0 on success, or a negative error in case of failure: * * **-EBUSY** if per-CPU memory copy buffer is busy, can try again * by returning 1 from bpf program. * * **-EINVAL** if arguments are invalid, or if *fmt* is invalid/unsupported. * * **-E2BIG** if *fmt* contains too many format specifiers. * * **-EOVERFLOW** if an overflow happened: The same object will be tried again. * * long bpf_seq_write(struct seq_file *m, const void *data, u32 len) * Description * **bpf_seq_write**\ () uses seq_file **seq_write**\ () to write the data. * The *m* represents the seq_file. The *data* and *len* represent the * data to write in bytes. * Return * 0 on success, or a negative error in case of failure: * * **-EOVERFLOW** if an overflow happened: The same object will be tried again. * * u64 bpf_sk_cgroup_id(void *sk) * Description * Return the cgroup v2 id of the socket *sk*. * * *sk* must be a non-**NULL** pointer to a socket, e.g. one * returned from **bpf_sk_lookup_xxx**\ (), * **bpf_sk_fullsock**\ (), etc. The format of returned id is * same as in **bpf_skb_cgroup_id**\ (). * * This helper is available only if the kernel was compiled with * the **CONFIG_SOCK_CGROUP_DATA** configuration option. * Return * The id is returned or 0 in case the id could not be retrieved. * * u64 bpf_sk_ancestor_cgroup_id(void *sk, int ancestor_level) * Description * Return id of cgroup v2 that is ancestor of cgroup associated * with the *sk* at the *ancestor_level*. The root cgroup is at * *ancestor_level* zero and each step down the hierarchy * increments the level. If *ancestor_level* == level of cgroup * associated with *sk*, then return value will be same as that * of **bpf_sk_cgroup_id**\ (). * * The helper is useful to implement policies based on cgroups * that are upper in hierarchy than immediate cgroup associated * with *sk*. * * The format of returned id and helper limitations are same as in * **bpf_sk_cgroup_id**\ (). * Return * The id is returned or 0 in case the id could not be retrieved. * * long bpf_ringbuf_output(void *ringbuf, void *data, u64 size, u64 flags) * Description * Copy *size* bytes from *data* into a ring buffer *ringbuf*. * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. * Return * 0 on success, or a negative error in case of failure. * * void *bpf_ringbuf_reserve(void *ringbuf, u64 size, u64 flags) * Description * Reserve *size* bytes of payload in a ring buffer *ringbuf*. * Return * Valid pointer with *size* bytes of memory available; NULL, * otherwise. * * void bpf_ringbuf_submit(void *data, u64 flags) * Description * Submit reserved ring buffer sample, pointed to by *data*. * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. * Return * Nothing. Always succeeds. * * void bpf_ringbuf_discard(void *data, u64 flags) * Description * Discard reserved ring buffer sample, pointed to by *data*. * If **BPF_RB_NO_WAKEUP** is specified in *flags*, no notification * of new data availability is sent. * If **BPF_RB_FORCE_WAKEUP** is specified in *flags*, notification * of new data availability is sent unconditionally. * Return * Nothing. Always succeeds. * * u64 bpf_ringbuf_query(void *ringbuf, u64 flags) * Description * Query various characteristics of provided ring buffer. What * exactly is queries is determined by *flags*: * * * **BPF_RB_AVAIL_DATA**: Amount of data not yet consumed. * * **BPF_RB_RING_SIZE**: The size of ring buffer. * * **BPF_RB_CONS_POS**: Consumer position (can wrap around). * * **BPF_RB_PROD_POS**: Producer(s) position (can wrap around). * * Data returned is just a momentary snapshot of actual values * and could be inaccurate, so this facility should be used to * power heuristics and for reporting, not to make 100% correct * calculation. * Return * Requested value, or 0, if *flags* are not recognized. * * long bpf_csum_level(struct sk_buff *skb, u64 level) * Description * Change the skbs checksum level by one layer up or down, or * reset it entirely to none in order to have the stack perform * checksum validation. The level is applicable to the following * protocols: TCP, UDP, GRE, SCTP, FCOE. For example, a decap of * | ETH | IP | UDP | GUE | IP | TCP | into | ETH | IP | TCP | * through **bpf_skb_adjust_room**\ () helper with passing in * **BPF_F_ADJ_ROOM_NO_CSUM_RESET** flag would require one call * to **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_DEC** since * the UDP header is removed. Similarly, an encap of the latter * into the former could be accompanied by a helper call to * **bpf_csum_level**\ () with **BPF_CSUM_LEVEL_INC** if the * skb is still intended to be processed in higher layers of the * stack instead of just egressing at tc. * * There are three supported level settings at this time: * * * **BPF_CSUM_LEVEL_INC**: Increases skb->csum_level for skbs * with CHECKSUM_UNNECESSARY. * * **BPF_CSUM_LEVEL_DEC**: Decreases skb->csum_level for skbs * with CHECKSUM_UNNECESSARY. * * **BPF_CSUM_LEVEL_RESET**: Resets skb->csum_level to 0 and * sets CHECKSUM_NONE to force checksum validation by the stack. * * **BPF_CSUM_LEVEL_QUERY**: No-op, returns the current * skb->csum_level. * Return * 0 on success, or a negative error in case of failure. In the * case of **BPF_CSUM_LEVEL_QUERY**, the current skb->csum_level * is returned or the error code -EACCES in case the skb is not * subject to CHECKSUM_UNNECESSARY. * * struct tcp6_sock *bpf_skc_to_tcp6_sock(void *sk) * Description * Dynamically cast a *sk* pointer to a *tcp6_sock* pointer. * Return * *sk* if casting is valid, or **NULL** otherwise. * * struct tcp_sock *bpf_skc_to_tcp_sock(void *sk) * Description * Dynamically cast a *sk* pointer to a *tcp_sock* pointer. * Return * *sk* if casting is valid, or **NULL** otherwise. * * struct tcp_timewait_sock *bpf_skc_to_tcp_timewait_sock(void *sk) * Description * Dynamically cast a *sk* pointer to a *tcp_timewait_sock* pointer. * Return * *sk* if casting is valid, or **NULL** otherwise. * * struct tcp_request_sock *bpf_skc_to_tcp_request_sock(void *sk) * Description * Dynamically cast a *sk* pointer to a *tcp_request_sock* pointer. * Return * *sk* if casting is valid, or **NULL** otherwise. * * struct udp6_sock *bpf_skc_to_udp6_sock(void *sk) * Description * Dynamically cast a *sk* pointer to a *udp6_sock* pointer. * Return * *sk* if casting is valid, or **NULL** otherwise. * * long bpf_get_task_stack(struct task_struct *task, void *buf, u32 size, u64 flags) * Description * Return a user or a kernel stack in bpf program provided buffer. * To achieve this, the helper needs *task*, which is a valid * pointer to **struct task_struct**. To store the stacktrace, the * bpf program provides *buf* with a nonnegative *size*. * * The last argument, *flags*, holds the number of stack frames to * skip (from 0 to 255), masked with * **BPF_F_SKIP_FIELD_MASK**. The next bits can be used to set * the following flags: * * **BPF_F_USER_STACK** * Collect a user space stack instead of a kernel stack. * **BPF_F_USER_BUILD_ID** * Collect buildid+offset instead of ips for user stack, * only valid if **BPF_F_USER_STACK** is also specified. * * **bpf_get_task_stack**\ () can collect up to * **PERF_MAX_STACK_DEPTH** both kernel and user frames, subject * to sufficient large buffer size. Note that * this limit can be controlled with the **sysctl** program, and * that it should be manually increased in order to profile long * user stacks (such as stacks for Java programs). To do so, use: * * :: * * # sysctl kernel.perf_event_max_stack= * Return * A non-negative value equal to or less than *size* on success, * or a negative error in case of failure. * * long bpf_load_hdr_opt(struct bpf_sock_ops *skops, void *searchby_res, u32 len, u64 flags) * Description * Load header option. Support reading a particular TCP header * option for bpf program (**BPF_PROG_TYPE_SOCK_OPS**). * * If *flags* is 0, it will search the option from the * *skops*\ **->skb_data**. The comment in **struct bpf_sock_ops** * has details on what skb_data contains under different * *skops*\ **->op**. * * The first byte of the *searchby_res* specifies the * kind that it wants to search. * * If the searching kind is an experimental kind * (i.e. 253 or 254 according to RFC6994). It also * needs to specify the "magic" which is either * 2 bytes or 4 bytes. It then also needs to * specify the size of the magic by using * the 2nd byte which is "kind-length" of a TCP * header option and the "kind-length" also * includes the first 2 bytes "kind" and "kind-length" * itself as a normal TCP header option also does. * * For example, to search experimental kind 254 with * 2 byte magic 0xeB9F, the searchby_res should be * [ 254, 4, 0xeB, 0x9F, 0, 0, .... 0 ]. * * To search for the standard window scale option (3), * the *searchby_res* should be [ 3, 0, 0, .... 0 ]. * Note, kind-length must be 0 for regular option. * * Searching for No-Op (0) and End-of-Option-List (1) are * not supported. * * *len* must be at least 2 bytes which is the minimal size * of a header option. * * Supported flags: * * * **BPF_LOAD_HDR_OPT_TCP_SYN** to search from the * saved_syn packet or the just-received syn packet. * * Return * > 0 when found, the header option is copied to *searchby_res*. * The return value is the total length copied. On failure, a * negative error code is returned: * * **-EINVAL** if a parameter is invalid. * * **-ENOMSG** if the option is not found. * * **-ENOENT** if no syn packet is available when * **BPF_LOAD_HDR_OPT_TCP_SYN** is used. * * **-ENOSPC** if there is not enough space. Only *len* number of * bytes are copied. * * **-EFAULT** on failure to parse the header options in the * packet. * * **-EPERM** if the helper cannot be used under the current * *skops*\ **->op**. * * long bpf_store_hdr_opt(struct bpf_sock_ops *skops, const void *from, u32 len, u64 flags) * Description * Store header option. The data will be copied * from buffer *from* with length *len* to the TCP header. * * The buffer *from* should have the whole option that * includes the kind, kind-length, and the actual * option data. The *len* must be at least kind-length * long. The kind-length does not have to be 4 byte * aligned. The kernel will take care of the padding * and setting the 4 bytes aligned value to th->doff. * * This helper will check for duplicated option * by searching the same option in the outgoing skb. * * This helper can only be called during * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. * * Return * 0 on success, or negative error in case of failure: * * **-EINVAL** If param is invalid. * * **-ENOSPC** if there is not enough space in the header. * Nothing has been written * * **-EEXIST** if the option already exists. * * **-EFAULT** on failrue to parse the existing header options. * * **-EPERM** if the helper cannot be used under the current * *skops*\ **->op**. * * long bpf_reserve_hdr_opt(struct bpf_sock_ops *skops, u32 len, u64 flags) * Description * Reserve *len* bytes for the bpf header option. The * space will be used by **bpf_store_hdr_opt**\ () later in * **BPF_SOCK_OPS_WRITE_HDR_OPT_CB**. * * If **bpf_reserve_hdr_opt**\ () is called multiple times, * the total number of bytes will be reserved. * * This helper can only be called during * **BPF_SOCK_OPS_HDR_OPT_LEN_CB**. * * Return * 0 on success, or negative error in case of failure: * * **-EINVAL** if a parameter is invalid. * * **-ENOSPC** if there is not enough space in the header. * * **-EPERM** if the helper cannot be used under the current * *skops*\ **->op**. * * void *bpf_inode_storage_get(struct bpf_map *map, void *inode, void *value, u64 flags) * Description * Get a bpf_local_storage from an *inode*. * * Logically, it could be thought of as getting the value from * a *map* with *inode* as the **key**. From this * perspective, the usage is not much different from * **bpf_map_lookup_elem**\ (*map*, **&**\ *inode*) except this * helper enforces the key must be an inode and the map must also * be a **BPF_MAP_TYPE_INODE_STORAGE**. * * Underneath, the value is stored locally at *inode* instead of * the *map*. The *map* is used as the bpf-local-storage * "type". The bpf-local-storage "type" (i.e. the *map*) is * searched against all bpf_local_storage residing at *inode*. * * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be * used such that a new bpf_local_storage will be * created if one does not exist. *value* can be used * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify * the initial value of a bpf_local_storage. If *value* is * **NULL**, the new bpf_local_storage will be zero initialized. * Return * A bpf_local_storage pointer is returned on success. * * **NULL** if not found or there was an error in adding * a new bpf_local_storage. * * int bpf_inode_storage_delete(struct bpf_map *map, void *inode) * Description * Delete a bpf_local_storage from an *inode*. * Return * 0 on success. * * **-ENOENT** if the bpf_local_storage cannot be found. * * long bpf_d_path(struct path *path, char *buf, u32 sz) * Description * Return full path for given **struct path** object, which * needs to be the kernel BTF *path* object. The path is * returned in the provided buffer *buf* of size *sz* and * is zero terminated. * * Return * On success, the strictly positive length of the string, * including the trailing NUL character. On error, a negative * value. * * long bpf_copy_from_user(void *dst, u32 size, const void *user_ptr) * Description * Read *size* bytes from user space address *user_ptr* and store * the data in *dst*. This is a wrapper of **copy_from_user**\ (). * Return * 0 on success, or a negative error in case of failure. * * long bpf_snprintf_btf(char *str, u32 str_size, struct btf_ptr *ptr, u32 btf_ptr_size, u64 flags) * Description * Use BTF to store a string representation of *ptr*->ptr in *str*, * using *ptr*->type_id. This value should specify the type * that *ptr*->ptr points to. LLVM __builtin_btf_type_id(type, 1) * can be used to look up vmlinux BTF type ids. Traversing the * data structure using BTF, the type information and values are * stored in the first *str_size* - 1 bytes of *str*. Safe copy of * the pointer data is carried out to avoid kernel crashes during * operation. Smaller types can use string space on the stack; * larger programs can use map data to store the string * representation. * * The string can be subsequently shared with userspace via * bpf_perf_event_output() or ring buffer interfaces. * bpf_trace_printk() is to be avoided as it places too small * a limit on string size to be useful. * * *flags* is a combination of * * **BTF_F_COMPACT** * no formatting around type information * **BTF_F_NONAME** * no struct/union member names/types * **BTF_F_PTR_RAW** * show raw (unobfuscated) pointer values; * equivalent to printk specifier %px. * **BTF_F_ZERO** * show zero-valued struct/union members; they * are not displayed by default * * Return * The number of bytes that were written (or would have been * written if output had to be truncated due to string size), * or a negative error in cases of failure. * * long bpf_seq_printf_btf(struct seq_file *m, struct btf_ptr *ptr, u32 ptr_size, u64 flags) * Description * Use BTF to write to seq_write a string representation of * *ptr*->ptr, using *ptr*->type_id as per bpf_snprintf_btf(). * *flags* are identical to those used for bpf_snprintf_btf. * Return * 0 on success or a negative error in case of failure. * * u64 bpf_skb_cgroup_classid(struct sk_buff *skb) * Description * See **bpf_get_cgroup_classid**\ () for the main description. * This helper differs from **bpf_get_cgroup_classid**\ () in that * the cgroup v1 net_cls class is retrieved only from the *skb*'s * associated socket instead of the current process. * Return * The id is returned or 0 in case the id could not be retrieved. * * long bpf_redirect_neigh(u32 ifindex, struct bpf_redir_neigh *params, int plen, u64 flags) * Description * Redirect the packet to another net device of index *ifindex* * and fill in L2 addresses from neighboring subsystem. This helper * is somewhat similar to **bpf_redirect**\ (), except that it * populates L2 addresses as well, meaning, internally, the helper * relies on the neighbor lookup for the L2 address of the nexthop. * * The helper will perform a FIB lookup based on the skb's * networking header to get the address of the next hop, unless * this is supplied by the caller in the *params* argument. The * *plen* argument indicates the len of *params* and should be set * to 0 if *params* is NULL. * * The *flags* argument is reserved and must be 0. The helper is * currently only supported for tc BPF program types, and enabled * for IPv4 and IPv6 protocols. * Return * The helper returns **TC_ACT_REDIRECT** on success or * **TC_ACT_SHOT** on error. * * void *bpf_per_cpu_ptr(const void *percpu_ptr, u32 cpu) * Description * Take a pointer to a percpu ksym, *percpu_ptr*, and return a * pointer to the percpu kernel variable on *cpu*. A ksym is an * extern variable decorated with '__ksym'. For ksym, there is a * global var (either static or global) defined of the same name * in the kernel. The ksym is percpu if the global var is percpu. * The returned pointer points to the global percpu var on *cpu*. * * bpf_per_cpu_ptr() has the same semantic as per_cpu_ptr() in the * kernel, except that bpf_per_cpu_ptr() may return NULL. This * happens if *cpu* is larger than nr_cpu_ids. The caller of * bpf_per_cpu_ptr() must check the returned value. * Return * A pointer pointing to the kernel percpu variable on *cpu*, or * NULL, if *cpu* is invalid. * * void *bpf_this_cpu_ptr(const void *percpu_ptr) * Description * Take a pointer to a percpu ksym, *percpu_ptr*, and return a * pointer to the percpu kernel variable on this cpu. See the * description of 'ksym' in **bpf_per_cpu_ptr**\ (). * * bpf_this_cpu_ptr() has the same semantic as this_cpu_ptr() in * the kernel. Different from **bpf_per_cpu_ptr**\ (), it would * never return NULL. * Return * A pointer pointing to the kernel percpu variable on this cpu. * * long bpf_redirect_peer(u32 ifindex, u64 flags) * Description * Redirect the packet to another net device of index *ifindex*. * This helper is somewhat similar to **bpf_redirect**\ (), except * that the redirection happens to the *ifindex*' peer device and * the netns switch takes place from ingress to ingress without * going through the CPU's backlog queue. * * The *flags* argument is reserved and must be 0. The helper is * currently only supported for tc BPF program types at the ingress * hook and for veth device types. The peer device must reside in a * different network namespace. * Return * The helper returns **TC_ACT_REDIRECT** on success or * **TC_ACT_SHOT** on error. * * void *bpf_task_storage_get(struct bpf_map *map, struct task_struct *task, void *value, u64 flags) * Description * Get a bpf_local_storage from the *task*. * * Logically, it could be thought of as getting the value from * a *map* with *task* as the **key**. From this * perspective, the usage is not much different from * **bpf_map_lookup_elem**\ (*map*, **&**\ *task*) except this * helper enforces the key must be an task_struct and the map must also * be a **BPF_MAP_TYPE_TASK_STORAGE**. * * Underneath, the value is stored locally at *task* instead of * the *map*. The *map* is used as the bpf-local-storage * "type". The bpf-local-storage "type" (i.e. the *map*) is * searched against all bpf_local_storage residing at *task*. * * An optional *flags* (**BPF_LOCAL_STORAGE_GET_F_CREATE**) can be * used such that a new bpf_local_storage will be * created if one does not exist. *value* can be used * together with **BPF_LOCAL_STORAGE_GET_F_CREATE** to specify * the initial value of a bpf_local_storage. If *value* is * **NULL**, the new bpf_local_storage will be zero initialized. * Return * A bpf_local_storage pointer is returned on success. * * **NULL** if not found or there was an error in adding * a new bpf_local_storage. * * long bpf_task_storage_delete(struct bpf_map *map, struct task_struct *task) * Description * Delete a bpf_local_storage from a *task*. * Return * 0 on success. * * **-ENOENT** if the bpf_local_storage cannot be found. * * struct task_struct *bpf_get_current_task_btf(void) * Description * Return a BTF pointer to the "current" task. * This pointer can also be used in helpers that accept an * *ARG_PTR_TO_BTF_ID* of type *task_struct*. * Return * Pointer to the current task. * * long bpf_bprm_opts_set(struct linux_binprm *bprm, u64 flags) * Description * Set or clear certain options on *bprm*: * * **BPF_F_BPRM_SECUREEXEC** Set the secureexec bit * which sets the **AT_SECURE** auxv for glibc. The bit * is cleared if the flag is not specified. * Return * **-EINVAL** if invalid *flags* are passed, zero otherwise. * * u64 bpf_ktime_get_coarse_ns(void) * Description * Return a coarse-grained version of the time elapsed since * system boot, in nanoseconds. Does not include time the system * was suspended. * * See: **clock_gettime**\ (**CLOCK_MONOTONIC_COARSE**) * Return * Current *ktime*. * * long bpf_ima_inode_hash(struct inode *inode, void *dst, u32 size) * Description * Returns the stored IMA hash of the *inode* (if it's avaialable). * If the hash is larger than *size*, then only *size* * bytes will be copied to *dst* * Return * The **hash_algo** is returned on success, * **-EOPNOTSUP** if IMA is disabled or **-EINVAL** if * invalid arguments are passed. * * struct socket *bpf_sock_from_file(struct file *file) * Description * If the given file represents a socket, returns the associated * socket. * Return * A pointer to a struct socket on success or NULL if the file is * not a socket. */ #define __BPF_FUNC_MAPPER(FN) \ FN(unspec), \ FN(map_lookup_elem), \ FN(map_update_elem), \ FN(map_delete_elem), \ FN(probe_read), \ FN(ktime_get_ns), \ FN(trace_printk), \ FN(get_prandom_u32), \ FN(get_smp_processor_id), \ FN(skb_store_bytes), \ FN(l3_csum_replace), \ FN(l4_csum_replace), \ FN(tail_call), \ FN(clone_redirect), \ FN(get_current_pid_tgid), \ FN(get_current_uid_gid), \ FN(get_current_comm), \ FN(get_cgroup_classid), \ FN(skb_vlan_push), \ FN(skb_vlan_pop), \ FN(skb_get_tunnel_key), \ FN(skb_set_tunnel_key), \ FN(perf_event_read), \ FN(redirect), \ FN(get_route_realm), \ FN(perf_event_output), \ FN(skb_load_bytes), \ FN(get_stackid), \ FN(csum_diff), \ FN(skb_get_tunnel_opt), \ FN(skb_set_tunnel_opt), \ FN(skb_change_proto), \ FN(skb_change_type), \ FN(skb_under_cgroup), \ FN(get_hash_recalc), \ FN(get_current_task), \ FN(probe_write_user), \ FN(current_task_under_cgroup), \ FN(skb_change_tail), \ FN(skb_pull_data), \ FN(csum_update), \ FN(set_hash_invalid), \ FN(get_numa_node_id), \ FN(skb_change_head), \ FN(xdp_adjust_head), \ FN(probe_read_str), \ FN(get_socket_cookie), \ FN(get_socket_uid), \ FN(set_hash), \ FN(setsockopt), \ FN(skb_adjust_room), \ FN(redirect_map), \ FN(sk_redirect_map), \ FN(sock_map_update), \ FN(xdp_adjust_meta), \ FN(perf_event_read_value), \ FN(perf_prog_read_value), \ FN(getsockopt), \ FN(override_return), \ FN(sock_ops_cb_flags_set), \ FN(msg_redirect_map), \ FN(msg_apply_bytes), \ FN(msg_cork_bytes), \ FN(msg_pull_data), \ FN(bind), \ FN(xdp_adjust_tail), \ FN(skb_get_xfrm_state), \ FN(get_stack), \ FN(skb_load_bytes_relative), \ FN(fib_lookup), \ FN(sock_hash_update), \ FN(msg_redirect_hash), \ FN(sk_redirect_hash), \ FN(lwt_push_encap), \ FN(lwt_seg6_store_bytes), \ FN(lwt_seg6_adjust_srh), \ FN(lwt_seg6_action), \ FN(rc_repeat), \ FN(rc_keydown), \ FN(skb_cgroup_id), \ FN(get_current_cgroup_id), \ FN(get_local_storage), \ FN(sk_select_reuseport), \ FN(skb_ancestor_cgroup_id), \ FN(sk_lookup_tcp), \ FN(sk_lookup_udp), \ FN(sk_release), \ FN(map_push_elem), \ FN(map_pop_elem), \ FN(map_peek_elem), \ FN(msg_push_data), \ FN(msg_pop_data), \ FN(rc_pointer_rel), \ FN(spin_lock), \ FN(spin_unlock), \ FN(sk_fullsock), \ FN(tcp_sock), \ FN(skb_ecn_set_ce), \ FN(get_listener_sock), \ FN(skc_lookup_tcp), \ FN(tcp_check_syncookie), \ FN(sysctl_get_name), \ FN(sysctl_get_current_value), \ FN(sysctl_get_new_value), \ FN(sysctl_set_new_value), \ FN(strtol), \ FN(strtoul), \ FN(sk_storage_get), \ FN(sk_storage_delete), \ FN(send_signal), \ FN(tcp_gen_syncookie), \ FN(skb_output), \ FN(probe_read_user), \ FN(probe_read_kernel), \ FN(probe_read_user_str), \ FN(probe_read_kernel_str), \ FN(tcp_send_ack), \ FN(send_signal_thread), \ FN(jiffies64), \ FN(read_branch_records), \ FN(get_ns_current_pid_tgid), \ FN(xdp_output), \ FN(get_netns_cookie), \ FN(get_current_ancestor_cgroup_id), \ FN(sk_assign), \ FN(ktime_get_boot_ns), \ FN(seq_printf), \ FN(seq_write), \ FN(sk_cgroup_id), \ FN(sk_ancestor_cgroup_id), \ FN(ringbuf_output), \ FN(ringbuf_reserve), \ FN(ringbuf_submit), \ FN(ringbuf_discard), \ FN(ringbuf_query), \ FN(csum_level), \ FN(skc_to_tcp6_sock), \ FN(skc_to_tcp_sock), \ FN(skc_to_tcp_timewait_sock), \ FN(skc_to_tcp_request_sock), \ FN(skc_to_udp6_sock), \ FN(get_task_stack), \ FN(load_hdr_opt), \ FN(store_hdr_opt), \ FN(reserve_hdr_opt), \ FN(inode_storage_get), \ FN(inode_storage_delete), \ FN(d_path), \ FN(copy_from_user), \ FN(snprintf_btf), \ FN(seq_printf_btf), \ FN(skb_cgroup_classid), \ FN(redirect_neigh), \ FN(per_cpu_ptr), \ FN(this_cpu_ptr), \ FN(redirect_peer), \ FN(task_storage_get), \ FN(task_storage_delete), \ FN(get_current_task_btf), \ FN(bprm_opts_set), \ FN(ktime_get_coarse_ns), \ FN(ima_inode_hash), \ FN(sock_from_file), \ /* */ /* integer value in 'imm' field of BPF_CALL instruction selects which helper * function eBPF program intends to call */ #define __BPF_ENUM_FN(x) BPF_FUNC_ ## x enum bpf_func_id { __BPF_FUNC_MAPPER(__BPF_ENUM_FN) __BPF_FUNC_MAX_ID, }; #undef __BPF_ENUM_FN /* All flags used by eBPF helper functions, placed here. */ /* BPF_FUNC_skb_store_bytes flags. */ enum { BPF_F_RECOMPUTE_CSUM = (1ULL << 0), BPF_F_INVALIDATE_HASH = (1ULL << 1), }; /* BPF_FUNC_l3_csum_replace and BPF_FUNC_l4_csum_replace flags. * First 4 bits are for passing the header field size. */ enum { BPF_F_HDR_FIELD_MASK = 0xfULL, }; /* BPF_FUNC_l4_csum_replace flags. */ enum { BPF_F_PSEUDO_HDR = (1ULL << 4), BPF_F_MARK_MANGLED_0 = (1ULL << 5), BPF_F_MARK_ENFORCE = (1ULL << 6), }; /* BPF_FUNC_clone_redirect and BPF_FUNC_redirect flags. */ enum { BPF_F_INGRESS = (1ULL << 0), }; /* BPF_FUNC_skb_set_tunnel_key and BPF_FUNC_skb_get_tunnel_key flags. */ enum { BPF_F_TUNINFO_IPV6 = (1ULL << 0), }; /* flags for both BPF_FUNC_get_stackid and BPF_FUNC_get_stack. */ enum { BPF_F_SKIP_FIELD_MASK = 0xffULL, BPF_F_USER_STACK = (1ULL << 8), /* flags used by BPF_FUNC_get_stackid only. */ BPF_F_FAST_STACK_CMP = (1ULL << 9), BPF_F_REUSE_STACKID = (1ULL << 10), /* flags used by BPF_FUNC_get_stack only. */ BPF_F_USER_BUILD_ID = (1ULL << 11), }; /* BPF_FUNC_skb_set_tunnel_key flags. */ enum { BPF_F_ZERO_CSUM_TX = (1ULL << 1), BPF_F_DONT_FRAGMENT = (1ULL << 2), BPF_F_SEQ_NUMBER = (1ULL << 3), }; /* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and * BPF_FUNC_perf_event_read_value flags. */ enum { BPF_F_INDEX_MASK = 0xffffffffULL, BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK, /* BPF_FUNC_perf_event_output for sk_buff input context. */ BPF_F_CTXLEN_MASK = (0xfffffULL << 32), }; /* Current network namespace */ enum { BPF_F_CURRENT_NETNS = (-1L), }; /* BPF_FUNC_csum_level level values. */ enum { BPF_CSUM_LEVEL_QUERY, BPF_CSUM_LEVEL_INC, BPF_CSUM_LEVEL_DEC, BPF_CSUM_LEVEL_RESET, }; /* BPF_FUNC_skb_adjust_room flags. */ enum { BPF_F_ADJ_ROOM_FIXED_GSO = (1ULL << 0), BPF_F_ADJ_ROOM_ENCAP_L3_IPV4 = (1ULL << 1), BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 = (1ULL << 2), BPF_F_ADJ_ROOM_ENCAP_L4_GRE = (1ULL << 3), BPF_F_ADJ_ROOM_ENCAP_L4_UDP = (1ULL << 4), BPF_F_ADJ_ROOM_NO_CSUM_RESET = (1ULL << 5), }; enum { BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff, BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 56, }; #define BPF_F_ADJ_ROOM_ENCAP_L2(len) (((__u64)len & \ BPF_ADJ_ROOM_ENCAP_L2_MASK) \ << BPF_ADJ_ROOM_ENCAP_L2_SHIFT) /* BPF_FUNC_sysctl_get_name flags. */ enum { BPF_F_SYSCTL_BASE_NAME = (1ULL << 0), }; /* BPF_FUNC__storage_get flags */ enum { BPF_LOCAL_STORAGE_GET_F_CREATE = (1ULL << 0), /* BPF_SK_STORAGE_GET_F_CREATE is only kept for backward compatibility * and BPF_LOCAL_STORAGE_GET_F_CREATE must be used instead. */ BPF_SK_STORAGE_GET_F_CREATE = BPF_LOCAL_STORAGE_GET_F_CREATE, }; /* BPF_FUNC_read_branch_records flags. */ enum { BPF_F_GET_BRANCH_RECORDS_SIZE = (1ULL << 0), }; /* BPF_FUNC_bpf_ringbuf_commit, BPF_FUNC_bpf_ringbuf_discard, and * BPF_FUNC_bpf_ringbuf_output flags. */ enum { BPF_RB_NO_WAKEUP = (1ULL << 0), BPF_RB_FORCE_WAKEUP = (1ULL << 1), }; /* BPF_FUNC_bpf_ringbuf_query flags */ enum { BPF_RB_AVAIL_DATA = 0, BPF_RB_RING_SIZE = 1, BPF_RB_CONS_POS = 2, BPF_RB_PROD_POS = 3, }; /* BPF ring buffer constants */ enum { BPF_RINGBUF_BUSY_BIT = (1U << 31), BPF_RINGBUF_DISCARD_BIT = (1U << 30), BPF_RINGBUF_HDR_SZ = 8, }; /* BPF_FUNC_sk_assign flags in bpf_sk_lookup context. */ enum { BPF_SK_LOOKUP_F_REPLACE = (1ULL << 0), BPF_SK_LOOKUP_F_NO_REUSEPORT = (1ULL << 1), }; /* Mode for BPF_FUNC_skb_adjust_room helper. */ enum bpf_adj_room_mode { BPF_ADJ_ROOM_NET, BPF_ADJ_ROOM_MAC, }; /* Mode for BPF_FUNC_skb_load_bytes_relative helper. */ enum bpf_hdr_start_off { BPF_HDR_START_MAC, BPF_HDR_START_NET, }; /* Encapsulation type for BPF_FUNC_lwt_push_encap helper. */ enum bpf_lwt_encap_mode { BPF_LWT_ENCAP_SEG6, BPF_LWT_ENCAP_SEG6_INLINE, BPF_LWT_ENCAP_IP, }; /* Flags for bpf_bprm_opts_set helper */ enum { BPF_F_BPRM_SECUREEXEC = (1ULL << 0), }; #define __bpf_md_ptr(type, name) \ union { \ type name; \ __u64 :64; \ } __attribute__((aligned(8))) /* user accessible mirror of in-kernel sk_buff. * new fields can only be added to the end of this structure */ struct __sk_buff { __u32 len; __u32 pkt_type; __u32 mark; __u32 queue_mapping; __u32 protocol; __u32 vlan_present; __u32 vlan_tci; __u32 vlan_proto; __u32 priority; __u32 ingress_ifindex; __u32 ifindex; __u32 tc_index; __u32 cb[5]; __u32 hash; __u32 tc_classid; __u32 data; __u32 data_end; __u32 napi_id; /* Accessed by BPF_PROG_TYPE_sk_skb types from here to ... */ __u32 family; __u32 remote_ip4; /* Stored in network byte order */ __u32 local_ip4; /* Stored in network byte order */ __u32 remote_ip6[4]; /* Stored in network byte order */ __u32 local_ip6[4]; /* Stored in network byte order */ __u32 remote_port; /* Stored in network byte order */ __u32 local_port; /* stored in host byte order */ /* ... here. */ __u32 data_meta; __bpf_md_ptr(struct bpf_flow_keys *, flow_keys); __u64 tstamp; __u32 wire_len; __u32 gso_segs; __bpf_md_ptr(struct bpf_sock *, sk); __u32 gso_size; }; struct bpf_tunnel_key { __u32 tunnel_id; union { __u32 remote_ipv4; __u32 remote_ipv6[4]; }; __u8 tunnel_tos; __u8 tunnel_ttl; __u16 tunnel_ext; /* Padding, future use. */ __u32 tunnel_label; }; /* user accessible mirror of in-kernel xfrm_state. * new fields can only be added to the end of this structure */ struct bpf_xfrm_state { __u32 reqid; __u32 spi; /* Stored in network byte order */ __u16 family; __u16 ext; /* Padding, future use. */ union { __u32 remote_ipv4; /* Stored in network byte order */ __u32 remote_ipv6[4]; /* Stored in network byte order */ }; }; /* Generic BPF return codes which all BPF program types may support. * The values are binary compatible with their TC_ACT_* counter-part to * provide backwards compatibility with existing SCHED_CLS and SCHED_ACT * programs. * * XDP is handled seprately, see XDP_*. */ enum bpf_ret_code { BPF_OK = 0, /* 1 reserved */ BPF_DROP = 2, /* 3-6 reserved */ BPF_REDIRECT = 7, /* >127 are reserved for prog type specific return codes. * * BPF_LWT_REROUTE: used by BPF_PROG_TYPE_LWT_IN and * BPF_PROG_TYPE_LWT_XMIT to indicate that skb had been * changed and should be routed based on its new L3 header. * (This is an L3 redirect, as opposed to L2 redirect * represented by BPF_REDIRECT above). */ BPF_LWT_REROUTE = 128, }; struct bpf_sock { __u32 bound_dev_if; __u32 family; __u32 type; __u32 protocol; __u32 mark; __u32 priority; /* IP address also allows 1 and 2 bytes access */ __u32 src_ip4; __u32 src_ip6[4]; __u32 src_port; /* host byte order */ __u32 dst_port; /* network byte order */ __u32 dst_ip4; __u32 dst_ip6[4]; __u32 state; __s32 rx_queue_mapping; }; struct bpf_tcp_sock { __u32 snd_cwnd; /* Sending congestion window */ __u32 srtt_us; /* smoothed round trip time << 3 in usecs */ __u32 rtt_min; __u32 snd_ssthresh; /* Slow start size threshold */ __u32 rcv_nxt; /* What we want to receive next */ __u32 snd_nxt; /* Next sequence we send */ __u32 snd_una; /* First byte we want an ack for */ __u32 mss_cache; /* Cached effective mss, not including SACKS */ __u32 ecn_flags; /* ECN status bits. */ __u32 rate_delivered; /* saved rate sample: packets delivered */ __u32 rate_interval_us; /* saved rate sample: time elapsed */ __u32 packets_out; /* Packets which are "in flight" */ __u32 retrans_out; /* Retransmitted packets out */ __u32 total_retrans; /* Total retransmits for entire connection */ __u32 segs_in; /* RFC4898 tcpEStatsPerfSegsIn * total number of segments in. */ __u32 data_segs_in; /* RFC4898 tcpEStatsPerfDataSegsIn * total number of data segments in. */ __u32 segs_out; /* RFC4898 tcpEStatsPerfSegsOut * The total number of segments sent. */ __u32 data_segs_out; /* RFC4898 tcpEStatsPerfDataSegsOut * total number of data segments sent. */ __u32 lost_out; /* Lost packets */ __u32 sacked_out; /* SACK'd packets */ __u64 bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived * sum(delta(rcv_nxt)), or how many bytes * were acked. */ __u64 bytes_acked; /* RFC4898 tcpEStatsAppHCThruOctetsAcked * sum(delta(snd_una)), or how many bytes * were acked. */ __u32 dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups * total number of DSACK blocks received */ __u32 delivered; /* Total data packets delivered incl. rexmits */ __u32 delivered_ce; /* Like the above but only ECE marked packets */ __u32 icsk_retransmits; /* Number of unrecovered [RTO] timeouts */ }; struct bpf_sock_tuple { union { struct { __be32 saddr; __be32 daddr; __be16 sport; __be16 dport; } ipv4; struct { __be32 saddr[4]; __be32 daddr[4]; __be16 sport; __be16 dport; } ipv6; }; }; struct bpf_xdp_sock { __u32 queue_id; }; #define XDP_PACKET_HEADROOM 256 /* User return codes for XDP prog type. * A valid XDP program must return one of these defined values. All other * return codes are reserved for future use. Unknown return codes will * result in packet drops and a warning via bpf_warn_invalid_xdp_action(). */ enum xdp_action { XDP_ABORTED = 0, XDP_DROP, XDP_PASS, XDP_TX, XDP_REDIRECT, }; /* user accessible metadata for XDP packet hook * new fields must be added to the end of this structure */ struct xdp_md { __u32 data; __u32 data_end; __u32 data_meta; /* Below access go through struct xdp_rxq_info */ __u32 ingress_ifindex; /* rxq->dev->ifindex */ __u32 rx_queue_index; /* rxq->queue_index */ __u32 egress_ifindex; /* txq->dev->ifindex */ }; /* DEVMAP map-value layout * * The struct data-layout of map-value is a configuration interface. * New members can only be added to the end of this structure. */ struct bpf_devmap_val { __u32 ifindex; /* device index */ union { int fd; /* prog fd on map write */ __u32 id; /* prog id on map read */ } bpf_prog; }; /* CPUMAP map-value layout * * The struct data-layout of map-value is a configuration interface. * New members can only be added to the end of this structure. */ struct bpf_cpumap_val { __u32 qsize; /* queue size to remote target CPU */ union { int fd; /* prog fd on map write */ __u32 id; /* prog id on map read */ } bpf_prog; }; enum sk_action { SK_DROP = 0, SK_PASS, }; /* user accessible metadata for SK_MSG packet hook, new fields must * be added to the end of this structure */ struct sk_msg_md { __bpf_md_ptr(void *, data); __bpf_md_ptr(void *, data_end); __u32 family; __u32 remote_ip4; /* Stored in network byte order */ __u32 local_ip4; /* Stored in network byte order */ __u32 remote_ip6[4]; /* Stored in network byte order */ __u32 local_ip6[4]; /* Stored in network byte order */ __u32 remote_port; /* Stored in network byte order */ __u32 local_port; /* stored in host byte order */ __u32 size; /* Total size of sk_msg */ __bpf_md_ptr(struct bpf_sock *, sk); /* current socket */ }; struct sk_reuseport_md { /* * Start of directly accessible data. It begins from * the tcp/udp header. */ __bpf_md_ptr(void *, data); /* End of directly accessible data */ __bpf_md_ptr(void *, data_end); /* * Total length of packet (starting from the tcp/udp header). * Note that the directly accessible bytes (data_end - data) * could be less than this "len". Those bytes could be * indirectly read by a helper "bpf_skb_load_bytes()". */ __u32 len; /* * Eth protocol in the mac header (network byte order). e.g. * ETH_P_IP(0x0800) and ETH_P_IPV6(0x86DD) */ __u32 eth_protocol; __u32 ip_protocol; /* IP protocol. e.g. IPPROTO_TCP, IPPROTO_UDP */ __u32 bind_inany; /* Is sock bound to an INANY address? */ __u32 hash; /* A hash of the packet 4 tuples */ }; #define BPF_TAG_SIZE 8 struct bpf_prog_info { __u32 type; __u32 id; __u8 tag[BPF_TAG_SIZE]; __u32 jited_prog_len; __u32 xlated_prog_len; __aligned_u64 jited_prog_insns; __aligned_u64 xlated_prog_insns; __u64 load_time; /* ns since boottime */ __u32 created_by_uid; __u32 nr_map_ids; __aligned_u64 map_ids; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 gpl_compatible:1; __u32 :31; /* alignment pad */ __u64 netns_dev; __u64 netns_ino; __u32 nr_jited_ksyms; __u32 nr_jited_func_lens; __aligned_u64 jited_ksyms; __aligned_u64 jited_func_lens; __u32 btf_id; __u32 func_info_rec_size; __aligned_u64 func_info; __u32 nr_func_info; __u32 nr_line_info; __aligned_u64 line_info; __aligned_u64 jited_line_info; __u32 nr_jited_line_info; __u32 line_info_rec_size; __u32 jited_line_info_rec_size; __u32 nr_prog_tags; __aligned_u64 prog_tags; __u64 run_time_ns; __u64 run_cnt; } __attribute__((aligned(8))); struct bpf_map_info { __u32 type; __u32 id; __u32 key_size; __u32 value_size; __u32 max_entries; __u32 map_flags; char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 btf_vmlinux_value_type_id; __u64 netns_dev; __u64 netns_ino; __u32 btf_id; __u32 btf_key_type_id; __u32 btf_value_type_id; } __attribute__((aligned(8))); struct bpf_btf_info { __aligned_u64 btf; __u32 btf_size; __u32 id; __aligned_u64 name; __u32 name_len; __u32 kernel_btf; } __attribute__((aligned(8))); struct bpf_link_info { __u32 type; __u32 id; __u32 prog_id; union { struct { __aligned_u64 tp_name; /* in/out: tp_name buffer ptr */ __u32 tp_name_len; /* in/out: tp_name buffer len */ } raw_tracepoint; struct { __u32 attach_type; } tracing; struct { __u64 cgroup_id; __u32 attach_type; } cgroup; struct { __aligned_u64 target_name; /* in/out: target_name buffer ptr */ __u32 target_name_len; /* in/out: target_name buffer len */ union { struct { __u32 map_id; } map; }; } iter; struct { __u32 netns_ino; __u32 attach_type; } netns; struct { __u32 ifindex; } xdp; }; } __attribute__((aligned(8))); /* User bpf_sock_addr struct to access socket fields and sockaddr struct passed * by user and intended to be used by socket (e.g. to bind to, depends on * attach type). */ struct bpf_sock_addr { __u32 user_family; /* Allows 4-byte read, but no write. */ __u32 user_ip4; /* Allows 1,2,4-byte read and 4-byte write. * Stored in network byte order. */ __u32 user_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write. * Stored in network byte order. */ __u32 user_port; /* Allows 1,2,4-byte read and 4-byte write. * Stored in network byte order */ __u32 family; /* Allows 4-byte read, but no write */ __u32 type; /* Allows 4-byte read, but no write */ __u32 protocol; /* Allows 4-byte read, but no write */ __u32 msg_src_ip4; /* Allows 1,2,4-byte read and 4-byte write. * Stored in network byte order. */ __u32 msg_src_ip6[4]; /* Allows 1,2,4,8-byte read and 4,8-byte write. * Stored in network byte order. */ __bpf_md_ptr(struct bpf_sock *, sk); }; /* User bpf_sock_ops struct to access socket values and specify request ops * and their replies. * Some of this fields are in network (bigendian) byte order and may need * to be converted before use (bpf_ntohl() defined in samples/bpf/bpf_endian.h). * New fields can only be added at the end of this structure */ struct bpf_sock_ops { __u32 op; union { __u32 args[4]; /* Optionally passed to bpf program */ __u32 reply; /* Returned by bpf program */ __u32 replylong[4]; /* Optionally returned by bpf prog */ }; __u32 family; __u32 remote_ip4; /* Stored in network byte order */ __u32 local_ip4; /* Stored in network byte order */ __u32 remote_ip6[4]; /* Stored in network byte order */ __u32 local_ip6[4]; /* Stored in network byte order */ __u32 remote_port; /* Stored in network byte order */ __u32 local_port; /* stored in host byte order */ __u32 is_fullsock; /* Some TCP fields are only valid if * there is a full socket. If not, the * fields read as zero. */ __u32 snd_cwnd; __u32 srtt_us; /* Averaged RTT << 3 in usecs */ __u32 bpf_sock_ops_cb_flags; /* flags defined in uapi/linux/tcp.h */ __u32 state; __u32 rtt_min; __u32 snd_ssthresh; __u32 rcv_nxt; __u32 snd_nxt; __u32 snd_una; __u32 mss_cache; __u32 ecn_flags; __u32 rate_delivered; __u32 rate_interval_us; __u32 packets_out; __u32 retrans_out; __u32 total_retrans; __u32 segs_in; __u32 data_segs_in; __u32 segs_out; __u32 data_segs_out; __u32 lost_out; __u32 sacked_out; __u32 sk_txhash; __u64 bytes_received; __u64 bytes_acked; __bpf_md_ptr(struct bpf_sock *, sk); /* [skb_data, skb_data_end) covers the whole TCP header. * * BPF_SOCK_OPS_PARSE_HDR_OPT_CB: The packet received * BPF_SOCK_OPS_HDR_OPT_LEN_CB: Not useful because the * header has not been written. * BPF_SOCK_OPS_WRITE_HDR_OPT_CB: The header and options have * been written so far. * BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB: The SYNACK that concludes * the 3WHS. * BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB: The ACK that concludes * the 3WHS. * * bpf_load_hdr_opt() can also be used to read a particular option. */ __bpf_md_ptr(void *, skb_data); __bpf_md_ptr(void *, skb_data_end); __u32 skb_len; /* The total length of a packet. * It includes the header, options, * and payload. */ __u32 skb_tcp_flags; /* tcp_flags of the header. It provides * an easy way to check for tcp_flags * without parsing skb_data. * * In particular, the skb_tcp_flags * will still be available in * BPF_SOCK_OPS_HDR_OPT_LEN even though * the outgoing header has not * been written yet. */ }; /* Definitions for bpf_sock_ops_cb_flags */ enum { BPF_SOCK_OPS_RTO_CB_FLAG = (1<<0), BPF_SOCK_OPS_RETRANS_CB_FLAG = (1<<1), BPF_SOCK_OPS_STATE_CB_FLAG = (1<<2), BPF_SOCK_OPS_RTT_CB_FLAG = (1<<3), /* Call bpf for all received TCP headers. The bpf prog will be * called under sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB * * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB * for the header option related helpers that will be useful * to the bpf programs. * * It could be used at the client/active side (i.e. connect() side) * when the server told it that the server was in syncookie * mode and required the active side to resend the bpf-written * options. The active side can keep writing the bpf-options until * it received a valid packet from the server side to confirm * the earlier packet (and options) has been received. The later * example patch is using it like this at the active side when the * server is in syncookie mode. * * The bpf prog will usually turn this off in the common cases. */ BPF_SOCK_OPS_PARSE_ALL_HDR_OPT_CB_FLAG = (1<<4), /* Call bpf when kernel has received a header option that * the kernel cannot handle. The bpf prog will be called under * sock_ops->op == BPF_SOCK_OPS_PARSE_HDR_OPT_CB. * * Please refer to the comment in BPF_SOCK_OPS_PARSE_HDR_OPT_CB * for the header option related helpers that will be useful * to the bpf programs. */ BPF_SOCK_OPS_PARSE_UNKNOWN_HDR_OPT_CB_FLAG = (1<<5), /* Call bpf when the kernel is writing header options for the * outgoing packet. The bpf prog will first be called * to reserve space in a skb under * sock_ops->op == BPF_SOCK_OPS_HDR_OPT_LEN_CB. Then * the bpf prog will be called to write the header option(s) * under sock_ops->op == BPF_SOCK_OPS_WRITE_HDR_OPT_CB. * * Please refer to the comment in BPF_SOCK_OPS_HDR_OPT_LEN_CB * and BPF_SOCK_OPS_WRITE_HDR_OPT_CB for the header option * related helpers that will be useful to the bpf programs. * * The kernel gets its chance to reserve space and write * options first before the BPF program does. */ BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = (1<<6), /* Mask of all currently supported cb flags */ BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F, }; /* List of known BPF sock_ops operators. * New entries can only be added at the end */ enum { BPF_SOCK_OPS_VOID, BPF_SOCK_OPS_TIMEOUT_INIT, /* Should return SYN-RTO value to use or * -1 if default value should be used */ BPF_SOCK_OPS_RWND_INIT, /* Should return initial advertized * window (in packets) or -1 if default * value should be used */ BPF_SOCK_OPS_TCP_CONNECT_CB, /* Calls BPF program right before an * active connection is initialized */ BPF_SOCK_OPS_ACTIVE_ESTABLISHED_CB, /* Calls BPF program when an * active connection is * established */ BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB, /* Calls BPF program when a * passive connection is * established */ BPF_SOCK_OPS_NEEDS_ECN, /* If connection's congestion control * needs ECN */ BPF_SOCK_OPS_BASE_RTT, /* Get base RTT. The correct value is * based on the path and may be * dependent on the congestion control * algorithm. In general it indicates * a congestion threshold. RTTs above * this indicate congestion */ BPF_SOCK_OPS_RTO_CB, /* Called when an RTO has triggered. * Arg1: value of icsk_retransmits * Arg2: value of icsk_rto * Arg3: whether RTO has expired */ BPF_SOCK_OPS_RETRANS_CB, /* Called when skb is retransmitted. * Arg1: sequence number of 1st byte * Arg2: # segments * Arg3: return value of * tcp_transmit_skb (0 => success) */ BPF_SOCK_OPS_STATE_CB, /* Called when TCP changes state. * Arg1: old_state * Arg2: new_state */ BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after * socket transition to LISTEN state. */ BPF_SOCK_OPS_RTT_CB, /* Called on every RTT. */ BPF_SOCK_OPS_PARSE_HDR_OPT_CB, /* Parse the header option. * It will be called to handle * the packets received at * an already established * connection. * * sock_ops->skb_data: * Referring to the received skb. * It covers the TCP header only. * * bpf_load_hdr_opt() can also * be used to search for a * particular option. */ BPF_SOCK_OPS_HDR_OPT_LEN_CB, /* Reserve space for writing the * header option later in * BPF_SOCK_OPS_WRITE_HDR_OPT_CB. * Arg1: bool want_cookie. (in * writing SYNACK only) * * sock_ops->skb_data: * Not available because no header has * been written yet. * * sock_ops->skb_tcp_flags: * The tcp_flags of the * outgoing skb. (e.g. SYN, ACK, FIN). * * bpf_reserve_hdr_opt() should * be used to reserve space. */ BPF_SOCK_OPS_WRITE_HDR_OPT_CB, /* Write the header options * Arg1: bool want_cookie. (in * writing SYNACK only) * * sock_ops->skb_data: * Referring to the outgoing skb. * It covers the TCP header * that has already been written * by the kernel and the * earlier bpf-progs. * * sock_ops->skb_tcp_flags: * The tcp_flags of the outgoing * skb. (e.g. SYN, ACK, FIN). * * bpf_store_hdr_opt() should * be used to write the * option. * * bpf_load_hdr_opt() can also * be used to search for a * particular option that * has already been written * by the kernel or the * earlier bpf-progs. */ }; /* List of TCP states. There is a build check in net/ipv4/tcp.c to detect * changes between the TCP and BPF versions. Ideally this should never happen. * If it does, we need to add code to convert them before calling * the BPF sock_ops function. */ enum { BPF_TCP_ESTABLISHED = 1, BPF_TCP_SYN_SENT, BPF_TCP_SYN_RECV, BPF_TCP_FIN_WAIT1, BPF_TCP_FIN_WAIT2, BPF_TCP_TIME_WAIT, BPF_TCP_CLOSE, BPF_TCP_CLOSE_WAIT, BPF_TCP_LAST_ACK, BPF_TCP_LISTEN, BPF_TCP_CLOSING, /* Now a valid state */ BPF_TCP_NEW_SYN_RECV, BPF_TCP_MAX_STATES /* Leave at the end! */ }; enum { TCP_BPF_IW = 1001, /* Set TCP initial congestion window */ TCP_BPF_SNDCWND_CLAMP = 1002, /* Set sndcwnd_clamp */ TCP_BPF_DELACK_MAX = 1003, /* Max delay ack in usecs */ TCP_BPF_RTO_MIN = 1004, /* Min delay ack in usecs */ /* Copy the SYN pkt to optval * * BPF_PROG_TYPE_SOCK_OPS only. It is similar to the * bpf_getsockopt(TCP_SAVED_SYN) but it does not limit * to only getting from the saved_syn. It can either get the * syn packet from: * * 1. the just-received SYN packet (only available when writing the * SYNACK). It will be useful when it is not necessary to * save the SYN packet for latter use. It is also the only way * to get the SYN during syncookie mode because the syn * packet cannot be saved during syncookie. * * OR * * 2. the earlier saved syn which was done by * bpf_setsockopt(TCP_SAVE_SYN). * * The bpf_getsockopt(TCP_BPF_SYN*) option will hide where the * SYN packet is obtained. * * If the bpf-prog does not need the IP[46] header, the * bpf-prog can avoid parsing the IP header by using * TCP_BPF_SYN. Otherwise, the bpf-prog can get both * IP[46] and TCP header by using TCP_BPF_SYN_IP. * * >0: Total number of bytes copied * -ENOSPC: Not enough space in optval. Only optlen number of * bytes is copied. * -ENOENT: The SYN skb is not available now and the earlier SYN pkt * is not saved by setsockopt(TCP_SAVE_SYN). */ TCP_BPF_SYN = 1005, /* Copy the TCP header */ TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */ TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */ }; enum { BPF_LOAD_HDR_OPT_TCP_SYN = (1ULL << 0), }; /* args[0] value during BPF_SOCK_OPS_HDR_OPT_LEN_CB and * BPF_SOCK_OPS_WRITE_HDR_OPT_CB. */ enum { BPF_WRITE_HDR_TCP_CURRENT_MSS = 1, /* Kernel is finding the * total option spaces * required for an established * sk in order to calculate the * MSS. No skb is actually * sent. */ BPF_WRITE_HDR_TCP_SYNACK_COOKIE = 2, /* Kernel is in syncookie mode * when sending a SYN. */ }; struct bpf_perf_event_value { __u64 counter; __u64 enabled; __u64 running; }; enum { BPF_DEVCG_ACC_MKNOD = (1ULL << 0), BPF_DEVCG_ACC_READ = (1ULL << 1), BPF_DEVCG_ACC_WRITE = (1ULL << 2), }; enum { BPF_DEVCG_DEV_BLOCK = (1ULL << 0), BPF_DEVCG_DEV_CHAR = (1ULL << 1), }; struct bpf_cgroup_dev_ctx { /* access_type encoded as (BPF_DEVCG_ACC_* << 16) | BPF_DEVCG_DEV_* */ __u32 access_type; __u32 major; __u32 minor; }; struct bpf_raw_tracepoint_args { __u64 args[0]; }; /* DIRECT: Skip the FIB rules and go to FIB table associated with device * OUTPUT: Do lookup from egress perspective; default is ingress */ enum { BPF_FIB_LOOKUP_DIRECT = (1U << 0), BPF_FIB_LOOKUP_OUTPUT = (1U << 1), }; enum { BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */ BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */ BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */ BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */ BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */ BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */ BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */ BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */ }; struct bpf_fib_lookup { /* input: network family for lookup (AF_INET, AF_INET6) * output: network family of egress nexthop */ __u8 family; /* set if lookup is to consider L4 data - e.g., FIB rules */ __u8 l4_protocol; __be16 sport; __be16 dport; /* total length of packet from network header - used for MTU check */ __u16 tot_len; /* input: L3 device index for lookup * output: device index from FIB lookup */ __u32 ifindex; union { /* inputs to lookup */ __u8 tos; /* AF_INET */ __be32 flowinfo; /* AF_INET6, flow_label + priority */ /* output: metric of fib result (IPv4/IPv6 only) */ __u32 rt_metric; }; union { __be32 ipv4_src; __u32 ipv6_src[4]; /* in6_addr; network order */ }; /* input to bpf_fib_lookup, ipv{4,6}_dst is destination address in * network header. output: bpf_fib_lookup sets to gateway address * if FIB lookup returns gateway route */ union { __be32 ipv4_dst; __u32 ipv6_dst[4]; /* in6_addr; network order */ }; /* output */ __be16 h_vlan_proto; __be16 h_vlan_TCI; __u8 smac[6]; /* ETH_ALEN */ __u8 dmac[6]; /* ETH_ALEN */ }; struct bpf_redir_neigh { /* network family for lookup (AF_INET, AF_INET6) */ __u32 nh_family; /* network address of nexthop; skips fib lookup to find gateway */ union { __be32 ipv4_nh; __u32 ipv6_nh[4]; /* in6_addr; network order */ }; }; enum bpf_task_fd_type { BPF_FD_TYPE_RAW_TRACEPOINT, /* tp name */ BPF_FD_TYPE_TRACEPOINT, /* tp name */ BPF_FD_TYPE_KPROBE, /* (symbol + offset) or addr */ BPF_FD_TYPE_KRETPROBE, /* (symbol + offset) or addr */ BPF_FD_TYPE_UPROBE, /* filename + offset */ BPF_FD_TYPE_URETPROBE, /* filename + offset */ }; enum { BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = (1U << 0), BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = (1U << 1), BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = (1U << 2), }; struct bpf_flow_keys { __u16 nhoff; __u16 thoff; __u16 addr_proto; /* ETH_P_* of valid addrs */ __u8 is_frag; __u8 is_first_frag; __u8 is_encap; __u8 ip_proto; __be16 n_proto; __be16 sport; __be16 dport; union { struct { __be32 ipv4_src; __be32 ipv4_dst; }; struct { __u32 ipv6_src[4]; /* in6_addr; network order */ __u32 ipv6_dst[4]; /* in6_addr; network order */ }; }; __u32 flags; __be32 flow_label; }; struct bpf_func_info { __u32 insn_off; __u32 type_id; }; #define BPF_LINE_INFO_LINE_NUM(line_col) ((line_col) >> 10) #define BPF_LINE_INFO_LINE_COL(line_col) ((line_col) & 0x3ff) struct bpf_line_info { __u32 insn_off; __u32 file_name_off; __u32 line_off; __u32 line_col; }; struct bpf_spin_lock { __u32 val; }; struct bpf_sysctl { __u32 write; /* Sysctl is being read (= 0) or written (= 1). * Allows 1,2,4-byte read, but no write. */ __u32 file_pos; /* Sysctl file position to read from, write to. * Allows 1,2,4-byte read an 4-byte write. */ }; struct bpf_sockopt { __bpf_md_ptr(struct bpf_sock *, sk); __bpf_md_ptr(void *, optval); __bpf_md_ptr(void *, optval_end); __s32 level; __s32 optname; __s32 optlen; __s32 retval; }; struct bpf_pidns_info { __u32 pid; __u32 tgid; }; /* User accessible data for SK_LOOKUP programs. Add new fields at the end. */ struct bpf_sk_lookup { __bpf_md_ptr(struct bpf_sock *, sk); /* Selected socket */ __u32 family; /* Protocol family (AF_INET, AF_INET6) */ __u32 protocol; /* IP protocol (IPPROTO_TCP, IPPROTO_UDP) */ __u32 remote_ip4; /* Network byte order */ __u32 remote_ip6[4]; /* Network byte order */ __u32 remote_port; /* Network byte order */ __u32 local_ip4; /* Network byte order */ __u32 local_ip6[4]; /* Network byte order */ __u32 local_port; /* Host byte order */ }; /* * struct btf_ptr is used for typed pointer representation; the * type id is used to render the pointer data as the appropriate type * via the bpf_snprintf_btf() helper described above. A flags field - * potentially to specify additional details about the BTF pointer * (rather than its mode of display) - is included for future use. * Display flags - BTF_F_* - are passed to bpf_snprintf_btf separately. */ struct btf_ptr { void *ptr; __u32 type_id; __u32 flags; /* BTF ptr flags; unused at present. */ }; /* * Flags to control bpf_snprintf_btf() behaviour. * - BTF_F_COMPACT: no formatting around type information * - BTF_F_NONAME: no struct/union member names/types * - BTF_F_PTR_RAW: show raw (unobfuscated) pointer values; * equivalent to %px. * - BTF_F_ZERO: show zero-valued struct/union members; they * are not displayed by default */ enum { BTF_F_COMPACT = (1ULL << 0), BTF_F_NONAME = (1ULL << 1), BTF_F_PTR_RAW = (1ULL << 2), BTF_F_ZERO = (1ULL << 3), }; #endif /* _UAPI__LINUX_BPF_H__ */ lxc-4.0.12/src/include/fexecve.c0000644061062106075000000000275714176403775013351 00000000000000/* liblxcapi * * Copyright © 2019 Christian Brauner . * Copyright © 2019 Canonical Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include #include #include #include #include "config.h" #include "macro.h" #include "process_utils.h" int fexecve(int fd, char *const argv[], char *const envp[]) { char procfd[LXC_PROC_PID_FD_LEN]; int ret; if (fd < 0 || !argv || !envp) { errno = EINVAL; return -1; } execveat(fd, "", argv, envp, AT_EMPTY_PATH); if (errno != ENOSYS) return -1; ret = snprintf(procfd, sizeof(procfd), "/proc/self/fd/%d", fd); if (ret < 0 || (size_t)ret >= sizeof(procfd)) { errno = ENAMETOOLONG; return -1; } execve(procfd, argv, envp); return -1; } lxc-4.0.12/src/include/netns_ifaddrs.h0000644061062106075000000000255014176403775014543 00000000000000#ifndef _LXC_NETNS_IFADDRS_H #define _LXC_NETNS_IFADDRS_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include "../lxc/compiler.h" #include "../lxc/memory_utils.h" struct netns_ifaddrs { struct netns_ifaddrs *ifa_next; /* Can - but shouldn't be - NULL. */ char *ifa_name; /* This field is not present struct ifaddrs. */ int ifa_ifindex; unsigned ifa_flags; /* This field is not present struct ifaddrs. */ int ifa_mtu; /* This field is not present struct ifaddrs. */ int ifa_prefixlen; struct sockaddr *ifa_addr; struct sockaddr *ifa_netmask; union { struct sockaddr *ifu_broadaddr; struct sockaddr *ifu_dstaddr; } ifa_ifu; /* These fields are not present struct ifaddrs. */ int ifa_stats_type; #if HAVE_STRUCT_RTNL_LINK_STATS64 struct rtnl_link_stats64 ifa_stats; #else struct rtnl_link_stats ifa_stats; #endif }; #define __ifa_broadaddr ifa_ifu.ifu_broadaddr #define __ifa_dstaddr ifa_ifu.ifu_dstaddr __hidden extern void netns_freeifaddrs(struct netns_ifaddrs *); define_cleanup_function(struct netns_ifaddrs *, netns_freeifaddrs); __hidden extern int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id, bool *netnsid_aware); #ifdef __cplusplus } #endif #endif /* _LXC_NETNS_IFADDRS_H */ lxc-4.0.12/src/include/strlcpy.h0000644061062106075000000000172514176403775013423 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #ifndef _STRLCPY_H #define _STRLCPY_H #include "../lxc/compiler.h" #include __hidden extern size_t strlcpy(char *, const char *, size_t); #endif lxc-4.0.12/src/include/bpf_common.h0000644061062106075000000000254614176403775014044 00000000000000/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _UAPI__LINUX_BPF_COMMON_H__ #define _UAPI__LINUX_BPF_COMMON_H__ /* Instruction classes */ #define BPF_CLASS(code) ((code) & 0x07) #define BPF_LD 0x00 #define BPF_LDX 0x01 #define BPF_ST 0x02 #define BPF_STX 0x03 #define BPF_ALU 0x04 #define BPF_JMP 0x05 #define BPF_RET 0x06 #define BPF_MISC 0x07 /* ld/ldx fields */ #define BPF_SIZE(code) ((code) & 0x18) #define BPF_W 0x00 /* 32-bit */ #define BPF_H 0x08 /* 16-bit */ #define BPF_B 0x10 /* 8-bit */ /* eBPF BPF_DW 0x18 64-bit */ #define BPF_MODE(code) ((code) & 0xe0) #define BPF_IMM 0x00 #define BPF_ABS 0x20 #define BPF_IND 0x40 #define BPF_MEM 0x60 #define BPF_LEN 0x80 #define BPF_MSH 0xa0 /* alu/jmp fields */ #define BPF_OP(code) ((code) & 0xf0) #define BPF_ADD 0x00 #define BPF_SUB 0x10 #define BPF_MUL 0x20 #define BPF_DIV 0x30 #define BPF_OR 0x40 #define BPF_AND 0x50 #define BPF_LSH 0x60 #define BPF_RSH 0x70 #define BPF_NEG 0x80 #define BPF_MOD 0x90 #define BPF_XOR 0xa0 #define BPF_JA 0x00 #define BPF_JEQ 0x10 #define BPF_JGT 0x20 #define BPF_JGE 0x30 #define BPF_JSET 0x40 #define BPF_SRC(code) ((code) & 0x08) #define BPF_K 0x00 #define BPF_X 0x08 #ifndef BPF_MAXINSNS #define BPF_MAXINSNS 4096 #endif #endif /* _UAPI__LINUX_BPF_COMMON_H__ */ lxc-4.0.12/src/include/prlimit.h0000644061062106075000000000334114176403775013377 00000000000000/* * Copyright (C) 2008 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _PRLIMIT_H #define _PRLIMIT_H #include #include #include "../lxc/memory_utils.h" #define RLIM_SAVED_CUR RLIM_INFINITY #define RLIM_SAVED_MAX RLIM_INFINITY __hidden int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); __hidden int prlimit64(pid_t, int, const struct rlimit64 *, struct rlimit64 *); #endif lxc-4.0.12/src/include/lxcmntent.h0000644061062106075000000000320214176403775013727 00000000000000/* Utilities for reading/writing fstab, mtab, etc. Copyright (C) 1995-2000, 2001, 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LXCMNTENT_H #define _LXCMNTENT_H #include "../lxc/compiler.h" #if IS_BIONIC struct mntent { char* mnt_fsname; char* mnt_dir; char* mnt_type; char* mnt_opts; int mnt_freq; int mnt_passno; }; __hidden extern struct mntent *getmntent(FILE *stream); __hidden extern struct mntent *getmntent_r(FILE *stream, struct mntent *mp, char *buffer, int bufsiz); #endif #if !defined(HAVE_SETMNTENT) || IS_BIONIC __hidden FILE *setmntent(const char *file, const char *mode); #endif #if !defined(HAVE_ENDMNTENT) || IS_BIONIC __hidden int endmntent(FILE *stream); #endif #if !defined(HAVE_HASMNTOPT) || IS_BIONIC __hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt); #endif #endif lxc-4.0.12/src/include/openpty.c0000644061062106075000000000474014176403775013414 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #ifdef HAVE_PTY_H #include #endif static int pts_name(int fd, char **pts, size_t buf_len) { int rv; char *buf = *pts; for (;;) { char *new_buf; if (buf_len) { rv = ptsname_r(fd, buf, buf_len); if (rv != 0 || memchr(buf, '\0', buf_len)) /* We either got an error, or we succeeded and the returned name fit in the buffer. */ break; /* Try again with a longer buffer. */ buf_len += buf_len; /* Double it */ } else /* No initial buffer; start out by mallocing one. */ buf_len = 128; /* First time guess. */ if (buf != *pts) /* We've already malloced another buffer at least once. */ new_buf = realloc(buf, buf_len); else new_buf = malloc(buf_len); if (!new_buf) { rv = -1; break; } buf = new_buf; } if (rv == 0) *pts = buf; /* Return buffer to the user. */ else if (buf != *pts) free(buf); /* Free what we malloced when returning an error. */ return rv; } int __unlockpt(int fd) { #ifdef TIOCSPTLCK int unlock = 0; if (ioctl(fd, TIOCSPTLCK, &unlock)) { if (errno != EINVAL) return -1; } #endif return 0; } int openpty(int *ptx, int *pty, char *name, const struct termios *termp, const struct winsize *winp) { char _buf[PATH_MAX]; char *buf = _buf; int ptx_fd, ret = -1, pty_fd = -1; *buf = '\0'; ptx_fd = open("/dev/ptmx", O_RDWR | O_NOCTTY); if (ptx_fd == -1) return -1; if (__unlockpt(ptx_fd)) goto on_error; #ifdef TIOCGPTPEER /* Try to allocate pty_fd solely based on ptx_fd first. */ pty_fd = ioctl(ptx_fd, TIOCGPTPEER, O_RDWR | O_NOCTTY); #endif if (pty_fd == -1) { /* Fallback to path-based pty_fd allocation in case kernel doesn't * support TIOCGPTPEER. */ if (pts_name(ptx_fd, &buf, sizeof(_buf))) goto on_error; pty_fd = open(buf, O_RDWR | O_NOCTTY); if (pty_fd == -1) goto on_error; } if (termp) tcsetattr(pty_fd, TCSAFLUSH, termp); #ifdef TIOCSWINSZ if (winp) ioctl(pty_fd, TIOCSWINSZ, winp); #endif *ptx = ptx_fd; *pty = pty_fd; if (name != NULL) { if (*buf == '\0') if (pts_name(ptx_fd, &buf, sizeof(_buf))) goto on_error; strcpy(name, buf); } ret = 0; on_error: if (ret == -1) { close(ptx_fd); if (pty_fd != -1) close(pty_fd); } if (buf != _buf) free(buf); return ret; } lxc-4.0.12/src/include/strchrnul.h0000644061062106075000000000224214176403775013742 00000000000000/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and bug fix and commentary by Jim Blandy (jimb@ai.mit.edu); adaptation to strchr suggested by Dick Karpinski (dick@cca.ucsf.edu), and implemented by Roland McGrath (roland@ai.mit.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #include "../lxc/compiler.h" __hidden extern char *strchrnul(const char *s, int c_in); lxc-4.0.12/src/include/getgrgid_r.h0000644061062106075000000000212314176403775014031 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #ifndef _GETGRGID_R_H #define _GETGRGID_R_H #include #include #include #include "../lxc/compiler.h" __hidden extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, struct group **res); #endif /* _GETGRGID_R_H */ lxc-4.0.12/src/include/getline.c0000644061062106075000000000415214176403775013342 00000000000000/* * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. * * This software was developed by SPARTA ISSO under SPAWAR contract * N66001-04-C-6019 ("SEFOS"). * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include /* * Emulate glibc getline() via BSD fgetln(). * Note that outsize is not changed unless memory is allocated. */ ssize_t getline(char **outbuf, size_t *outsize, FILE *fp) { size_t len; char *buf; buf = fgetln(fp, &len); if (buf == NULL) return (-1); /* Assumes realloc() accepts NULL for ptr (C99) */ if (*outbuf == NULL || *outsize < len + 1) { void *tmp = realloc(*outbuf, len + 1); if (tmp == NULL) return (-1); *outbuf = tmp; *outsize = len + 1; } memcpy(*outbuf, buf, len); (*outbuf)[len] = '\0'; return (len); } lxc-4.0.12/src/include/strlcat.c0000644061062106075000000000221314176403775013363 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #include #include #include #if !HAVE_STRLCPY #include "strlcpy.h" #endif size_t strlcat(char *src, const char *append, size_t len) { size_t src_len; src_len = strnlen(src, len); if (src_len == len) return src_len + strlen(append); return src_len + strlcpy(src + src_len, append, len - src_len); } lxc-4.0.12/src/include/strlcpy.c0000644061062106075000000000204014176403775013405 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #include size_t strlcpy(char *dest, const char *src, size_t size) { size_t ret = strlen(src); if (size) { size_t len = (ret >= size) ? size - 1 : ret; memcpy(dest, src, len); dest[len] = '\0'; } return ret; } lxc-4.0.12/src/include/netns_ifaddrs.c0000644061062106075000000003104314176403775014535 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "nl.h" #include "macro.h" #include "netns_ifaddrs.h" #ifndef NETNS_RTA #define NETNS_RTA(r) \ ((struct rtattr *)(((char *)(r)) + NLMSG_ALIGN(sizeof(struct rtgenmsg)))) #endif #define IFADDRS_HASH_SIZE 64 #define __NETLINK_ALIGN(len) (((len) + 3) & ~3) #define __NLMSG_OK(nlh, end) \ ((size_t)((char *)(end) - (char *)(nlh)) >= sizeof(struct nlmsghdr)) #define __NLMSG_NEXT(nlh) \ (struct nlmsghdr *)((char *)(nlh) + __NETLINK_ALIGN((nlh)->nlmsg_len)) #define __NLMSG_DATA(nlh) ((void *)((char *)(nlh) + sizeof(struct nlmsghdr))) #define __NLMSG_DATAEND(nlh) ((char *)(nlh) + (nlh)->nlmsg_len) #define __NLMSG_RTA(nlh, len) \ ((void *)((char *)(nlh) + sizeof(struct nlmsghdr) + \ __NETLINK_ALIGN(len))) #define __RTA_DATALEN(rta) ((rta)->rta_len - sizeof(struct rtattr)) #define __RTA_NEXT(rta) \ (struct rtattr *)((char *)(rta) + __NETLINK_ALIGN((rta)->rta_len)) #define __RTA_OK(nlh, end) \ ((size_t)((char *)(end) - (char *)(rta)) >= sizeof(struct rtattr)) #define __NLMSG_RTAOK(rta, nlh) __RTA_OK(rta, __NLMSG_DATAEND(nlh)) #define __IN6_IS_ADDR_LINKLOCAL(a) \ ((((uint8_t *)(a))[0]) == 0xfe && (((uint8_t *)(a))[1] & 0xc0) == 0x80) #define __IN6_IS_ADDR_MC_LINKLOCAL(a) \ (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *)(a))[1] & 0xf) == 0x2)) #define __RTA_DATA(rta) ((void *)((char *)(rta) + sizeof(struct rtattr))) /* getifaddrs() reports hardware addresses with PF_PACKET that implies struct * sockaddr_ll. But e.g. Infiniband socket address length is longer than * sockaddr_ll.ssl_addr[8] can hold. Use this hack struct to extend ssl_addr - * callers should be able to still use it. */ struct sockaddr_ll_hack { unsigned short sll_family, sll_protocol; int sll_ifindex; unsigned short sll_hatype; unsigned char sll_pkttype, sll_halen; unsigned char sll_addr[24]; }; union sockany { struct sockaddr sa; struct sockaddr_ll_hack ll; struct sockaddr_in v4; struct sockaddr_in6 v6; }; struct ifaddrs_storage { struct netns_ifaddrs ifa; struct ifaddrs_storage *hash_next; union sockany addr, netmask, ifu; unsigned int index; char name[IFNAMSIZ + 1]; }; struct ifaddrs_ctx { struct ifaddrs_storage *first; struct ifaddrs_storage *last; struct ifaddrs_storage *hash[IFADDRS_HASH_SIZE]; }; static void copy_addr(struct sockaddr **r, int af, union sockany *sa, void *addr, size_t addrlen, int ifindex) { uint8_t *dst; size_t len; switch (af) { case AF_INET: dst = (uint8_t *)&sa->v4.sin_addr; len = 4; break; case AF_INET6: dst = (uint8_t *)&sa->v6.sin6_addr; len = 16; if (__IN6_IS_ADDR_LINKLOCAL(addr) || __IN6_IS_ADDR_MC_LINKLOCAL(addr)) sa->v6.sin6_scope_id = ifindex; break; default: return; } if (addrlen < len) return; sa->sa.sa_family = af; memcpy(dst, addr, len); *r = &sa->sa; } static void gen_netmask(struct sockaddr **r, int af, union sockany *sa, int prefixlen) { uint8_t addr[16] = {0}; int i; if ((size_t)prefixlen > 8 * sizeof(addr)) prefixlen = 8 * sizeof(addr); i = prefixlen / 8; memset(addr, 0xff, i); if ((size_t)i < sizeof(addr)) addr[i++] = 0xff << (8 - (prefixlen % 8)); copy_addr(r, af, sa, addr, sizeof(addr), 0); } static void copy_lladdr(struct sockaddr **r, union sockany *sa, void *addr, size_t addrlen, int ifindex, unsigned short hatype) { if (addrlen > sizeof(sa->ll.sll_addr)) return; sa->ll.sll_family = AF_PACKET; sa->ll.sll_ifindex = ifindex; sa->ll.sll_hatype = hatype; sa->ll.sll_halen = addrlen; memcpy(sa->ll.sll_addr, addr, addrlen); *r = &sa->sa; } static int nl_msg_to_ifaddr(void *pctx, bool *netnsid_aware, struct nlmsghdr *h) { struct ifaddrs_storage *ifs, *ifs0; struct rtattr *rta; int stats_len = 0; struct ifinfomsg *ifi = __NLMSG_DATA(h); struct ifaddrmsg *ifa = __NLMSG_DATA(h); struct ifaddrs_ctx *ctx = pctx; if (h->nlmsg_type == RTM_NEWLINK) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" for (rta = __NLMSG_RTA(h, sizeof(*ifi)); __NLMSG_RTAOK(rta, h); rta = __RTA_NEXT(rta)) { #if HAVE_STRUCT_RTNL_LINK_STATS64 if (rta->rta_type != IFLA_STATS64) #else if (rta->rta_type != IFLA_STATS) #endif continue; stats_len = __RTA_DATALEN(rta); break; } #pragma GCC diagnostic pop } else { for (ifs0 = ctx->hash[ifa->ifa_index % IFADDRS_HASH_SIZE]; ifs0; ifs0 = ifs0->hash_next) if (ifs0->index == ifa->ifa_index) break; if (!ifs0) return 0; } ifs = calloc(1, sizeof(struct ifaddrs_storage) + stats_len); if (!ifs) { errno = ENOMEM; return -1; } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" if (h->nlmsg_type == RTM_NEWLINK) { ifs->index = ifi->ifi_index; ifs->ifa.ifa_ifindex = ifi->ifi_index; ifs->ifa.ifa_flags = ifi->ifi_flags; for (rta = __NLMSG_RTA(h, sizeof(*ifi)); __NLMSG_RTAOK(rta, h); rta = __RTA_NEXT(rta)) { switch (rta->rta_type) { case IFLA_IFNAME: if (__RTA_DATALEN(rta) < sizeof(ifs->name)) { memcpy(ifs->name, __RTA_DATA(rta), __RTA_DATALEN(rta)); ifs->ifa.ifa_name = ifs->name; } break; case IFLA_ADDRESS: copy_lladdr(&ifs->ifa.ifa_addr, &ifs->addr, __RTA_DATA(rta), __RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type); break; case IFLA_BROADCAST: copy_lladdr(&ifs->ifa.__ifa_broadaddr, &ifs->ifu, __RTA_DATA(rta), __RTA_DATALEN(rta), ifi->ifi_index, ifi->ifi_type); break; #if HAVE_STRUCT_RTNL_LINK_STATS64 case IFLA_STATS64: ifs->ifa.ifa_stats_type = IFLA_STATS64; #else case IFLA_STATS: ifs->ifa.ifa_stats_type = IFLA_STATS; #endif memcpy(&ifs->ifa.ifa_stats, __RTA_DATA(rta), __RTA_DATALEN(rta)); break; case IFLA_MTU: memcpy(&ifs->ifa.ifa_mtu, __RTA_DATA(rta), sizeof(int)); break; case IFLA_TARGET_NETNSID: *netnsid_aware = true; break; } } if (ifs->ifa.ifa_name) { unsigned int bucket = ifs->index % IFADDRS_HASH_SIZE; ifs->hash_next = ctx->hash[bucket]; ctx->hash[bucket] = ifs; } } else { ifs->ifa.ifa_name = ifs0->ifa.ifa_name; ifs->ifa.ifa_mtu = ifs0->ifa.ifa_mtu; ifs->ifa.ifa_ifindex = ifs0->ifa.ifa_ifindex; ifs->ifa.ifa_flags = ifs0->ifa.ifa_flags; for (rta = __NLMSG_RTA(h, sizeof(*ifa)); __NLMSG_RTAOK(rta, h); rta = __RTA_NEXT(rta)) { switch (rta->rta_type) { case IFA_ADDRESS: /* If ifa_addr is already set we, received an * IFA_LOCAL before so treat this as * destination address. */ if (ifs->ifa.ifa_addr) copy_addr(&ifs->ifa.__ifa_dstaddr, ifa->ifa_family, &ifs->ifu, __RTA_DATA(rta), __RTA_DATALEN(rta), ifa->ifa_index); else copy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, __RTA_DATA(rta), __RTA_DATALEN(rta), ifa->ifa_index); break; case IFA_BROADCAST: copy_addr(&ifs->ifa.__ifa_broadaddr, ifa->ifa_family, &ifs->ifu, __RTA_DATA(rta), __RTA_DATALEN(rta), ifa->ifa_index); break; case IFA_LOCAL: /* If ifa_addr is set and we get IFA_LOCAL, * assume we have a point-to-point network. * Move address to correct field. */ if (ifs->ifa.ifa_addr) { ifs->ifu = ifs->addr; ifs->ifa.__ifa_dstaddr = &ifs->ifu.sa; memset(&ifs->addr, 0, sizeof(ifs->addr)); } copy_addr(&ifs->ifa.ifa_addr, ifa->ifa_family, &ifs->addr, __RTA_DATA(rta), __RTA_DATALEN(rta), ifa->ifa_index); break; case IFA_LABEL: if (__RTA_DATALEN(rta) < sizeof(ifs->name)) { memcpy(ifs->name, __RTA_DATA(rta), __RTA_DATALEN(rta)); ifs->ifa.ifa_name = ifs->name; } break; case IFA_TARGET_NETNSID: *netnsid_aware = true; break; } } if (ifs->ifa.ifa_addr) { gen_netmask(&ifs->ifa.ifa_netmask, ifa->ifa_family, &ifs->netmask, ifa->ifa_prefixlen); ifs->ifa.ifa_prefixlen = ifa->ifa_prefixlen; } } #pragma GCC diagnostic pop if (ifs->ifa.ifa_name) { if (!ctx->first) ctx->first = ifs; if (ctx->last) ctx->last->ifa.ifa_next = &ifs->ifa; ctx->last = ifs; } else { free(ifs); } return 0; } static int __ifaddrs_netlink_send(int fd, struct nlmsghdr *nlmsghdr) { int ret; struct sockaddr_nl nladdr; struct iovec iov = { .iov_base = nlmsghdr, .iov_len = nlmsghdr->nlmsg_len, }; struct msghdr msg = { .msg_name = &nladdr, .msg_namelen = sizeof(nladdr), .msg_iov = &iov, .msg_iovlen = 1, }; memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; nladdr.nl_pid = 0; nladdr.nl_groups = 0; ret = sendmsg(fd, &msg, MSG_NOSIGNAL); if (ret < 0) return -1; return ret; } static int __ifaddrs_netlink_recv(int fd, unsigned int seq, int type, int af, __s32 netns_id, bool *netnsid_aware, int (*cb)(void *ctx, bool *netnsid_aware, struct nlmsghdr *h), void *ctx) { int r, property, ret; char *buf; struct nlmsghdr *hdr; struct ifinfomsg *ifi_msg; struct ifaddrmsg *ifa_msg; union { uint8_t buf[8192]; struct { struct nlmsghdr nlh; struct rtgenmsg g; } req; struct nlmsghdr reply; } u; char getlink_buf[__NETLINK_ALIGN(sizeof(struct nlmsghdr)) + __NETLINK_ALIGN(sizeof(struct ifinfomsg)) + __NETLINK_ALIGN(1024)] = {0}; char getaddr_buf[__NETLINK_ALIGN(sizeof(struct nlmsghdr)) + __NETLINK_ALIGN(sizeof(struct ifaddrmsg)) + __NETLINK_ALIGN(1024)] = {0}; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" if (type == RTM_GETLINK) { buf = getlink_buf; hdr = (struct nlmsghdr *)buf; hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi_msg)); ifi_msg = (struct ifinfomsg *)__NLMSG_DATA(hdr); ifi_msg->ifi_family = af; property = IFLA_TARGET_NETNSID; } else if (type == RTM_GETADDR) { buf = getaddr_buf; hdr = (struct nlmsghdr *)buf; hdr->nlmsg_len = NLMSG_LENGTH(sizeof(*ifa_msg)); ifa_msg = (struct ifaddrmsg *)__NLMSG_DATA(hdr); ifa_msg->ifa_family = af; property = IFA_TARGET_NETNSID; } else { errno = EINVAL; return -1; } #pragma GCC diagnostic pop hdr->nlmsg_type = type; hdr->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; hdr->nlmsg_pid = 0; hdr->nlmsg_seq = seq; if (netns_id >= 0) addattr(hdr, 1024, property, &netns_id, sizeof(netns_id)); r = __ifaddrs_netlink_send(fd, hdr); if (r < 0) return -1; for (;;) { r = recv(fd, u.buf, sizeof(u.buf), MSG_DONTWAIT); if (r <= 0) return -1; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" for (hdr = &u.reply; __NLMSG_OK(hdr, (void *)&u.buf[r]); hdr = __NLMSG_NEXT(hdr)) { if (hdr->nlmsg_type == NLMSG_DONE) return 0; if (hdr->nlmsg_type == NLMSG_ERROR) { errno = EINVAL; return -1; } ret = cb(ctx, netnsid_aware, hdr); if (ret) return ret; } #pragma GCC diagnostic pop } } static int __rtnl_enumerate(int link_af, int addr_af, __s32 netns_id, bool *netnsid_aware, int (*cb)(void *ctx, bool *netnsid_aware, struct nlmsghdr *h), void *ctx) { int fd, r, saved_errno; bool getaddr_netnsid_aware = false, getlink_netnsid_aware = false; fd = socket(PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); if (fd < 0) return -1; r = setsockopt(fd, SOL_NETLINK, NETLINK_GET_STRICT_CHK, &(int){1}, sizeof(int)); if (r < 0 && netns_id >= 0) { close(fd); *netnsid_aware = false; return -1; } r = __ifaddrs_netlink_recv(fd, 1, RTM_GETLINK, link_af, netns_id, &getlink_netnsid_aware, cb, ctx); if (!r) r = __ifaddrs_netlink_recv(fd, 2, RTM_GETADDR, addr_af, netns_id, &getaddr_netnsid_aware, cb, ctx); saved_errno = errno; close(fd); errno = saved_errno; if (getaddr_netnsid_aware && getlink_netnsid_aware) *netnsid_aware = true; else *netnsid_aware = false; return r; } void netns_freeifaddrs(struct netns_ifaddrs *ifp) { struct netns_ifaddrs *n; while (ifp) { n = ifp->ifa_next; free(ifp); ifp = n; } } int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id, bool *netnsid_aware) { int r, saved_errno; struct ifaddrs_ctx _ctx; struct ifaddrs_ctx *ctx = &_ctx; memset(ctx, 0, sizeof *ctx); r = __rtnl_enumerate(AF_UNSPEC, AF_UNSPEC, netns_id, netnsid_aware, nl_msg_to_ifaddr, ctx); saved_errno = errno; if (r < 0) netns_freeifaddrs(&ctx->first->ifa); else *ifap = &ctx->first->ifa; errno = saved_errno; return r; } lxc-4.0.12/src/include/fexecve.h0000644061062106075000000000205614176403775013346 00000000000000/* liblxcapi * * Copyright © 2019 Christian Brauner . * Copyright © 2019 Canonical Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LXC_FEXECVE_H #define _LXC_FEXECVE_H #include "../lxc/compiler.h" #include __hidden extern int fexecve(int fd, char *const argv[], char *const envp[]); #endif /* _LXC_FEXECVE_H */ lxc-4.0.12/src/include/getline.h0000644061062106075000000000313414176403775013346 00000000000000/* * Copyright (c) 2006 SPARTA, Inc. * All rights reserved. * * This software was developed by SPARTA ISSO under SPAWAR contract * N66001-04-C-6019 ("SEFOS"). * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #ifndef _GETLINE_H #define _GETLINE_H #include #include "../lxc/compiler.h" __hidden extern ssize_t getline(char **outbuf, size_t *outsize, FILE *fp); #endif lxc-4.0.12/src/include/strlcat.h0000644061062106075000000000174214176403775013376 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #ifndef _STRLCAT_H #define _STRLCAT_H #include "../lxc/compiler.h" #include __hidden extern size_t strlcat(char *src, const char *append, size_t len); #endif lxc-4.0.12/src/include/getgrgid_r.c0000644061062106075000000002300514176403775014026 00000000000000/* liblxcapi * * Copyright © 2018 Christian Brauner . * Copyright © 2018 Canonical Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * This function has been copied from musl. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #define LOGIN_NAME_MAX 256 #define NSCDVERSION 2 #define GETPWBYNAME 0 #define GETPWBYUID 1 #define GETGRBYNAME 2 #define GETGRBYGID 3 #define GETINITGR 15 #define REQVERSION 0 #define REQTYPE 1 #define REQKEYLEN 2 #define REQ_LEN 3 #define PWVERSION 0 #define PWFOUND 1 #define PWNAMELEN 2 #define PWPASSWDLEN 3 #define PWUID 4 #define PWGID 5 #define PWGECOSLEN 6 #define PWDIRLEN 7 #define PWSHELLLEN 8 #define PW_LEN 9 #define GRVERSION 0 #define GRFOUND 1 #define GRNAMELEN 2 #define GRPASSWDLEN 3 #define GRGID 4 #define GRMEMCNT 5 #define GR_LEN 6 #define INITGRVERSION 0 #define INITGRFOUND 1 #define INITGRNGRPS 2 #define INITGR_LEN 3 #define FIX(x) (gr->gr_##x = gr->gr_##x - line + buf) static unsigned atou(char **s) { unsigned x; for (x = 0; **s - '0' < 10U; ++*s) x = 10 * x + (**s - '0'); return x; } static int __getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, char ***mem, size_t *nmem, struct group **res) { ssize_t l; char *s, *mems; size_t i; int rv = 0; #ifdef HAVE_PTHREAD_SETCANCELSTATE int cs; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); #endif for (;;) { if ((l = getline(line, size, f)) < 0) { rv = ferror(f) ? errno : 0; free(*line); *line = 0; gr = 0; goto end; } line[0][l - 1] = 0; s = line[0]; gr->gr_name = s++; if (!(s = strchr(s, ':'))) continue; *s++ = 0; gr->gr_passwd = s; if (!(s = strchr(s, ':'))) continue; *s++ = 0; gr->gr_gid = atou(&s); if (*s != ':') continue; *s++ = 0; mems = s; break; } for (*nmem = !!*s; *s; s++) if (*s == ',') ++*nmem; free(*mem); *mem = calloc(sizeof(char *), *nmem + 1); if (!*mem) { rv = errno; free(*line); *line = 0; gr = 0; goto end; } if (*mems) { mem[0][0] = mems; for (s = mems, i = 0; *s; s++) if (*s == ',') *s++ = 0, mem[0][++i] = s; mem[0][++i] = 0; } else { mem[0][0] = 0; } gr->gr_mem = *mem; end: #ifdef HAVE_PTHREAD_SETCANCELSTATE pthread_setcancelstate(cs, 0); #endif *res = gr; if (rv) errno = rv; return rv; } static char *itoa(char *p, uint32_t x) { // number of digits in a uint32_t + NUL p += 11; *--p = 0; do { *--p = '0' + x % 10; x /= 10; } while (x); return p; } static const struct { short sun_family; char sun_path[21]; } addr = {AF_UNIX, "/var/run/nscd/socket"}; static FILE *__nscd_query(int32_t req, const char *key, int32_t *buf, size_t len, int *swap) { size_t i; int fd; FILE *f = 0; int32_t req_buf[REQ_LEN] = {NSCDVERSION, req, strnlen(key, LOGIN_NAME_MAX) + 1}; struct msghdr msg = {.msg_iov = (struct iovec[]){{&req_buf, sizeof(req_buf)}, {(char *)key, strlen(key) + 1}}, .msg_iovlen = 2}; int errno_save = errno; *swap = 0; retry: memset(buf, 0, len); buf[0] = NSCDVERSION; fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) return NULL; if (!(f = fdopen(fd, "r"))) { close(fd); return 0; } if (req_buf[2] > LOGIN_NAME_MAX) return f; if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { /* If there isn't a running nscd we simulate a "not found" * result and the caller is responsible for calling * fclose on the (unconnected) socket. The value of * errno must be left unchanged in this case. */ if (errno == EACCES || errno == ECONNREFUSED || errno == ENOENT) { errno = errno_save; return f; } goto error; } if (sendmsg(fd, &msg, MSG_NOSIGNAL) < 0) goto error; if (!fread(buf, len, 1, f)) { /* If the VERSION entry mismatches nscd will disconnect. The * most likely cause is that the endianness mismatched. So, we * byteswap and try once more. (if we already swapped, just * fail out) */ if (ferror(f)) goto error; if (!*swap) { fclose(f); for (i = 0; i < sizeof(req_buf) / sizeof(req_buf[0]); i++) { req_buf[i] = bswap_32(req_buf[i]); } *swap = 1; goto retry; } else { errno = EIO; goto error; } } if (*swap) { for (i = 0; i < len / sizeof(buf[0]); i++) { buf[i] = bswap_32(buf[i]); } } /* The first entry in every nscd response is the version number. This * really shouldn't happen, and is evidence of some form of malformed * response. */ if (buf[0] != NSCDVERSION) { errno = EIO; goto error; } return f; error: fclose(f); return 0; } static int __getgr_a(const char *name, gid_t gid, struct group *gr, char **buf, size_t *size, char ***mem, size_t *nmem, struct group **res) { FILE *f; int rv = 0; #ifdef HAVE_PTHREAD_SETCANCELSTATE int cs; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); #endif *res = 0; f = fopen("/etc/group", "rbe"); if (!f) { rv = errno; goto done; } while (!(rv = __getgrent_a(f, gr, buf, size, mem, nmem, res)) && *res) { if ((name && !strcmp(name, (*res)->gr_name)) || (!name && (*res)->gr_gid == gid)) { break; } } fclose(f); if (!*res && (rv == 0 || rv == ENOENT || rv == ENOTDIR)) { int32_t req = name ? GETGRBYNAME : GETGRBYGID; int32_t i; const char *key; int32_t groupbuf[GR_LEN] = {0}; size_t len = 0; size_t grlist_len = 0; char gidbuf[11] = {0}; int swap = 0; char *ptr; if (name) { key = name; } else { if (gid < 0 || gid > UINT32_MAX) { rv = 0; goto done; } key = itoa(gidbuf, gid); } f = __nscd_query(req, key, groupbuf, sizeof groupbuf, &swap); if (!f) { rv = errno; goto done; } if (!groupbuf[GRFOUND]) { rv = 0; goto cleanup_f; } if (!groupbuf[GRNAMELEN] || !groupbuf[GRPASSWDLEN]) { rv = EIO; goto cleanup_f; } if ((int64_t)groupbuf[GRNAMELEN] > (int64_t)(SIZE_MAX - groupbuf[GRPASSWDLEN])) { rv = ENOMEM; goto cleanup_f; } len = groupbuf[GRNAMELEN] + groupbuf[GRPASSWDLEN]; for (i = 0; i < groupbuf[GRMEMCNT]; i++) { uint32_t name_len; if (fread(&name_len, sizeof name_len, 1, f) < 1) { rv = ferror(f) ? errno : EIO; goto cleanup_f; } if (swap) { name_len = bswap_32(name_len); } if (name_len > SIZE_MAX - grlist_len || name_len > SIZE_MAX - len) { rv = ENOMEM; goto cleanup_f; } len += name_len; grlist_len += name_len; } if (len > *size || !*buf) { char *tmp = realloc(*buf, len); if (!tmp) { rv = errno; goto cleanup_f; } *buf = tmp; *size = len; } if (!fread(*buf, len, 1, f)) { rv = ferror(f) ? errno : EIO; goto cleanup_f; } if (((size_t)(groupbuf[GRMEMCNT] + 1)) > *nmem) { if (((size_t)(groupbuf[GRMEMCNT] + 1)) > (SIZE_MAX / sizeof(char *))) { rv = ENOMEM; goto cleanup_f; } char **tmp = realloc(*mem, (groupbuf[GRMEMCNT] + 1) * sizeof(char *)); if (!tmp) { rv = errno; goto cleanup_f; } *mem = tmp; *nmem = groupbuf[GRMEMCNT] + 1; } if (groupbuf[GRMEMCNT]) { mem[0][0] = *buf + groupbuf[GRNAMELEN] + groupbuf[GRPASSWDLEN]; for (ptr = mem[0][0], i = 0; ptr != mem[0][0] + grlist_len; ptr++) if (!*ptr) mem[0][++i] = ptr + 1; mem[0][i] = 0; if (i != groupbuf[GRMEMCNT]) { rv = EIO; goto cleanup_f; } } else { mem[0][0] = 0; } gr->gr_name = *buf; gr->gr_passwd = gr->gr_name + groupbuf[GRNAMELEN]; gr->gr_gid = groupbuf[GRGID]; gr->gr_mem = *mem; if (gr->gr_passwd[-1] || gr->gr_passwd[groupbuf[GRPASSWDLEN] - 1]) { rv = EIO; goto cleanup_f; } if ((name && strcmp(name, gr->gr_name)) || (!name && gid != gr->gr_gid)) { rv = EIO; goto cleanup_f; } *res = gr; cleanup_f: fclose(f); goto done; } done: #ifdef HAVE_PTHREAD_SETCANCELSTATE pthread_setcancelstate(cs, 0); #endif if (rv) errno = rv; return rv; } static int getgr_r(const char *name, gid_t gid, struct group *gr, char *buf, size_t size, struct group **res) { char *line = 0; size_t len = 0; char **mem = 0; size_t nmem = 0; int rv = 0; size_t i; #ifdef HAVE_PTHREAD_SETCANCELSTATE int cs; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); #endif rv = __getgr_a(name, gid, gr, &line, &len, &mem, &nmem, res); if (*res && size < len + (nmem + 1) * sizeof(char *) + 32) { *res = 0; rv = ERANGE; } if (*res) { buf += (16 - (uintptr_t)buf) % 16; gr->gr_mem = (void *)buf; buf += (nmem + 1) * sizeof(char *); memcpy(buf, line, len); FIX(name); FIX(passwd); for (i = 0; mem[i]; i++) gr->gr_mem[i] = mem[i] - line + buf; gr->gr_mem[i] = 0; } free(mem); free(line); #ifdef HAVE_PTHREAD_SETCANCELSTATE pthread_setcancelstate(cs, 0); #endif if (rv) errno = rv; return rv; } int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, struct group **res) { return getgr_r(0, gid, gr, buf, size, res); } lxc-4.0.12/src/include/strchrnul.c0000644061062106075000000001326714176403775013746 00000000000000/* Copyright (C) 1991-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and bug fix and commentary by Jim Blandy (jimb@ai.mit.edu); adaptation to strchr suggested by Dick Karpinski (dick@cca.ucsf.edu), and implemented by Roland McGrath (roland@ai.mit.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see . */ #include #include #include "strchrnul.h" /* Find the first occurrence of C in S or the final NUL byte. */ char *strchrnul(const char *s, int c_in) { const unsigned char *char_ptr; const unsigned long int *longword_ptr; unsigned long int longword, magic_bits, charmask; unsigned char c; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" c = (unsigned char)c_in; /* Handle the first few characters by reading one character at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *)s; ((unsigned long int)char_ptr & (sizeof(longword) - 1)) != 0; ++char_ptr) if (*char_ptr == c || *char_ptr == '\0') return (void *)char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to 8-byte longwords. */ longword_ptr = (unsigned long int *)char_ptr; #pragma GCC diagnostic pop /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits the "holes." Note that there is a hole just to the left of each byte, with an extra at the end: bits: 01111110 11111110 11111110 11111111 bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD The 1-bits make sure that carries propagate to the next 0-bit. The 0-bits provide holes for carries to fall into. */ magic_bits = -1; magic_bits = magic_bits / 0xff * 0xfe << 1 >> 1 | 1; /* Set up a longword, each of whose bytes is C. */ charmask = c | (c << 8); charmask |= charmask << 16; if (sizeof(longword) > 4) /* Do the shift in two steps to avoid a warning if long has 32 bits. */ charmask |= (charmask << 16) << 16; if (sizeof(longword) > 8) abort(); /* Instead of the traditional loop which tests each character, we will test a longword at a time. The tricky part is testing if *any of the four* bytes in the longword in question are zero. */ for (;;) { /* We tentatively exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. 1) Is this safe? Will it catch all the zero bytes? Suppose there is a byte with all zeros. Any carry bits propagating from its left will fall into the hole at its least significant bit and stop. Since there will be no carry from its most significant bit, the LSB of the byte to the left will be unchanged, and the zero will be detected. 2) Is this worthwhile? Will it ignore everything except zero bytes? Suppose every byte of LONGWORD has a bit set somewhere. There will be a carry into bit 8. If bit 8 is set, this will carry into bit 16. If bit 8 is clear, one of bits 9-15 must be set, so there will be a carry into bit 16. Similarly, there will be a carry into bit 24. If one of bits 24-30 is set, there will be a carry into bit 31, so all of the hole bits will be changed. The one misfire occurs when bits 24-30 are clear and bit 31 is set; in this case, the hole at bit 31 is not changed. If we had access to the processor carry flag, we could close this loophole by putting the fourth hole at bit 32! So it ignores everything except 128's, when they're aligned properly. 3) But wait! Aren't we looking for C as well as zero? Good point. So what we do is XOR LONGWORD with a longword, each of whose bytes is C. This turns each byte that is C into a zero. */ longword = *longword_ptr++; /* Add MAGIC_BITS to LONGWORD. */ if ((((longword + magic_bits) /* Set those bits that were unchanged by the addition. */ ^ ~longword) /* Look at only the hole bits. If any of the hole bits are unchanged, most likely one of the bytes was a zero. */ & ~magic_bits) != 0 /* That caught zeroes. Now test for C. */ || ((((longword ^ charmask) + magic_bits) ^ ~(longword ^ charmask)) & ~magic_bits) != 0) { /* Which of the bytes was C or zero? If none of them were, it was a misfire; continue the search. */ const unsigned char *cp = (const unsigned char *)(longword_ptr - 1); if (*cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; if (sizeof(longword) > 4) { if (*++cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; if (*++cp == c || *cp == '\0') return (char *)cp; } } } /* This should never happen. */ return NULL; } lxc-4.0.12/src/include/prlimit.c0000644061062106075000000000510714176403775013374 00000000000000/* * Copyright (C) 2008 The Android Open Source Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include #include #include /* __le64, __l32 ... */ #include #include #include #include #include #include #if defined(__LP64__) #error This code is only needed on 32-bit systems! #endif #define RLIM64_INFINITY (~0ULL) typedef uint64_t u64; // There is no prlimit system call, so we need to use prlimit64. int prlimit(pid_t pid, int resource, const struct rlimit *n32, struct rlimit *o32) { struct rlimit64 n64; if (n32 != NULL) { n64.rlim_cur = (n32->rlim_cur == RLIM_INFINITY) ? RLIM64_INFINITY : n32->rlim_cur; n64.rlim_max = (n32->rlim_max == RLIM_INFINITY) ? RLIM64_INFINITY : n32->rlim_max; } struct rlimit64 o64; int result = prlimit64( pid, resource, (n32 != NULL) ? (const struct rlimit64 *)&n64 : NULL, (o32 != NULL) ? &o64 : NULL); if (result != -1 && o32 != NULL) { o32->rlim_cur = (o64.rlim_cur == RLIM64_INFINITY) ? RLIM_INFINITY : o64.rlim_cur; o32->rlim_max = (o64.rlim_max == RLIM64_INFINITY) ? RLIM_INFINITY : o64.rlim_max; } return result; } lxc-4.0.12/src/include/lxcmntent.c0000644061062106075000000001213514176403775013727 00000000000000/* Utilities for reading/writing fstab, mtab, etc. * Copyright (C) 1995-2000, 2001, 2002, 2003, 2006 * Free Software Foundation, Inc. * This file is part of the GNU C Library. * * The GNU C Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * The GNU C Library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #include #include #include #include #include #include "../lxc/macro.h" /* Since the values in a line are separated by spaces, a name cannot * contain a space. Therefore some programs encode spaces in names * by the strings "\040". We undo the encoding when reading an entry. * The decoding happens in place. */ static char *decode_name(char *buf) { char *rp = buf; char *wp = buf; do { if (rp[0] == '\\' && rp[1] == '0' && rp[2] == '4' && rp[3] == '0') { /* \040 is a SPACE. */ *wp++ = ' '; rp += 3; } else if (rp[0] == '\\' && rp[1] == '0' && rp[2] == '1' && rp[3] == '1') { /* \011 is a TAB. */ *wp++ = '\t'; rp += 3; } else if (rp[0] == '\\' && rp[1] == '0' && rp[2] == '1' && rp[3] == '2') { /* \012 is a NEWLINE. */ *wp++ = '\n'; rp += 3; } else if (rp[0] == '\\' && rp[1] == '\\') { /* We have to escape \\ to be able to represent all characters. */ *wp++ = '\\'; rp += 1; } else if (rp[0] == '\\' && rp[1] == '1' && rp[2] == '3' && rp[3] == '4') { /* \134 is also \\. */ *wp++ = '\\'; rp += 3; } else { *wp++ = *rp; } } while (*rp++ != '\0'); return buf; } /* Read one mount table entry from STREAM. Returns a pointer to storage * reused on the next call, or null for EOF or error (use feof/ferror to check). */ struct mntent *getmntent_r(FILE *stream, struct mntent *mp, char *buffer, int bufsiz) { char *cp; char *head; do { char *end_ptr; if (!fgets(buffer, bufsiz, stream)) return NULL; end_ptr = strchr(buffer, '\n'); if (end_ptr != NULL) { /* chop newline */ *end_ptr = '\0'; } else { /* Not the whole line was read. Do it now but forget it. */ char tmp[1024] = {0}; while (fgets(tmp, sizeof tmp, stream)) if (strchr(tmp, '\n') != NULL) break; } head = buffer + strspn(buffer, " \t"); /* skip empty lines and comment lines: */ } while (head[0] == '\0' || head[0] == '#'); cp = strsep(&head, " \t"); mp->mnt_fsname = cp ? decode_name(cp) : (char *)""; if (head) head += strspn(head, " \t"); cp = strsep(&head, " \t"); mp->mnt_dir = cp ? decode_name(cp) : (char *)""; if (head) head += strspn(head, " \t"); cp = strsep(&head, " \t"); mp->mnt_type = cp ? decode_name(cp) : (char *)""; if (head) head += strspn(head, " \t"); cp = strsep(&head, " \t"); mp->mnt_opts = cp ? decode_name(cp) : (char *)""; if (head) { int ret = sscanf(head, " %d %d ", &mp->mnt_freq, &mp->mnt_passno); switch (ret) { case 0: mp->mnt_freq = 0; break; case 1: mp->mnt_passno = 0; break; case 2: break; } } else { mp->mnt_freq = 0; } return mp; } struct mntent *getmntent(FILE *stream) { static struct mntent m; static char *getmntent_buffer; if (!getmntent_buffer) { getmntent_buffer = (char *)malloc(LXC_MAX_BUFFER); if (!getmntent_buffer) return NULL; } return getmntent_r(stream, &m, getmntent_buffer, LXC_MAX_BUFFER); } /* Prepare to begin reading and/or writing mount table entries from the * beginning of FILE. MODE is as for `fopen'. */ FILE *setmntent(const char *file, const char *mode) { /* Extend the mode parameter with "c" to disable cancellation in the * I/O functions and "e" to set FD_CLOEXEC. */ size_t modelen = strlen(mode); char newmode[256]; if (modelen >= (sizeof(newmode) - 3)) { errno = -EFBIG; return NULL; } memcpy(newmode, mode, modelen); memcpy(newmode + modelen, "ce", 3); return fopen(file, newmode); } /* Close a stream opened with `setmntent'. */ int endmntent(FILE *stream) { /* SunOS 4.x allows for NULL stream */ if (stream) fclose(stream); /* SunOS 4.x says to always return 1 */ return 1; } /* Search MNT->mnt_opts for an option matching OPT. * Returns the address of the substring, or null if none found. */ char *hasmntopt(const struct mntent *mnt, const char *opt) { const size_t optlen = strlen(opt); char *rest = mnt->mnt_opts, *p; while ((p = strstr(rest, opt))) { if ((p == rest || p[-1] == ',') && (p[optlen] == '\0' || p[optlen] == '=' || p[optlen] == ',')) return p; rest = strchr(p, ','); if (!rest) break; ++rest; } return NULL; } lxc-4.0.12/src/include/openpty.h0000644061062106075000000000073714176403775013423 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef _OPENPTY_H #define _OPENPTY_H #include #include #include "../lxc/memory_utils.h" /* * Create pseudo tty ptx pty pair with @__name and set terminal * attributes according to @__termp and @__winp and return handles for both * ends in @__aptx and @__apts. */ __hidden extern int openpty(int *ptx, int *pty, char *name, const struct termios *termp, const struct winsize *winp); #endif lxc-4.0.12/src/Makefile.in0000644061062106075000000005115214176404005012156 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/acinclude.m4 \ $(top_srcdir)/config/attributes.m4 \ $(top_srcdir)/config/ax_pthread.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ APPARMOR_CACHE_DIR = @APPARMOR_CACHE_DIR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CAP_LIBS = @CAP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFAULT_CGROUP_PATTERN = @DEFAULT_CGROUP_PATTERN@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOG_CFLAGS = @DLOG_CFLAGS@ DLOG_LIBS = @DLOG_LIBS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDIR = @LIBDIR@ LIBEXECDIR = @LIBEXECDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBURING_LIBS = @LIBURING_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALSTATEDIR = @LOCALSTATEDIR@ LOGPATH = @LOGPATH@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LXCBINHOOKDIR = @LXCBINHOOKDIR@ LXCHOOKDIR = @LXCHOOKDIR@ LXCINITDIR = @LXCINITDIR@ LXCPATH = @LXCPATH@ LXCROOTFSMOUNT = @LXCROOTFSMOUNT@ LXCTEMPLATECONFIG = @LXCTEMPLATECONFIG@ LXCTEMPLATEDIR = @LXCTEMPLATEDIR@ LXC_ABI = @LXC_ABI@ LXC_ABI_MAJOR = @LXC_ABI_MAJOR@ LXC_ABI_MICRO = @LXC_ABI_MICRO@ LXC_ABI_MINOR = @LXC_ABI_MINOR@ LXC_DEFAULT_CONFIG = @LXC_DEFAULT_CONFIG@ LXC_DEVEL = @LXC_DEVEL@ LXC_DISTRO_SYSCONF = @LXC_DISTRO_SYSCONF@ LXC_GENERATE_DATE = @LXC_GENERATE_DATE@ LXC_GLOBAL_CONF = @LXC_GLOBAL_CONF@ LXC_USERNIC_CONF = @LXC_USERNIC_CONF@ LXC_USERNIC_DB = @LXC_USERNIC_DB@ LXC_VERSION = @LXC_VERSION@ LXC_VERSION_BASE = @LXC_VERSION_BASE@ LXC_VERSION_BETA = @LXC_VERSION_BETA@ LXC_VERSION_MAJOR = @LXC_VERSION_MAJOR@ LXC_VERSION_MICRO = @LXC_VERSION_MICRO@ LXC_VERSION_MINOR = @LXC_VERSION_MINOR@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PREFIX = @PREFIX@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RUNTIME_PATH = @RUNTIME_PATH@ SBINDIR = @SBINDIR@ SECCOMP_CFLAGS = @SECCOMP_CFLAGS@ SECCOMP_LIBS = @SECCOMP_LIBS@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ db2xman = @db2xman@ docdir = @docdir@ docdtd = @docdtd@ dvidir = @dvidir@ exec_pamdir = @exec_pamdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = lxc tests all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lxc-4.0.12/src/Makefile.am0000644061062106075000000000002414176403775012152 00000000000000SUBDIRS = lxc tests lxc-4.0.12/src/config.h.in0000644061062106075000000002763514176404004012144 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* "Prefix for shared files." */ #undef DATADIR /* build for use with Coverity */ #undef ENABLE_COVERITY_BUILD /* build with sanitizers enabled */ #undef ENABLE_SANITIZERS /* Rexec liblxc as memfd */ #undef ENFORCE_MEMFD_REXEC /* enforce thread-safety otherwise fail the build */ #undef ENFORCE_THREAD_SAFETY /* Define to 1 if you have the `clone3' function. */ #undef HAVE_CLONE3 /* Define to 1 if you have the `close_range' function. */ #undef HAVE_CLOSE_RANGE /* Define to 1 if you have the `confstr' function. */ #undef HAVE_CONFSTR /* Define to 1 if you have the declaration of `PR_CAPBSET_DROP', and to 0 if you don't. */ #undef HAVE_DECL_PR_CAPBSET_DROP /* Define to 1 if you have the declaration of `PR_GET_NO_NEW_PRIVS', and to 0 if you don't. */ #undef HAVE_DECL_PR_GET_NO_NEW_PRIVS /* Define to 1 if you have the declaration of `PR_SET_NO_NEW_PRIVS', and to 0 if you don't. */ #undef HAVE_DECL_PR_SET_NO_NEW_PRIVS /* Define to 1 if you have the declaration of `seccomp_notify_fd', and to 0 if you don't. */ #undef HAVE_DECL_SECCOMP_NOTIFY_FD /* Define to 1 if you have the declaration of `seccomp_syscall_resolve_name_arch', and to 0 if you don't. */ #undef HAVE_DECL_SECCOMP_SYSCALL_RESOLVE_NAME_ARCH /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `endmntent' function. */ #undef HAVE_ENDMNTENT /* Define to 1 if you have the `execveat' function. */ #undef HAVE_EXECVEAT /* Define to 1 if you have the `faccessat' function. */ #undef HAVE_FACCESSAT /* Define to 1 if you have the `fgetln' function. */ #undef HAVE_FGETLN /* Define to 1 if you have the `fmemopen' function. */ #undef HAVE_FMEMOPEN /* Define to 1 if you have the `fsconfig' function. */ #undef HAVE_FSCONFIG /* Define to 1 if you have the `fsmount' function. */ #undef HAVE_FSMOUNT /* Define to 1 if you have the `fsopen' function. */ #undef HAVE_FSOPEN /* Define to 1 if you have the `fspick' function. */ #undef HAVE_FSPICK /* Define to 1 if you have the `getgrgid_r' function. */ #undef HAVE_GETGRGID_R /* Define to 1 if you have the `getline' function. */ #undef HAVE_GETLINE /* Define to 1 if you have the `getsubopt' function. */ #undef HAVE_GETSUBOPT /* Define to 1 if you have the `gettid' function. */ #undef HAVE_GETTID /* Define to 1 if you have the `hasmntopt' function. */ #undef HAVE_HASMNTOPT /* Have ifaddrs.h */ #undef HAVE_IFADDRS_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `keyctl' function. */ #undef HAVE_KEYCTL /* Define to 1 if you have the `cap' library (-lcap). */ #undef HAVE_LIBCAP /* Define to 1 if you have the `dlog' library (-ldlog). */ #undef HAVE_LIBDLOG /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the `seccomp' library (-lseccomp). */ #undef HAVE_LIBSECCOMP /* Define to 1 if you have the `uring' library (-luring). */ #undef HAVE_LIBURING /* Define to 1 if you have the `util' library (-lutil). */ #undef HAVE_LIBUTIL /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_GENETLINK_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETLINK_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UNISTD_H /* Define to 1 if you have the `memfd_create' function. */ #undef HAVE_MEMFD_CREATE /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* Define to 1 if you have the `mount_setattr' function. */ #undef HAVE_MOUNT_SETATTR /* Define to 1 if you have the `move_mount' function. */ #undef HAVE_MOVE_MOUNT /* Define to 1 if you have the `openat2' function. */ #undef HAVE_OPENAT2 /* Define to 1 if you have the `openpty' function. */ #undef HAVE_OPENPTY /* Define to 1 if you have the `open_tree' function. */ #undef HAVE_OPEN_TREE /* Define to 1 if you have the `pivot_root' function. */ #undef HAVE_PIVOT_ROOT /* Define to 1 if you have the `prlimit' function. */ #undef HAVE_PRLIMIT /* Define to 1 if you have the `prlimit64' function. */ #undef HAVE_PRLIMIT64 /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the `pthread_setcancelstate' function. */ #undef HAVE_PTHREAD_SETCANCELSTATE /* Define to 1 if you have the header file. */ #undef HAVE_PTY_H /* Define to 1 if you have the `rand_r' function. */ #undef HAVE_RAND_R /* Define to 1 if the system has the type `scmp_filter_ctx'. */ #undef HAVE_SCMP_FILTER_CTX /* Define to 1 if you have the `sethostname' function. */ #undef HAVE_SETHOSTNAME /* Define to 1 if you have the `setmntent' function. */ #undef HAVE_SETMNTENT /* Define to 1 if you have the `setns' function. */ #undef HAVE_SETNS /* Define to 1 if you have the `sigdescr_np' function. */ #undef HAVE_SIGDESCR_NP /* Have static libcap */ #undef HAVE_STATIC_LIBCAP /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchrnul' function. */ #undef HAVE_STRCHRNUL /* Define if you have `strerror_r'. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if the system has the type `struct clone_args'. */ #undef HAVE_STRUCT_CLONE_ARGS /* Define to 1 if `cgroup' is a member of `struct clone_args'. */ #undef HAVE_STRUCT_CLONE_ARGS_CGROUP /* Define to 1 if `set_tid' is a member of `struct clone_args'. */ #undef HAVE_STRUCT_CLONE_ARGS_SET_TID /* Define to 1 if the system has the type `struct mount_attr'. */ #undef HAVE_STRUCT_MOUNT_ATTR /* Define to 1 if the system has the type `struct open_how'. */ #undef HAVE_STRUCT_OPEN_HOW /* Define to 1 if the system has the type `struct rtnl_link_stats64'. */ #undef HAVE_STRUCT_RTNL_LINK_STATS64 /* Define to 1 if the system has the type `struct seccomp_notif_sizes'. */ #undef HAVE_STRUCT_SECCOMP_NOTIF_SIZES /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MEMFD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PERSONALITY_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SIGNALFD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMERFD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unshare' function. */ #undef HAVE_UNSHARE /* Define to 1 if you have the `utmpxname' function. */ #undef HAVE_UTMPXNAME /* Define to 1 if you have the header file. */ #undef HAVE_UTMPX_H /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if the system has the type `__aligned_u64'. */ #undef HAVE___ALIGNED_U64 /* bionic libc */ #undef IS_BIONIC /* Have cap_get_file */ #undef LIBCAP_SUPPORTS_FILE_CAPABILITIES /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS /* Enabling mutex debugging */ #undef MUTEX_DEBUGGING /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES lxc-4.0.12/src/lxc/0000755061062106075000000000000014176404015010754 500000000000000lxc-4.0.12/src/lxc/lxc.h0000644061062106075000000000705214176403775011653 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_LXC_H #define __LXC_LXC_H #include "config.h" #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include "attach_options.h" #include "lxccontainer.h" #include "compiler.h" #include "memory_utils.h" #include "state.h" struct lxc_msg; struct lxc_conf; struct lxc_arguments; struct lxc_handler; /** Following code is for liblxc. lxc/lxc.h will contain exports of liblxc **/ /* * Start the specified command inside a system container * @argv : an array of char * corresponding to the command line * @conf : configuration * @daemonize : whether or not the container is daemonized * Returns 0 on success, < 0 otherwise */ __hidden extern int lxc_start(char *const argv[], struct lxc_handler *handler, const char *lxcpath, bool daemonize, int *error_num); /* * Start the specified command inside an application container * @name : the name of the container * @argv : an array of char * corresponding to the command line * @quiet : if != 0 then lxc-init won't produce any output * @conf : configuration * @daemonize : whether or not the container is daemonized * Returns 0 on success, < 0 otherwise */ __hidden extern int lxc_execute(const char *name, char *const argv[], int quiet, struct lxc_handler *handler, const char *lxcpath, bool daemonize, int *error_num); /* * Close the fd associated with the monitoring * @fd : the file descriptor provided by lxc_monitor_open * Returns 0 on success, < 0 otherwise */ __hidden extern int lxc_monitor_close(int fd); /* * Freeze all the tasks running inside the container * @name : the container name * Returns 0 on success, < 0 otherwise */ __hidden extern int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath); /* * Unfreeze all previously frozen tasks. * @name : the name of the container * Return 0 on success, < 0 otherwise */ __hidden extern int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath); /* * Retrieve the container state * @name : the name of the container * Returns the state of the container on success, < 0 otherwise */ __hidden extern lxc_state_t lxc_state(const char *name, const char *lxcpath); /* * Create and return a new lxccontainer struct. */ extern struct lxc_container *lxc_container_new(const char *name, const char *configpath); /* * Returns 1 on success, 0 on failure. */ extern int lxc_container_get(struct lxc_container *c); /* * Put a lxccontainer struct reference. * Return -1 on error. * Return 0 if this was not the last reference. * If it is the last reference, free the lxccontainer and return 1. */ extern int lxc_container_put(struct lxc_container *c); static inline void put_lxc_container(struct lxc_container *c) { if (c) lxc_container_put(c); } define_cleanup_function(struct lxc_container *, put_lxc_container); #define __put_lxc_container call_cleaner(put_lxc_container) /* * Get a list of valid wait states. * If states is NULL, simply return the number of states */ extern int lxc_get_wait_states(const char **states); /* * Add a dependency to a container */ __hidden extern int add_rdepend(struct lxc_conf *lxc_conf, char *rdepend); /* * Set a key/value configuration option. Requires that to take a lock on the * in-memory config of the container. */ __hidden extern int lxc_set_config_item_locked(struct lxc_conf *conf, const char *key, const char *v); #ifdef __cplusplus } #endif #endif /* __LXC_LXC_H */ lxc-4.0.12/src/lxc/Makefile.in0000644061062106075000000152455714176404005012763 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # SPDX-License-Identifier: LGPL-2.1+ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @IS_BIONIC_TRUE@am__append_1 = ../include/fexecve.h \ @IS_BIONIC_TRUE@ ../include/lxcmntent.h @HAVE_OPENPTY_FALSE@am__append_2 = ../include/openpty.h @HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_3 = ../include/prlimit.h @HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@am__append_4 = ../include/getline.h @HAVE_GETSUBOPT_FALSE@am__append_5 = tools/include/getsubopt.h @HAVE_GETGRGID_R_FALSE@am__append_6 = ../include/getgrgid_r.h @ENABLE_APPARMOR_TRUE@am__append_7 = lsm/apparmor.c @ENABLE_SELINUX_TRUE@am__append_8 = lsm/selinux.c @IS_BIONIC_TRUE@am__append_9 = ../include/fexecve.c ../include/fexecve.h \ @IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @HAVE_OPENPTY_FALSE@am__append_10 = ../include/openpty.c ../include/openpty.h @HAVE_GETGRGID_R_FALSE@am__append_11 = ../include/getgrgid_r.c ../include/getgrgid_r.h @HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@am__append_12 = ../include/getline.c ../include/getline.h @HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_13 = ../include/prlimit.c ../include/prlimit.h @ENABLE_SECCOMP_TRUE@am__append_14 = seccomp.c lxcseccomp.h @HAVE_STRLCPY_FALSE@am__append_15 = ../include/strlcpy.c ../include/strlcpy.h @HAVE_STRLCAT_FALSE@am__append_16 = ../include/strlcat.c ../include/strlcat.h @HAVE_STRCHRNUL_FALSE@am__append_17 = ../include/strchrnul.c ../include/strchrnul.h @ENFORCE_MEMFD_REXEC_TRUE@am__append_18 = rexec.c rexec.h @ENABLE_APPARMOR_TRUE@am__append_19 = -DHAVE_APPARMOR @ENABLE_OPENSSL_TRUE@am__append_20 = -DHAVE_OPENSSL @ENABLE_SECCOMP_TRUE@am__append_21 = -DHAVE_SECCOMP \ @ENABLE_SECCOMP_TRUE@ $(SECCOMP_CFLAGS) @ENABLE_SELINUX_TRUE@am__append_22 = -DHAVE_SELINUX @ENABLE_DLOG_TRUE@am__append_23 = -DHAVE_DLOG \ @ENABLE_DLOG_TRUE@ $(DLOG_CFLAGS) @USE_CONFIGPATH_LOGS_TRUE@am__append_24 = -DUSE_CONFIGPATH_LOGS @ENABLE_NO_UNDEFINED_TRUE@am__append_25 = -Wl,-no-undefined @ENABLE_COMMANDS_TRUE@am__append_26 = cmd/lxc-checkconfig \ @ENABLE_COMMANDS_TRUE@ cmd/lxc-update-config @ENABLE_COMMANDS_TRUE@@ENABLE_TOOLS_FALSE@bin_PROGRAMS = lxc-usernsexec$(EXEEXT) @ENABLE_TOOLS_TRUE@bin_PROGRAMS = lxc-attach$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-autostart$(EXEEXT) lxc-cgroup$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-checkpoint$(EXEEXT) lxc-copy$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-config$(EXEEXT) lxc-console$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-create$(EXEEXT) lxc-destroy$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-device$(EXEEXT) lxc-execute$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-freeze$(EXEEXT) lxc-info$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-ls$(EXEEXT) lxc-monitor$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-snapshot$(EXEEXT) lxc-start$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-stop$(EXEEXT) lxc-top$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-unfreeze$(EXEEXT) lxc-unshare$(EXEEXT) \ @ENABLE_TOOLS_TRUE@ lxc-wait$(EXEEXT) $(am__EXEEXT_1) @ENABLE_COMMANDS_TRUE@@ENABLE_TOOLS_TRUE@am__append_27 = lxc-usernsexec @ENABLE_COMMANDS_TRUE@sbin_PROGRAMS = init.lxc$(EXEEXT) \ @ENABLE_COMMANDS_TRUE@ $(am__EXEEXT_2) @ENABLE_COMMANDS_TRUE@pkglibexec_PROGRAMS = lxc-monitord$(EXEEXT) \ @ENABLE_COMMANDS_TRUE@ lxc-user-nic$(EXEEXT) @ENABLE_RPATH_TRUE@am__append_28 = -Wl,-rpath -Wl,$(libdir) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_29 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_30 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ rexec.c rexec.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_31 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_32 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_33 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_34 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_35 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_36 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_37 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_38 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_39 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_40 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_41 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_42 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_43 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_44 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_45 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_46 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_47 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_48 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_49 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_50 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_51 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_52 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_53 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_54 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_55 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_56 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_57 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_58 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_59 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_60 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_61 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_62 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_63 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_64 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_65 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_66 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_67 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_68 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_69 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_70 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_71 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_72 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_73 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_74 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_75 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_76 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_77 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_78 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_79 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_80 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_81 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_82 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_83 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_84 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_85 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_86 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_87 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_88 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_89 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_90 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_91 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_92 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_93 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_94 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_95 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_96 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_97 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_98 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_99 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_100 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_101 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_102 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_103 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_104 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_105 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_106 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_107 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_108 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_109 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_110 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_111 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_112 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_113 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_114 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_115 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_116 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_117 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_118 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_119 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_120 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_121 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_122 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_123 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_124 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_125 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_126 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_127 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_128 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_129 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_130 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ macro.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_131 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_132 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_133 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_134 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_135 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_136 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_137 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_138 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_139 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_140 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ memory_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_141 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_142 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_143 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_144 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_145 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_146 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_147 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_148 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_149 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_150 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_151 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_152 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_153 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_154 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_155 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_156 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_157 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_158 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_159 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_160 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_161 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_162 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_163 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_164 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_165 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_166 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_167 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_168 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_169 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_170 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_171 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_172 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_173 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_174 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_175 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_176 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_177 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_178 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_179 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_180 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_181 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_182 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_183 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_184 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_185 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_186 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_187 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_188 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_189 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_190 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_191 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_192 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_193 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_194 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_195 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_196 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_197 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_198 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_199 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_200 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ syscall_numbers.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ syscall_wrappers.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_201 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_202 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_203 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_204 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_205 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_206 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_207 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_208 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_209 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_210 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_211 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_212 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_213 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_214 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_215 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_216 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_217 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_218 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_219 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_220 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_221 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_222 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_223 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_224 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_225 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_226 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_227 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_228 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_229 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_230 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_231 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_232 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_233 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_234 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_235 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_236 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_237 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_238 = ../include/prlimit.c ../include/prlimit.h @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__append_239 = $(liblxc_la_SOURCES) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_240 = af_unix.c af_unix.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.c caps.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.c \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.c commands.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.c commands_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.c conf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.c confile.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.c confile_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.c error.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.c file_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.c initutils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.c log.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.c lxclock.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.c mainloop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.c monitor.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.c mount_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.c namespace.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.c network.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.c nl.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.c parse.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.c process_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.c ringbuf.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.c start.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.c state.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.c storage/dir.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.c storage/loop.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.c storage/lvm.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.c storage/nbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.c storage/overlay.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.c storage/rbd.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.c storage/rsync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.c storage/storage.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.c storage/zfs.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.c string_utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.c sync.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.c terminal.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.c utils.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.c uuid.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(LSM_SOURCES) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__append_241 = seccomp.c lxcseccomp.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__append_242 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__append_243 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__append_244 = ../include/strlcat.c ../include/strlcat.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__append_245 = ../include/openpty.c ../include/openpty.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__append_246 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__append_247 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_248 = ../include/prlimit.c ../include/prlimit.h @ENABLE_COMMANDS_TRUE@@HAVE_STRLCPY_FALSE@am__append_249 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_COMMANDS_TRUE@@HAVE_STRLCAT_FALSE@am__append_250 = ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@am__append_251 = $(liblxc_la_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_252 = af_unix.c af_unix.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ caps.c caps.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgfsng.c \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands.c commands.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands_utils.c commands_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ conf.c conf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile.c confile.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile_utils.c confile_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ error.c error.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ file_utils.c file_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ initutils.c initutils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ log.c log.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ lxclock.c lxclock.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mainloop.c mainloop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ monitor.c monitor.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mount_utils.c mount_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ namespace.c namespace.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ network.c network.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ nl.c nl.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ parse.c parse.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ process_utils.c process_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ringbuf.c ringbuf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ start.c start.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ state.c state.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/dir.c storage/dir.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/loop.c storage/loop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/lvm.c storage/lvm.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/nbd.c storage/nbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/overlay.c storage/overlay.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rbd.c storage/rbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rsync.c storage/rsync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage.c storage/storage.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/zfs.c storage/zfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ string_utils.c string_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ sync.c sync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ syscall_numbers.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ terminal.c terminal.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ utils.c utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ uuid.c uuid.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ $(LSM_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_253 = seccomp.c lxcseccomp.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRCHRNUL_FALSE@am__append_254 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCPY_FALSE@am__append_255 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCAT_FALSE@am__append_256 = ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_OPENPTY_FALSE@am__append_257 = ../include/openpty.c ../include/openpty.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@am__append_258 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_GETGRGID_R_FALSE@am__append_259 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_260 = ../include/prlimit.c ../include/prlimit.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@am__append_261 = $(liblxc_la_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_262 = af_unix.c af_unix.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ caps.c caps.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgfsng.c \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands.c commands.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands_utils.c commands_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ conf.c conf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile.c confile.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile_utils.c confile_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ error.c error.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ file_utils.c file_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ initutils.c initutils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ log.c log.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ lxclock.c lxclock.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mainloop.c mainloop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ memory_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ monitor.c monitor.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mount_utils.c mount_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ namespace.c namespace.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ network.c network.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ nl.c nl.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ parse.c parse.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ process_utils.c process_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ringbuf.c ringbuf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ start.c start.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ state.c state.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/dir.c storage/dir.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/loop.c storage/loop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/lvm.c storage/lvm.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/nbd.c storage/nbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/overlay.c storage/overlay.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rbd.c storage/rbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rsync.c storage/rsync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage.c storage/storage.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/zfs.c storage/zfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ string_utils.c string_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ sync.c sync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ syscall_numbers.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ syscall_wrappers.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ terminal.c terminal.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ utils.c utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ uuid.c uuid.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ $(LSM_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_263 = seccomp.c lxcseccomp.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRCHRNUL_FALSE@am__append_264 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCPY_FALSE@am__append_265 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCAT_FALSE@am__append_266 = ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_OPENPTY_FALSE@am__append_267 = ../include/openpty.c ../include/openpty.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@am__append_268 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_GETGRGID_R_FALSE@am__append_269 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_270 = ../include/prlimit.c ../include/prlimit.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@am__append_271 = $(liblxc_la_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_272 = af_unix.c af_unix.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ caps.c caps.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgfsng.c \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup.c cgroups/cgroup.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands.c commands.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands_utils.c commands_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ conf.c conf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile.c confile.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile_utils.c confile_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ error.c error.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ file_utils.c file_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ hlist.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ initutils.c initutils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ list.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ log.c log.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ lxclock.c lxclock.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ macro.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mainloop.c mainloop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ memory_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ monitor.c monitor.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mount_utils.c mount_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ namespace.c namespace.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ network.c network.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ nl.c nl.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ parse.c parse.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ process_utils.c process_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ringbuf.c ringbuf.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ start.c start.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ state.c state.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/btrfs.c storage/btrfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/dir.c storage/dir.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/loop.c storage/loop.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/lvm.c storage/lvm.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/nbd.c storage/nbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/overlay.c storage/overlay.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rbd.c storage/rbd.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rsync.c storage/rsync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage.c storage/storage.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage_utils.c storage/storage_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/zfs.c storage/zfs.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ string_utils.c string_utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ sync.c sync.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ syscall_wrappers.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ terminal.c terminal.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ utils.c utils.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ uuid.c uuid.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ $(LSM_SOURCES) @ENABLE_COMMANDS_TRUE@@ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__append_273 = seccomp.c lxcseccomp.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRCHRNUL_FALSE@am__append_274 = ../include/strchrnul.c ../include/strchrnul.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCPY_FALSE@am__append_275 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCAT_FALSE@am__append_276 = ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_OPENPTY_FALSE@am__append_277 = ../include/openpty.c ../include/openpty.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@am__append_278 = ../include/fexecve.c ../include/fexecve.h \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@ ../include/lxcmntent.c ../include/lxcmntent.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_GETGRGID_R_FALSE@am__append_279 = ../include/getgrgid_r.c ../include/getgrgid_r.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__append_280 = ../include/prlimit.c ../include/prlimit.h @ENABLE_TOOLS_TRUE@@HAVE_GETSUBOPT_FALSE@am__append_281 = tools/include/getsubopt.c tools/include/getsubopt.h @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@am__append_282 = init.lxc.static @ENABLE_COMMANDS_TRUE@@HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@@HAVE_STATIC_LIBCAP_TRUE@am__append_283 = ../include/getline.c ../include/getline.h @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@@HAVE_STRLCPY_FALSE@am__append_284 = ../include/strlcpy.c ../include/strlcpy.h @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@@HAVE_STRLCAT_FALSE@am__append_285 = ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@ENABLE_SANITIZERS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@am__append_286 = -fno-sanitize=address,undefined @ENABLE_COMMANDS_TRUE@@ENABLE_FUZZERS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@am__append_287 = -fno-sanitize=fuzzer-no-link @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@@HAVE_STRLCAT_FALSE@am__append_288 = ../include/strlcat.c ../include/strlcat.h @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@@HAVE_STRLCPY_FALSE@am__append_289 = ../include/strlcpy.c ../include/strlcpy.h subdir = src/lxc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/acinclude.m4 \ $(top_srcdir)/config/attributes.m4 \ $(top_srcdir)/config/ax_pthread.m4 \ $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__noinst_HEADERS_DIST) \ $(pkginclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = lxc.functions version.h CONFIG_CLEAN_VPATH_FILES = @ENABLE_COMMANDS_TRUE@@ENABLE_TOOLS_TRUE@am__EXEEXT_1 = lxc-usernsexec$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(exec_pamdir)" \ "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgincludedir)" @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@am__EXEEXT_2 = init.lxc.static$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) $(pkglibexec_PROGRAMS) $(sbin_PROGRAMS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } LTLIBRARIES = $(exec_pam_LTLIBRARIES) $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = liblxc_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__liblxc_la_SOURCES_DIST = af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h am__dirstamp = $(am__leading_dot)dirstamp @ENABLE_APPARMOR_TRUE@am__objects_1 = lsm/liblxc_la-apparmor.lo @ENABLE_SELINUX_TRUE@am__objects_2 = lsm/liblxc_la-selinux.lo am__objects_3 = lsm/liblxc_la-lsm.lo lsm/liblxc_la-nop.lo \ $(am__objects_1) $(am__objects_2) @IS_BIONIC_TRUE@am__objects_4 = ../include/liblxc_la-fexecve.lo \ @IS_BIONIC_TRUE@ ../include/liblxc_la-lxcmntent.lo @HAVE_OPENPTY_FALSE@am__objects_5 = ../include/liblxc_la-openpty.lo @HAVE_GETGRGID_R_FALSE@am__objects_6 = \ @HAVE_GETGRGID_R_FALSE@ ../include/liblxc_la-getgrgid_r.lo @HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@am__objects_7 = ../include/liblxc_la-getline.lo @HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__objects_8 = ../include/liblxc_la-prlimit.lo @ENABLE_SECCOMP_TRUE@am__objects_9 = liblxc_la-seccomp.lo @HAVE_STRLCPY_FALSE@am__objects_10 = ../include/liblxc_la-strlcpy.lo @HAVE_STRLCAT_FALSE@am__objects_11 = ../include/liblxc_la-strlcat.lo @HAVE_STRCHRNUL_FALSE@am__objects_12 = \ @HAVE_STRCHRNUL_FALSE@ ../include/liblxc_la-strchrnul.lo @ENFORCE_MEMFD_REXEC_TRUE@am__objects_13 = liblxc_la-rexec.lo am_liblxc_la_OBJECTS = liblxc_la-af_unix.lo liblxc_la-attach.lo \ liblxc_la-caps.lo cgroups/liblxc_la-cgfsng.lo \ cgroups/liblxc_la-cgroup.lo \ cgroups/liblxc_la-cgroup2_devices.lo \ cgroups/liblxc_la-cgroup_utils.lo liblxc_la-commands.lo \ liblxc_la-commands_utils.lo liblxc_la-conf.lo \ liblxc_la-confile.lo liblxc_la-confile_utils.lo \ liblxc_la-criu.lo liblxc_la-error.lo liblxc_la-execute.lo \ liblxc_la-freezer.lo liblxc_la-file_utils.lo \ ../include/liblxc_la-netns_ifaddrs.lo liblxc_la-initutils.lo \ liblxc_la-log.lo liblxc_la-lxccontainer.lo \ liblxc_la-lxclock.lo liblxc_la-mainloop.lo \ liblxc_la-mount_utils.lo liblxc_la-namespace.lo \ liblxc_la-network.lo liblxc_la-nl.lo liblxc_la-monitor.lo \ liblxc_la-parse.lo liblxc_la-process_utils.lo \ liblxc_la-ringbuf.lo liblxc_la-rtnl.lo liblxc_la-state.lo \ liblxc_la-start.lo storage/liblxc_la-btrfs.lo \ storage/liblxc_la-dir.lo storage/liblxc_la-loop.lo \ storage/liblxc_la-lvm.lo storage/liblxc_la-nbd.lo \ storage/liblxc_la-overlay.lo storage/liblxc_la-rbd.lo \ storage/liblxc_la-rsync.lo storage/liblxc_la-storage.lo \ storage/liblxc_la-storage_utils.lo storage/liblxc_la-zfs.lo \ liblxc_la-string_utils.lo liblxc_la-sync.lo \ liblxc_la-terminal.lo liblxc_la-utils.lo liblxc_la-uuid.lo \ $(am__objects_3) $(am__objects_4) $(am__objects_5) \ $(am__objects_6) $(am__objects_7) $(am__objects_8) \ $(am__objects_9) $(am__objects_10) $(am__objects_11) \ $(am__objects_12) $(am__objects_13) liblxc_la_OBJECTS = $(am_liblxc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = liblxc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(liblxc_la_CFLAGS) \ $(CFLAGS) $(liblxc_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@pam_cgfs_la_DEPENDENCIES = \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__DEPENDENCIES_1) am__pam_cgfs_la_SOURCES_DIST = pam/pam_cgfs.c file_utils.c \ file_utils.h macro.h memory_utils.h string_utils.c \ string_utils.h ../include/strlcat.c ../include/strlcat.h \ ../include/strlcpy.c ../include/strlcpy.h @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@@HAVE_STRLCAT_FALSE@am__objects_14 = ../include/pam_cgfs_la-strlcat.lo @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@@HAVE_STRLCPY_FALSE@am__objects_15 = ../include/pam_cgfs_la-strlcpy.lo @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@am_pam_cgfs_la_OBJECTS = \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ pam/cgfs_la-pam_cgfs.lo \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ pam_cgfs_la-file_utils.lo \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ pam_cgfs_la-string_utils.lo \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__objects_14) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__objects_15) pam_cgfs_la_OBJECTS = $(am_pam_cgfs_la_OBJECTS) pam_cgfs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pam_cgfs_la_CFLAGS) \ $(CFLAGS) $(pam_cgfs_la_LDFLAGS) $(LDFLAGS) -o $@ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@am_pam_cgfs_la_rpath = -rpath \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(exec_pamdir) am__init_lxc_SOURCES_DIST = cmd/lxc_init.c af_unix.c af_unix.h caps.c \ caps.h error.c error.h file_utils.c file_utils.h initutils.c \ initutils.h log.c log.h macro.h memory_utils.h namespace.c \ namespace.h string_utils.c string_utils.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@HAVE_STRLCPY_FALSE@am__objects_16 = ../include/strlcpy.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@HAVE_STRLCAT_FALSE@am__objects_17 = ../include/strlcat.$(OBJEXT) @ENABLE_COMMANDS_TRUE@am_init_lxc_OBJECTS = cmd/lxc_init.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ af_unix.$(OBJEXT) caps.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ error.$(OBJEXT) file_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ initutils.$(OBJEXT) log.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ namespace.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ string_utils.$(OBJEXT) $(am__objects_16) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_17) init_lxc_OBJECTS = $(am_init_lxc_OBJECTS) init_lxc_LDADD = $(LDADD) init_lxc_DEPENDENCIES = liblxc.la init_lxc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(init_lxc_LDFLAGS) $(LDFLAGS) -o $@ am__init_lxc_static_SOURCES_DIST = cmd/lxc_init.c af_unix.c af_unix.h \ caps.c caps.h error.c error.h file_utils.c file_utils.h \ initutils.c initutils.h log.c log.h macro.h memory_utils.h \ namespace.c namespace.h string_utils.c string_utils.h \ ../include/getline.c ../include/getline.h ../include/strlcpy.c \ ../include/strlcpy.h ../include/strlcat.c ../include/strlcat.h @ENABLE_COMMANDS_TRUE@@HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@@HAVE_STATIC_LIBCAP_TRUE@am__objects_18 = ../include/init_lxc_static-getline.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@@HAVE_STRLCPY_FALSE@am__objects_19 = ../include/init_lxc_static-strlcpy.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@@HAVE_STRLCAT_FALSE@am__objects_20 = ../include/init_lxc_static-strlcat.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@am_init_lxc_static_OBJECTS = cmd/init_lxc_static-lxc_init.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-af_unix.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-caps.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-error.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-file_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-initutils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-log.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-namespace.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ init_lxc_static-string_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__objects_18) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__objects_19) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__objects_20) init_lxc_static_OBJECTS = $(am_init_lxc_static_OBJECTS) init_lxc_static_DEPENDENCIES = init_lxc_static_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(init_lxc_static_CFLAGS) $(CFLAGS) $(init_lxc_static_LDFLAGS) \ $(LDFLAGS) -o $@ am__lxc_attach_SOURCES_DIST = tools/lxc_attach.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_APPARMOR_TRUE@am__objects_21 = lsm/apparmor.$(OBJEXT) @ENABLE_SELINUX_TRUE@am__objects_22 = lsm/selinux.$(OBJEXT) am__objects_23 = lsm/lsm.$(OBJEXT) lsm/nop.$(OBJEXT) $(am__objects_21) \ $(am__objects_22) @IS_BIONIC_TRUE@am__objects_24 = ../include/fexecve.$(OBJEXT) \ @IS_BIONIC_TRUE@ ../include/lxcmntent.$(OBJEXT) @HAVE_OPENPTY_FALSE@am__objects_25 = ../include/openpty.$(OBJEXT) @HAVE_GETGRGID_R_FALSE@am__objects_26 = \ @HAVE_GETGRGID_R_FALSE@ ../include/getgrgid_r.$(OBJEXT) @HAVE_FGETLN_TRUE@@HAVE_GETLINE_FALSE@am__objects_27 = ../include/getline.$(OBJEXT) @HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__objects_28 = ../include/prlimit.$(OBJEXT) @ENABLE_SECCOMP_TRUE@am__objects_29 = seccomp.$(OBJEXT) @HAVE_STRLCPY_FALSE@am__objects_30 = ../include/strlcpy.$(OBJEXT) @HAVE_STRLCAT_FALSE@am__objects_31 = ../include/strlcat.$(OBJEXT) @HAVE_STRCHRNUL_FALSE@am__objects_32 = ../include/strchrnul.$(OBJEXT) @ENFORCE_MEMFD_REXEC_TRUE@am__objects_33 = rexec.$(OBJEXT) am__objects_34 = af_unix.$(OBJEXT) attach.$(OBJEXT) caps.$(OBJEXT) \ cgroups/cgfsng.$(OBJEXT) cgroups/cgroup.$(OBJEXT) \ cgroups/cgroup2_devices.$(OBJEXT) \ cgroups/cgroup_utils.$(OBJEXT) commands.$(OBJEXT) \ commands_utils.$(OBJEXT) conf.$(OBJEXT) confile.$(OBJEXT) \ confile_utils.$(OBJEXT) criu.$(OBJEXT) error.$(OBJEXT) \ execute.$(OBJEXT) freezer.$(OBJEXT) file_utils.$(OBJEXT) \ ../include/netns_ifaddrs.$(OBJEXT) initutils.$(OBJEXT) \ log.$(OBJEXT) lxccontainer.$(OBJEXT) lxclock.$(OBJEXT) \ mainloop.$(OBJEXT) mount_utils.$(OBJEXT) namespace.$(OBJEXT) \ network.$(OBJEXT) nl.$(OBJEXT) monitor.$(OBJEXT) \ parse.$(OBJEXT) process_utils.$(OBJEXT) ringbuf.$(OBJEXT) \ rtnl.$(OBJEXT) state.$(OBJEXT) start.$(OBJEXT) \ storage/btrfs.$(OBJEXT) storage/dir.$(OBJEXT) \ storage/loop.$(OBJEXT) storage/lvm.$(OBJEXT) \ storage/nbd.$(OBJEXT) storage/overlay.$(OBJEXT) \ storage/rbd.$(OBJEXT) storage/rsync.$(OBJEXT) \ storage/storage.$(OBJEXT) storage/storage_utils.$(OBJEXT) \ storage/zfs.$(OBJEXT) string_utils.$(OBJEXT) sync.$(OBJEXT) \ terminal.$(OBJEXT) utils.$(OBJEXT) uuid.$(OBJEXT) \ $(am__objects_23) $(am__objects_24) $(am__objects_25) \ $(am__objects_26) $(am__objects_27) $(am__objects_28) \ $(am__objects_29) $(am__objects_30) $(am__objects_31) \ $(am__objects_32) $(am__objects_33) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@am__objects_35 = $(am__objects_34) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__objects_36 = af_unix.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ rexec.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(am__objects_23) @ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__objects_37 = seccomp.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRCHRNUL_FALSE@am__objects_38 = ../include/strchrnul.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCPY_FALSE@am__objects_39 = ../include/strlcpy.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_STRLCAT_FALSE@am__objects_40 = ../include/strlcat.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_OPENPTY_FALSE@am__objects_41 = ../include/openpty.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@am__objects_42 = ../include/fexecve.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@IS_BIONIC_TRUE@ ../include/lxcmntent.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_GETGRGID_R_FALSE@am__objects_43 = ../include/getgrgid_r.$(OBJEXT) @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__objects_44 = ../include/prlimit.$(OBJEXT) @ENABLE_TOOLS_TRUE@am_lxc_attach_OBJECTS = tools/lxc_attach.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_36) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_attach_OBJECTS = $(am_lxc_attach_OBJECTS) lxc_attach_LDADD = $(LDADD) lxc_attach_DEPENDENCIES = liblxc.la lxc_attach_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_attach_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_autostart_SOURCES_DIST = tools/lxc_autostart.c \ tools/arguments.c tools/arguments.h af_unix.c af_unix.h \ api_extensions.h attach.c attach.h ../include/bpf.h \ ../include/bpf_common.h caps.c caps.h cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@am__objects_45 = af_unix.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ caps.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgfsng.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ commands_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ conf.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ confile_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ error.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ file_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ initutils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ log.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ lxclock.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mainloop.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ monitor.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ mount_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ namespace.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ network.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ nl.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ parse.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ process_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ ringbuf.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ start.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ state.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/btrfs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/dir.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/loop.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/lvm.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/nbd.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/overlay.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rbd.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/rsync.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/storage_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ storage/zfs.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ string_utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ sync.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ terminal.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ utils.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ uuid.$(OBJEXT) \ @ENABLE_STATIC_BINARIES_FALSE@@ENABLE_TOOLS_TRUE@ $(am__objects_23) @ENABLE_TOOLS_TRUE@am_lxc_autostart_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_autostart.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_autostart_OBJECTS = $(am_lxc_autostart_OBJECTS) lxc_autostart_LDADD = $(LDADD) lxc_autostart_DEPENDENCIES = liblxc.la lxc_autostart_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_autostart_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_cgroup_SOURCES_DIST = tools/lxc_cgroup.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_cgroup_OBJECTS = tools/lxc_cgroup.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_cgroup_OBJECTS = $(am_lxc_cgroup_OBJECTS) lxc_cgroup_LDADD = $(LDADD) lxc_cgroup_DEPENDENCIES = liblxc.la lxc_cgroup_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_cgroup_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_checkpoint_SOURCES_DIST = tools/lxc_checkpoint.c \ tools/arguments.c tools/arguments.h af_unix.c af_unix.h \ api_extensions.h attach.c attach.h ../include/bpf.h \ ../include/bpf_common.h caps.c caps.h cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_checkpoint_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_checkpoint.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_checkpoint_OBJECTS = $(am_lxc_checkpoint_OBJECTS) lxc_checkpoint_LDADD = $(LDADD) lxc_checkpoint_DEPENDENCIES = liblxc.la lxc_checkpoint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(lxc_checkpoint_LDFLAGS) $(LDFLAGS) -o \ $@ am__lxc_config_SOURCES_DIST = tools/lxc_config.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_config_OBJECTS = tools/lxc_config.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_config_OBJECTS = $(am_lxc_config_OBJECTS) lxc_config_LDADD = $(LDADD) lxc_config_DEPENDENCIES = liblxc.la lxc_config_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_config_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_console_SOURCES_DIST = tools/lxc_console.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_console_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_console.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_console_OBJECTS = $(am_lxc_console_OBJECTS) lxc_console_LDADD = $(LDADD) lxc_console_DEPENDENCIES = liblxc.la lxc_console_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_console_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_copy_SOURCES_DIST = tools/lxc_copy.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h \ tools/include/getsubopt.c tools/include/getsubopt.h @ENABLE_TOOLS_TRUE@@HAVE_GETSUBOPT_FALSE@am__objects_46 = tools/include/getsubopt.$(OBJEXT) @ENABLE_TOOLS_TRUE@am_lxc_copy_OBJECTS = tools/lxc_copy.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) $(am__objects_46) lxc_copy_OBJECTS = $(am_lxc_copy_OBJECTS) lxc_copy_LDADD = $(LDADD) lxc_copy_DEPENDENCIES = liblxc.la lxc_copy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_copy_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_create_SOURCES_DIST = tools/lxc_create.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_create_OBJECTS = tools/lxc_create.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_create_OBJECTS = $(am_lxc_create_OBJECTS) lxc_create_LDADD = $(LDADD) lxc_create_DEPENDENCIES = liblxc.la lxc_create_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_create_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_destroy_SOURCES_DIST = tools/lxc_destroy.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_destroy_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_destroy.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_destroy_OBJECTS = $(am_lxc_destroy_OBJECTS) lxc_destroy_LDADD = $(LDADD) lxc_destroy_DEPENDENCIES = liblxc.la lxc_destroy_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_destroy_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_device_SOURCES_DIST = tools/lxc_device.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_device_OBJECTS = tools/lxc_device.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_device_OBJECTS = $(am_lxc_device_OBJECTS) lxc_device_LDADD = $(LDADD) lxc_device_DEPENDENCIES = liblxc.la lxc_device_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_device_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_execute_SOURCES_DIST = tools/lxc_execute.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_execute_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_execute.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_execute_OBJECTS = $(am_lxc_execute_OBJECTS) lxc_execute_LDADD = $(LDADD) lxc_execute_DEPENDENCIES = liblxc.la lxc_execute_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_execute_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_freeze_SOURCES_DIST = tools/lxc_freeze.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_freeze_OBJECTS = tools/lxc_freeze.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_freeze_OBJECTS = $(am_lxc_freeze_OBJECTS) lxc_freeze_LDADD = $(LDADD) lxc_freeze_DEPENDENCIES = liblxc.la lxc_freeze_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_freeze_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_info_SOURCES_DIST = tools/lxc_info.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_info_OBJECTS = tools/lxc_info.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_info_OBJECTS = $(am_lxc_info_OBJECTS) lxc_info_LDADD = $(LDADD) lxc_info_DEPENDENCIES = liblxc.la lxc_info_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_info_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_ls_SOURCES_DIST = tools/lxc_ls.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_ls_OBJECTS = tools/lxc_ls.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_ls_OBJECTS = $(am_lxc_ls_OBJECTS) lxc_ls_LDADD = $(LDADD) lxc_ls_DEPENDENCIES = liblxc.la lxc_ls_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_ls_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_monitor_SOURCES_DIST = tools/lxc_monitor.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_monitor_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_monitor.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_monitor_OBJECTS = $(am_lxc_monitor_OBJECTS) lxc_monitor_LDADD = $(LDADD) lxc_monitor_DEPENDENCIES = liblxc.la lxc_monitor_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_monitor_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_monitord_SOURCES_DIST = cmd/lxc_monitord.c af_unix.c af_unix.h \ api_extensions.h attach.c attach.h ../include/bpf.h \ ../include/bpf_common.h caps.c caps.h cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@am__objects_47 = $(am__objects_34) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__objects_48 = af_unix.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ caps.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgfsng.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup2_devices.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ cgroups/cgroup_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ commands_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ conf.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ confile_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ error.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ file_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ../include/netns_ifaddrs.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ initutils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ log.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ lxclock.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mainloop.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ monitor.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ mount_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ namespace.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ network.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ nl.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ parse.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ process_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ ringbuf.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ start.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ state.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/btrfs.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/dir.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/loop.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/lvm.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/nbd.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/overlay.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rbd.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/rsync.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/storage_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ storage/zfs.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ string_utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ sync.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ terminal.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ utils.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ uuid.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@ $(am__objects_23) @ENABLE_COMMANDS_TRUE@@ENABLE_SECCOMP_TRUE@@ENABLE_STATIC_BINARIES_FALSE@am__objects_49 = seccomp.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRCHRNUL_FALSE@am__objects_50 = ../include/strchrnul.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCPY_FALSE@am__objects_51 = ../include/strlcpy.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_STRLCAT_FALSE@am__objects_52 = ../include/strlcat.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_OPENPTY_FALSE@am__objects_53 = ../include/openpty.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@am__objects_54 = ../include/fexecve.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@IS_BIONIC_TRUE@ ../include/lxcmntent.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_GETGRGID_R_FALSE@am__objects_55 = ../include/getgrgid_r.$(OBJEXT) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_FALSE@@HAVE_PRLIMIT64_TRUE@@HAVE_PRLIMIT_FALSE@am__objects_56 = ../include/prlimit.$(OBJEXT) @ENABLE_COMMANDS_TRUE@am_lxc_monitord_OBJECTS = \ @ENABLE_COMMANDS_TRUE@ cmd/lxc_monitord.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_47) $(am__objects_48) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_49) $(am__objects_50) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_51) $(am__objects_52) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_53) $(am__objects_54) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_55) $(am__objects_56) lxc_monitord_OBJECTS = $(am_lxc_monitord_OBJECTS) lxc_monitord_LDADD = $(LDADD) lxc_monitord_DEPENDENCIES = liblxc.la lxc_monitord_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_monitord_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_snapshot_SOURCES_DIST = tools/lxc_snapshot.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_snapshot_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_snapshot.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_snapshot_OBJECTS = $(am_lxc_snapshot_OBJECTS) lxc_snapshot_LDADD = $(LDADD) lxc_snapshot_DEPENDENCIES = liblxc.la lxc_snapshot_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_snapshot_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_start_SOURCES_DIST = tools/lxc_start.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_start_OBJECTS = tools/lxc_start.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_start_OBJECTS = $(am_lxc_start_OBJECTS) lxc_start_LDADD = $(LDADD) lxc_start_DEPENDENCIES = liblxc.la lxc_start_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_start_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_stop_SOURCES_DIST = tools/lxc_stop.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_stop_OBJECTS = tools/lxc_stop.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_stop_OBJECTS = $(am_lxc_stop_OBJECTS) lxc_stop_LDADD = $(LDADD) lxc_stop_DEPENDENCIES = liblxc.la lxc_stop_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_stop_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_top_SOURCES_DIST = tools/lxc_top.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_top_OBJECTS = tools/lxc_top.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_top_OBJECTS = $(am_lxc_top_OBJECTS) lxc_top_LDADD = $(LDADD) lxc_top_DEPENDENCIES = liblxc.la lxc_top_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_top_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_unfreeze_SOURCES_DIST = tools/lxc_unfreeze.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_unfreeze_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_unfreeze.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_unfreeze_OBJECTS = $(am_lxc_unfreeze_OBJECTS) lxc_unfreeze_LDADD = $(LDADD) lxc_unfreeze_DEPENDENCIES = liblxc.la lxc_unfreeze_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_unfreeze_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_unshare_SOURCES_DIST = tools/lxc_unshare.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_unshare_OBJECTS = \ @ENABLE_TOOLS_TRUE@ tools/lxc_unshare.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_unshare_OBJECTS = $(am_lxc_unshare_OBJECTS) lxc_unshare_LDADD = $(LDADD) lxc_unshare_DEPENDENCIES = liblxc.la lxc_unshare_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_unshare_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_user_nic_SOURCES_DIST = cmd/lxc_user_nic.c af_unix.c af_unix.h \ api_extensions.h attach.c attach.h ../include/bpf.h \ ../include/bpf_common.h caps.c caps.h cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_COMMANDS_TRUE@am_lxc_user_nic_OBJECTS = \ @ENABLE_COMMANDS_TRUE@ cmd/lxc_user_nic.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_47) $(am__objects_48) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_49) $(am__objects_50) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_51) $(am__objects_52) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_53) $(am__objects_54) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_55) $(am__objects_56) lxc_user_nic_OBJECTS = $(am_lxc_user_nic_OBJECTS) lxc_user_nic_LDADD = $(LDADD) lxc_user_nic_DEPENDENCIES = liblxc.la lxc_user_nic_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_user_nic_LDFLAGS) $(LDFLAGS) -o $@ am__lxc_usernsexec_SOURCES_DIST = cmd/lxc_usernsexec.c af_unix.c \ af_unix.h api_extensions.h attach.c attach.h ../include/bpf.h \ ../include/bpf_common.h caps.c caps.h cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_COMMANDS_TRUE@am_lxc_usernsexec_OBJECTS = \ @ENABLE_COMMANDS_TRUE@ cmd/lxc_usernsexec.$(OBJEXT) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_47) $(am__objects_48) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_49) $(am__objects_50) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_51) $(am__objects_52) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_53) $(am__objects_54) \ @ENABLE_COMMANDS_TRUE@ $(am__objects_55) $(am__objects_56) lxc_usernsexec_OBJECTS = $(am_lxc_usernsexec_OBJECTS) lxc_usernsexec_LDADD = $(LDADD) lxc_usernsexec_DEPENDENCIES = liblxc.la lxc_usernsexec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(lxc_usernsexec_LDFLAGS) $(LDFLAGS) -o \ $@ am__lxc_wait_SOURCES_DIST = tools/lxc_wait.c tools/arguments.c \ tools/arguments.h af_unix.c af_unix.h api_extensions.h \ attach.c attach.h ../include/bpf.h ../include/bpf_common.h \ caps.c caps.h cgroups/cgfsng.c cgroups/cgroup.c \ cgroups/cgroup.h cgroups/cgroup2_devices.c \ cgroups/cgroup2_devices.h cgroups/cgroup_utils.c \ cgroups/cgroup_utils.h compiler.h commands.c commands.h \ commands_utils.c commands_utils.h conf.c conf.h confile.c \ confile.h confile_utils.c confile_utils.h criu.c criu.h \ error.c error.h execute.c error_utils.h freezer.c file_utils.c \ file_utils.h hlist.h ../include/netns_ifaddrs.c \ ../include/netns_ifaddrs.h initutils.c initutils.h list.h \ log.c log.h lxc.h lxccontainer.c lxccontainer.h lxclock.c \ lxclock.h lxcseccomp.h macro.h memory_utils.h mainloop.c \ mainloop.h mount_utils.c mount_utils.h namespace.c namespace.h \ network.c network.h nl.c nl.h monitor.c monitor.h parse.c \ parse.h process_utils.c process_utils.h ringbuf.c ringbuf.h \ rtnl.c rtnl.h state.c state.h start.c start.h storage/btrfs.c \ storage/btrfs.h storage/dir.c storage/dir.h storage/loop.c \ storage/loop.h storage/lvm.c storage/lvm.h storage/nbd.c \ storage/nbd.h storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h lsm/lsm.c lsm/lsm.h lsm/nop.c \ lsm/apparmor.c lsm/selinux.c ../include/fexecve.c \ ../include/fexecve.h ../include/lxcmntent.c \ ../include/lxcmntent.h ../include/openpty.c \ ../include/openpty.h ../include/getgrgid_r.c \ ../include/getgrgid_r.h ../include/getline.c \ ../include/getline.h ../include/prlimit.c ../include/prlimit.h \ seccomp.c ../include/strlcpy.c ../include/strlcpy.h \ ../include/strlcat.c ../include/strlcat.h \ ../include/strchrnul.c ../include/strchrnul.h rexec.c rexec.h @ENABLE_TOOLS_TRUE@am_lxc_wait_OBJECTS = tools/lxc_wait.$(OBJEXT) \ @ENABLE_TOOLS_TRUE@ tools/arguments.$(OBJEXT) $(am__objects_35) \ @ENABLE_TOOLS_TRUE@ $(am__objects_45) $(am__objects_37) \ @ENABLE_TOOLS_TRUE@ $(am__objects_38) $(am__objects_39) \ @ENABLE_TOOLS_TRUE@ $(am__objects_40) $(am__objects_41) \ @ENABLE_TOOLS_TRUE@ $(am__objects_42) $(am__objects_43) \ @ENABLE_TOOLS_TRUE@ $(am__objects_44) lxc_wait_OBJECTS = $(am_lxc_wait_OBJECTS) lxc_wait_LDADD = $(LDADD) lxc_wait_DEPENDENCIES = liblxc.la lxc_wait_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(lxc_wait_LDFLAGS) $(LDFLAGS) -o $@ SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ../include/$(DEPDIR)/fexecve.Po \ ../include/$(DEPDIR)/getgrgid_r.Po \ ../include/$(DEPDIR)/getline.Po \ ../include/$(DEPDIR)/init_lxc_static-getline.Po \ ../include/$(DEPDIR)/init_lxc_static-strlcat.Po \ ../include/$(DEPDIR)/init_lxc_static-strlcpy.Po \ ../include/$(DEPDIR)/liblxc_la-fexecve.Plo \ ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Plo \ ../include/$(DEPDIR)/liblxc_la-getline.Plo \ ../include/$(DEPDIR)/liblxc_la-lxcmntent.Plo \ ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Plo \ ../include/$(DEPDIR)/liblxc_la-openpty.Plo \ ../include/$(DEPDIR)/liblxc_la-prlimit.Plo \ ../include/$(DEPDIR)/liblxc_la-strchrnul.Plo \ ../include/$(DEPDIR)/liblxc_la-strlcat.Plo \ ../include/$(DEPDIR)/liblxc_la-strlcpy.Plo \ ../include/$(DEPDIR)/lxcmntent.Po \ ../include/$(DEPDIR)/netns_ifaddrs.Po \ ../include/$(DEPDIR)/openpty.Po \ ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Plo \ ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Plo \ ../include/$(DEPDIR)/prlimit.Po \ ../include/$(DEPDIR)/strchrnul.Po \ ../include/$(DEPDIR)/strlcat.Po \ ../include/$(DEPDIR)/strlcpy.Po ./$(DEPDIR)/af_unix.Po \ ./$(DEPDIR)/attach.Po ./$(DEPDIR)/caps.Po \ ./$(DEPDIR)/commands.Po ./$(DEPDIR)/commands_utils.Po \ ./$(DEPDIR)/conf.Po ./$(DEPDIR)/confile.Po \ ./$(DEPDIR)/confile_utils.Po ./$(DEPDIR)/criu.Po \ ./$(DEPDIR)/error.Po ./$(DEPDIR)/execute.Po \ ./$(DEPDIR)/file_utils.Po ./$(DEPDIR)/freezer.Po \ ./$(DEPDIR)/init_lxc_static-af_unix.Po \ ./$(DEPDIR)/init_lxc_static-caps.Po \ ./$(DEPDIR)/init_lxc_static-error.Po \ ./$(DEPDIR)/init_lxc_static-file_utils.Po \ ./$(DEPDIR)/init_lxc_static-initutils.Po \ ./$(DEPDIR)/init_lxc_static-log.Po \ ./$(DEPDIR)/init_lxc_static-namespace.Po \ ./$(DEPDIR)/init_lxc_static-string_utils.Po \ ./$(DEPDIR)/initutils.Po ./$(DEPDIR)/liblxc_la-af_unix.Plo \ ./$(DEPDIR)/liblxc_la-attach.Plo \ ./$(DEPDIR)/liblxc_la-caps.Plo \ ./$(DEPDIR)/liblxc_la-commands.Plo \ ./$(DEPDIR)/liblxc_la-commands_utils.Plo \ ./$(DEPDIR)/liblxc_la-conf.Plo \ ./$(DEPDIR)/liblxc_la-confile.Plo \ ./$(DEPDIR)/liblxc_la-confile_utils.Plo \ ./$(DEPDIR)/liblxc_la-criu.Plo ./$(DEPDIR)/liblxc_la-error.Plo \ ./$(DEPDIR)/liblxc_la-execute.Plo \ ./$(DEPDIR)/liblxc_la-file_utils.Plo \ ./$(DEPDIR)/liblxc_la-freezer.Plo \ ./$(DEPDIR)/liblxc_la-initutils.Plo \ ./$(DEPDIR)/liblxc_la-log.Plo \ ./$(DEPDIR)/liblxc_la-lxccontainer.Plo \ ./$(DEPDIR)/liblxc_la-lxclock.Plo \ ./$(DEPDIR)/liblxc_la-mainloop.Plo \ ./$(DEPDIR)/liblxc_la-monitor.Plo \ ./$(DEPDIR)/liblxc_la-mount_utils.Plo \ ./$(DEPDIR)/liblxc_la-namespace.Plo \ ./$(DEPDIR)/liblxc_la-network.Plo ./$(DEPDIR)/liblxc_la-nl.Plo \ ./$(DEPDIR)/liblxc_la-parse.Plo \ ./$(DEPDIR)/liblxc_la-process_utils.Plo \ ./$(DEPDIR)/liblxc_la-rexec.Plo \ ./$(DEPDIR)/liblxc_la-ringbuf.Plo \ ./$(DEPDIR)/liblxc_la-rtnl.Plo \ ./$(DEPDIR)/liblxc_la-seccomp.Plo \ ./$(DEPDIR)/liblxc_la-start.Plo \ ./$(DEPDIR)/liblxc_la-state.Plo \ ./$(DEPDIR)/liblxc_la-string_utils.Plo \ ./$(DEPDIR)/liblxc_la-sync.Plo \ ./$(DEPDIR)/liblxc_la-terminal.Plo \ ./$(DEPDIR)/liblxc_la-utils.Plo ./$(DEPDIR)/liblxc_la-uuid.Plo \ ./$(DEPDIR)/log.Po ./$(DEPDIR)/lxccontainer.Po \ ./$(DEPDIR)/lxclock.Po ./$(DEPDIR)/mainloop.Po \ ./$(DEPDIR)/monitor.Po ./$(DEPDIR)/mount_utils.Po \ ./$(DEPDIR)/namespace.Po ./$(DEPDIR)/network.Po \ ./$(DEPDIR)/nl.Po ./$(DEPDIR)/pam_cgfs_la-file_utils.Plo \ ./$(DEPDIR)/pam_cgfs_la-string_utils.Plo ./$(DEPDIR)/parse.Po \ ./$(DEPDIR)/process_utils.Po ./$(DEPDIR)/rexec.Po \ ./$(DEPDIR)/ringbuf.Po ./$(DEPDIR)/rtnl.Po \ ./$(DEPDIR)/seccomp.Po ./$(DEPDIR)/start.Po \ ./$(DEPDIR)/state.Po ./$(DEPDIR)/string_utils.Po \ ./$(DEPDIR)/sync.Po ./$(DEPDIR)/terminal.Po \ ./$(DEPDIR)/utils.Po ./$(DEPDIR)/uuid.Po \ cgroups/$(DEPDIR)/cgfsng.Po cgroups/$(DEPDIR)/cgroup.Po \ cgroups/$(DEPDIR)/cgroup2_devices.Po \ cgroups/$(DEPDIR)/cgroup_utils.Po \ cgroups/$(DEPDIR)/liblxc_la-cgfsng.Plo \ cgroups/$(DEPDIR)/liblxc_la-cgroup.Plo \ cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Plo \ cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Plo \ cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po \ cmd/$(DEPDIR)/lxc_init.Po cmd/$(DEPDIR)/lxc_monitord.Po \ cmd/$(DEPDIR)/lxc_user_nic.Po cmd/$(DEPDIR)/lxc_usernsexec.Po \ lsm/$(DEPDIR)/apparmor.Po lsm/$(DEPDIR)/liblxc_la-apparmor.Plo \ lsm/$(DEPDIR)/liblxc_la-lsm.Plo \ lsm/$(DEPDIR)/liblxc_la-nop.Plo \ lsm/$(DEPDIR)/liblxc_la-selinux.Plo lsm/$(DEPDIR)/lsm.Po \ lsm/$(DEPDIR)/nop.Po lsm/$(DEPDIR)/selinux.Po \ pam/$(DEPDIR)/cgfs_la-pam_cgfs.Plo storage/$(DEPDIR)/btrfs.Po \ storage/$(DEPDIR)/dir.Po storage/$(DEPDIR)/liblxc_la-btrfs.Plo \ storage/$(DEPDIR)/liblxc_la-dir.Plo \ storage/$(DEPDIR)/liblxc_la-loop.Plo \ storage/$(DEPDIR)/liblxc_la-lvm.Plo \ storage/$(DEPDIR)/liblxc_la-nbd.Plo \ storage/$(DEPDIR)/liblxc_la-overlay.Plo \ storage/$(DEPDIR)/liblxc_la-rbd.Plo \ storage/$(DEPDIR)/liblxc_la-rsync.Plo \ storage/$(DEPDIR)/liblxc_la-storage.Plo \ storage/$(DEPDIR)/liblxc_la-storage_utils.Plo \ storage/$(DEPDIR)/liblxc_la-zfs.Plo storage/$(DEPDIR)/loop.Po \ storage/$(DEPDIR)/lvm.Po storage/$(DEPDIR)/nbd.Po \ storage/$(DEPDIR)/overlay.Po storage/$(DEPDIR)/rbd.Po \ storage/$(DEPDIR)/rsync.Po storage/$(DEPDIR)/storage.Po \ storage/$(DEPDIR)/storage_utils.Po storage/$(DEPDIR)/zfs.Po \ tools/$(DEPDIR)/arguments.Po tools/$(DEPDIR)/lxc_attach.Po \ tools/$(DEPDIR)/lxc_autostart.Po tools/$(DEPDIR)/lxc_cgroup.Po \ tools/$(DEPDIR)/lxc_checkpoint.Po \ tools/$(DEPDIR)/lxc_config.Po tools/$(DEPDIR)/lxc_console.Po \ tools/$(DEPDIR)/lxc_copy.Po tools/$(DEPDIR)/lxc_create.Po \ tools/$(DEPDIR)/lxc_destroy.Po tools/$(DEPDIR)/lxc_device.Po \ tools/$(DEPDIR)/lxc_execute.Po tools/$(DEPDIR)/lxc_freeze.Po \ tools/$(DEPDIR)/lxc_info.Po tools/$(DEPDIR)/lxc_ls.Po \ tools/$(DEPDIR)/lxc_monitor.Po tools/$(DEPDIR)/lxc_snapshot.Po \ tools/$(DEPDIR)/lxc_start.Po tools/$(DEPDIR)/lxc_stop.Po \ tools/$(DEPDIR)/lxc_top.Po tools/$(DEPDIR)/lxc_unfreeze.Po \ tools/$(DEPDIR)/lxc_unshare.Po tools/$(DEPDIR)/lxc_wait.Po \ tools/include/$(DEPDIR)/getsubopt.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liblxc_la_SOURCES) $(pam_cgfs_la_SOURCES) \ $(init_lxc_SOURCES) $(init_lxc_static_SOURCES) \ $(lxc_attach_SOURCES) $(lxc_autostart_SOURCES) \ $(lxc_cgroup_SOURCES) $(lxc_checkpoint_SOURCES) \ $(lxc_config_SOURCES) $(lxc_console_SOURCES) \ $(lxc_copy_SOURCES) $(lxc_create_SOURCES) \ $(lxc_destroy_SOURCES) $(lxc_device_SOURCES) \ $(lxc_execute_SOURCES) $(lxc_freeze_SOURCES) \ $(lxc_info_SOURCES) $(lxc_ls_SOURCES) $(lxc_monitor_SOURCES) \ $(lxc_monitord_SOURCES) $(lxc_snapshot_SOURCES) \ $(lxc_start_SOURCES) $(lxc_stop_SOURCES) $(lxc_top_SOURCES) \ $(lxc_unfreeze_SOURCES) $(lxc_unshare_SOURCES) \ $(lxc_user_nic_SOURCES) $(lxc_usernsexec_SOURCES) \ $(lxc_wait_SOURCES) DIST_SOURCES = $(am__liblxc_la_SOURCES_DIST) \ $(am__pam_cgfs_la_SOURCES_DIST) $(am__init_lxc_SOURCES_DIST) \ $(am__init_lxc_static_SOURCES_DIST) \ $(am__lxc_attach_SOURCES_DIST) \ $(am__lxc_autostart_SOURCES_DIST) \ $(am__lxc_cgroup_SOURCES_DIST) \ $(am__lxc_checkpoint_SOURCES_DIST) \ $(am__lxc_config_SOURCES_DIST) $(am__lxc_console_SOURCES_DIST) \ $(am__lxc_copy_SOURCES_DIST) $(am__lxc_create_SOURCES_DIST) \ $(am__lxc_destroy_SOURCES_DIST) $(am__lxc_device_SOURCES_DIST) \ $(am__lxc_execute_SOURCES_DIST) $(am__lxc_freeze_SOURCES_DIST) \ $(am__lxc_info_SOURCES_DIST) $(am__lxc_ls_SOURCES_DIST) \ $(am__lxc_monitor_SOURCES_DIST) \ $(am__lxc_monitord_SOURCES_DIST) \ $(am__lxc_snapshot_SOURCES_DIST) $(am__lxc_start_SOURCES_DIST) \ $(am__lxc_stop_SOURCES_DIST) $(am__lxc_top_SOURCES_DIST) \ $(am__lxc_unfreeze_SOURCES_DIST) \ $(am__lxc_unshare_SOURCES_DIST) \ $(am__lxc_user_nic_SOURCES_DIST) \ $(am__lxc_usernsexec_SOURCES_DIST) \ $(am__lxc_wait_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__noinst_HEADERS_DIST = api_extensions.h attach.h ../include/bpf.h \ ../include/bpf_common.h caps.h cgroups/cgroup.h \ cgroups/cgroup_utils.h cgroups/cgroup2_devices.h compiler.h \ conf.h confile.h confile_utils.h criu.h error.h error_utils.h \ file_utils.h hlist.h ../include/strchrnul.h \ ../include/strlcat.h ../include/strlcpy.h \ ../include/netns_ifaddrs.h initutils.h list.h log.h lxc.h \ lxclock.h macro.h memory_utils.h monitor.h mount_utils.h \ namespace.h process_utils.h rexec.h start.h state.h \ storage/btrfs.h storage/dir.h storage/loop.h storage/lvm.h \ storage/nbd.h storage/overlay.h storage/rbd.h storage/rsync.h \ storage/storage.h storage/storage_utils.h storage/zfs.h \ string_utils.h syscall_numbers.h syscall_wrappers.h terminal.h \ ../tests/lxctest.h tools/arguments.h utils.h uuid.h \ ../include/fexecve.h ../include/lxcmntent.h \ ../include/openpty.h ../include/prlimit.h ../include/getline.h \ tools/include/getsubopt.h ../include/getgrgid_r.h HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/lxc.functions.in \ $(srcdir)/version.h.in $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_CFLAGS = @AM_CFLAGS@ -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ -DLXCPATH=\"$(LXCPATH)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ -DLXCINITDIR=\"$(LXCINITDIR)\" -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \ -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \ -DLOGPATH=\"$(LOGPATH)\" \ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \ -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \ -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" -DSBINDIR=\"$(SBINDIR)\" \ -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" -I \ $(top_srcdir)/src -I $(top_srcdir)/src/include -I \ $(top_srcdir)/src/lxc -I $(top_srcdir)/src/lxc/storage -I \ $(top_srcdir)/src/lxc/cgroups $(am__append_19) \ $(am__append_20) $(am__append_21) $(am__append_22) \ $(am__append_23) $(am__append_24) AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_LDFLAGS = @AM_LDFLAGS@ -Wl,-E $(am__append_28) APPARMOR_CACHE_DIR = @APPARMOR_CACHE_DIR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BINDIR = @BINDIR@ CAP_LIBS = @CAP_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIR = @DATADIR@ DEFAULT_CGROUP_PATTERN = @DEFAULT_CGROUP_PATTERN@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DLOG_CFLAGS = @DLOG_CFLAGS@ DLOG_LIBS = @DLOG_LIBS@ DOCDIR = @DOCDIR@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_DOXYGEN = @HAVE_DOXYGEN@ INCLUDEDIR = @INCLUDEDIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBDIR = @LIBDIR@ LIBEXECDIR = @LIBEXECDIR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIBURING_LIBS = @LIBURING_LIBS@ LIPO = @LIPO@ LN_S = @LN_S@ LOCALSTATEDIR = @LOCALSTATEDIR@ LOGPATH = @LOGPATH@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LXCBINHOOKDIR = @LXCBINHOOKDIR@ LXCHOOKDIR = @LXCHOOKDIR@ LXCINITDIR = @LXCINITDIR@ LXCPATH = @LXCPATH@ LXCROOTFSMOUNT = @LXCROOTFSMOUNT@ LXCTEMPLATECONFIG = @LXCTEMPLATECONFIG@ LXCTEMPLATEDIR = @LXCTEMPLATEDIR@ LXC_ABI = @LXC_ABI@ LXC_ABI_MAJOR = @LXC_ABI_MAJOR@ LXC_ABI_MICRO = @LXC_ABI_MICRO@ LXC_ABI_MINOR = @LXC_ABI_MINOR@ LXC_DEFAULT_CONFIG = @LXC_DEFAULT_CONFIG@ LXC_DEVEL = @LXC_DEVEL@ LXC_DISTRO_SYSCONF = @LXC_DISTRO_SYSCONF@ LXC_GENERATE_DATE = @LXC_GENERATE_DATE@ LXC_GLOBAL_CONF = @LXC_GLOBAL_CONF@ LXC_USERNIC_CONF = @LXC_USERNIC_CONF@ LXC_USERNIC_DB = @LXC_USERNIC_DB@ LXC_VERSION = @LXC_VERSION@ LXC_VERSION_BASE = @LXC_VERSION_BASE@ LXC_VERSION_BETA = @LXC_VERSION_BETA@ LXC_VERSION_MAJOR = @LXC_VERSION_MAJOR@ LXC_VERSION_MICRO = @LXC_VERSION_MICRO@ LXC_VERSION_MINOR = @LXC_VERSION_MINOR@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJCOPY = @OBJCOPY@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPENSSL_LIBS = @OPENSSL_LIBS@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CFLAGS = @PAM_CFLAGS@ PAM_LIBS = @PAM_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PREFIX = @PREFIX@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RUNTIME_PATH = @RUNTIME_PATH@ SBINDIR = @SBINDIR@ SECCOMP_CFLAGS = @SECCOMP_CFLAGS@ SECCOMP_LIBS = @SECCOMP_LIBS@ SED = @SED@ SELINUX_LIBS = @SELINUX_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SYSCONFDIR = @SYSCONFDIR@ SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bashcompdir = @bashcompdir@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ db2xman = @db2xman@ docdir = @docdir@ docdtd = @docdtd@ dvidir = @dvidir@ exec_pamdir = @exec_pamdir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = attach_options.h \ lxccontainer.h \ version.h noinst_HEADERS = api_extensions.h attach.h ../include/bpf.h \ ../include/bpf_common.h caps.h cgroups/cgroup.h \ cgroups/cgroup_utils.h cgroups/cgroup2_devices.h compiler.h \ conf.h confile.h confile_utils.h criu.h error.h error_utils.h \ file_utils.h hlist.h ../include/strchrnul.h \ ../include/strlcat.h ../include/strlcpy.h \ ../include/netns_ifaddrs.h initutils.h list.h log.h lxc.h \ lxclock.h macro.h memory_utils.h monitor.h mount_utils.h \ namespace.h process_utils.h rexec.h start.h state.h \ storage/btrfs.h storage/dir.h storage/loop.h storage/lvm.h \ storage/nbd.h storage/overlay.h storage/rbd.h storage/rsync.h \ storage/storage.h storage/storage_utils.h storage/zfs.h \ string_utils.h syscall_numbers.h syscall_wrappers.h terminal.h \ ../tests/lxctest.h tools/arguments.h utils.h uuid.h \ $(am__append_1) $(am__append_2) $(am__append_3) \ $(am__append_4) $(am__append_5) $(am__append_6) sodir = $(libdir) LSM_SOURCES = lsm/lsm.c lsm/lsm.h lsm/nop.c $(am__append_7) \ $(am__append_8) lib_LTLIBRARIES = liblxc.la liblxc_la_SOURCES = af_unix.c af_unix.h api_extensions.h attach.c \ attach.h ../include/bpf.h ../include/bpf_common.h caps.c \ caps.h cgroups/cgfsng.c cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h compiler.h \ commands.c commands.h commands_utils.c commands_utils.h conf.c \ conf.h confile.c confile.h confile_utils.c confile_utils.h \ criu.c criu.h error.c error.h execute.c error_utils.h \ freezer.c file_utils.c file_utils.h hlist.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h list.h log.c log.h lxc.h \ lxccontainer.c lxccontainer.h lxclock.c lxclock.h lxcseccomp.h \ macro.h memory_utils.h mainloop.c mainloop.h mount_utils.c \ mount_utils.h namespace.c namespace.h network.c network.h nl.c \ nl.h monitor.c monitor.h parse.c parse.h process_utils.c \ process_utils.h ringbuf.c ringbuf.h rtnl.c rtnl.h state.c \ state.h start.c start.h storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h storage/rbd.c \ storage/rbd.h storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h storage/storage_utils.c \ storage/storage_utils.h storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h sync.c sync.h syscall_numbers.h \ syscall_wrappers.h terminal.c terminal.h utils.c utils.h \ uuid.c uuid.h version.h $(LSM_SOURCES) $(am__append_9) \ $(am__append_10) $(am__append_11) $(am__append_12) \ $(am__append_13) $(am__append_14) $(am__append_15) \ $(am__append_16) $(am__append_17) $(am__append_18) # build the shared library liblxc_la_CFLAGS = -fPIC \ -DPIC \ $(AM_CFLAGS) \ $(LIBLXC_SANITIZER) \ -pthread liblxc_la_LDFLAGS = -pthread -Wl,-soname,liblxc.so.$(firstword $(subst \ ., ,@LXC_ABI@)) -version-info @LXC_ABI_MAJOR@ $(am__append_25) liblxc_la_LIBADD = $(CAP_LIBS) \ $(OPENSSL_LIBS) \ $(SELINUX_LIBS) \ $(SECCOMP_LIBS) \ $(DLOG_LIBS) \ $(LIBURING_LIBS) bin_SCRIPTS = $(am__append_26) LDADD = liblxc.la \ @CAP_LIBS@ \ @OPENSSL_LIBS@ \ @SECCOMP_LIBS@ \ @SELINUX_LIBS@ \ @DLOG_LIBS@ \ @LIBURING_LIBS@ @ENABLE_TOOLS_TRUE@lxc_attach_SOURCES = tools/lxc_attach.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_29) $(am__append_30) \ @ENABLE_TOOLS_TRUE@ $(am__append_31) $(am__append_32) \ @ENABLE_TOOLS_TRUE@ $(am__append_33) $(am__append_34) \ @ENABLE_TOOLS_TRUE@ $(am__append_35) $(am__append_36) \ @ENABLE_TOOLS_TRUE@ $(am__append_37) $(am__append_38) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_attach_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_autostart_SOURCES = tools/lxc_autostart.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_39) $(am__append_40) \ @ENABLE_TOOLS_TRUE@ $(am__append_41) $(am__append_42) \ @ENABLE_TOOLS_TRUE@ $(am__append_43) $(am__append_44) \ @ENABLE_TOOLS_TRUE@ $(am__append_45) $(am__append_46) \ @ENABLE_TOOLS_TRUE@ $(am__append_47) $(am__append_48) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_autostart_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_49) $(am__append_50) \ @ENABLE_TOOLS_TRUE@ $(am__append_51) $(am__append_52) \ @ENABLE_TOOLS_TRUE@ $(am__append_53) $(am__append_54) \ @ENABLE_TOOLS_TRUE@ $(am__append_55) $(am__append_56) \ @ENABLE_TOOLS_TRUE@ $(am__append_57) $(am__append_58) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_cgroup_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_config_SOURCES = tools/lxc_config.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_59) $(am__append_60) \ @ENABLE_TOOLS_TRUE@ $(am__append_61) $(am__append_62) \ @ENABLE_TOOLS_TRUE@ $(am__append_63) $(am__append_64) \ @ENABLE_TOOLS_TRUE@ $(am__append_65) $(am__append_66) \ @ENABLE_TOOLS_TRUE@ $(am__append_67) $(am__append_68) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_config_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_console_SOURCES = tools/lxc_console.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_69) $(am__append_70) \ @ENABLE_TOOLS_TRUE@ $(am__append_71) $(am__append_72) \ @ENABLE_TOOLS_TRUE@ $(am__append_73) $(am__append_74) \ @ENABLE_TOOLS_TRUE@ $(am__append_75) $(am__append_76) \ @ENABLE_TOOLS_TRUE@ $(am__append_77) $(am__append_78) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_console_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_destroy_SOURCES = tools/lxc_destroy.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_79) $(am__append_80) \ @ENABLE_TOOLS_TRUE@ $(am__append_81) $(am__append_82) \ @ENABLE_TOOLS_TRUE@ $(am__append_83) $(am__append_84) \ @ENABLE_TOOLS_TRUE@ $(am__append_85) $(am__append_86) \ @ENABLE_TOOLS_TRUE@ $(am__append_87) $(am__append_88) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_destroy_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_device_SOURCES = tools/lxc_device.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_89) $(am__append_90) \ @ENABLE_TOOLS_TRUE@ $(am__append_91) $(am__append_92) \ @ENABLE_TOOLS_TRUE@ $(am__append_93) $(am__append_94) \ @ENABLE_TOOLS_TRUE@ $(am__append_95) $(am__append_96) \ @ENABLE_TOOLS_TRUE@ $(am__append_97) $(am__append_98) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_device_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_execute_SOURCES = tools/lxc_execute.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_99) $(am__append_100) \ @ENABLE_TOOLS_TRUE@ $(am__append_101) $(am__append_102) \ @ENABLE_TOOLS_TRUE@ $(am__append_103) $(am__append_104) \ @ENABLE_TOOLS_TRUE@ $(am__append_105) $(am__append_106) \ @ENABLE_TOOLS_TRUE@ $(am__append_107) $(am__append_108) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_execute_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_freeze_SOURCES = tools/lxc_freeze.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_109) $(am__append_110) \ @ENABLE_TOOLS_TRUE@ $(am__append_111) $(am__append_112) \ @ENABLE_TOOLS_TRUE@ $(am__append_113) $(am__append_114) \ @ENABLE_TOOLS_TRUE@ $(am__append_115) $(am__append_116) \ @ENABLE_TOOLS_TRUE@ $(am__append_117) $(am__append_118) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_freeze_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_info_SOURCES = tools/lxc_info.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_119) $(am__append_120) \ @ENABLE_TOOLS_TRUE@ $(am__append_121) $(am__append_122) \ @ENABLE_TOOLS_TRUE@ $(am__append_123) $(am__append_124) \ @ENABLE_TOOLS_TRUE@ $(am__append_125) $(am__append_126) \ @ENABLE_TOOLS_TRUE@ $(am__append_127) $(am__append_128) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_info_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_monitor_SOURCES = tools/lxc_monitor.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_129) $(am__append_130) \ @ENABLE_TOOLS_TRUE@ $(am__append_131) $(am__append_132) \ @ENABLE_TOOLS_TRUE@ $(am__append_133) $(am__append_134) \ @ENABLE_TOOLS_TRUE@ $(am__append_135) $(am__append_136) \ @ENABLE_TOOLS_TRUE@ $(am__append_137) $(am__append_138) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_monitor_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_ls_SOURCES = tools/lxc_ls.c tools/arguments.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.h $(am__append_139) \ @ENABLE_TOOLS_TRUE@ $(am__append_140) $(am__append_141) \ @ENABLE_TOOLS_TRUE@ $(am__append_142) $(am__append_143) \ @ENABLE_TOOLS_TRUE@ $(am__append_144) $(am__append_145) \ @ENABLE_TOOLS_TRUE@ $(am__append_146) $(am__append_147) \ @ENABLE_TOOLS_TRUE@ $(am__append_148) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_ls_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_copy_SOURCES = tools/lxc_copy.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_149) $(am__append_150) \ @ENABLE_TOOLS_TRUE@ $(am__append_151) $(am__append_152) \ @ENABLE_TOOLS_TRUE@ $(am__append_153) $(am__append_154) \ @ENABLE_TOOLS_TRUE@ $(am__append_155) $(am__append_156) \ @ENABLE_TOOLS_TRUE@ $(am__append_157) $(am__append_158) \ @ENABLE_TOOLS_TRUE@ $(am__append_281) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_copy_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_start_SOURCES = tools/lxc_start.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_159) $(am__append_160) \ @ENABLE_TOOLS_TRUE@ $(am__append_161) $(am__append_162) \ @ENABLE_TOOLS_TRUE@ $(am__append_163) $(am__append_164) \ @ENABLE_TOOLS_TRUE@ $(am__append_165) $(am__append_166) \ @ENABLE_TOOLS_TRUE@ $(am__append_167) $(am__append_168) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_start_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_stop_SOURCES = tools/lxc_stop.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_169) $(am__append_170) \ @ENABLE_TOOLS_TRUE@ $(am__append_171) $(am__append_172) \ @ENABLE_TOOLS_TRUE@ $(am__append_173) $(am__append_174) \ @ENABLE_TOOLS_TRUE@ $(am__append_175) $(am__append_176) \ @ENABLE_TOOLS_TRUE@ $(am__append_177) $(am__append_178) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_stop_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_top_SOURCES = tools/lxc_top.c tools/arguments.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.h $(am__append_179) \ @ENABLE_TOOLS_TRUE@ $(am__append_180) $(am__append_181) \ @ENABLE_TOOLS_TRUE@ $(am__append_182) $(am__append_183) \ @ENABLE_TOOLS_TRUE@ $(am__append_184) $(am__append_185) \ @ENABLE_TOOLS_TRUE@ $(am__append_186) $(am__append_187) \ @ENABLE_TOOLS_TRUE@ $(am__append_188) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_top_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_189) $(am__append_190) \ @ENABLE_TOOLS_TRUE@ $(am__append_191) $(am__append_192) \ @ENABLE_TOOLS_TRUE@ $(am__append_193) $(am__append_194) \ @ENABLE_TOOLS_TRUE@ $(am__append_195) $(am__append_196) \ @ENABLE_TOOLS_TRUE@ $(am__append_197) $(am__append_198) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_unfreeze_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_unshare_SOURCES = tools/lxc_unshare.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_199) $(am__append_200) \ @ENABLE_TOOLS_TRUE@ $(am__append_201) $(am__append_202) \ @ENABLE_TOOLS_TRUE@ $(am__append_203) $(am__append_204) \ @ENABLE_TOOLS_TRUE@ $(am__append_205) $(am__append_206) \ @ENABLE_TOOLS_TRUE@ $(am__append_207) $(am__append_208) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_unshare_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_wait_SOURCES = tools/lxc_wait.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_209) $(am__append_210) \ @ENABLE_TOOLS_TRUE@ $(am__append_211) $(am__append_212) \ @ENABLE_TOOLS_TRUE@ $(am__append_213) $(am__append_214) \ @ENABLE_TOOLS_TRUE@ $(am__append_215) $(am__append_216) \ @ENABLE_TOOLS_TRUE@ $(am__append_217) $(am__append_218) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_wait_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_create_SOURCES = tools/lxc_create.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_219) $(am__append_220) \ @ENABLE_TOOLS_TRUE@ $(am__append_221) $(am__append_222) \ @ENABLE_TOOLS_TRUE@ $(am__append_223) $(am__append_224) \ @ENABLE_TOOLS_TRUE@ $(am__append_225) $(am__append_226) \ @ENABLE_TOOLS_TRUE@ $(am__append_227) $(am__append_228) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_create_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_229) $(am__append_230) \ @ENABLE_TOOLS_TRUE@ $(am__append_231) $(am__append_232) \ @ENABLE_TOOLS_TRUE@ $(am__append_233) $(am__append_234) \ @ENABLE_TOOLS_TRUE@ $(am__append_235) $(am__append_236) \ @ENABLE_TOOLS_TRUE@ $(am__append_237) $(am__append_238) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_snapshot_LDFLAGS = -all-static -pthread @ENABLE_TOOLS_TRUE@lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ @ENABLE_TOOLS_TRUE@ tools/arguments.c tools/arguments.h \ @ENABLE_TOOLS_TRUE@ $(am__append_239) $(am__append_240) \ @ENABLE_TOOLS_TRUE@ $(am__append_241) $(am__append_242) \ @ENABLE_TOOLS_TRUE@ $(am__append_243) $(am__append_244) \ @ENABLE_TOOLS_TRUE@ $(am__append_245) $(am__append_246) \ @ENABLE_TOOLS_TRUE@ $(am__append_247) $(am__append_248) @ENABLE_STATIC_BINARIES_TRUE@@ENABLE_TOOLS_TRUE@lxc_checkpoint_LDFLAGS = -all-static -pthread # Binaries shipping with liblxc @ENABLE_COMMANDS_TRUE@init_lxc_SOURCES = cmd/lxc_init.c af_unix.c \ @ENABLE_COMMANDS_TRUE@ af_unix.h caps.c caps.h error.c error.h \ @ENABLE_COMMANDS_TRUE@ file_utils.c file_utils.h initutils.c \ @ENABLE_COMMANDS_TRUE@ initutils.h log.c log.h macro.h \ @ENABLE_COMMANDS_TRUE@ memory_utils.h namespace.c namespace.h \ @ENABLE_COMMANDS_TRUE@ string_utils.c string_utils.h \ @ENABLE_COMMANDS_TRUE@ $(am__append_249) $(am__append_250) @ENABLE_COMMANDS_TRUE@init_lxc_LDFLAGS = -pthread @ENABLE_COMMANDS_TRUE@lxc_monitord_SOURCES = cmd/lxc_monitord.c \ @ENABLE_COMMANDS_TRUE@ $(am__append_251) $(am__append_252) \ @ENABLE_COMMANDS_TRUE@ $(am__append_253) $(am__append_254) \ @ENABLE_COMMANDS_TRUE@ $(am__append_255) $(am__append_256) \ @ENABLE_COMMANDS_TRUE@ $(am__append_257) $(am__append_258) \ @ENABLE_COMMANDS_TRUE@ $(am__append_259) $(am__append_260) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@lxc_monitord_LDFLAGS = -all-static -pthread @ENABLE_COMMANDS_TRUE@lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \ @ENABLE_COMMANDS_TRUE@ $(am__append_261) $(am__append_262) \ @ENABLE_COMMANDS_TRUE@ $(am__append_263) $(am__append_264) \ @ENABLE_COMMANDS_TRUE@ $(am__append_265) $(am__append_266) \ @ENABLE_COMMANDS_TRUE@ $(am__append_267) $(am__append_268) \ @ENABLE_COMMANDS_TRUE@ $(am__append_269) $(am__append_270) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@lxc_user_nic_LDFLAGS = -all-static -pthread @ENABLE_COMMANDS_TRUE@lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \ @ENABLE_COMMANDS_TRUE@ $(am__append_271) $(am__append_272) \ @ENABLE_COMMANDS_TRUE@ $(am__append_273) $(am__append_274) \ @ENABLE_COMMANDS_TRUE@ $(am__append_275) $(am__append_276) \ @ENABLE_COMMANDS_TRUE@ $(am__append_277) $(am__append_278) \ @ENABLE_COMMANDS_TRUE@ $(am__append_279) $(am__append_280) @ENABLE_COMMANDS_TRUE@@ENABLE_STATIC_BINARIES_TRUE@lxc_usernsexec_LDFLAGS = -all-static -pthread @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@init_lxc_static_SOURCES = \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ cmd/lxc_init.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ af_unix.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ af_unix.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ caps.c caps.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ error.c error.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ file_utils.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ file_utils.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ initutils.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ initutils.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ log.c log.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ macro.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ memory_utils.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ namespace.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ namespace.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ string_utils.c \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ string_utils.h \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__append_283) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__append_284) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__append_285) @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@init_lxc_static_LDFLAGS = -all-static -pthread @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@init_lxc_static_LDADD = @CAP_LIBS@ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@init_lxc_static_CFLAGS = \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(AM_CFLAGS) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ -DNO_LXC_CONF \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__append_286) \ @ENABLE_COMMANDS_TRUE@@HAVE_STATIC_LIBCAP_TRUE@ $(am__append_287) @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@exec_pam_LTLIBRARIES = pam_cgfs.la @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@pam_cgfs_la_SOURCES = pam/pam_cgfs.c \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ file_utils.c file_utils.h \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ macro.h memory_utils.h \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ string_utils.c string_utils.h \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__append_288) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(am__append_289) @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@pam_cgfs_la_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@pam_cgfs_la_LIBADD = $(AM_LIBS) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(PAM_LIBS) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(DLOG_LIBS) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ -L$(top_srcdir) @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ -avoid-version \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ -module \ @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ -shared all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lxc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lxc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): lxc.functions: $(top_builddir)/config.status $(srcdir)/lxc.functions.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ version.h: $(top_builddir)/config.status $(srcdir)/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-pkglibexecPROGRAMS: $(pkglibexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkglibexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-pkglibexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(pkglibexec_PROGRAMS)'; test -n "$(pkglibexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(pkglibexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(pkglibexecdir)" && rm -f $$files clean-pkglibexecPROGRAMS: @list='$(pkglibexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-exec_pamLTLIBRARIES: $(exec_pam_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(exec_pam_LTLIBRARIES)'; test -n "$(exec_pamdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(exec_pamdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(exec_pamdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(exec_pamdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(exec_pamdir)"; \ } uninstall-exec_pamLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(exec_pam_LTLIBRARIES)'; test -n "$(exec_pamdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(exec_pamdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(exec_pamdir)/$$f"; \ done clean-exec_pamLTLIBRARIES: -test -z "$(exec_pam_LTLIBRARIES)" || rm -f $(exec_pam_LTLIBRARIES) @list='$(exec_pam_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cgroups/$(am__dirstamp): @$(MKDIR_P) cgroups @: > cgroups/$(am__dirstamp) cgroups/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) cgroups/$(DEPDIR) @: > cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/liblxc_la-cgfsng.lo: cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/liblxc_la-cgroup.lo: cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/liblxc_la-cgroup2_devices.lo: cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/liblxc_la-cgroup_utils.lo: cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) ../include/$(am__dirstamp): @$(MKDIR_P) ../include @: > ../include/$(am__dirstamp) ../include/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../include/$(DEPDIR) @: > ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-netns_ifaddrs.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) storage/$(am__dirstamp): @$(MKDIR_P) storage @: > storage/$(am__dirstamp) storage/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) storage/$(DEPDIR) @: > storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-btrfs.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-dir.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-loop.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-lvm.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-nbd.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-overlay.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-rbd.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-rsync.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-storage.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-storage_utils.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/liblxc_la-zfs.lo: storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) lsm/$(am__dirstamp): @$(MKDIR_P) lsm @: > lsm/$(am__dirstamp) lsm/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) lsm/$(DEPDIR) @: > lsm/$(DEPDIR)/$(am__dirstamp) lsm/liblxc_la-lsm.lo: lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) lsm/liblxc_la-nop.lo: lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) lsm/liblxc_la-apparmor.lo: lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) lsm/liblxc_la-selinux.lo: lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-fexecve.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-lxcmntent.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-openpty.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-getgrgid_r.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-getline.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-prlimit.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-strlcpy.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-strlcat.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/liblxc_la-strchrnul.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) liblxc.la: $(liblxc_la_OBJECTS) $(liblxc_la_DEPENDENCIES) $(EXTRA_liblxc_la_DEPENDENCIES) $(AM_V_CCLD)$(liblxc_la_LINK) -rpath $(libdir) $(liblxc_la_OBJECTS) $(liblxc_la_LIBADD) $(LIBS) pam/$(am__dirstamp): @$(MKDIR_P) pam @: > pam/$(am__dirstamp) pam/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) pam/$(DEPDIR) @: > pam/$(DEPDIR)/$(am__dirstamp) pam/cgfs_la-pam_cgfs.lo: pam/$(am__dirstamp) \ pam/$(DEPDIR)/$(am__dirstamp) ../include/pam_cgfs_la-strlcat.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/pam_cgfs_la-strlcpy.lo: ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) pam_cgfs.la: $(pam_cgfs_la_OBJECTS) $(pam_cgfs_la_DEPENDENCIES) $(EXTRA_pam_cgfs_la_DEPENDENCIES) $(AM_V_CCLD)$(pam_cgfs_la_LINK) $(am_pam_cgfs_la_rpath) $(pam_cgfs_la_OBJECTS) $(pam_cgfs_la_LIBADD) $(LIBS) cmd/$(am__dirstamp): @$(MKDIR_P) cmd @: > cmd/$(am__dirstamp) cmd/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) cmd/$(DEPDIR) @: > cmd/$(DEPDIR)/$(am__dirstamp) cmd/lxc_init.$(OBJEXT): cmd/$(am__dirstamp) \ cmd/$(DEPDIR)/$(am__dirstamp) ../include/strlcpy.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/strlcat.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) init.lxc$(EXEEXT): $(init_lxc_OBJECTS) $(init_lxc_DEPENDENCIES) $(EXTRA_init_lxc_DEPENDENCIES) @rm -f init.lxc$(EXEEXT) $(AM_V_CCLD)$(init_lxc_LINK) $(init_lxc_OBJECTS) $(init_lxc_LDADD) $(LIBS) cmd/init_lxc_static-lxc_init.$(OBJEXT): cmd/$(am__dirstamp) \ cmd/$(DEPDIR)/$(am__dirstamp) ../include/init_lxc_static-getline.$(OBJEXT): \ ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/init_lxc_static-strlcpy.$(OBJEXT): \ ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/init_lxc_static-strlcat.$(OBJEXT): \ ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) init.lxc.static$(EXEEXT): $(init_lxc_static_OBJECTS) $(init_lxc_static_DEPENDENCIES) $(EXTRA_init_lxc_static_DEPENDENCIES) @rm -f init.lxc.static$(EXEEXT) $(AM_V_CCLD)$(init_lxc_static_LINK) $(init_lxc_static_OBJECTS) $(init_lxc_static_LDADD) $(LIBS) tools/$(am__dirstamp): @$(MKDIR_P) tools @: > tools/$(am__dirstamp) tools/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/$(DEPDIR) @: > tools/$(DEPDIR)/$(am__dirstamp) tools/lxc_attach.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) tools/arguments.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) cgroups/cgfsng.$(OBJEXT): cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/cgroup.$(OBJEXT): cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/cgroup2_devices.$(OBJEXT): cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) cgroups/cgroup_utils.$(OBJEXT): cgroups/$(am__dirstamp) \ cgroups/$(DEPDIR)/$(am__dirstamp) ../include/netns_ifaddrs.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) storage/btrfs.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/dir.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/loop.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/lvm.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/nbd.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/overlay.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/rbd.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/rsync.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/storage.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/storage_utils.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) storage/zfs.$(OBJEXT): storage/$(am__dirstamp) \ storage/$(DEPDIR)/$(am__dirstamp) lsm/lsm.$(OBJEXT): lsm/$(am__dirstamp) lsm/$(DEPDIR)/$(am__dirstamp) lsm/nop.$(OBJEXT): lsm/$(am__dirstamp) lsm/$(DEPDIR)/$(am__dirstamp) lsm/apparmor.$(OBJEXT): lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) lsm/selinux.$(OBJEXT): lsm/$(am__dirstamp) \ lsm/$(DEPDIR)/$(am__dirstamp) ../include/fexecve.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/lxcmntent.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/openpty.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/getgrgid_r.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/getline.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/prlimit.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) ../include/strchrnul.$(OBJEXT): ../include/$(am__dirstamp) \ ../include/$(DEPDIR)/$(am__dirstamp) lxc-attach$(EXEEXT): $(lxc_attach_OBJECTS) $(lxc_attach_DEPENDENCIES) $(EXTRA_lxc_attach_DEPENDENCIES) @rm -f lxc-attach$(EXEEXT) $(AM_V_CCLD)$(lxc_attach_LINK) $(lxc_attach_OBJECTS) $(lxc_attach_LDADD) $(LIBS) tools/lxc_autostart.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-autostart$(EXEEXT): $(lxc_autostart_OBJECTS) $(lxc_autostart_DEPENDENCIES) $(EXTRA_lxc_autostart_DEPENDENCIES) @rm -f lxc-autostart$(EXEEXT) $(AM_V_CCLD)$(lxc_autostart_LINK) $(lxc_autostart_OBJECTS) $(lxc_autostart_LDADD) $(LIBS) tools/lxc_cgroup.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-cgroup$(EXEEXT): $(lxc_cgroup_OBJECTS) $(lxc_cgroup_DEPENDENCIES) $(EXTRA_lxc_cgroup_DEPENDENCIES) @rm -f lxc-cgroup$(EXEEXT) $(AM_V_CCLD)$(lxc_cgroup_LINK) $(lxc_cgroup_OBJECTS) $(lxc_cgroup_LDADD) $(LIBS) tools/lxc_checkpoint.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-checkpoint$(EXEEXT): $(lxc_checkpoint_OBJECTS) $(lxc_checkpoint_DEPENDENCIES) $(EXTRA_lxc_checkpoint_DEPENDENCIES) @rm -f lxc-checkpoint$(EXEEXT) $(AM_V_CCLD)$(lxc_checkpoint_LINK) $(lxc_checkpoint_OBJECTS) $(lxc_checkpoint_LDADD) $(LIBS) tools/lxc_config.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-config$(EXEEXT): $(lxc_config_OBJECTS) $(lxc_config_DEPENDENCIES) $(EXTRA_lxc_config_DEPENDENCIES) @rm -f lxc-config$(EXEEXT) $(AM_V_CCLD)$(lxc_config_LINK) $(lxc_config_OBJECTS) $(lxc_config_LDADD) $(LIBS) tools/lxc_console.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-console$(EXEEXT): $(lxc_console_OBJECTS) $(lxc_console_DEPENDENCIES) $(EXTRA_lxc_console_DEPENDENCIES) @rm -f lxc-console$(EXEEXT) $(AM_V_CCLD)$(lxc_console_LINK) $(lxc_console_OBJECTS) $(lxc_console_LDADD) $(LIBS) tools/lxc_copy.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) tools/include/$(am__dirstamp): @$(MKDIR_P) tools/include @: > tools/include/$(am__dirstamp) tools/include/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/include/$(DEPDIR) @: > tools/include/$(DEPDIR)/$(am__dirstamp) tools/include/getsubopt.$(OBJEXT): tools/include/$(am__dirstamp) \ tools/include/$(DEPDIR)/$(am__dirstamp) lxc-copy$(EXEEXT): $(lxc_copy_OBJECTS) $(lxc_copy_DEPENDENCIES) $(EXTRA_lxc_copy_DEPENDENCIES) @rm -f lxc-copy$(EXEEXT) $(AM_V_CCLD)$(lxc_copy_LINK) $(lxc_copy_OBJECTS) $(lxc_copy_LDADD) $(LIBS) tools/lxc_create.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-create$(EXEEXT): $(lxc_create_OBJECTS) $(lxc_create_DEPENDENCIES) $(EXTRA_lxc_create_DEPENDENCIES) @rm -f lxc-create$(EXEEXT) $(AM_V_CCLD)$(lxc_create_LINK) $(lxc_create_OBJECTS) $(lxc_create_LDADD) $(LIBS) tools/lxc_destroy.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-destroy$(EXEEXT): $(lxc_destroy_OBJECTS) $(lxc_destroy_DEPENDENCIES) $(EXTRA_lxc_destroy_DEPENDENCIES) @rm -f lxc-destroy$(EXEEXT) $(AM_V_CCLD)$(lxc_destroy_LINK) $(lxc_destroy_OBJECTS) $(lxc_destroy_LDADD) $(LIBS) tools/lxc_device.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-device$(EXEEXT): $(lxc_device_OBJECTS) $(lxc_device_DEPENDENCIES) $(EXTRA_lxc_device_DEPENDENCIES) @rm -f lxc-device$(EXEEXT) $(AM_V_CCLD)$(lxc_device_LINK) $(lxc_device_OBJECTS) $(lxc_device_LDADD) $(LIBS) tools/lxc_execute.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-execute$(EXEEXT): $(lxc_execute_OBJECTS) $(lxc_execute_DEPENDENCIES) $(EXTRA_lxc_execute_DEPENDENCIES) @rm -f lxc-execute$(EXEEXT) $(AM_V_CCLD)$(lxc_execute_LINK) $(lxc_execute_OBJECTS) $(lxc_execute_LDADD) $(LIBS) tools/lxc_freeze.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-freeze$(EXEEXT): $(lxc_freeze_OBJECTS) $(lxc_freeze_DEPENDENCIES) $(EXTRA_lxc_freeze_DEPENDENCIES) @rm -f lxc-freeze$(EXEEXT) $(AM_V_CCLD)$(lxc_freeze_LINK) $(lxc_freeze_OBJECTS) $(lxc_freeze_LDADD) $(LIBS) tools/lxc_info.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-info$(EXEEXT): $(lxc_info_OBJECTS) $(lxc_info_DEPENDENCIES) $(EXTRA_lxc_info_DEPENDENCIES) @rm -f lxc-info$(EXEEXT) $(AM_V_CCLD)$(lxc_info_LINK) $(lxc_info_OBJECTS) $(lxc_info_LDADD) $(LIBS) tools/lxc_ls.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-ls$(EXEEXT): $(lxc_ls_OBJECTS) $(lxc_ls_DEPENDENCIES) $(EXTRA_lxc_ls_DEPENDENCIES) @rm -f lxc-ls$(EXEEXT) $(AM_V_CCLD)$(lxc_ls_LINK) $(lxc_ls_OBJECTS) $(lxc_ls_LDADD) $(LIBS) tools/lxc_monitor.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-monitor$(EXEEXT): $(lxc_monitor_OBJECTS) $(lxc_monitor_DEPENDENCIES) $(EXTRA_lxc_monitor_DEPENDENCIES) @rm -f lxc-monitor$(EXEEXT) $(AM_V_CCLD)$(lxc_monitor_LINK) $(lxc_monitor_OBJECTS) $(lxc_monitor_LDADD) $(LIBS) cmd/lxc_monitord.$(OBJEXT): cmd/$(am__dirstamp) \ cmd/$(DEPDIR)/$(am__dirstamp) lxc-monitord$(EXEEXT): $(lxc_monitord_OBJECTS) $(lxc_monitord_DEPENDENCIES) $(EXTRA_lxc_monitord_DEPENDENCIES) @rm -f lxc-monitord$(EXEEXT) $(AM_V_CCLD)$(lxc_monitord_LINK) $(lxc_monitord_OBJECTS) $(lxc_monitord_LDADD) $(LIBS) tools/lxc_snapshot.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-snapshot$(EXEEXT): $(lxc_snapshot_OBJECTS) $(lxc_snapshot_DEPENDENCIES) $(EXTRA_lxc_snapshot_DEPENDENCIES) @rm -f lxc-snapshot$(EXEEXT) $(AM_V_CCLD)$(lxc_snapshot_LINK) $(lxc_snapshot_OBJECTS) $(lxc_snapshot_LDADD) $(LIBS) tools/lxc_start.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-start$(EXEEXT): $(lxc_start_OBJECTS) $(lxc_start_DEPENDENCIES) $(EXTRA_lxc_start_DEPENDENCIES) @rm -f lxc-start$(EXEEXT) $(AM_V_CCLD)$(lxc_start_LINK) $(lxc_start_OBJECTS) $(lxc_start_LDADD) $(LIBS) tools/lxc_stop.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-stop$(EXEEXT): $(lxc_stop_OBJECTS) $(lxc_stop_DEPENDENCIES) $(EXTRA_lxc_stop_DEPENDENCIES) @rm -f lxc-stop$(EXEEXT) $(AM_V_CCLD)$(lxc_stop_LINK) $(lxc_stop_OBJECTS) $(lxc_stop_LDADD) $(LIBS) tools/lxc_top.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-top$(EXEEXT): $(lxc_top_OBJECTS) $(lxc_top_DEPENDENCIES) $(EXTRA_lxc_top_DEPENDENCIES) @rm -f lxc-top$(EXEEXT) $(AM_V_CCLD)$(lxc_top_LINK) $(lxc_top_OBJECTS) $(lxc_top_LDADD) $(LIBS) tools/lxc_unfreeze.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-unfreeze$(EXEEXT): $(lxc_unfreeze_OBJECTS) $(lxc_unfreeze_DEPENDENCIES) $(EXTRA_lxc_unfreeze_DEPENDENCIES) @rm -f lxc-unfreeze$(EXEEXT) $(AM_V_CCLD)$(lxc_unfreeze_LINK) $(lxc_unfreeze_OBJECTS) $(lxc_unfreeze_LDADD) $(LIBS) tools/lxc_unshare.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-unshare$(EXEEXT): $(lxc_unshare_OBJECTS) $(lxc_unshare_DEPENDENCIES) $(EXTRA_lxc_unshare_DEPENDENCIES) @rm -f lxc-unshare$(EXEEXT) $(AM_V_CCLD)$(lxc_unshare_LINK) $(lxc_unshare_OBJECTS) $(lxc_unshare_LDADD) $(LIBS) cmd/lxc_user_nic.$(OBJEXT): cmd/$(am__dirstamp) \ cmd/$(DEPDIR)/$(am__dirstamp) lxc-user-nic$(EXEEXT): $(lxc_user_nic_OBJECTS) $(lxc_user_nic_DEPENDENCIES) $(EXTRA_lxc_user_nic_DEPENDENCIES) @rm -f lxc-user-nic$(EXEEXT) $(AM_V_CCLD)$(lxc_user_nic_LINK) $(lxc_user_nic_OBJECTS) $(lxc_user_nic_LDADD) $(LIBS) cmd/lxc_usernsexec.$(OBJEXT): cmd/$(am__dirstamp) \ cmd/$(DEPDIR)/$(am__dirstamp) lxc-usernsexec$(EXEEXT): $(lxc_usernsexec_OBJECTS) $(lxc_usernsexec_DEPENDENCIES) $(EXTRA_lxc_usernsexec_DEPENDENCIES) @rm -f lxc-usernsexec$(EXEEXT) $(AM_V_CCLD)$(lxc_usernsexec_LINK) $(lxc_usernsexec_OBJECTS) $(lxc_usernsexec_LDADD) $(LIBS) tools/lxc_wait.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) lxc-wait$(EXEEXT): $(lxc_wait_OBJECTS) $(lxc_wait_DEPENDENCIES) $(EXTRA_lxc_wait_DEPENDENCIES) @rm -f lxc-wait$(EXEEXT) $(AM_V_CCLD)$(lxc_wait_LINK) $(lxc_wait_OBJECTS) $(lxc_wait_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../include/*.$(OBJEXT) -rm -f ../include/*.lo -rm -f cgroups/*.$(OBJEXT) -rm -f cgroups/*.lo -rm -f cmd/*.$(OBJEXT) -rm -f lsm/*.$(OBJEXT) -rm -f lsm/*.lo -rm -f pam/*.$(OBJEXT) -rm -f pam/*.lo -rm -f storage/*.$(OBJEXT) -rm -f storage/*.lo -rm -f tools/*.$(OBJEXT) -rm -f tools/include/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/fexecve.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/getgrgid_r.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/getline.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/init_lxc_static-getline.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/init_lxc_static-strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/init_lxc_static-strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-fexecve.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-getgrgid_r.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-getline.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-lxcmntent.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-openpty.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-prlimit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-strchrnul.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-strlcat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/liblxc_la-strlcpy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/lxcmntent.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/netns_ifaddrs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/openpty.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/pam_cgfs_la-strlcat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/prlimit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strchrnul.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strlcat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@../include/$(DEPDIR)/strlcpy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/af_unix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commands.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commands_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confile.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confile_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/criu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freezer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-af_unix.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-caps.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-file_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-initutils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-namespace.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_lxc_static-string_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initutils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-af_unix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-attach.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-caps.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-commands.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-commands_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-conf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-confile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-confile_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-criu.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-execute.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-file_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-freezer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-initutils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-log.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-lxccontainer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-lxclock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-mainloop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-monitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-mount_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-namespace.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-network.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-nl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-parse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-process_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-rexec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-ringbuf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-rtnl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-seccomp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-start.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-state.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-string_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-sync.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-terminal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblxc_la-uuid.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxccontainer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lxclock.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mainloop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namespace.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_cgfs_la-file_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_cgfs_la-string_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rexec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ringbuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtnl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/start.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/terminal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/cgfsng.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/cgroup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/cgroup2_devices.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/cgroup_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/liblxc_la-cgfsng.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/liblxc_la-cgroup.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cmd/$(DEPDIR)/lxc_init.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cmd/$(DEPDIR)/lxc_monitord.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cmd/$(DEPDIR)/lxc_user_nic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cmd/$(DEPDIR)/lxc_usernsexec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/apparmor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/liblxc_la-apparmor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/liblxc_la-lsm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/liblxc_la-nop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/liblxc_la-selinux.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/lsm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/nop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lsm/$(DEPDIR)/selinux.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@pam/$(DEPDIR)/cgfs_la-pam_cgfs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/btrfs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/dir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-btrfs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-dir.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-loop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-lvm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-nbd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-overlay.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-rbd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-rsync.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-storage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-storage_utils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/liblxc_la-zfs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/lvm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/nbd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/overlay.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/rbd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/rsync.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/storage.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/storage_utils.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@storage/$(DEPDIR)/zfs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/arguments.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_attach.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_autostart.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_cgroup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_checkpoint.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_config.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_console.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_copy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_create.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_destroy.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_device.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_execute.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_freeze.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_info.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_ls.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_monitor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_snapshot.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_start.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_stop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_top.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_unfreeze.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_unshare.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/lxc_wait.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@tools/include/$(DEPDIR)/getsubopt.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< liblxc_la-af_unix.lo: af_unix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-af_unix.lo -MD -MP -MF $(DEPDIR)/liblxc_la-af_unix.Tpo -c -o liblxc_la-af_unix.lo `test -f 'af_unix.c' || echo '$(srcdir)/'`af_unix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-af_unix.Tpo $(DEPDIR)/liblxc_la-af_unix.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='af_unix.c' object='liblxc_la-af_unix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-af_unix.lo `test -f 'af_unix.c' || echo '$(srcdir)/'`af_unix.c liblxc_la-attach.lo: attach.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-attach.lo -MD -MP -MF $(DEPDIR)/liblxc_la-attach.Tpo -c -o liblxc_la-attach.lo `test -f 'attach.c' || echo '$(srcdir)/'`attach.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-attach.Tpo $(DEPDIR)/liblxc_la-attach.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='attach.c' object='liblxc_la-attach.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-attach.lo `test -f 'attach.c' || echo '$(srcdir)/'`attach.c liblxc_la-caps.lo: caps.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-caps.lo -MD -MP -MF $(DEPDIR)/liblxc_la-caps.Tpo -c -o liblxc_la-caps.lo `test -f 'caps.c' || echo '$(srcdir)/'`caps.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-caps.Tpo $(DEPDIR)/liblxc_la-caps.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='caps.c' object='liblxc_la-caps.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-caps.lo `test -f 'caps.c' || echo '$(srcdir)/'`caps.c cgroups/liblxc_la-cgfsng.lo: cgroups/cgfsng.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT cgroups/liblxc_la-cgfsng.lo -MD -MP -MF cgroups/$(DEPDIR)/liblxc_la-cgfsng.Tpo -c -o cgroups/liblxc_la-cgfsng.lo `test -f 'cgroups/cgfsng.c' || echo '$(srcdir)/'`cgroups/cgfsng.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cgroups/$(DEPDIR)/liblxc_la-cgfsng.Tpo cgroups/$(DEPDIR)/liblxc_la-cgfsng.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroups/cgfsng.c' object='cgroups/liblxc_la-cgfsng.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o cgroups/liblxc_la-cgfsng.lo `test -f 'cgroups/cgfsng.c' || echo '$(srcdir)/'`cgroups/cgfsng.c cgroups/liblxc_la-cgroup.lo: cgroups/cgroup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT cgroups/liblxc_la-cgroup.lo -MD -MP -MF cgroups/$(DEPDIR)/liblxc_la-cgroup.Tpo -c -o cgroups/liblxc_la-cgroup.lo `test -f 'cgroups/cgroup.c' || echo '$(srcdir)/'`cgroups/cgroup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cgroups/$(DEPDIR)/liblxc_la-cgroup.Tpo cgroups/$(DEPDIR)/liblxc_la-cgroup.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroups/cgroup.c' object='cgroups/liblxc_la-cgroup.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o cgroups/liblxc_la-cgroup.lo `test -f 'cgroups/cgroup.c' || echo '$(srcdir)/'`cgroups/cgroup.c cgroups/liblxc_la-cgroup2_devices.lo: cgroups/cgroup2_devices.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT cgroups/liblxc_la-cgroup2_devices.lo -MD -MP -MF cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Tpo -c -o cgroups/liblxc_la-cgroup2_devices.lo `test -f 'cgroups/cgroup2_devices.c' || echo '$(srcdir)/'`cgroups/cgroup2_devices.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Tpo cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroups/cgroup2_devices.c' object='cgroups/liblxc_la-cgroup2_devices.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o cgroups/liblxc_la-cgroup2_devices.lo `test -f 'cgroups/cgroup2_devices.c' || echo '$(srcdir)/'`cgroups/cgroup2_devices.c cgroups/liblxc_la-cgroup_utils.lo: cgroups/cgroup_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT cgroups/liblxc_la-cgroup_utils.lo -MD -MP -MF cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Tpo -c -o cgroups/liblxc_la-cgroup_utils.lo `test -f 'cgroups/cgroup_utils.c' || echo '$(srcdir)/'`cgroups/cgroup_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Tpo cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cgroups/cgroup_utils.c' object='cgroups/liblxc_la-cgroup_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o cgroups/liblxc_la-cgroup_utils.lo `test -f 'cgroups/cgroup_utils.c' || echo '$(srcdir)/'`cgroups/cgroup_utils.c liblxc_la-commands.lo: commands.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-commands.lo -MD -MP -MF $(DEPDIR)/liblxc_la-commands.Tpo -c -o liblxc_la-commands.lo `test -f 'commands.c' || echo '$(srcdir)/'`commands.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-commands.Tpo $(DEPDIR)/liblxc_la-commands.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='commands.c' object='liblxc_la-commands.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-commands.lo `test -f 'commands.c' || echo '$(srcdir)/'`commands.c liblxc_la-commands_utils.lo: commands_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-commands_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-commands_utils.Tpo -c -o liblxc_la-commands_utils.lo `test -f 'commands_utils.c' || echo '$(srcdir)/'`commands_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-commands_utils.Tpo $(DEPDIR)/liblxc_la-commands_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='commands_utils.c' object='liblxc_la-commands_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-commands_utils.lo `test -f 'commands_utils.c' || echo '$(srcdir)/'`commands_utils.c liblxc_la-conf.lo: conf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-conf.lo -MD -MP -MF $(DEPDIR)/liblxc_la-conf.Tpo -c -o liblxc_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-conf.Tpo $(DEPDIR)/liblxc_la-conf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conf.c' object='liblxc_la-conf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-conf.lo `test -f 'conf.c' || echo '$(srcdir)/'`conf.c liblxc_la-confile.lo: confile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-confile.lo -MD -MP -MF $(DEPDIR)/liblxc_la-confile.Tpo -c -o liblxc_la-confile.lo `test -f 'confile.c' || echo '$(srcdir)/'`confile.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-confile.Tpo $(DEPDIR)/liblxc_la-confile.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='confile.c' object='liblxc_la-confile.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-confile.lo `test -f 'confile.c' || echo '$(srcdir)/'`confile.c liblxc_la-confile_utils.lo: confile_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-confile_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-confile_utils.Tpo -c -o liblxc_la-confile_utils.lo `test -f 'confile_utils.c' || echo '$(srcdir)/'`confile_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-confile_utils.Tpo $(DEPDIR)/liblxc_la-confile_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='confile_utils.c' object='liblxc_la-confile_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-confile_utils.lo `test -f 'confile_utils.c' || echo '$(srcdir)/'`confile_utils.c liblxc_la-criu.lo: criu.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-criu.lo -MD -MP -MF $(DEPDIR)/liblxc_la-criu.Tpo -c -o liblxc_la-criu.lo `test -f 'criu.c' || echo '$(srcdir)/'`criu.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-criu.Tpo $(DEPDIR)/liblxc_la-criu.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='criu.c' object='liblxc_la-criu.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-criu.lo `test -f 'criu.c' || echo '$(srcdir)/'`criu.c liblxc_la-error.lo: error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-error.lo -MD -MP -MF $(DEPDIR)/liblxc_la-error.Tpo -c -o liblxc_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-error.Tpo $(DEPDIR)/liblxc_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='liblxc_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-error.lo `test -f 'error.c' || echo '$(srcdir)/'`error.c liblxc_la-execute.lo: execute.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-execute.lo -MD -MP -MF $(DEPDIR)/liblxc_la-execute.Tpo -c -o liblxc_la-execute.lo `test -f 'execute.c' || echo '$(srcdir)/'`execute.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-execute.Tpo $(DEPDIR)/liblxc_la-execute.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='execute.c' object='liblxc_la-execute.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-execute.lo `test -f 'execute.c' || echo '$(srcdir)/'`execute.c liblxc_la-freezer.lo: freezer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-freezer.lo -MD -MP -MF $(DEPDIR)/liblxc_la-freezer.Tpo -c -o liblxc_la-freezer.lo `test -f 'freezer.c' || echo '$(srcdir)/'`freezer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-freezer.Tpo $(DEPDIR)/liblxc_la-freezer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freezer.c' object='liblxc_la-freezer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-freezer.lo `test -f 'freezer.c' || echo '$(srcdir)/'`freezer.c liblxc_la-file_utils.lo: file_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-file_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-file_utils.Tpo -c -o liblxc_la-file_utils.lo `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-file_utils.Tpo $(DEPDIR)/liblxc_la-file_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_utils.c' object='liblxc_la-file_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-file_utils.lo `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c ../include/liblxc_la-netns_ifaddrs.lo: ../include/netns_ifaddrs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-netns_ifaddrs.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Tpo -c -o ../include/liblxc_la-netns_ifaddrs.lo `test -f '../include/netns_ifaddrs.c' || echo '$(srcdir)/'`../include/netns_ifaddrs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Tpo ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/netns_ifaddrs.c' object='../include/liblxc_la-netns_ifaddrs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-netns_ifaddrs.lo `test -f '../include/netns_ifaddrs.c' || echo '$(srcdir)/'`../include/netns_ifaddrs.c liblxc_la-initutils.lo: initutils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-initutils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-initutils.Tpo -c -o liblxc_la-initutils.lo `test -f 'initutils.c' || echo '$(srcdir)/'`initutils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-initutils.Tpo $(DEPDIR)/liblxc_la-initutils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initutils.c' object='liblxc_la-initutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-initutils.lo `test -f 'initutils.c' || echo '$(srcdir)/'`initutils.c liblxc_la-log.lo: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-log.lo -MD -MP -MF $(DEPDIR)/liblxc_la-log.Tpo -c -o liblxc_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-log.Tpo $(DEPDIR)/liblxc_la-log.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='liblxc_la-log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c liblxc_la-lxccontainer.lo: lxccontainer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-lxccontainer.lo -MD -MP -MF $(DEPDIR)/liblxc_la-lxccontainer.Tpo -c -o liblxc_la-lxccontainer.lo `test -f 'lxccontainer.c' || echo '$(srcdir)/'`lxccontainer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-lxccontainer.Tpo $(DEPDIR)/liblxc_la-lxccontainer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lxccontainer.c' object='liblxc_la-lxccontainer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-lxccontainer.lo `test -f 'lxccontainer.c' || echo '$(srcdir)/'`lxccontainer.c liblxc_la-lxclock.lo: lxclock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-lxclock.lo -MD -MP -MF $(DEPDIR)/liblxc_la-lxclock.Tpo -c -o liblxc_la-lxclock.lo `test -f 'lxclock.c' || echo '$(srcdir)/'`lxclock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-lxclock.Tpo $(DEPDIR)/liblxc_la-lxclock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lxclock.c' object='liblxc_la-lxclock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-lxclock.lo `test -f 'lxclock.c' || echo '$(srcdir)/'`lxclock.c liblxc_la-mainloop.lo: mainloop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-mainloop.lo -MD -MP -MF $(DEPDIR)/liblxc_la-mainloop.Tpo -c -o liblxc_la-mainloop.lo `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-mainloop.Tpo $(DEPDIR)/liblxc_la-mainloop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mainloop.c' object='liblxc_la-mainloop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-mainloop.lo `test -f 'mainloop.c' || echo '$(srcdir)/'`mainloop.c liblxc_la-mount_utils.lo: mount_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-mount_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-mount_utils.Tpo -c -o liblxc_la-mount_utils.lo `test -f 'mount_utils.c' || echo '$(srcdir)/'`mount_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-mount_utils.Tpo $(DEPDIR)/liblxc_la-mount_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mount_utils.c' object='liblxc_la-mount_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-mount_utils.lo `test -f 'mount_utils.c' || echo '$(srcdir)/'`mount_utils.c liblxc_la-namespace.lo: namespace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-namespace.lo -MD -MP -MF $(DEPDIR)/liblxc_la-namespace.Tpo -c -o liblxc_la-namespace.lo `test -f 'namespace.c' || echo '$(srcdir)/'`namespace.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-namespace.Tpo $(DEPDIR)/liblxc_la-namespace.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='namespace.c' object='liblxc_la-namespace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-namespace.lo `test -f 'namespace.c' || echo '$(srcdir)/'`namespace.c liblxc_la-network.lo: network.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-network.lo -MD -MP -MF $(DEPDIR)/liblxc_la-network.Tpo -c -o liblxc_la-network.lo `test -f 'network.c' || echo '$(srcdir)/'`network.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-network.Tpo $(DEPDIR)/liblxc_la-network.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='network.c' object='liblxc_la-network.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-network.lo `test -f 'network.c' || echo '$(srcdir)/'`network.c liblxc_la-nl.lo: nl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-nl.lo -MD -MP -MF $(DEPDIR)/liblxc_la-nl.Tpo -c -o liblxc_la-nl.lo `test -f 'nl.c' || echo '$(srcdir)/'`nl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-nl.Tpo $(DEPDIR)/liblxc_la-nl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nl.c' object='liblxc_la-nl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-nl.lo `test -f 'nl.c' || echo '$(srcdir)/'`nl.c liblxc_la-monitor.lo: monitor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-monitor.lo -MD -MP -MF $(DEPDIR)/liblxc_la-monitor.Tpo -c -o liblxc_la-monitor.lo `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-monitor.Tpo $(DEPDIR)/liblxc_la-monitor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='monitor.c' object='liblxc_la-monitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-monitor.lo `test -f 'monitor.c' || echo '$(srcdir)/'`monitor.c liblxc_la-parse.lo: parse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-parse.lo -MD -MP -MF $(DEPDIR)/liblxc_la-parse.Tpo -c -o liblxc_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-parse.Tpo $(DEPDIR)/liblxc_la-parse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='parse.c' object='liblxc_la-parse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-parse.lo `test -f 'parse.c' || echo '$(srcdir)/'`parse.c liblxc_la-process_utils.lo: process_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-process_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-process_utils.Tpo -c -o liblxc_la-process_utils.lo `test -f 'process_utils.c' || echo '$(srcdir)/'`process_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-process_utils.Tpo $(DEPDIR)/liblxc_la-process_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='process_utils.c' object='liblxc_la-process_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-process_utils.lo `test -f 'process_utils.c' || echo '$(srcdir)/'`process_utils.c liblxc_la-ringbuf.lo: ringbuf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-ringbuf.lo -MD -MP -MF $(DEPDIR)/liblxc_la-ringbuf.Tpo -c -o liblxc_la-ringbuf.lo `test -f 'ringbuf.c' || echo '$(srcdir)/'`ringbuf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-ringbuf.Tpo $(DEPDIR)/liblxc_la-ringbuf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ringbuf.c' object='liblxc_la-ringbuf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-ringbuf.lo `test -f 'ringbuf.c' || echo '$(srcdir)/'`ringbuf.c liblxc_la-rtnl.lo: rtnl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-rtnl.lo -MD -MP -MF $(DEPDIR)/liblxc_la-rtnl.Tpo -c -o liblxc_la-rtnl.lo `test -f 'rtnl.c' || echo '$(srcdir)/'`rtnl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-rtnl.Tpo $(DEPDIR)/liblxc_la-rtnl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl.c' object='liblxc_la-rtnl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-rtnl.lo `test -f 'rtnl.c' || echo '$(srcdir)/'`rtnl.c liblxc_la-state.lo: state.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-state.lo -MD -MP -MF $(DEPDIR)/liblxc_la-state.Tpo -c -o liblxc_la-state.lo `test -f 'state.c' || echo '$(srcdir)/'`state.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-state.Tpo $(DEPDIR)/liblxc_la-state.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='state.c' object='liblxc_la-state.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-state.lo `test -f 'state.c' || echo '$(srcdir)/'`state.c liblxc_la-start.lo: start.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-start.lo -MD -MP -MF $(DEPDIR)/liblxc_la-start.Tpo -c -o liblxc_la-start.lo `test -f 'start.c' || echo '$(srcdir)/'`start.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-start.Tpo $(DEPDIR)/liblxc_la-start.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='start.c' object='liblxc_la-start.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-start.lo `test -f 'start.c' || echo '$(srcdir)/'`start.c storage/liblxc_la-btrfs.lo: storage/btrfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-btrfs.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-btrfs.Tpo -c -o storage/liblxc_la-btrfs.lo `test -f 'storage/btrfs.c' || echo '$(srcdir)/'`storage/btrfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-btrfs.Tpo storage/$(DEPDIR)/liblxc_la-btrfs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/btrfs.c' object='storage/liblxc_la-btrfs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-btrfs.lo `test -f 'storage/btrfs.c' || echo '$(srcdir)/'`storage/btrfs.c storage/liblxc_la-dir.lo: storage/dir.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-dir.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-dir.Tpo -c -o storage/liblxc_la-dir.lo `test -f 'storage/dir.c' || echo '$(srcdir)/'`storage/dir.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-dir.Tpo storage/$(DEPDIR)/liblxc_la-dir.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/dir.c' object='storage/liblxc_la-dir.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-dir.lo `test -f 'storage/dir.c' || echo '$(srcdir)/'`storage/dir.c storage/liblxc_la-loop.lo: storage/loop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-loop.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-loop.Tpo -c -o storage/liblxc_la-loop.lo `test -f 'storage/loop.c' || echo '$(srcdir)/'`storage/loop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-loop.Tpo storage/$(DEPDIR)/liblxc_la-loop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/loop.c' object='storage/liblxc_la-loop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-loop.lo `test -f 'storage/loop.c' || echo '$(srcdir)/'`storage/loop.c storage/liblxc_la-lvm.lo: storage/lvm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-lvm.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-lvm.Tpo -c -o storage/liblxc_la-lvm.lo `test -f 'storage/lvm.c' || echo '$(srcdir)/'`storage/lvm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-lvm.Tpo storage/$(DEPDIR)/liblxc_la-lvm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/lvm.c' object='storage/liblxc_la-lvm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-lvm.lo `test -f 'storage/lvm.c' || echo '$(srcdir)/'`storage/lvm.c storage/liblxc_la-nbd.lo: storage/nbd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-nbd.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-nbd.Tpo -c -o storage/liblxc_la-nbd.lo `test -f 'storage/nbd.c' || echo '$(srcdir)/'`storage/nbd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-nbd.Tpo storage/$(DEPDIR)/liblxc_la-nbd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/nbd.c' object='storage/liblxc_la-nbd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-nbd.lo `test -f 'storage/nbd.c' || echo '$(srcdir)/'`storage/nbd.c storage/liblxc_la-overlay.lo: storage/overlay.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-overlay.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-overlay.Tpo -c -o storage/liblxc_la-overlay.lo `test -f 'storage/overlay.c' || echo '$(srcdir)/'`storage/overlay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-overlay.Tpo storage/$(DEPDIR)/liblxc_la-overlay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/overlay.c' object='storage/liblxc_la-overlay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-overlay.lo `test -f 'storage/overlay.c' || echo '$(srcdir)/'`storage/overlay.c storage/liblxc_la-rbd.lo: storage/rbd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-rbd.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-rbd.Tpo -c -o storage/liblxc_la-rbd.lo `test -f 'storage/rbd.c' || echo '$(srcdir)/'`storage/rbd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-rbd.Tpo storage/$(DEPDIR)/liblxc_la-rbd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/rbd.c' object='storage/liblxc_la-rbd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-rbd.lo `test -f 'storage/rbd.c' || echo '$(srcdir)/'`storage/rbd.c storage/liblxc_la-rsync.lo: storage/rsync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-rsync.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-rsync.Tpo -c -o storage/liblxc_la-rsync.lo `test -f 'storage/rsync.c' || echo '$(srcdir)/'`storage/rsync.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-rsync.Tpo storage/$(DEPDIR)/liblxc_la-rsync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/rsync.c' object='storage/liblxc_la-rsync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-rsync.lo `test -f 'storage/rsync.c' || echo '$(srcdir)/'`storage/rsync.c storage/liblxc_la-storage.lo: storage/storage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-storage.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-storage.Tpo -c -o storage/liblxc_la-storage.lo `test -f 'storage/storage.c' || echo '$(srcdir)/'`storage/storage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-storage.Tpo storage/$(DEPDIR)/liblxc_la-storage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/storage.c' object='storage/liblxc_la-storage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-storage.lo `test -f 'storage/storage.c' || echo '$(srcdir)/'`storage/storage.c storage/liblxc_la-storage_utils.lo: storage/storage_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-storage_utils.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-storage_utils.Tpo -c -o storage/liblxc_la-storage_utils.lo `test -f 'storage/storage_utils.c' || echo '$(srcdir)/'`storage/storage_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-storage_utils.Tpo storage/$(DEPDIR)/liblxc_la-storage_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/storage_utils.c' object='storage/liblxc_la-storage_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-storage_utils.lo `test -f 'storage/storage_utils.c' || echo '$(srcdir)/'`storage/storage_utils.c storage/liblxc_la-zfs.lo: storage/zfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT storage/liblxc_la-zfs.lo -MD -MP -MF storage/$(DEPDIR)/liblxc_la-zfs.Tpo -c -o storage/liblxc_la-zfs.lo `test -f 'storage/zfs.c' || echo '$(srcdir)/'`storage/zfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) storage/$(DEPDIR)/liblxc_la-zfs.Tpo storage/$(DEPDIR)/liblxc_la-zfs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='storage/zfs.c' object='storage/liblxc_la-zfs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o storage/liblxc_la-zfs.lo `test -f 'storage/zfs.c' || echo '$(srcdir)/'`storage/zfs.c liblxc_la-string_utils.lo: string_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-string_utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-string_utils.Tpo -c -o liblxc_la-string_utils.lo `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-string_utils.Tpo $(DEPDIR)/liblxc_la-string_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_utils.c' object='liblxc_la-string_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-string_utils.lo `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c liblxc_la-sync.lo: sync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-sync.lo -MD -MP -MF $(DEPDIR)/liblxc_la-sync.Tpo -c -o liblxc_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-sync.Tpo $(DEPDIR)/liblxc_la-sync.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sync.c' object='liblxc_la-sync.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-sync.lo `test -f 'sync.c' || echo '$(srcdir)/'`sync.c liblxc_la-terminal.lo: terminal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-terminal.lo -MD -MP -MF $(DEPDIR)/liblxc_la-terminal.Tpo -c -o liblxc_la-terminal.lo `test -f 'terminal.c' || echo '$(srcdir)/'`terminal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-terminal.Tpo $(DEPDIR)/liblxc_la-terminal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='terminal.c' object='liblxc_la-terminal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-terminal.lo `test -f 'terminal.c' || echo '$(srcdir)/'`terminal.c liblxc_la-utils.lo: utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-utils.lo -MD -MP -MF $(DEPDIR)/liblxc_la-utils.Tpo -c -o liblxc_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-utils.Tpo $(DEPDIR)/liblxc_la-utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='liblxc_la-utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-utils.lo `test -f 'utils.c' || echo '$(srcdir)/'`utils.c liblxc_la-uuid.lo: uuid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-uuid.lo -MD -MP -MF $(DEPDIR)/liblxc_la-uuid.Tpo -c -o liblxc_la-uuid.lo `test -f 'uuid.c' || echo '$(srcdir)/'`uuid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-uuid.Tpo $(DEPDIR)/liblxc_la-uuid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='uuid.c' object='liblxc_la-uuid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-uuid.lo `test -f 'uuid.c' || echo '$(srcdir)/'`uuid.c lsm/liblxc_la-lsm.lo: lsm/lsm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT lsm/liblxc_la-lsm.lo -MD -MP -MF lsm/$(DEPDIR)/liblxc_la-lsm.Tpo -c -o lsm/liblxc_la-lsm.lo `test -f 'lsm/lsm.c' || echo '$(srcdir)/'`lsm/lsm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lsm/$(DEPDIR)/liblxc_la-lsm.Tpo lsm/$(DEPDIR)/liblxc_la-lsm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lsm/lsm.c' object='lsm/liblxc_la-lsm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o lsm/liblxc_la-lsm.lo `test -f 'lsm/lsm.c' || echo '$(srcdir)/'`lsm/lsm.c lsm/liblxc_la-nop.lo: lsm/nop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT lsm/liblxc_la-nop.lo -MD -MP -MF lsm/$(DEPDIR)/liblxc_la-nop.Tpo -c -o lsm/liblxc_la-nop.lo `test -f 'lsm/nop.c' || echo '$(srcdir)/'`lsm/nop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lsm/$(DEPDIR)/liblxc_la-nop.Tpo lsm/$(DEPDIR)/liblxc_la-nop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lsm/nop.c' object='lsm/liblxc_la-nop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o lsm/liblxc_la-nop.lo `test -f 'lsm/nop.c' || echo '$(srcdir)/'`lsm/nop.c lsm/liblxc_la-apparmor.lo: lsm/apparmor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT lsm/liblxc_la-apparmor.lo -MD -MP -MF lsm/$(DEPDIR)/liblxc_la-apparmor.Tpo -c -o lsm/liblxc_la-apparmor.lo `test -f 'lsm/apparmor.c' || echo '$(srcdir)/'`lsm/apparmor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lsm/$(DEPDIR)/liblxc_la-apparmor.Tpo lsm/$(DEPDIR)/liblxc_la-apparmor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lsm/apparmor.c' object='lsm/liblxc_la-apparmor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o lsm/liblxc_la-apparmor.lo `test -f 'lsm/apparmor.c' || echo '$(srcdir)/'`lsm/apparmor.c lsm/liblxc_la-selinux.lo: lsm/selinux.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT lsm/liblxc_la-selinux.lo -MD -MP -MF lsm/$(DEPDIR)/liblxc_la-selinux.Tpo -c -o lsm/liblxc_la-selinux.lo `test -f 'lsm/selinux.c' || echo '$(srcdir)/'`lsm/selinux.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) lsm/$(DEPDIR)/liblxc_la-selinux.Tpo lsm/$(DEPDIR)/liblxc_la-selinux.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lsm/selinux.c' object='lsm/liblxc_la-selinux.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o lsm/liblxc_la-selinux.lo `test -f 'lsm/selinux.c' || echo '$(srcdir)/'`lsm/selinux.c ../include/liblxc_la-fexecve.lo: ../include/fexecve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-fexecve.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-fexecve.Tpo -c -o ../include/liblxc_la-fexecve.lo `test -f '../include/fexecve.c' || echo '$(srcdir)/'`../include/fexecve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-fexecve.Tpo ../include/$(DEPDIR)/liblxc_la-fexecve.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/fexecve.c' object='../include/liblxc_la-fexecve.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-fexecve.lo `test -f '../include/fexecve.c' || echo '$(srcdir)/'`../include/fexecve.c ../include/liblxc_la-lxcmntent.lo: ../include/lxcmntent.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-lxcmntent.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-lxcmntent.Tpo -c -o ../include/liblxc_la-lxcmntent.lo `test -f '../include/lxcmntent.c' || echo '$(srcdir)/'`../include/lxcmntent.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-lxcmntent.Tpo ../include/$(DEPDIR)/liblxc_la-lxcmntent.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/lxcmntent.c' object='../include/liblxc_la-lxcmntent.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-lxcmntent.lo `test -f '../include/lxcmntent.c' || echo '$(srcdir)/'`../include/lxcmntent.c ../include/liblxc_la-openpty.lo: ../include/openpty.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-openpty.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-openpty.Tpo -c -o ../include/liblxc_la-openpty.lo `test -f '../include/openpty.c' || echo '$(srcdir)/'`../include/openpty.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-openpty.Tpo ../include/$(DEPDIR)/liblxc_la-openpty.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/openpty.c' object='../include/liblxc_la-openpty.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-openpty.lo `test -f '../include/openpty.c' || echo '$(srcdir)/'`../include/openpty.c ../include/liblxc_la-getgrgid_r.lo: ../include/getgrgid_r.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-getgrgid_r.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Tpo -c -o ../include/liblxc_la-getgrgid_r.lo `test -f '../include/getgrgid_r.c' || echo '$(srcdir)/'`../include/getgrgid_r.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Tpo ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/getgrgid_r.c' object='../include/liblxc_la-getgrgid_r.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-getgrgid_r.lo `test -f '../include/getgrgid_r.c' || echo '$(srcdir)/'`../include/getgrgid_r.c ../include/liblxc_la-getline.lo: ../include/getline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-getline.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-getline.Tpo -c -o ../include/liblxc_la-getline.lo `test -f '../include/getline.c' || echo '$(srcdir)/'`../include/getline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-getline.Tpo ../include/$(DEPDIR)/liblxc_la-getline.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/getline.c' object='../include/liblxc_la-getline.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-getline.lo `test -f '../include/getline.c' || echo '$(srcdir)/'`../include/getline.c ../include/liblxc_la-prlimit.lo: ../include/prlimit.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-prlimit.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-prlimit.Tpo -c -o ../include/liblxc_la-prlimit.lo `test -f '../include/prlimit.c' || echo '$(srcdir)/'`../include/prlimit.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-prlimit.Tpo ../include/$(DEPDIR)/liblxc_la-prlimit.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/prlimit.c' object='../include/liblxc_la-prlimit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-prlimit.lo `test -f '../include/prlimit.c' || echo '$(srcdir)/'`../include/prlimit.c liblxc_la-seccomp.lo: seccomp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-seccomp.lo -MD -MP -MF $(DEPDIR)/liblxc_la-seccomp.Tpo -c -o liblxc_la-seccomp.lo `test -f 'seccomp.c' || echo '$(srcdir)/'`seccomp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-seccomp.Tpo $(DEPDIR)/liblxc_la-seccomp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='seccomp.c' object='liblxc_la-seccomp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-seccomp.lo `test -f 'seccomp.c' || echo '$(srcdir)/'`seccomp.c ../include/liblxc_la-strlcpy.lo: ../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-strlcpy.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-strlcpy.Tpo -c -o ../include/liblxc_la-strlcpy.lo `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-strlcpy.Tpo ../include/$(DEPDIR)/liblxc_la-strlcpy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcpy.c' object='../include/liblxc_la-strlcpy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-strlcpy.lo `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c ../include/liblxc_la-strlcat.lo: ../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-strlcat.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-strlcat.Tpo -c -o ../include/liblxc_la-strlcat.lo `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-strlcat.Tpo ../include/$(DEPDIR)/liblxc_la-strlcat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcat.c' object='../include/liblxc_la-strlcat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-strlcat.lo `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c ../include/liblxc_la-strchrnul.lo: ../include/strchrnul.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT ../include/liblxc_la-strchrnul.lo -MD -MP -MF ../include/$(DEPDIR)/liblxc_la-strchrnul.Tpo -c -o ../include/liblxc_la-strchrnul.lo `test -f '../include/strchrnul.c' || echo '$(srcdir)/'`../include/strchrnul.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/liblxc_la-strchrnul.Tpo ../include/$(DEPDIR)/liblxc_la-strchrnul.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strchrnul.c' object='../include/liblxc_la-strchrnul.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o ../include/liblxc_la-strchrnul.lo `test -f '../include/strchrnul.c' || echo '$(srcdir)/'`../include/strchrnul.c liblxc_la-rexec.lo: rexec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -MT liblxc_la-rexec.lo -MD -MP -MF $(DEPDIR)/liblxc_la-rexec.Tpo -c -o liblxc_la-rexec.lo `test -f 'rexec.c' || echo '$(srcdir)/'`rexec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblxc_la-rexec.Tpo $(DEPDIR)/liblxc_la-rexec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rexec.c' object='liblxc_la-rexec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblxc_la_CFLAGS) $(CFLAGS) -c -o liblxc_la-rexec.lo `test -f 'rexec.c' || echo '$(srcdir)/'`rexec.c pam/cgfs_la-pam_cgfs.lo: pam/pam_cgfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -MT pam/cgfs_la-pam_cgfs.lo -MD -MP -MF pam/$(DEPDIR)/cgfs_la-pam_cgfs.Tpo -c -o pam/cgfs_la-pam_cgfs.lo `test -f 'pam/pam_cgfs.c' || echo '$(srcdir)/'`pam/pam_cgfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) pam/$(DEPDIR)/cgfs_la-pam_cgfs.Tpo pam/$(DEPDIR)/cgfs_la-pam_cgfs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pam/pam_cgfs.c' object='pam/cgfs_la-pam_cgfs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -c -o pam/cgfs_la-pam_cgfs.lo `test -f 'pam/pam_cgfs.c' || echo '$(srcdir)/'`pam/pam_cgfs.c pam_cgfs_la-file_utils.lo: file_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -MT pam_cgfs_la-file_utils.lo -MD -MP -MF $(DEPDIR)/pam_cgfs_la-file_utils.Tpo -c -o pam_cgfs_la-file_utils.lo `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pam_cgfs_la-file_utils.Tpo $(DEPDIR)/pam_cgfs_la-file_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_utils.c' object='pam_cgfs_la-file_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -c -o pam_cgfs_la-file_utils.lo `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c pam_cgfs_la-string_utils.lo: string_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -MT pam_cgfs_la-string_utils.lo -MD -MP -MF $(DEPDIR)/pam_cgfs_la-string_utils.Tpo -c -o pam_cgfs_la-string_utils.lo `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/pam_cgfs_la-string_utils.Tpo $(DEPDIR)/pam_cgfs_la-string_utils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_utils.c' object='pam_cgfs_la-string_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -c -o pam_cgfs_la-string_utils.lo `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c ../include/pam_cgfs_la-strlcat.lo: ../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -MT ../include/pam_cgfs_la-strlcat.lo -MD -MP -MF ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Tpo -c -o ../include/pam_cgfs_la-strlcat.lo `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Tpo ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcat.c' object='../include/pam_cgfs_la-strlcat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -c -o ../include/pam_cgfs_la-strlcat.lo `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c ../include/pam_cgfs_la-strlcpy.lo: ../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -MT ../include/pam_cgfs_la-strlcpy.lo -MD -MP -MF ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Tpo -c -o ../include/pam_cgfs_la-strlcpy.lo `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Tpo ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcpy.c' object='../include/pam_cgfs_la-strlcpy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_cgfs_la_CFLAGS) $(CFLAGS) -c -o ../include/pam_cgfs_la-strlcpy.lo `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c cmd/init_lxc_static-lxc_init.o: cmd/lxc_init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT cmd/init_lxc_static-lxc_init.o -MD -MP -MF cmd/$(DEPDIR)/init_lxc_static-lxc_init.Tpo -c -o cmd/init_lxc_static-lxc_init.o `test -f 'cmd/lxc_init.c' || echo '$(srcdir)/'`cmd/lxc_init.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cmd/$(DEPDIR)/init_lxc_static-lxc_init.Tpo cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cmd/lxc_init.c' object='cmd/init_lxc_static-lxc_init.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o cmd/init_lxc_static-lxc_init.o `test -f 'cmd/lxc_init.c' || echo '$(srcdir)/'`cmd/lxc_init.c cmd/init_lxc_static-lxc_init.obj: cmd/lxc_init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT cmd/init_lxc_static-lxc_init.obj -MD -MP -MF cmd/$(DEPDIR)/init_lxc_static-lxc_init.Tpo -c -o cmd/init_lxc_static-lxc_init.obj `if test -f 'cmd/lxc_init.c'; then $(CYGPATH_W) 'cmd/lxc_init.c'; else $(CYGPATH_W) '$(srcdir)/cmd/lxc_init.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cmd/$(DEPDIR)/init_lxc_static-lxc_init.Tpo cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cmd/lxc_init.c' object='cmd/init_lxc_static-lxc_init.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o cmd/init_lxc_static-lxc_init.obj `if test -f 'cmd/lxc_init.c'; then $(CYGPATH_W) 'cmd/lxc_init.c'; else $(CYGPATH_W) '$(srcdir)/cmd/lxc_init.c'; fi` init_lxc_static-af_unix.o: af_unix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-af_unix.o -MD -MP -MF $(DEPDIR)/init_lxc_static-af_unix.Tpo -c -o init_lxc_static-af_unix.o `test -f 'af_unix.c' || echo '$(srcdir)/'`af_unix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-af_unix.Tpo $(DEPDIR)/init_lxc_static-af_unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='af_unix.c' object='init_lxc_static-af_unix.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-af_unix.o `test -f 'af_unix.c' || echo '$(srcdir)/'`af_unix.c init_lxc_static-af_unix.obj: af_unix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-af_unix.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-af_unix.Tpo -c -o init_lxc_static-af_unix.obj `if test -f 'af_unix.c'; then $(CYGPATH_W) 'af_unix.c'; else $(CYGPATH_W) '$(srcdir)/af_unix.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-af_unix.Tpo $(DEPDIR)/init_lxc_static-af_unix.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='af_unix.c' object='init_lxc_static-af_unix.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-af_unix.obj `if test -f 'af_unix.c'; then $(CYGPATH_W) 'af_unix.c'; else $(CYGPATH_W) '$(srcdir)/af_unix.c'; fi` init_lxc_static-caps.o: caps.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-caps.o -MD -MP -MF $(DEPDIR)/init_lxc_static-caps.Tpo -c -o init_lxc_static-caps.o `test -f 'caps.c' || echo '$(srcdir)/'`caps.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-caps.Tpo $(DEPDIR)/init_lxc_static-caps.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='caps.c' object='init_lxc_static-caps.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-caps.o `test -f 'caps.c' || echo '$(srcdir)/'`caps.c init_lxc_static-caps.obj: caps.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-caps.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-caps.Tpo -c -o init_lxc_static-caps.obj `if test -f 'caps.c'; then $(CYGPATH_W) 'caps.c'; else $(CYGPATH_W) '$(srcdir)/caps.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-caps.Tpo $(DEPDIR)/init_lxc_static-caps.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='caps.c' object='init_lxc_static-caps.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-caps.obj `if test -f 'caps.c'; then $(CYGPATH_W) 'caps.c'; else $(CYGPATH_W) '$(srcdir)/caps.c'; fi` init_lxc_static-error.o: error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-error.o -MD -MP -MF $(DEPDIR)/init_lxc_static-error.Tpo -c -o init_lxc_static-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-error.Tpo $(DEPDIR)/init_lxc_static-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='init_lxc_static-error.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-error.o `test -f 'error.c' || echo '$(srcdir)/'`error.c init_lxc_static-error.obj: error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-error.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-error.Tpo -c -o init_lxc_static-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-error.Tpo $(DEPDIR)/init_lxc_static-error.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error.c' object='init_lxc_static-error.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-error.obj `if test -f 'error.c'; then $(CYGPATH_W) 'error.c'; else $(CYGPATH_W) '$(srcdir)/error.c'; fi` init_lxc_static-file_utils.o: file_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-file_utils.o -MD -MP -MF $(DEPDIR)/init_lxc_static-file_utils.Tpo -c -o init_lxc_static-file_utils.o `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-file_utils.Tpo $(DEPDIR)/init_lxc_static-file_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_utils.c' object='init_lxc_static-file_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-file_utils.o `test -f 'file_utils.c' || echo '$(srcdir)/'`file_utils.c init_lxc_static-file_utils.obj: file_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-file_utils.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-file_utils.Tpo -c -o init_lxc_static-file_utils.obj `if test -f 'file_utils.c'; then $(CYGPATH_W) 'file_utils.c'; else $(CYGPATH_W) '$(srcdir)/file_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-file_utils.Tpo $(DEPDIR)/init_lxc_static-file_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_utils.c' object='init_lxc_static-file_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-file_utils.obj `if test -f 'file_utils.c'; then $(CYGPATH_W) 'file_utils.c'; else $(CYGPATH_W) '$(srcdir)/file_utils.c'; fi` init_lxc_static-initutils.o: initutils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-initutils.o -MD -MP -MF $(DEPDIR)/init_lxc_static-initutils.Tpo -c -o init_lxc_static-initutils.o `test -f 'initutils.c' || echo '$(srcdir)/'`initutils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-initutils.Tpo $(DEPDIR)/init_lxc_static-initutils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initutils.c' object='init_lxc_static-initutils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-initutils.o `test -f 'initutils.c' || echo '$(srcdir)/'`initutils.c init_lxc_static-initutils.obj: initutils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-initutils.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-initutils.Tpo -c -o init_lxc_static-initutils.obj `if test -f 'initutils.c'; then $(CYGPATH_W) 'initutils.c'; else $(CYGPATH_W) '$(srcdir)/initutils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-initutils.Tpo $(DEPDIR)/init_lxc_static-initutils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='initutils.c' object='init_lxc_static-initutils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-initutils.obj `if test -f 'initutils.c'; then $(CYGPATH_W) 'initutils.c'; else $(CYGPATH_W) '$(srcdir)/initutils.c'; fi` init_lxc_static-log.o: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-log.o -MD -MP -MF $(DEPDIR)/init_lxc_static-log.Tpo -c -o init_lxc_static-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-log.Tpo $(DEPDIR)/init_lxc_static-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='init_lxc_static-log.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-log.o `test -f 'log.c' || echo '$(srcdir)/'`log.c init_lxc_static-log.obj: log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-log.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-log.Tpo -c -o init_lxc_static-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-log.Tpo $(DEPDIR)/init_lxc_static-log.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='log.c' object='init_lxc_static-log.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-log.obj `if test -f 'log.c'; then $(CYGPATH_W) 'log.c'; else $(CYGPATH_W) '$(srcdir)/log.c'; fi` init_lxc_static-namespace.o: namespace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-namespace.o -MD -MP -MF $(DEPDIR)/init_lxc_static-namespace.Tpo -c -o init_lxc_static-namespace.o `test -f 'namespace.c' || echo '$(srcdir)/'`namespace.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-namespace.Tpo $(DEPDIR)/init_lxc_static-namespace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='namespace.c' object='init_lxc_static-namespace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-namespace.o `test -f 'namespace.c' || echo '$(srcdir)/'`namespace.c init_lxc_static-namespace.obj: namespace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-namespace.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-namespace.Tpo -c -o init_lxc_static-namespace.obj `if test -f 'namespace.c'; then $(CYGPATH_W) 'namespace.c'; else $(CYGPATH_W) '$(srcdir)/namespace.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-namespace.Tpo $(DEPDIR)/init_lxc_static-namespace.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='namespace.c' object='init_lxc_static-namespace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-namespace.obj `if test -f 'namespace.c'; then $(CYGPATH_W) 'namespace.c'; else $(CYGPATH_W) '$(srcdir)/namespace.c'; fi` init_lxc_static-string_utils.o: string_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-string_utils.o -MD -MP -MF $(DEPDIR)/init_lxc_static-string_utils.Tpo -c -o init_lxc_static-string_utils.o `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-string_utils.Tpo $(DEPDIR)/init_lxc_static-string_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_utils.c' object='init_lxc_static-string_utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-string_utils.o `test -f 'string_utils.c' || echo '$(srcdir)/'`string_utils.c init_lxc_static-string_utils.obj: string_utils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT init_lxc_static-string_utils.obj -MD -MP -MF $(DEPDIR)/init_lxc_static-string_utils.Tpo -c -o init_lxc_static-string_utils.obj `if test -f 'string_utils.c'; then $(CYGPATH_W) 'string_utils.c'; else $(CYGPATH_W) '$(srcdir)/string_utils.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/init_lxc_static-string_utils.Tpo $(DEPDIR)/init_lxc_static-string_utils.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_utils.c' object='init_lxc_static-string_utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o init_lxc_static-string_utils.obj `if test -f 'string_utils.c'; then $(CYGPATH_W) 'string_utils.c'; else $(CYGPATH_W) '$(srcdir)/string_utils.c'; fi` ../include/init_lxc_static-getline.o: ../include/getline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-getline.o -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-getline.Tpo -c -o ../include/init_lxc_static-getline.o `test -f '../include/getline.c' || echo '$(srcdir)/'`../include/getline.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-getline.Tpo ../include/$(DEPDIR)/init_lxc_static-getline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/getline.c' object='../include/init_lxc_static-getline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-getline.o `test -f '../include/getline.c' || echo '$(srcdir)/'`../include/getline.c ../include/init_lxc_static-getline.obj: ../include/getline.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-getline.obj -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-getline.Tpo -c -o ../include/init_lxc_static-getline.obj `if test -f '../include/getline.c'; then $(CYGPATH_W) '../include/getline.c'; else $(CYGPATH_W) '$(srcdir)/../include/getline.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-getline.Tpo ../include/$(DEPDIR)/init_lxc_static-getline.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/getline.c' object='../include/init_lxc_static-getline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-getline.obj `if test -f '../include/getline.c'; then $(CYGPATH_W) '../include/getline.c'; else $(CYGPATH_W) '$(srcdir)/../include/getline.c'; fi` ../include/init_lxc_static-strlcpy.o: ../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-strlcpy.o -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-strlcpy.Tpo -c -o ../include/init_lxc_static-strlcpy.o `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-strlcpy.Tpo ../include/$(DEPDIR)/init_lxc_static-strlcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcpy.c' object='../include/init_lxc_static-strlcpy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-strlcpy.o `test -f '../include/strlcpy.c' || echo '$(srcdir)/'`../include/strlcpy.c ../include/init_lxc_static-strlcpy.obj: ../include/strlcpy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-strlcpy.obj -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-strlcpy.Tpo -c -o ../include/init_lxc_static-strlcpy.obj `if test -f '../include/strlcpy.c'; then $(CYGPATH_W) '../include/strlcpy.c'; else $(CYGPATH_W) '$(srcdir)/../include/strlcpy.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-strlcpy.Tpo ../include/$(DEPDIR)/init_lxc_static-strlcpy.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcpy.c' object='../include/init_lxc_static-strlcpy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-strlcpy.obj `if test -f '../include/strlcpy.c'; then $(CYGPATH_W) '../include/strlcpy.c'; else $(CYGPATH_W) '$(srcdir)/../include/strlcpy.c'; fi` ../include/init_lxc_static-strlcat.o: ../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-strlcat.o -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-strlcat.Tpo -c -o ../include/init_lxc_static-strlcat.o `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-strlcat.Tpo ../include/$(DEPDIR)/init_lxc_static-strlcat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcat.c' object='../include/init_lxc_static-strlcat.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-strlcat.o `test -f '../include/strlcat.c' || echo '$(srcdir)/'`../include/strlcat.c ../include/init_lxc_static-strlcat.obj: ../include/strlcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -MT ../include/init_lxc_static-strlcat.obj -MD -MP -MF ../include/$(DEPDIR)/init_lxc_static-strlcat.Tpo -c -o ../include/init_lxc_static-strlcat.obj `if test -f '../include/strlcat.c'; then $(CYGPATH_W) '../include/strlcat.c'; else $(CYGPATH_W) '$(srcdir)/../include/strlcat.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../include/$(DEPDIR)/init_lxc_static-strlcat.Tpo ../include/$(DEPDIR)/init_lxc_static-strlcat.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../include/strlcat.c' object='../include/init_lxc_static-strlcat.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(init_lxc_static_CFLAGS) $(CFLAGS) -c -o ../include/init_lxc_static-strlcat.obj `if test -f '../include/strlcat.c'; then $(CYGPATH_W) '../include/strlcat.c'; else $(CYGPATH_W) '$(srcdir)/../include/strlcat.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf ../include/.libs ../include/_libs -rm -rf cgroups/.libs cgroups/_libs -rm -rf lsm/.libs lsm/_libs -rm -rf pam/.libs pam/_libs -rm -rf storage/.libs storage/_libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES install-pkglibexecPROGRAMS: install-libLTLIBRARIES install-sbinPROGRAMS: install-libLTLIBRARIES install-execpamLTLIBRARIES: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(exec_pamdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../include/$(DEPDIR)/$(am__dirstamp) -rm -f ../include/$(am__dirstamp) -rm -f cgroups/$(DEPDIR)/$(am__dirstamp) -rm -f cgroups/$(am__dirstamp) -rm -f cmd/$(DEPDIR)/$(am__dirstamp) -rm -f cmd/$(am__dirstamp) -rm -f lsm/$(DEPDIR)/$(am__dirstamp) -rm -f lsm/$(am__dirstamp) -rm -f pam/$(DEPDIR)/$(am__dirstamp) -rm -f pam/$(am__dirstamp) -rm -f storage/$(DEPDIR)/$(am__dirstamp) -rm -f storage/$(am__dirstamp) -rm -f tools/$(DEPDIR)/$(am__dirstamp) -rm -f tools/$(am__dirstamp) -rm -f tools/include/$(DEPDIR)/$(am__dirstamp) -rm -f tools/include/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @ENABLE_BASH_FALSE@install-data-local: @ENABLE_COMMANDS_FALSE@install-data-local: clean: clean-am clean-am: clean-binPROGRAMS clean-exec_pamLTLIBRARIES clean-generic \ clean-libLTLIBRARIES clean-libtool clean-pkglibexecPROGRAMS \ clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ../include/$(DEPDIR)/fexecve.Po -rm -f ../include/$(DEPDIR)/getgrgid_r.Po -rm -f ../include/$(DEPDIR)/getline.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-getline.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-strlcat.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-strlcpy.Po -rm -f ../include/$(DEPDIR)/liblxc_la-fexecve.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-getline.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-lxcmntent.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-openpty.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-prlimit.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strchrnul.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strlcat.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strlcpy.Plo -rm -f ../include/$(DEPDIR)/lxcmntent.Po -rm -f ../include/$(DEPDIR)/netns_ifaddrs.Po -rm -f ../include/$(DEPDIR)/openpty.Po -rm -f ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Plo -rm -f ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Plo -rm -f ../include/$(DEPDIR)/prlimit.Po -rm -f ../include/$(DEPDIR)/strchrnul.Po -rm -f ../include/$(DEPDIR)/strlcat.Po -rm -f ../include/$(DEPDIR)/strlcpy.Po -rm -f ./$(DEPDIR)/af_unix.Po -rm -f ./$(DEPDIR)/attach.Po -rm -f ./$(DEPDIR)/caps.Po -rm -f ./$(DEPDIR)/commands.Po -rm -f ./$(DEPDIR)/commands_utils.Po -rm -f ./$(DEPDIR)/conf.Po -rm -f ./$(DEPDIR)/confile.Po -rm -f ./$(DEPDIR)/confile_utils.Po -rm -f ./$(DEPDIR)/criu.Po -rm -f ./$(DEPDIR)/error.Po -rm -f ./$(DEPDIR)/execute.Po -rm -f ./$(DEPDIR)/file_utils.Po -rm -f ./$(DEPDIR)/freezer.Po -rm -f ./$(DEPDIR)/init_lxc_static-af_unix.Po -rm -f ./$(DEPDIR)/init_lxc_static-caps.Po -rm -f ./$(DEPDIR)/init_lxc_static-error.Po -rm -f ./$(DEPDIR)/init_lxc_static-file_utils.Po -rm -f ./$(DEPDIR)/init_lxc_static-initutils.Po -rm -f ./$(DEPDIR)/init_lxc_static-log.Po -rm -f ./$(DEPDIR)/init_lxc_static-namespace.Po -rm -f ./$(DEPDIR)/init_lxc_static-string_utils.Po -rm -f ./$(DEPDIR)/initutils.Po -rm -f ./$(DEPDIR)/liblxc_la-af_unix.Plo -rm -f ./$(DEPDIR)/liblxc_la-attach.Plo -rm -f ./$(DEPDIR)/liblxc_la-caps.Plo -rm -f ./$(DEPDIR)/liblxc_la-commands.Plo -rm -f ./$(DEPDIR)/liblxc_la-commands_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-conf.Plo -rm -f ./$(DEPDIR)/liblxc_la-confile.Plo -rm -f ./$(DEPDIR)/liblxc_la-confile_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-criu.Plo -rm -f ./$(DEPDIR)/liblxc_la-error.Plo -rm -f ./$(DEPDIR)/liblxc_la-execute.Plo -rm -f ./$(DEPDIR)/liblxc_la-file_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-freezer.Plo -rm -f ./$(DEPDIR)/liblxc_la-initutils.Plo -rm -f ./$(DEPDIR)/liblxc_la-log.Plo -rm -f ./$(DEPDIR)/liblxc_la-lxccontainer.Plo -rm -f ./$(DEPDIR)/liblxc_la-lxclock.Plo -rm -f ./$(DEPDIR)/liblxc_la-mainloop.Plo -rm -f ./$(DEPDIR)/liblxc_la-monitor.Plo -rm -f ./$(DEPDIR)/liblxc_la-mount_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-namespace.Plo -rm -f ./$(DEPDIR)/liblxc_la-network.Plo -rm -f ./$(DEPDIR)/liblxc_la-nl.Plo -rm -f ./$(DEPDIR)/liblxc_la-parse.Plo -rm -f ./$(DEPDIR)/liblxc_la-process_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-rexec.Plo -rm -f ./$(DEPDIR)/liblxc_la-ringbuf.Plo -rm -f ./$(DEPDIR)/liblxc_la-rtnl.Plo -rm -f ./$(DEPDIR)/liblxc_la-seccomp.Plo -rm -f ./$(DEPDIR)/liblxc_la-start.Plo -rm -f ./$(DEPDIR)/liblxc_la-state.Plo -rm -f ./$(DEPDIR)/liblxc_la-string_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-sync.Plo -rm -f ./$(DEPDIR)/liblxc_la-terminal.Plo -rm -f ./$(DEPDIR)/liblxc_la-utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-uuid.Plo -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/lxccontainer.Po -rm -f ./$(DEPDIR)/lxclock.Po -rm -f ./$(DEPDIR)/mainloop.Po -rm -f ./$(DEPDIR)/monitor.Po -rm -f ./$(DEPDIR)/mount_utils.Po -rm -f ./$(DEPDIR)/namespace.Po -rm -f ./$(DEPDIR)/network.Po -rm -f ./$(DEPDIR)/nl.Po -rm -f ./$(DEPDIR)/pam_cgfs_la-file_utils.Plo -rm -f ./$(DEPDIR)/pam_cgfs_la-string_utils.Plo -rm -f ./$(DEPDIR)/parse.Po -rm -f ./$(DEPDIR)/process_utils.Po -rm -f ./$(DEPDIR)/rexec.Po -rm -f ./$(DEPDIR)/ringbuf.Po -rm -f ./$(DEPDIR)/rtnl.Po -rm -f ./$(DEPDIR)/seccomp.Po -rm -f ./$(DEPDIR)/start.Po -rm -f ./$(DEPDIR)/state.Po -rm -f ./$(DEPDIR)/string_utils.Po -rm -f ./$(DEPDIR)/sync.Po -rm -f ./$(DEPDIR)/terminal.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f ./$(DEPDIR)/uuid.Po -rm -f cgroups/$(DEPDIR)/cgfsng.Po -rm -f cgroups/$(DEPDIR)/cgroup.Po -rm -f cgroups/$(DEPDIR)/cgroup2_devices.Po -rm -f cgroups/$(DEPDIR)/cgroup_utils.Po -rm -f cgroups/$(DEPDIR)/liblxc_la-cgfsng.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Plo -rm -f cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po -rm -f cmd/$(DEPDIR)/lxc_init.Po -rm -f cmd/$(DEPDIR)/lxc_monitord.Po -rm -f cmd/$(DEPDIR)/lxc_user_nic.Po -rm -f cmd/$(DEPDIR)/lxc_usernsexec.Po -rm -f lsm/$(DEPDIR)/apparmor.Po -rm -f lsm/$(DEPDIR)/liblxc_la-apparmor.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-lsm.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-nop.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-selinux.Plo -rm -f lsm/$(DEPDIR)/lsm.Po -rm -f lsm/$(DEPDIR)/nop.Po -rm -f lsm/$(DEPDIR)/selinux.Po -rm -f pam/$(DEPDIR)/cgfs_la-pam_cgfs.Plo -rm -f storage/$(DEPDIR)/btrfs.Po -rm -f storage/$(DEPDIR)/dir.Po -rm -f storage/$(DEPDIR)/liblxc_la-btrfs.Plo -rm -f storage/$(DEPDIR)/liblxc_la-dir.Plo -rm -f storage/$(DEPDIR)/liblxc_la-loop.Plo -rm -f storage/$(DEPDIR)/liblxc_la-lvm.Plo -rm -f storage/$(DEPDIR)/liblxc_la-nbd.Plo -rm -f storage/$(DEPDIR)/liblxc_la-overlay.Plo -rm -f storage/$(DEPDIR)/liblxc_la-rbd.Plo -rm -f storage/$(DEPDIR)/liblxc_la-rsync.Plo -rm -f storage/$(DEPDIR)/liblxc_la-storage.Plo -rm -f storage/$(DEPDIR)/liblxc_la-storage_utils.Plo -rm -f storage/$(DEPDIR)/liblxc_la-zfs.Plo -rm -f storage/$(DEPDIR)/loop.Po -rm -f storage/$(DEPDIR)/lvm.Po -rm -f storage/$(DEPDIR)/nbd.Po -rm -f storage/$(DEPDIR)/overlay.Po -rm -f storage/$(DEPDIR)/rbd.Po -rm -f storage/$(DEPDIR)/rsync.Po -rm -f storage/$(DEPDIR)/storage.Po -rm -f storage/$(DEPDIR)/storage_utils.Po -rm -f storage/$(DEPDIR)/zfs.Po -rm -f tools/$(DEPDIR)/arguments.Po -rm -f tools/$(DEPDIR)/lxc_attach.Po -rm -f tools/$(DEPDIR)/lxc_autostart.Po -rm -f tools/$(DEPDIR)/lxc_cgroup.Po -rm -f tools/$(DEPDIR)/lxc_checkpoint.Po -rm -f tools/$(DEPDIR)/lxc_config.Po -rm -f tools/$(DEPDIR)/lxc_console.Po -rm -f tools/$(DEPDIR)/lxc_copy.Po -rm -f tools/$(DEPDIR)/lxc_create.Po -rm -f tools/$(DEPDIR)/lxc_destroy.Po -rm -f tools/$(DEPDIR)/lxc_device.Po -rm -f tools/$(DEPDIR)/lxc_execute.Po -rm -f tools/$(DEPDIR)/lxc_freeze.Po -rm -f tools/$(DEPDIR)/lxc_info.Po -rm -f tools/$(DEPDIR)/lxc_ls.Po -rm -f tools/$(DEPDIR)/lxc_monitor.Po -rm -f tools/$(DEPDIR)/lxc_snapshot.Po -rm -f tools/$(DEPDIR)/lxc_start.Po -rm -f tools/$(DEPDIR)/lxc_stop.Po -rm -f tools/$(DEPDIR)/lxc_top.Po -rm -f tools/$(DEPDIR)/lxc_unfreeze.Po -rm -f tools/$(DEPDIR)/lxc_unshare.Po -rm -f tools/$(DEPDIR)/lxc_wait.Po -rm -f tools/include/$(DEPDIR)/getsubopt.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-exec_pamLTLIBRARIES install-libLTLIBRARIES \ install-pkglibexecPROGRAMS install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ../include/$(DEPDIR)/fexecve.Po -rm -f ../include/$(DEPDIR)/getgrgid_r.Po -rm -f ../include/$(DEPDIR)/getline.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-getline.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-strlcat.Po -rm -f ../include/$(DEPDIR)/init_lxc_static-strlcpy.Po -rm -f ../include/$(DEPDIR)/liblxc_la-fexecve.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-getgrgid_r.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-getline.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-lxcmntent.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-netns_ifaddrs.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-openpty.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-prlimit.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strchrnul.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strlcat.Plo -rm -f ../include/$(DEPDIR)/liblxc_la-strlcpy.Plo -rm -f ../include/$(DEPDIR)/lxcmntent.Po -rm -f ../include/$(DEPDIR)/netns_ifaddrs.Po -rm -f ../include/$(DEPDIR)/openpty.Po -rm -f ../include/$(DEPDIR)/pam_cgfs_la-strlcat.Plo -rm -f ../include/$(DEPDIR)/pam_cgfs_la-strlcpy.Plo -rm -f ../include/$(DEPDIR)/prlimit.Po -rm -f ../include/$(DEPDIR)/strchrnul.Po -rm -f ../include/$(DEPDIR)/strlcat.Po -rm -f ../include/$(DEPDIR)/strlcpy.Po -rm -f ./$(DEPDIR)/af_unix.Po -rm -f ./$(DEPDIR)/attach.Po -rm -f ./$(DEPDIR)/caps.Po -rm -f ./$(DEPDIR)/commands.Po -rm -f ./$(DEPDIR)/commands_utils.Po -rm -f ./$(DEPDIR)/conf.Po -rm -f ./$(DEPDIR)/confile.Po -rm -f ./$(DEPDIR)/confile_utils.Po -rm -f ./$(DEPDIR)/criu.Po -rm -f ./$(DEPDIR)/error.Po -rm -f ./$(DEPDIR)/execute.Po -rm -f ./$(DEPDIR)/file_utils.Po -rm -f ./$(DEPDIR)/freezer.Po -rm -f ./$(DEPDIR)/init_lxc_static-af_unix.Po -rm -f ./$(DEPDIR)/init_lxc_static-caps.Po -rm -f ./$(DEPDIR)/init_lxc_static-error.Po -rm -f ./$(DEPDIR)/init_lxc_static-file_utils.Po -rm -f ./$(DEPDIR)/init_lxc_static-initutils.Po -rm -f ./$(DEPDIR)/init_lxc_static-log.Po -rm -f ./$(DEPDIR)/init_lxc_static-namespace.Po -rm -f ./$(DEPDIR)/init_lxc_static-string_utils.Po -rm -f ./$(DEPDIR)/initutils.Po -rm -f ./$(DEPDIR)/liblxc_la-af_unix.Plo -rm -f ./$(DEPDIR)/liblxc_la-attach.Plo -rm -f ./$(DEPDIR)/liblxc_la-caps.Plo -rm -f ./$(DEPDIR)/liblxc_la-commands.Plo -rm -f ./$(DEPDIR)/liblxc_la-commands_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-conf.Plo -rm -f ./$(DEPDIR)/liblxc_la-confile.Plo -rm -f ./$(DEPDIR)/liblxc_la-confile_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-criu.Plo -rm -f ./$(DEPDIR)/liblxc_la-error.Plo -rm -f ./$(DEPDIR)/liblxc_la-execute.Plo -rm -f ./$(DEPDIR)/liblxc_la-file_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-freezer.Plo -rm -f ./$(DEPDIR)/liblxc_la-initutils.Plo -rm -f ./$(DEPDIR)/liblxc_la-log.Plo -rm -f ./$(DEPDIR)/liblxc_la-lxccontainer.Plo -rm -f ./$(DEPDIR)/liblxc_la-lxclock.Plo -rm -f ./$(DEPDIR)/liblxc_la-mainloop.Plo -rm -f ./$(DEPDIR)/liblxc_la-monitor.Plo -rm -f ./$(DEPDIR)/liblxc_la-mount_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-namespace.Plo -rm -f ./$(DEPDIR)/liblxc_la-network.Plo -rm -f ./$(DEPDIR)/liblxc_la-nl.Plo -rm -f ./$(DEPDIR)/liblxc_la-parse.Plo -rm -f ./$(DEPDIR)/liblxc_la-process_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-rexec.Plo -rm -f ./$(DEPDIR)/liblxc_la-ringbuf.Plo -rm -f ./$(DEPDIR)/liblxc_la-rtnl.Plo -rm -f ./$(DEPDIR)/liblxc_la-seccomp.Plo -rm -f ./$(DEPDIR)/liblxc_la-start.Plo -rm -f ./$(DEPDIR)/liblxc_la-state.Plo -rm -f ./$(DEPDIR)/liblxc_la-string_utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-sync.Plo -rm -f ./$(DEPDIR)/liblxc_la-terminal.Plo -rm -f ./$(DEPDIR)/liblxc_la-utils.Plo -rm -f ./$(DEPDIR)/liblxc_la-uuid.Plo -rm -f ./$(DEPDIR)/log.Po -rm -f ./$(DEPDIR)/lxccontainer.Po -rm -f ./$(DEPDIR)/lxclock.Po -rm -f ./$(DEPDIR)/mainloop.Po -rm -f ./$(DEPDIR)/monitor.Po -rm -f ./$(DEPDIR)/mount_utils.Po -rm -f ./$(DEPDIR)/namespace.Po -rm -f ./$(DEPDIR)/network.Po -rm -f ./$(DEPDIR)/nl.Po -rm -f ./$(DEPDIR)/pam_cgfs_la-file_utils.Plo -rm -f ./$(DEPDIR)/pam_cgfs_la-string_utils.Plo -rm -f ./$(DEPDIR)/parse.Po -rm -f ./$(DEPDIR)/process_utils.Po -rm -f ./$(DEPDIR)/rexec.Po -rm -f ./$(DEPDIR)/ringbuf.Po -rm -f ./$(DEPDIR)/rtnl.Po -rm -f ./$(DEPDIR)/seccomp.Po -rm -f ./$(DEPDIR)/start.Po -rm -f ./$(DEPDIR)/state.Po -rm -f ./$(DEPDIR)/string_utils.Po -rm -f ./$(DEPDIR)/sync.Po -rm -f ./$(DEPDIR)/terminal.Po -rm -f ./$(DEPDIR)/utils.Po -rm -f ./$(DEPDIR)/uuid.Po -rm -f cgroups/$(DEPDIR)/cgfsng.Po -rm -f cgroups/$(DEPDIR)/cgroup.Po -rm -f cgroups/$(DEPDIR)/cgroup2_devices.Po -rm -f cgroups/$(DEPDIR)/cgroup_utils.Po -rm -f cgroups/$(DEPDIR)/liblxc_la-cgfsng.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup2_devices.Plo -rm -f cgroups/$(DEPDIR)/liblxc_la-cgroup_utils.Plo -rm -f cmd/$(DEPDIR)/init_lxc_static-lxc_init.Po -rm -f cmd/$(DEPDIR)/lxc_init.Po -rm -f cmd/$(DEPDIR)/lxc_monitord.Po -rm -f cmd/$(DEPDIR)/lxc_user_nic.Po -rm -f cmd/$(DEPDIR)/lxc_usernsexec.Po -rm -f lsm/$(DEPDIR)/apparmor.Po -rm -f lsm/$(DEPDIR)/liblxc_la-apparmor.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-lsm.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-nop.Plo -rm -f lsm/$(DEPDIR)/liblxc_la-selinux.Plo -rm -f lsm/$(DEPDIR)/lsm.Po -rm -f lsm/$(DEPDIR)/nop.Po -rm -f lsm/$(DEPDIR)/selinux.Po -rm -f pam/$(DEPDIR)/cgfs_la-pam_cgfs.Plo -rm -f storage/$(DEPDIR)/btrfs.Po -rm -f storage/$(DEPDIR)/dir.Po -rm -f storage/$(DEPDIR)/liblxc_la-btrfs.Plo -rm -f storage/$(DEPDIR)/liblxc_la-dir.Plo -rm -f storage/$(DEPDIR)/liblxc_la-loop.Plo -rm -f storage/$(DEPDIR)/liblxc_la-lvm.Plo -rm -f storage/$(DEPDIR)/liblxc_la-nbd.Plo -rm -f storage/$(DEPDIR)/liblxc_la-overlay.Plo -rm -f storage/$(DEPDIR)/liblxc_la-rbd.Plo -rm -f storage/$(DEPDIR)/liblxc_la-rsync.Plo -rm -f storage/$(DEPDIR)/liblxc_la-storage.Plo -rm -f storage/$(DEPDIR)/liblxc_la-storage_utils.Plo -rm -f storage/$(DEPDIR)/liblxc_la-zfs.Plo -rm -f storage/$(DEPDIR)/loop.Po -rm -f storage/$(DEPDIR)/lvm.Po -rm -f storage/$(DEPDIR)/nbd.Po -rm -f storage/$(DEPDIR)/overlay.Po -rm -f storage/$(DEPDIR)/rbd.Po -rm -f storage/$(DEPDIR)/rsync.Po -rm -f storage/$(DEPDIR)/storage.Po -rm -f storage/$(DEPDIR)/storage_utils.Po -rm -f storage/$(DEPDIR)/zfs.Po -rm -f tools/$(DEPDIR)/arguments.Po -rm -f tools/$(DEPDIR)/lxc_attach.Po -rm -f tools/$(DEPDIR)/lxc_autostart.Po -rm -f tools/$(DEPDIR)/lxc_cgroup.Po -rm -f tools/$(DEPDIR)/lxc_checkpoint.Po -rm -f tools/$(DEPDIR)/lxc_config.Po -rm -f tools/$(DEPDIR)/lxc_console.Po -rm -f tools/$(DEPDIR)/lxc_copy.Po -rm -f tools/$(DEPDIR)/lxc_create.Po -rm -f tools/$(DEPDIR)/lxc_destroy.Po -rm -f tools/$(DEPDIR)/lxc_device.Po -rm -f tools/$(DEPDIR)/lxc_execute.Po -rm -f tools/$(DEPDIR)/lxc_freeze.Po -rm -f tools/$(DEPDIR)/lxc_info.Po -rm -f tools/$(DEPDIR)/lxc_ls.Po -rm -f tools/$(DEPDIR)/lxc_monitor.Po -rm -f tools/$(DEPDIR)/lxc_snapshot.Po -rm -f tools/$(DEPDIR)/lxc_start.Po -rm -f tools/$(DEPDIR)/lxc_stop.Po -rm -f tools/$(DEPDIR)/lxc_top.Po -rm -f tools/$(DEPDIR)/lxc_unfreeze.Po -rm -f tools/$(DEPDIR)/lxc_unshare.Po -rm -f tools/$(DEPDIR)/lxc_wait.Po -rm -f tools/include/$(DEPDIR)/getsubopt.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-exec_pamLTLIBRARIES uninstall-libLTLIBRARIES \ uninstall-local uninstall-pkgincludeHEADERS \ uninstall-pkglibexecPROGRAMS uninstall-sbinPROGRAMS .MAKE: install-am install-exec-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-exec_pamLTLIBRARIES clean-generic \ clean-libLTLIBRARIES clean-libtool clean-pkglibexecPROGRAMS \ clean-sbinPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-binSCRIPTS \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-exec_pamLTLIBRARIES install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-pdf install-pdf-am \ install-pkgincludeHEADERS install-pkglibexecPROGRAMS \ install-ps install-ps-am install-sbinPROGRAMS install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-binSCRIPTS uninstall-exec_pamLTLIBRARIES \ uninstall-libLTLIBRARIES uninstall-local \ uninstall-pkgincludeHEADERS uninstall-pkglibexecPROGRAMS \ uninstall-sbinPROGRAMS .PRECIOUS: Makefile install-exec-hook: mkdir -p $(DESTDIR)$(datadir)/lxc install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@ rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1 cd $(DESTDIR)$(libdir); \ ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \ ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.la" @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.a" @ENABLE_COMMANDS_TRUE@ chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic @ENABLE_BASH_TRUE@@ENABLE_COMMANDS_TRUE@install-data-local: @ENABLE_BASH_TRUE@@ENABLE_COMMANDS_TRUE@ cd $(DESTDIR)$(bashcompdir); \ @ENABLE_BASH_TRUE@@ENABLE_COMMANDS_TRUE@ for bin in $(bin_PROGRAMS) ; do \ @ENABLE_BASH_TRUE@@ENABLE_COMMANDS_TRUE@ ln -sf lxc $$bin ; \ @ENABLE_BASH_TRUE@@ENABLE_COMMANDS_TRUE@ done uninstall-local: $(RM) $(DESTDIR)$(libdir)/liblxc.so* $(RM) $(DESTDIR)$(libdir)/liblxc.a @ENABLE_BASH_TRUE@ for bin in $(bin_PROGRAMS) ; do \ @ENABLE_BASH_TRUE@ $(RM) $(DESTDIR)$(bashcompdir)/$$bin ; \ @ENABLE_BASH_TRUE@ done @ENABLE_PAM_TRUE@@HAVE_PAM_TRUE@ $(RM) $(DESTDIR)$(exec_pamdir)/pam_cgfs.so* # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: lxc-4.0.12/src/lxc/lxclock.c0000644061062106075000000001335414176403775012521 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "lxc.h" #include "log.h" #include "lxclock.h" #include "memory_utils.h" #include "utils.h" #ifdef MUTEX_DEBUGGING #include #endif #define MAX_STACKDEPTH 25 lxc_log_define(lxclock, lxc); #ifdef MUTEX_DEBUGGING static pthread_mutex_t thread_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; static inline void dump_stacktrace(void) { void *array[MAX_STACKDEPTH]; size_t size; char **strings; size = backtrace(array, MAX_STACKDEPTH); strings = backtrace_symbols(array, size); /* Using fprintf here as our logging module is not thread safe. */ fprintf(stderr, "\tObtained %zu stack frames\n", size); for (int i = 0; i < size; i++) fprintf(stderr, "\t\t%s\n", strings[i]); free(strings); } #else static pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER; static inline void dump_stacktrace(void) {;} #endif static void lock_mutex(pthread_mutex_t *l) { int ret; ret = pthread_mutex_lock(l); if (ret != 0) { SYSERROR("Failed to acquire mutex"); dump_stacktrace(); _exit(EXIT_FAILURE); } } static void unlock_mutex(pthread_mutex_t *l) { int ret; ret = pthread_mutex_unlock(l); if (ret != 0) { SYSERROR("Failed to release mutex"); dump_stacktrace(); _exit(EXIT_FAILURE); } } static char *lxclock_name(const char *p, const char *n) { __do_free char *dest = NULL, *rundir = NULL; int ret; size_t len; /* lockfile will be: * "/run" + "/lxc/lock/$lxcpath/$lxcname + '\0' if root * or * $XDG_RUNTIME_DIR + "/lxc/lock/$lxcpath/$lxcname + '\0' if non-root */ /* length of "/lxc/lock/" + $lxcpath + "/" + "." + $lxcname + '\0' */ len = STRLITERALLEN("/lxc/lock/") + strlen(n) + strlen(p) + 3; rundir = get_rundir(); if (!rundir) return NULL; len += strlen(rundir); dest = malloc(len); if (!dest) return NULL; ret = strnprintf(dest, len, "%s/lxc/lock/%s", rundir, p); if (ret < 0) return NULL; ret = mkdir_p(dest, 0755); if (ret < 0) return NULL; ret = strnprintf(dest, len, "%s/lxc/lock/%s/.%s", rundir, p, n); if (ret < 0) return NULL; return move_ptr(dest); } static sem_t *lxc_new_unnamed_sem(void) { __do_free sem_t *s = NULL; int ret; s = malloc(sizeof(*s)); if (!s) return ret_set_errno(NULL, ENOMEM); ret = sem_init(s, 0, 1); if (ret < 0) return NULL; return move_ptr(s); } struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name) { __do_free struct lxc_lock *l = NULL; l = zalloc(sizeof(*l)); if (!l) return ret_set_errno(NULL, ENOMEM); if (name) { l->type = LXC_LOCK_FLOCK; l->u.f.fname = lxclock_name(lxcpath, name); if (!l->u.f.fname) return ret_set_errno(NULL, ENOMEM); l->u.f.fd = -EBADF; } else { l->type = LXC_LOCK_ANON_SEM; l->u.sem = lxc_new_unnamed_sem(); if (!l->u.sem) return ret_set_errno(NULL, ENOMEM); } return move_ptr(l); } int lxclock(struct lxc_lock *l, int timeout) { int ret = -1; struct flock lk; switch (l->type) { case LXC_LOCK_ANON_SEM: if (!timeout) { ret = sem_wait(l->u.sem); } else { struct timespec ts; ret = clock_gettime(CLOCK_REALTIME, &ts); if (ret < 0) return -2; ts.tv_sec += timeout; ret = sem_timedwait(l->u.sem, &ts); } break; case LXC_LOCK_FLOCK: if (timeout) return log_error(-2, "Timeouts are not supported with file locks"); if (!l->u.f.fname) return log_error(-2, "No filename set for file lock"); if (l->u.f.fd < 0) { l->u.f.fd = open(l->u.f.fname, O_CREAT | O_RDWR | O_NOFOLLOW | O_CLOEXEC | O_NOCTTY, S_IWUSR | S_IRUSR); if (l->u.f.fd < 0) return log_error_errno(-2, errno, "Failed to open \"%s\"", l->u.f.fname); } memset(&lk, 0, sizeof(struct flock)); lk.l_type = F_WRLCK; lk.l_whence = SEEK_SET; ret = fcntl(l->u.f.fd, F_OFD_SETLKW, &lk); if (ret < 0 && errno == EINVAL) ret = flock(l->u.f.fd, LOCK_EX); break; default: return ret_set_errno(-1, EINVAL); } return ret; } int lxcunlock(struct lxc_lock *l) { struct flock lk; int ret = 0; switch (l->type) { case LXC_LOCK_ANON_SEM: if (!l->u.sem) return -2; ret = sem_post(l->u.sem); break; case LXC_LOCK_FLOCK: if (l->u.f.fd < 0) return -2; memset(&lk, 0, sizeof(struct flock)); lk.l_type = F_UNLCK; lk.l_whence = SEEK_SET; ret = fcntl(l->u.f.fd, F_OFD_SETLK, &lk); if (ret < 0 && errno == EINVAL) ret = flock(l->u.f.fd, LOCK_EX | LOCK_NB); close_prot_errno_disarm(l->u.f.fd); break; default: return ret_set_errno(-1, EINVAL); } return ret; } /* * lxc_putlock() is only called when a container_new() fails, * or during container_put(), which is already guaranteed to * only be done by one task. * So the only exclusion we need to provide here is for regular * thread safety (i.e. file descriptor table changes). */ void lxc_putlock(struct lxc_lock *l) { if (!l) return; switch (l->type) { case LXC_LOCK_ANON_SEM: if (l->u.sem) { sem_destroy(l->u.sem); free_disarm(l->u.sem); } break; case LXC_LOCK_FLOCK: close_prot_errno_disarm(l->u.f.fd); free_disarm(l->u.f.fname); break; } free(l); } void process_lock(void) { lock_mutex(&thread_mutex); } void process_unlock(void) { unlock_mutex(&thread_mutex); } int container_mem_lock(struct lxc_container *c) { return lxclock(c->privlock, 0); } void container_mem_unlock(struct lxc_container *c) { lxcunlock(c->privlock); } int container_disk_lock(struct lxc_container *c) { int ret; ret = lxclock(c->privlock, 0); if (ret < 0) return ret; ret = lxclock(c->slock, 0); if (ret < 0) { lxcunlock(c->privlock); return ret; } return 0; } void container_disk_unlock(struct lxc_container *c) { lxcunlock(c->slock); lxcunlock(c->privlock); } lxc-4.0.12/src/lxc/initutils.c0000644061062106075000000003663314176403775013113 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include "compiler.h" #include "error.h" #include "file_utils.h" #include "initutils.h" #include "macro.h" #include "memory_utils.h" #include "process_utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif static char *copy_global_config_value(char *p) { int len = strlen(p); char *retbuf; if (len < 1) return NULL; if (p[len-1] == '\n') { p[len-1] = '\0'; len--; } retbuf = malloc(len + 1); if (!retbuf) return NULL; (void)strlcpy(retbuf, p, len + 1); return retbuf; } const char *lxc_global_config_value(const char *option_name) { static const char * const options[][2] = { { "lxc.bdev.lvm.vg", DEFAULT_VG }, { "lxc.bdev.lvm.thin_pool", DEFAULT_THIN_POOL }, { "lxc.bdev.zfs.root", DEFAULT_ZFSROOT }, { "lxc.bdev.rbd.rbdpool", DEFAULT_RBDPOOL }, { "lxc.lxcpath", NULL }, { "lxc.default_config", NULL }, { "lxc.cgroup.pattern", NULL }, { "lxc.cgroup.use", NULL }, { NULL, NULL }, }; /* placed in the thread local storage pool for non-bionic targets */ static thread_local const char *values[sizeof(options) / sizeof(options[0])] = {0}; /* user_config_path is freed as soon as it is used */ char *user_config_path = NULL; /* * The following variables are freed at bottom unconditionally. * So NULL the value if it is to be returned to the caller */ char *user_default_config_path = NULL; char *user_lxc_path = NULL; char *user_cgroup_pattern = NULL; if (geteuid() > 0) { const char *user_home = getenv("HOME"); if (!user_home) user_home = "/"; user_config_path = malloc(sizeof(char) * (22 + strlen(user_home))); user_default_config_path = malloc(sizeof(char) * (26 + strlen(user_home))); user_lxc_path = malloc(sizeof(char) * (19 + strlen(user_home))); sprintf(user_config_path, "%s/.config/lxc/lxc.conf", user_home); sprintf(user_default_config_path, "%s/.config/lxc/default.conf", user_home); sprintf(user_lxc_path, "%s/.local/share/lxc/", user_home); } else { user_config_path = strdup(LXC_GLOBAL_CONF); user_default_config_path = strdup(LXC_DEFAULT_CONFIG); user_lxc_path = strdup(LXCPATH); if (!strequal(DEFAULT_CGROUP_PATTERN, "")) user_cgroup_pattern = strdup(DEFAULT_CGROUP_PATTERN); } const char * const (*ptr)[2]; size_t i; FILE *fin = NULL; for (i = 0, ptr = options; (*ptr)[0]; ptr++, i++) { if (strequal(option_name, (*ptr)[0])) break; } if (!(*ptr)[0]) { free(user_config_path); free(user_default_config_path); free(user_lxc_path); free(user_cgroup_pattern); errno = EINVAL; return NULL; } if (values[i]) { free(user_config_path); free(user_default_config_path); free(user_lxc_path); free(user_cgroup_pattern); return values[i]; } fin = fopen_cloexec(user_config_path, "r"); free(user_config_path); if (fin) { __do_free char *line = NULL; size_t len = 0; char *slider1, *slider2; while (getline(&line, &len, fin) > 0) { if (*line == '#') continue; slider1 = strstr(line, option_name); if (!slider1) continue; /* see if there was just white space in front * of the option name */ for (slider2 = line; slider2 < slider1; slider2++) if (*slider2 != ' ' && *slider2 != '\t') break; if (slider2 < slider1) continue; slider1 = strchr(slider1, '='); if (!slider1) continue; /* see if there was just white space after * the option name */ for (slider2 += strlen(option_name); slider2 < slider1; slider2++) if (*slider2 != ' ' && *slider2 != '\t') break; if (slider2 < slider1) continue; slider1++; while (*slider1 && (*slider1 == ' ' || *slider1 == '\t')) slider1++; if (!*slider1) continue; if (strequal(option_name, "lxc.lxcpath")) { free(user_lxc_path); user_lxc_path = copy_global_config_value(slider1); remove_trailing_slashes(user_lxc_path); values[i] = move_ptr(user_lxc_path); goto out; } values[i] = copy_global_config_value(slider1); goto out; } } /* could not find value, use default */ if (strequal(option_name, "lxc.lxcpath")) { remove_trailing_slashes(user_lxc_path); values[i] = move_ptr(user_lxc_path); } else if (strequal(option_name, "lxc.default_config")) { values[i] = move_ptr(user_default_config_path); } else if (strequal(option_name, "lxc.cgroup.pattern")) { values[i] = move_ptr(user_cgroup_pattern); } else { values[i] = (*ptr)[1]; } /* special case: if default value is NULL, * and there is no config, don't view that * as an error... */ if (!values[i]) errno = 0; out: if (fin) fclose(fin); free(user_cgroup_pattern); free(user_default_config_path); free(user_lxc_path); return values[i]; } /* * Sets the process title to the specified title. Note that this may fail if * the kernel doesn't support PR_SET_MM_MAP (kernels <3.18). */ int setproctitle(char *title) { __do_fclose FILE *f = NULL; int i, fd, len; char *buf_ptr, *tmp_proctitle; char buf[LXC_LINELEN]; int ret = 0; ssize_t bytes_read = 0; static char *proctitle = NULL; /* * We don't really need to know all of this stuff, but unfortunately * PR_SET_MM_MAP requires us to set it all at once, so we have to * figure it out anyway. */ unsigned long start_data, end_data, start_brk, start_code, end_code, start_stack, arg_start, arg_end, env_start, env_end, brk_val; struct prctl_mm_map prctl_map; f = fopen_cloexec("/proc/self/stat", "r"); if (!f) return -1; fd = fileno(f); if (fd < 0) return -1; bytes_read = lxc_read_nointr(fd, buf, sizeof(buf) - 1); if (bytes_read <= 0) return -1; buf[bytes_read] = '\0'; /* Skip the first 25 fields, column 26-28 are start_code, end_code, * and start_stack */ buf_ptr = strchr(buf, ' '); for (i = 0; i < 24; i++) { if (!buf_ptr) return -1; buf_ptr = strchr(buf_ptr + 1, ' '); } if (!buf_ptr) return -1; i = sscanf(buf_ptr, "%lu %lu %lu", &start_code, &end_code, &start_stack); if (i != 3) return -1; /* Skip the next 19 fields, column 45-51 are start_data to arg_end */ for (i = 0; i < 19; i++) { if (!buf_ptr) return -1; buf_ptr = strchr(buf_ptr + 1, ' '); } if (!buf_ptr) return -1; i = sscanf(buf_ptr, "%lu %lu %lu %*u %*u %lu %lu", &start_data, &end_data, &start_brk, &env_start, &env_end); if (i != 5) return -1; /* Include the null byte here, because in the calculations below we * want to have room for it. */ len = strlen(title) + 1; tmp_proctitle = realloc(proctitle, len); if (!tmp_proctitle) return -1; proctitle = tmp_proctitle; arg_start = (unsigned long)proctitle; arg_end = arg_start + len; brk_val = syscall(__NR_brk, 0); prctl_map = (struct prctl_mm_map){ .start_code = start_code, .end_code = end_code, .start_stack = start_stack, .start_data = start_data, .end_data = end_data, .start_brk = start_brk, .brk = brk_val, .arg_start = arg_start, .arg_end = arg_end, .env_start = env_start, .env_end = env_end, .auxv = NULL, .auxv_size = 0, .exe_fd = -1, }; ret = prctl(PR_SET_MM, prctl_arg(PR_SET_MM_MAP), prctl_arg(&prctl_map), prctl_arg(sizeof(prctl_map)), prctl_arg(0)); if (ret == 0) (void)strlcpy((char *)arg_start, title, len); return ret; } static void prevent_forking(void) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; char path[PATH_MAX]; size_t len = 0; f = fopen("/proc/self/cgroup", "re"); if (!f) return; while (getline(&line, &len, f) != -1) { __do_close int fd = -EBADF; int ret; char *p, *p2; p = strchr(line, ':'); if (!p) continue; p++; p2 = strchr(p, ':'); if (!p2) continue; *p2 = '\0'; /* This is a cgroup v2 entry. Skip it. */ if ((p2 - p) == 0) continue; if (strcmp(p, "pids") != 0) continue; p2++; p2 += lxc_char_left_gc(p2, strlen(p2)); p2[lxc_char_right_gc(p2, strlen(p2))] = '\0'; ret = snprintf(path, sizeof(path), "/sys/fs/cgroup/pids/%s/pids.max", p2); if (ret < 0 || (size_t)ret >= sizeof(path)) { fprintf(stderr, "Failed to create string\n"); return; } fd = open(path, O_WRONLY | O_CLOEXEC); if (fd < 0) { fprintf(stderr, "Failed to open \"%s\"\n", path); return; } ret = write(fd, "1", 1); if (ret != 1) fprintf(stderr, "Failed to write to \"%s\"\n", path); return; } } static void kill_children(pid_t pid) { __do_fclose FILE *f = NULL; char path[PATH_MAX]; int ret; ret = snprintf(path, sizeof(path), "/proc/%d/task/%d/children", pid, pid); if (ret < 0 || (size_t)ret >= sizeof(path)) { fprintf(stderr, "Failed to create string\n"); return; } f = fopen(path, "re"); if (!f) { fprintf(stderr, "Failed to open %s\n", path); return; } while (!feof(f)) { pid_t find_pid; if (fscanf(f, "%d ", &find_pid) != 1) { fprintf(stderr, "Failed to retrieve pid\n"); return; } (void)kill_children(find_pid); (void)kill(find_pid, SIGKILL); } } static void remove_self(void) { int ret; ssize_t n; char path[PATH_MAX] = {0}; n = readlink("/proc/self/exe", path, sizeof(path)); if (n < 0 || n >= PATH_MAX) return; path[n] = '\0'; ret = umount2(path, MNT_DETACH); if (ret < 0) return; ret = unlink(path); if (ret < 0) return; } static sig_atomic_t was_interrupted; static void interrupt_handler(int sig) { if (!was_interrupted) was_interrupted = sig; } static int close_inherited(void) { int fddir; DIR *dir; struct dirent *direntp; restart: dir = opendir("/proc/self/fd"); if (!dir) return -errno; fddir = dirfd(dir); while ((direntp = readdir(dir))) { int fd, ret; if (strcmp(direntp->d_name, ".") == 0) continue; if (strcmp(direntp->d_name, "..") == 0) continue; ret = lxc_safe_int(direntp->d_name, &fd); if (ret < 0) continue; if (fd == STDERR_FILENO || fd == fddir) break; if (close(fd)) { closedir(dir); return -errno; } closedir(dir); goto restart; } closedir(dir); return 0; } __noreturn int lxc_container_init(int argc, char *const *argv, bool quiet) { int i, logfd, ret; pid_t pid; struct sigaction act; sigset_t mask, omask; int have_status = 0, exit_with = 1, shutdown = 0; /* Mask all the signals so we are safe to install a signal handler and * to fork. */ ret = sigfillset(&mask); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&mask, SIGILL); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&mask, SIGSEGV); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&mask, SIGBUS); if (ret < 0) exit(EXIT_FAILURE); ret = pthread_sigmask(SIG_SETMASK, &mask, &omask); if (ret < 0) exit(EXIT_FAILURE); ret = sigfillset(&act.sa_mask); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&act.sa_mask, SIGILL); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&act.sa_mask, SIGSEGV); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&act.sa_mask, SIGBUS); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&act.sa_mask, SIGSTOP); if (ret < 0) exit(EXIT_FAILURE); ret = sigdelset(&act.sa_mask, SIGKILL); if (ret < 0) exit(EXIT_FAILURE); act.sa_flags = 0; act.sa_handler = interrupt_handler; for (i = 1; i < NSIG; i++) { /* Exclude some signals: ILL, SEGV and BUS are likely to reveal * a bug and we want a core. STOP and KILL cannot be handled * anyway: they're here for documentation. 32 and 33 are not * defined. */ if (i == SIGILL || i == SIGSEGV || i == SIGBUS || i == SIGSTOP || i == SIGKILL || i == 32 || i == 33) continue; ret = sigaction(i, &act, NULL); if (ret < 0) { if (errno == EINVAL) continue; if (!quiet) fprintf(stderr, "Failed to change signal action\n"); exit(EXIT_FAILURE); } } remove_self(); pid = fork(); if (pid < 0) exit(EXIT_FAILURE); if (!pid) { /* restore default signal handlers */ for (i = 1; i < NSIG; i++) { sighandler_t sigerr; if (i == SIGILL || i == SIGSEGV || i == SIGBUS || i == SIGSTOP || i == SIGKILL || i == 32 || i == 33) continue; sigerr = signal(i, SIG_DFL); if (sigerr == SIG_ERR && !quiet) fprintf(stderr, "Failed to reset to default action for signal \"%d\": %d\n", i, pid); } ret = pthread_sigmask(SIG_SETMASK, &omask, NULL); if (ret < 0) { if (quiet) fprintf(stderr, "Failed to set signal mask\n"); exit(EXIT_FAILURE); } (void)setsid(); (void)ioctl(STDIN_FILENO, TIOCSCTTY, 0); ret = execvp(argv[0], argv); if (!quiet) fprintf(stderr, "Failed to exec \"%s\"\n", argv[0]); exit(ret); } logfd = open("/dev/console", O_WRONLY | O_NOCTTY | O_CLOEXEC); if (logfd >= 0) { ret = dup3(logfd, STDERR_FILENO, O_CLOEXEC); if (ret < 0) exit(EXIT_FAILURE); } (void)setproctitle("init"); /* Let's process the signals now. */ ret = sigdelset(&omask, SIGALRM); if (ret < 0) exit(EXIT_FAILURE); ret = pthread_sigmask(SIG_SETMASK, &omask, NULL); if (ret < 0) { if (!quiet) fprintf(stderr, "Failed to set signal mask\n"); exit(EXIT_FAILURE); } ret = close_range(STDERR_FILENO + 1, UINT_MAX, CLOSE_RANGE_UNSHARE); if (ret) { /* * Fallback to close_inherited() when the syscall is not * available or when CLOSE_RANGE_UNSHARE isn't supported. * On a regular kernel CLOSE_RANGE_UNSHARE should always be * available but openSUSE Leap 15.3 seems to have a partial * backport without CLOSE_RANGE_UNSHARE support. */ if (errno == ENOSYS || errno == EINVAL) ret = close_inherited(); } if (ret) { fprintf(stderr, "Aborting attach to prevent leaking file descriptors into container\n"); exit(EXIT_FAILURE); } for (;;) { int status; pid_t waited_pid; switch (was_interrupted) { case 0: /* Some applications send SIGHUP in order to get init to reload * its configuration. We don't want to forward this onto the * application itself, because it probably isn't expecting this * signal since it was expecting init to do something with it. * * Instead, let's explicitly ignore it here. The actual * terminal case is handled in the monitor's handler, which * sends this task a SIGTERM in the case of a SIGHUP, which is * what we want. */ case SIGHUP: break; case SIGPWR: case SIGTERM: if (!shutdown) { pid_t mypid = lxc_raw_getpid(); shutdown = 1; prevent_forking(); if (mypid != 1) { kill_children(mypid); } else { ret = kill(-1, SIGTERM); if (ret < 0 && !quiet) fprintf(stderr, "Failed to send SIGTERM to all children\n"); } alarm(1); } break; case SIGALRM: { pid_t mypid = lxc_raw_getpid(); prevent_forking(); if (mypid != 1) { kill_children(mypid); } else { ret = kill(-1, SIGKILL); if (ret < 0 && !quiet) fprintf(stderr, "Failed to send SIGTERM to all children\n"); } break; } default: kill(pid, was_interrupted); break; } ret = EXIT_SUCCESS; was_interrupted = 0; waited_pid = wait(&status); if (waited_pid < 0) { if (errno == ECHILD) goto out; if (errno == EINTR) continue; if (!quiet) fprintf(stderr, "Failed to wait on child %d\n", pid); ret = -1; goto out; } /* Reset timer each time a process exited. */ if (shutdown) alarm(1); /* Keep the exit code of the started application (not wrapped * pid) and continue to wait for the end of the orphan group. */ if (waited_pid == pid && !have_status) { exit_with = lxc_error_set_and_log(waited_pid, status); have_status = 1; } } out: if (ret < 0) exit(EXIT_FAILURE); exit(exit_with); } lxc-4.0.12/src/lxc/parse.c0000644061062106075000000000725614176403775012200 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "file_utils.h" #include "log.h" #include "macro.h" #include "parse.h" #include "syscall_wrappers.h" #include "utils.h" lxc_log_define(parse, lxc); void *lxc_strmmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) { void *tmp = NULL, *overlap = NULL; /* We establish an anonymous mapping that is one byte larger than the * underlying file. The pages handed to us are zero filled. */ tmp = mmap(addr, length + 1, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (tmp == MAP_FAILED) return tmp; /* Now we establish a fixed-address mapping starting at the address we * received from our anonymous mapping and replace all bytes excluding * the additional \0-byte with the file. This allows us to use normal * string-handling functions. */ overlap = mmap(tmp, length, prot, MAP_FIXED | flags, fd, offset); if (overlap == MAP_FAILED) munmap(tmp, length + 1); return overlap; } int lxc_strmunmap(void *addr, size_t length) { return munmap(addr, length + 1); } int lxc_file_for_each_line_mmap(const char *file, lxc_file_cb callback, void *data) { __do_close int fd = -EBADF, memfd = -EBADF; ssize_t ret = -1; char *buf = NULL; struct stat st = {}; ssize_t bytes; char *line; memfd = memfd_create(".lxc_config_file", MFD_CLOEXEC); if (memfd < 0) { char template[] = P_tmpdir "/.lxc_config_file_XXXXXX"; if (errno != ENOSYS) { SYSERROR("Failed to create memory file"); goto on_error; } TRACE("Failed to create in-memory file. Falling back to temporary file"); memfd = lxc_make_tmpfile(template, true); if (memfd < 0) { SYSERROR("Failed to create temporary file \"%s\"", template); goto on_error; } } fd = open(file, O_RDONLY | O_CLOEXEC); if (fd < 0) { SYSERROR("Failed to open file \"%s\"", file); goto on_error; } ret = fstat(fd, &st); if (ret) { SYSERROR("Failed to stat file \"%s\"", file); goto on_error; } if (st.st_size > INT_MAX) { SYSERROR("Excessively large config file \"%s\"", file); goto on_error; } bytes = __fd_to_fd(fd, memfd); if (bytes < 0) { SYSERROR("Failed to copy config file \"%s\"", file); goto on_error; } ret = lxc_write_nointr(memfd, "\0", 1); if (ret < 0) { SYSERROR("Failed to append zero byte"); goto on_error; } bytes++; ret = lseek(memfd, 0, SEEK_SET); if (ret < 0) { SYSERROR("Failed to lseek"); goto on_error; } ret = -1; buf = mmap(NULL, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_POPULATE, memfd, 0); if (buf == MAP_FAILED) { buf = NULL; SYSERROR("Failed to mmap"); goto on_error; } ret = 0; lxc_iterate_parts(line, buf, "\r\n\0") { ret = callback(line, data); if (ret) { /* Callback rv > 0 means stop here callback rv < 0 means * error. */ if (ret < 0) ERROR("Failed to parse config file \"%s\" at line \"%s\"", file, line); break; } } on_error: if (buf && munmap(buf, bytes)) { SYSERROR("Failed to unmap"); if (ret == 0) ret = -1; } return ret; } int lxc_file_for_each_line(const char *file, lxc_file_cb callback, void *data) { __do_fclose FILE *f = NULL; __do_free char *line = NULL; int err = 0; size_t len = 0; f = fopen(file, "re"); if (!f) { SYSERROR("Failed to open \"%s\"", file); return -1; } while (getline(&line, &len, f) != -1) { err = callback(line, data); if (err) { /* Callback rv > 0 means stop here callback rv < 0 means * error. */ if (err < 0) ERROR("Failed to parse config: \"%s\"", line); break; } } return err; } lxc-4.0.12/src/lxc/memory_utils.h0000644061062106075000000000541514176403775013616 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_MEMORY_UTILS_H #define __LXC_MEMORY_UTILS_H #include "config.h" #include #include #include #include #include #include #include "macro.h" #include "error_utils.h" #define define_cleanup_function(type, cleaner) \ static inline void cleaner##_function(type *ptr) \ { \ if (*ptr) \ cleaner(*ptr); \ } #define call_cleaner(cleaner) \ __attribute__((__cleanup__(cleaner##_function))) __attribute__((unused)) #define close_prot_errno_disarm(fd) \ if (fd >= 0) { \ int _e_ = errno; \ close(fd); \ errno = _e_; \ fd = -EBADF; \ } #define close_prot_errno_move(fd, new_fd) \ if (fd >= 0) { \ int _e_ = errno; \ close(fd); \ errno = _e_; \ fd = new_fd; \ new_fd = -EBADF; \ } static inline void close_prot_errno_disarm_function(int *fd) { close_prot_errno_disarm(*fd); } #define __do_close call_cleaner(close_prot_errno_disarm) define_cleanup_function(FILE *, fclose); #define __do_fclose call_cleaner(fclose) define_cleanup_function(DIR *, closedir); #define __do_closedir call_cleaner(closedir) #define free_disarm(ptr) \ ({ \ if (!IS_ERR_OR_NULL(ptr)) { \ free(ptr); \ ptr = NULL; \ } \ }) static inline void free_disarm_function(void *ptr) { free_disarm(*(void **)ptr); } #define __do_free call_cleaner(free_disarm) static inline void free_string_list(char **list) { if (list && !IS_ERR(list)) { for (int i = 0; list[i]; i++) free(list[i]); free_disarm(list); } } define_cleanup_function(char **, free_string_list); #define __do_free_string_list call_cleaner(free_string_list) static inline void *memdup(const void *data, size_t len) { void *copy = NULL; copy = len ? malloc(len) : NULL; return copy ? memcpy(copy, data, len) : NULL; } #define zalloc(__size__) (calloc(1, __size__)) #define free_move_ptr(a, b) \ ({ \ free(a); \ (a) = move_ptr((b)); \ }) #define close_move_fd(a, b) \ ({ \ close(a); \ (a) = move_fd((b)); \ }) #define close_equal(a, b) \ ({ \ if (a >= 0 && a != b) \ close(a); \ if (b >= 0) \ close(b); \ a = b = -EBADF; \ }) #define free_equal(a, b) \ ({ \ if (a != b) \ free(a); \ free(b); \ a = b = NULL; \ }) #endif /* __LXC_MEMORY_UTILS_H */ lxc-4.0.12/src/lxc/hlist.h0000644061062106075000000006755114176403775012222 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_HLIST_H #define __LXC_HLIST_H struct list_head { struct list_head *next, *prev; }; struct hlist_head { struct hlist_node *first; }; struct hlist_node { struct hlist_node *next, **pprev; }; /* * These are non-NULL pointers that will result in page faults * under normal circumstances, used to verify that nobody uses * non-initialized list entries. */ #define LIST_POISON1 ((void *) 0x100) #define LIST_POISON2 ((void *) 0x122) /* * Circular doubly linked list implementation. * * Some of the internal functions ("__xxx") are useful when * manipulating whole lists rather than single entries, as * sometimes we already know the next/prev entries and we can * generate better code by using them directly rather than * using the generic single-entry routines. */ #define LIST_HEAD_INIT(name) { &(name), &(name) } #define LIST_HEAD(name) \ struct list_head name = LIST_HEAD_INIT(name) /** * INIT_LIST_HEAD - Initialize a list_head structure * @list: list_head structure to be initialized. * * Initializes the list_head to point to itself. If it is a list header, * the result is an empty list. */ static inline void INIT_LIST_HEAD(struct list_head *list) { list->next = list; list->prev = list; } /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { next->prev = new; new->next = next; new->prev = prev; prev->next = new; } /** * list_add - add a new entry * @new: new entry to be added * @head: list head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ static inline void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } /** * list_add_tail - add a new entry * @new: new entry to be added * @head: list head to add it before * * Insert a new entry before the specified head. * This is useful for implementing queues. */ static inline void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); } /* * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __list_del(struct list_head * prev, struct list_head * next) { next->prev = prev; prev->next = next; } static inline void __list_del_entry(struct list_head *entry) { __list_del(entry->prev, entry->next); } /** * list_del - deletes entry from list. * @entry: the element to delete from the list. * Note: list_empty() on entry does not return true after this, the entry is * in an undefined state. */ static inline void list_del(struct list_head *entry) { __list_del_entry(entry); entry->next = LIST_POISON1; entry->prev = LIST_POISON2; } /** * list_replace - replace old entry by new one * @old : the element to be replaced * @new : the new element to insert * * If @old was empty, it will be overwritten. */ static inline void list_replace(struct list_head *old, struct list_head *new) { new->next = old->next; new->next->prev = new; new->prev = old->prev; new->prev->next = new; } /** * list_replace_init - replace old entry by new one and initialize the old one * @old : the element to be replaced * @new : the new element to insert * * If @old was empty, it will be overwritten. */ static inline void list_replace_init(struct list_head *old, struct list_head *new) { list_replace(old, new); INIT_LIST_HEAD(old); } /** * list_swap - replace entry1 with entry2 and re-add entry1 at entry2's position * @entry1: the location to place entry2 * @entry2: the location to place entry1 */ static inline void list_swap(struct list_head *entry1, struct list_head *entry2) { struct list_head *pos = entry2->prev; list_del(entry2); list_replace(entry1, entry2); if (pos == entry1) pos = entry2; list_add(entry1, pos); } /** * list_del_init - deletes entry from list and reinitialize it. * @entry: the element to delete from the list. */ static inline void list_del_init(struct list_head *entry) { __list_del_entry(entry); INIT_LIST_HEAD(entry); } /** * list_move - delete from one list and add as another's head * @list: the entry to move * @head: the head that will precede our entry */ static inline void list_move(struct list_head *list, struct list_head *head) { __list_del_entry(list); list_add(list, head); } /** * list_move_tail - delete from one list and add as another's tail * @list: the entry to move * @head: the head that will follow our entry */ static inline void list_move_tail(struct list_head *list, struct list_head *head) { __list_del_entry(list); list_add_tail(list, head); } /** * list_bulk_move_tail - move a subsection of a list to its tail * @head: the head that will follow our entry * @first: first entry to move * @last: last entry to move, can be the same as first * * Move all entries between @first and including @last before @head. * All three entries must belong to the same linked list. */ static inline void list_bulk_move_tail(struct list_head *head, struct list_head *first, struct list_head *last) { first->prev->next = last->next; last->next->prev = first->prev; head->prev->next = first; first->prev = head->prev; last->next = head; head->prev = last; } /** * list_is_first -- tests whether @list is the first entry in list @head * @list: the entry to test * @head: the head of the list */ static inline int list_is_first(const struct list_head *list, const struct list_head *head) { return list->prev == head; } /** * list_is_last - tests whether @list is the last entry in list @head * @list: the entry to test * @head: the head of the list */ static inline int list_is_last(const struct list_head *list, const struct list_head *head) { return list->next == head; } /** * list_empty - tests whether a list is empty * @head: the list to test. */ static inline int list_empty(const struct list_head *head) { return head->next == head; } /** * list_rotate_left - rotate the list to the left * @head: the head of the list */ static inline void list_rotate_left(struct list_head *head) { struct list_head *first; if (!list_empty(head)) { first = head->next; list_move_tail(first, head); } } /** * list_rotate_to_front() - Rotate list to specific item. * @list: The desired new front of the list. * @head: The head of the list. * * Rotates list so that @list becomes the new front of the list. */ static inline void list_rotate_to_front(struct list_head *list, struct list_head *head) { /* * Deletes the list head from the list denoted by @head and * places it as the tail of @list, this effectively rotates the * list so that @list is at the front. */ list_move_tail(head, list); } /** * list_is_singular - tests whether a list has just one entry. * @head: the list to test. */ static inline int list_is_singular(const struct list_head *head) { return !list_empty(head) && (head->next == head->prev); } static inline void __list_cut_position(struct list_head *list, struct list_head *head, struct list_head *entry) { struct list_head *new_first = entry->next; list->next = head->next; list->next->prev = list; list->prev = entry; entry->next = list; head->next = new_first; new_first->prev = head; } /** * list_cut_position - cut a list into two * @list: a new list to add all removed entries * @head: a list with entries * @entry: an entry within head, could be the head itself * and if so we won't cut the list * * This helper moves the initial part of @head, up to and * including @entry, from @head to @list. You should * pass on @entry an element you know is on @head. @list * should be an empty list or a list you do not care about * losing its data. * */ static inline void list_cut_position(struct list_head *list, struct list_head *head, struct list_head *entry) { if (list_empty(head)) return; if (list_is_singular(head) && (head->next != entry && head != entry)) return; if (entry == head) INIT_LIST_HEAD(list); else __list_cut_position(list, head, entry); } /** * list_cut_before - cut a list into two, before given entry * @list: a new list to add all removed entries * @head: a list with entries * @entry: an entry within head, could be the head itself * * This helper moves the initial part of @head, up to but * excluding @entry, from @head to @list. You should pass * in @entry an element you know is on @head. @list should * be an empty list or a list you do not care about losing * its data. * If @entry == @head, all entries on @head are moved to * @list. */ static inline void list_cut_before(struct list_head *list, struct list_head *head, struct list_head *entry) { if (head->next == entry) { INIT_LIST_HEAD(list); return; } list->next = head->next; list->next->prev = list; list->prev = entry->prev; list->prev->next = list; head->next = entry; entry->prev = head; } static inline void __list_splice(const struct list_head *list, struct list_head *prev, struct list_head *next) { struct list_head *first = list->next; struct list_head *last = list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; } /** * list_splice - join two lists, this is designed for stacks * @list: the new list to add. * @head: the place to add it in the first list. */ static inline void list_splice(const struct list_head *list, struct list_head *head) { if (!list_empty(list)) __list_splice(list, head, head->next); } /** * list_splice_tail - join two lists, each list being a queue * @list: the new list to add. * @head: the place to add it in the first list. */ static inline void list_splice_tail(struct list_head *list, struct list_head *head) { if (!list_empty(list)) __list_splice(list, head->prev, head); } /** * list_splice_init - join two lists and reinitialise the emptied list. * @list: the new list to add. * @head: the place to add it in the first list. * * The list at @list is reinitialised */ static inline void list_splice_init(struct list_head *list, struct list_head *head) { if (!list_empty(list)) { __list_splice(list, head, head->next); INIT_LIST_HEAD(list); } } /** * list_splice_tail_init - join two lists and reinitialise the emptied list * @list: the new list to add. * @head: the place to add it in the first list. * * Each of the lists is a queue. * The list at @list is reinitialised */ static inline void list_splice_tail_init(struct list_head *list, struct list_head *head) { if (!list_empty(list)) { __list_splice(list, head->prev, head); INIT_LIST_HEAD(list); } } /** * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list_head within the struct. */ #define list_entry(ptr, type, member) \ container_of(ptr, type, member) /** * list_first_entry - get the first element from a list * @ptr: the list head to take the element from. * @type: the type of the struct this is embedded in. * @member: the name of the list_head within the struct. * * Note, that list is expected to be not empty. */ #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) /** * list_last_entry - get the last element from a list * @ptr: the list head to take the element from. * @type: the type of the struct this is embedded in. * @member: the name of the list_head within the struct. * * Note, that list is expected to be not empty. */ #define list_last_entry(ptr, type, member) \ list_entry((ptr)->prev, type, member) /** * list_first_entry_or_null - get the first element from a list * @ptr: the list head to take the element from. * @type: the type of the struct this is embedded in. * @member: the name of the list_head within the struct. * * Note that if the list is empty, it returns NULL. */ #define list_first_entry_or_null(ptr, type, member) ({ \ struct list_head *head__ = (ptr); \ struct list_head *pos__ = head__->next; \ pos__ != head__ ? list_entry(pos__, type, member) : NULL; \ }) /** * list_next_entry - get the next element in list * @pos: the type * to cursor * @member: the name of the list_head within the struct. */ #define list_next_entry(pos, member) \ list_entry((pos)->member.next, typeof(*(pos)), member) /** * list_prev_entry - get the prev element in list * @pos: the type * to cursor * @member: the name of the list_head within the struct. */ #define list_prev_entry(pos, member) \ list_entry((pos)->member.prev, typeof(*(pos)), member) /** * list_for_each - iterate over a list * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. */ #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) /** * list_for_each_continue - continue iteration over a list * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. * * Continue to iterate over a list, continuing after the current position. */ #define list_for_each_continue(pos, head) \ for (pos = pos->next; pos != (head); pos = pos->next) /** * list_for_each_prev - iterate over a list backwards * @pos: the &struct list_head to use as a loop cursor. * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; pos != (head); pos = pos->prev) /** * list_for_each_safe - iterate over a list safe against removal of list entry * @pos: the &struct list_head to use as a loop cursor. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. */ #define list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, n = pos->next) /** * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry * @pos: the &struct list_head to use as a loop cursor. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. */ #define list_for_each_prev_safe(pos, n, head) \ for (pos = (head)->prev, n = pos->prev; \ pos != (head); \ pos = n, n = pos->prev) /** * list_entry_is_head - test if the entry points to the head of the list * @pos: the type * to cursor * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_entry_is_head(pos, head, member) \ (&pos->member == (head)) /** * list_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_for_each_entry(pos, head, member) \ for (pos = list_first_entry(head, typeof(*pos), member); \ !list_entry_is_head(pos, head, member); \ pos = list_next_entry(pos, member)) /** * list_for_each_entry_reverse - iterate backwards over list of given type. * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_for_each_entry_reverse(pos, head, member) \ for (pos = list_last_entry(head, typeof(*pos), member); \ !list_entry_is_head(pos, head, member); \ pos = list_prev_entry(pos, member)) /** * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue() * @pos: the type * to use as a start point * @head: the head of the list * @member: the name of the list_head within the struct. * * Prepares a pos entry for use as a start point in list_for_each_entry_continue(). */ #define list_prepare_entry(pos, head, member) \ ((pos) ? : list_entry(head, typeof(*pos), member)) /** * list_for_each_entry_continue - continue iteration over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. * * Continue to iterate over list of given type, continuing after * the current position. */ #define list_for_each_entry_continue(pos, head, member) \ for (pos = list_next_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = list_next_entry(pos, member)) /** * list_for_each_entry_continue_reverse - iterate backwards from the given point * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. * * Start to iterate over list of given type backwards, continuing after * the current position. */ #define list_for_each_entry_continue_reverse(pos, head, member) \ for (pos = list_prev_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = list_prev_entry(pos, member)) /** * list_for_each_entry_from - iterate over list of given type from the current point * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. * * Iterate over list of given type, continuing from current position. */ #define list_for_each_entry_from(pos, head, member) \ for (; !list_entry_is_head(pos, head, member); \ pos = list_next_entry(pos, member)) /** * list_for_each_entry_from_reverse - iterate backwards over list of given type * from the current point * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the list_head within the struct. * * Iterate backwards over list of given type, continuing from current position. */ #define list_for_each_entry_from_reverse(pos, head, member) \ for (; !list_entry_is_head(pos, head, member); \ pos = list_prev_entry(pos, member)) /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_head within the struct. */ #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_first_entry(head, typeof(*pos), member), \ n = list_next_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = n, n = list_next_entry(n, member)) /** * list_for_each_entry_safe_continue - continue list iteration safe against removal * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_head within the struct. * * Iterate over list of given type, continuing after current point, * safe against removal of list entry. */ #define list_for_each_entry_safe_continue(pos, n, head, member) \ for (pos = list_next_entry(pos, member), \ n = list_next_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = n, n = list_next_entry(n, member)) /** * list_for_each_entry_safe_from - iterate over list from current point safe against removal * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_head within the struct. * * Iterate over list of given type from current point, safe against * removal of list entry. */ #define list_for_each_entry_safe_from(pos, n, head, member) \ for (n = list_next_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = n, n = list_next_entry(n, member)) /** * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal * @pos: the type * to use as a loop cursor. * @n: another type * to use as temporary storage * @head: the head for your list. * @member: the name of the list_head within the struct. * * Iterate backwards over list of given type, safe against removal * of list entry. */ #define list_for_each_entry_safe_reverse(pos, n, head, member) \ for (pos = list_last_entry(head, typeof(*pos), member), \ n = list_prev_entry(pos, member); \ !list_entry_is_head(pos, head, member); \ pos = n, n = list_prev_entry(n, member)) /** * list_safe_reset_next - reset a stale list_for_each_entry_safe loop * @pos: the loop cursor used in the list_for_each_entry_safe loop * @n: temporary storage used in list_for_each_entry_safe * @member: the name of the list_head within the struct. * * list_safe_reset_next is not safe to use in general if the list may be * modified concurrently (eg. the lock is dropped in the loop body). An * exception to this is if the cursor element (pos) is pinned in the list, * and list_safe_reset_next is called after re-taking the lock and before * completing the current iteration of the loop body. */ #define list_safe_reset_next(pos, n, member) \ n = list_next_entry(pos, member) /* * Double linked lists with a single pointer list head. * Mostly useful for hash tables where the two pointer list head is * too wasteful. * You lose the ability to access the tail in O(1). */ #define HLIST_HEAD_INIT { .first = NULL } #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) static inline void INIT_HLIST_NODE(struct hlist_node *h) { h->next = NULL; h->pprev = NULL; } /** * hlist_unhashed - Has node been removed from list and reinitialized? * @h: Node to be checked * * Not that not all removal functions will leave a node in unhashed * state. For example, hlist_nulls_del_init_rcu() does leave the * node in unhashed state, but hlist_nulls_del() does not. */ static inline int hlist_unhashed(const struct hlist_node *h) { return !h->pprev; } /** * hlist_unhashed_lockless - Version of hlist_unhashed for lockless use * @h: Node to be checked */ static inline int hlist_unhashed_lockless(const struct hlist_node *h) { return !h->pprev; } /** * hlist_empty - Is the specified hlist_head structure an empty hlist? * @h: Structure to check. */ static inline int hlist_empty(const struct hlist_head *h) { return !h->first; } static inline void __hlist_del(struct hlist_node *n) { struct hlist_node *next = n->next; struct hlist_node **pprev = n->pprev; *pprev = next; if (next) next->pprev = pprev; } /** * hlist_del - Delete the specified hlist_node from its list * @n: Node to delete. * * Note that this function leaves the node in hashed state. Use * hlist_del_init() or similar instead to unhash @n. */ static inline void hlist_del(struct hlist_node *n) { __hlist_del(n); n->next = LIST_POISON1; n->pprev = LIST_POISON2; } /** * hlist_del_init - Delete the specified hlist_node from its list and initialize * @n: Node to delete. * * Note that this function leaves the node in unhashed state. */ static inline void hlist_del_init(struct hlist_node *n) { if (!hlist_unhashed(n)) { __hlist_del(n); INIT_HLIST_NODE(n); } } /** * hlist_add_head - add a new entry at the beginning of the hlist * @n: new entry to be added * @h: hlist head to add it after * * Insert a new entry after the specified head. * This is good for implementing stacks. */ static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) { struct hlist_node *first = h->first; n->next = first; if (first) first->pprev = &n->next; h->first = n; n->pprev = &h->first; } /** * hlist_add_before - add a new entry before the one specified * @n: new entry to be added * @next: hlist node to add it before, which must be non-NULL */ static inline void hlist_add_before(struct hlist_node *n, struct hlist_node *next) { n->pprev = next->pprev; n->next = next; next->pprev = &n->next; *(n->pprev) = n; } /** * hlist_add_behind - add a new entry after the one specified * @n: new entry to be added * @prev: hlist node to add it after, which must be non-NULL */ static inline void hlist_add_behind(struct hlist_node *n, struct hlist_node *prev) { n->next = prev->next; prev->next = n; n->pprev = &prev->next; if (n->next) n->next->pprev = &n->next; } /** * hlist_add_fake - create a fake hlist consisting of a single headless node * @n: Node to make a fake list out of * * This makes @n appear to be its own predecessor on a headless hlist. * The point of this is to allow things like hlist_del() to work correctly * in cases where there is no list. */ static inline void hlist_add_fake(struct hlist_node *n) { n->pprev = &n->next; } /** * hlist_fake: Is this node a fake hlist? * @h: Node to check for being a self-referential fake hlist. */ static inline bool hlist_fake(struct hlist_node *h) { return h->pprev == &h->next; } /** * hlist_is_singular_node - is node the only element of the specified hlist? * @n: Node to check for singularity. * @h: Header for potentially singular list. * * Check whether the node is the only node of the head without * accessing head, thus avoiding unnecessary cache misses. */ static inline bool hlist_is_singular_node(struct hlist_node *n, struct hlist_head *h) { return !n->next && n->pprev == &h->first; } /** * hlist_move_list - Move an hlist * @old: hlist_head for old list. * @new: hlist_head for new list. * * Move a list from one list head to another. Fixup the pprev * reference of the first entry if it exists. */ static inline void hlist_move_list(struct hlist_head *old, struct hlist_head *new) { new->first = old->first; if (new->first) new->first->pprev = &new->first; old->first = NULL; } #define hlist_entry(ptr, type, member) container_of(ptr,type,member) #define hlist_for_each(pos, head) \ for (pos = (head)->first; pos ; pos = pos->next) #define hlist_for_each_safe(pos, n, head) \ for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ pos = n) #define hlist_entry_safe(ptr, type, member) \ ({ typeof(ptr) ____ptr = (ptr); \ ____ptr ? hlist_entry(____ptr, type, member) : NULL; \ }) /** * hlist_for_each_entry - iterate over list of given type * @pos: the type * to use as a loop cursor. * @head: the head for your list. * @member: the name of the hlist_node within the struct. */ #define hlist_for_each_entry(pos, head, member) \ for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ pos; \ pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) /** * hlist_for_each_entry_continue - iterate over a hlist continuing after current point * @pos: the type * to use as a loop cursor. * @member: the name of the hlist_node within the struct. */ #define hlist_for_each_entry_continue(pos, member) \ for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member);\ pos; \ pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) /** * hlist_for_each_entry_from - iterate over a hlist continuing from current point * @pos: the type * to use as a loop cursor. * @member: the name of the hlist_node within the struct. */ #define hlist_for_each_entry_from(pos, member) \ for (; pos; \ pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) /** * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop cursor. * @n: a &struct hlist_node to use as temporary storage * @head: the head for your list. * @member: the name of the hlist_node within the struct. */ #define hlist_for_each_entry_safe(pos, n, head, member) \ for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\ pos && ({ n = pos->member.next; 1; }); \ pos = hlist_entry_safe(n, typeof(*pos), member)) #define list_len(pos, head, member) \ ({ \ size_t __list_len__ = 0; \ \ list_for_each_entry(pos, head, member) { \ (__list_len__)++; \ } \ \ __list_len__; \ }) #endif /* __LXC_HLIST_H */ lxc-4.0.12/src/lxc/mainloop.c0000644061062106075000000003251014176403775012673 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "log.h" #include "macro.h" #include "mainloop.h" #if HAVE_LIBURING #include #endif lxc_log_define(mainloop, lxc); #define CANCEL_RECEIVED (1 << 0) #define CANCEL_SUCCESS (1 << 1) struct mainloop_handler { int fd; void *data; lxc_mainloop_callback_t callback; lxc_mainloop_cleanup_t cleanup; const char *name; unsigned int flags; struct list_head head; }; #define MAX_EVENTS 10 static int __io_uring_disarm(struct lxc_async_descr *descr, struct mainloop_handler *handler); static int disarm_handler(struct lxc_async_descr *descr, struct mainloop_handler *handler, bool oneshot) { int ret = 0; if (descr->type == LXC_MAINLOOP_IO_URING) { /* * For a oneshot handler we don't have to do anything. If we * end up here we know that an event for this handler has been * generated before and since this is a oneshot handler it * means that it has been deactivated. So the only thing we * need to do is to call the registered cleanup handler and * remove the handler from the list. */ if (!oneshot) ret = __io_uring_disarm(descr, handler); } else { ret = epoll_ctl(descr->epfd, EPOLL_CTL_DEL, handler->fd, NULL); } if (ret < 0) return syswarn_ret(-1, "Failed to disarm %d for \"%s\" handler", handler->fd, handler->name); TRACE("Disarmed %d for \"%s\" handler", handler->fd, handler->name); return 0; } static void delete_handler(struct mainloop_handler *handler) { if (handler->cleanup) { int ret; ret = handler->cleanup(handler->fd, handler->data); if (ret < 0) SYSWARN("Failed to cleanup %d for \"%s\" handler", handler->fd, handler->name); } TRACE("Deleted %d for \"%s\" handler", handler->fd, handler->name); list_del(&handler->head); free(handler); } static inline void cleanup_handler(struct lxc_async_descr *descr, struct mainloop_handler *handler, bool oneshot) { if (disarm_handler(descr, handler, oneshot) == 0) delete_handler(handler); } #if !HAVE_LIBURING static inline int __lxc_mainloop_io_uring(struct lxc_async_descr *descr, int timeout_ms) { return ret_errno(ENOSYS); } static int __io_uring_arm(struct lxc_async_descr *descr, struct mainloop_handler *handler, bool oneshot) { return ret_errno(ENOSYS); } static int __io_uring_disarm(struct lxc_async_descr *descr, struct mainloop_handler *handler) { return ret_errno(ENOSYS); } static inline int __io_uring_open(struct lxc_async_descr *descr) { return ret_errno(ENOSYS); } #else /* !HAVE_LIBURING */ static inline int __io_uring_open(struct lxc_async_descr *descr) { int ret; *descr = (struct lxc_async_descr){ .epfd = -EBADF, }; descr->ring = mmap(NULL, sizeof(struct io_uring), PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE | MAP_ANONYMOUS, -1, 0); if (descr->ring == MAP_FAILED) return syserror("Failed to mmap io_uring memory"); ret = io_uring_queue_init(512, descr->ring, 0); if (ret) { SYSERROR("Failed to initialize io_uring instance"); goto on_error; } ret = io_uring_ring_dontfork(descr->ring); if (ret) { SYSERROR("Failed to prevent inheritance of io_uring mmaped region"); goto on_error; } descr->type = LXC_MAINLOOP_IO_URING; TRACE("Created io-uring instance"); return 0; on_error: ret = munmap(descr->ring, sizeof(struct io_uring)); if (ret < 0) SYSWARN("Failed to unmap io_uring mmaped memory"); return ret_errno(ENOSYS); } static int __io_uring_arm(struct lxc_async_descr *descr, struct mainloop_handler *handler, bool oneshot) { int ret; struct io_uring_sqe *sqe; sqe = io_uring_get_sqe(descr->ring); if (!sqe) return syserror_set(ENOENT, "Failed to get submission queue entry"); io_uring_prep_poll_add(sqe, handler->fd, EPOLLIN); /* * Raise IORING_POLL_ADD_MULTI to set up a multishot poll. The same sqe * will now produce multiple cqes. A cqe produced from a multishot sqe * will raise IORING_CQE_F_MORE in cqe->flags. * Some devices can't be used with IORING_POLL_ADD_MULTI. This can only * be detected at completion time. The IORING_CQE_F_MORE flag will not * raised in cqe->flags. This includes terminal devices. So * unfortunately we can't use multishot for them although we really * would like to. But instead we will need to resubmit them. The * io_uring based mainloop will deal cases whwere multishot doesn't * work and resubmit the request. The handler just needs to inform the * mainloop that it wants to keep the handler. */ if (!oneshot) sqe->len |= IORING_POLL_ADD_MULTI; io_uring_sqe_set_data(sqe, handler); ret = io_uring_submit(descr->ring); if (ret < 0) { if (!oneshot && ret == -EINVAL) { /* The kernel might not yet support multishot. */ sqe->len &= ~IORING_POLL_ADD_MULTI; ret = io_uring_submit(descr->ring); } } if (ret < 0) return syserror_ret(ret, "Failed to add \"%s\" handler", handler->name); TRACE("Added \"%s\" handler", handler->name); return 0; } static int __io_uring_disarm(struct lxc_async_descr *descr, struct mainloop_handler *handler) { int ret; struct io_uring_sqe *sqe; sqe = io_uring_get_sqe(descr->ring); if (!sqe) return syserror_set(ENOENT, "Failed to get submission queue entry"); io_uring_prep_poll_remove(sqe, handler); io_uring_sqe_set_data(sqe, handler); ret = io_uring_submit(descr->ring); if (ret < 0) return syserror_ret(ret, "Failed to remove \"%s\" handler", handler->name); TRACE("Removed handler \"%s\"", handler->name); return ret; } static void msec_to_ts(struct __kernel_timespec *ts, unsigned int timeout_ms) { ts->tv_sec = timeout_ms / 1000; ts->tv_nsec = (timeout_ms % 1000) * 1000000; } static int __lxc_mainloop_io_uring(struct lxc_async_descr *descr, int timeout_ms) { struct __kernel_timespec ts; if (timeout_ms >= 0) msec_to_ts(&ts, timeout_ms); for (;;) { int ret; __s32 res = 0; bool oneshot = false; struct io_uring_cqe *cqe = NULL; struct mainloop_handler *handler = NULL; if (timeout_ms >= 0) ret = io_uring_wait_cqe_timeout(descr->ring, &cqe, &ts); else ret = io_uring_wait_cqe(descr->ring, &cqe); if (ret < 0) { if (ret == -EINTR) continue; if (ret == -ETIME) return 0; return syserror_ret(ret, "Failed to wait for completion"); } ret = LXC_MAINLOOP_CONTINUE; oneshot = !(cqe->flags & IORING_CQE_F_MORE); res = cqe->res; handler = io_uring_cqe_get_data(cqe); io_uring_cqe_seen(descr->ring, cqe); if (res <= 0) { switch (res) { case 0: TRACE("Removed \"%s\" handler", handler->name); handler->flags |= CANCEL_SUCCESS; if (has_exact_flags(handler->flags, (CANCEL_SUCCESS | CANCEL_RECEIVED))) delete_handler(handler); break; case -EALREADY: TRACE("Repeat sqe remove request for \"%s\" handler", handler->name); break; case -ECANCELED: TRACE("Canceled \"%s\" handler", handler->name); handler->flags |= CANCEL_RECEIVED; if (has_exact_flags(handler->flags, (CANCEL_SUCCESS | CANCEL_RECEIVED))) delete_handler(handler); break; case -ENOENT: TRACE("No sqe for \"%s\" handler", handler->name); break; default: WARN("Received unexpected return value %d in cqe for \"%s\" handler", res, handler->name); break; } } else { ret = handler->callback(handler->fd, res, handler->data, descr); switch (ret) { case LXC_MAINLOOP_CONTINUE: /* We're operating in oneshot mode so we need to rearm. */ if (oneshot && __io_uring_arm(descr, handler, true)) return -1; break; case LXC_MAINLOOP_DISARM: /* * If this is a multhishot handler we need to * disarm it here. Actual cleanup happens * later. */ disarm_handler(descr, handler, oneshot); /* * If this is a oneshot handler we know it has * just run and we also know the above call was * a nop. So clean it up directly. */ if (oneshot) delete_handler(handler); break; case LXC_MAINLOOP_CLOSE: return log_trace(0, "Closing from \"%s\"", handler->name); case LXC_MAINLOOP_ERROR: return syserror_ret(-1, "Closing with error from \"%s\"", handler->name); default: WARN("Received unexpected return value %d from \"%s\" handler", ret, handler->name); break; } } if (list_empty(&descr->handlers)) return error_ret(0, "Closing because there are no more handlers"); } } #endif /* HAVE_LIBURING */ static int __lxc_mainloop_epoll(struct lxc_async_descr *descr, int timeout_ms) { for (;;) { int nfds; struct epoll_event events[MAX_EVENTS]; nfds = epoll_wait(descr->epfd, events, MAX_EVENTS, timeout_ms); if (nfds < 0) { if (errno == EINTR) continue; return -errno; } for (int i = 0; i < nfds; i++) { int ret; struct mainloop_handler *handler = events[i].data.ptr; /* If the handler returns a positive value, exit the * mainloop. */ ret = handler->callback(handler->fd, events[i].events, handler->data, descr); switch (ret) { case LXC_MAINLOOP_DISARM: cleanup_handler(descr, handler, false); __fallthrough; case LXC_MAINLOOP_CONTINUE: break; case LXC_MAINLOOP_CLOSE: return 0; case LXC_MAINLOOP_ERROR: return -1; } } if (nfds == 0) return 0; if (list_empty(&descr->handlers)) return 0; } } int lxc_mainloop(struct lxc_async_descr *descr, int timeout_ms) { if (descr->type == LXC_MAINLOOP_IO_URING) return __lxc_mainloop_io_uring(descr, timeout_ms); return __lxc_mainloop_epoll(descr, timeout_ms); } static int __lxc_mainloop_add_handler_events(struct lxc_async_descr *descr, int fd, int events, lxc_mainloop_callback_t callback, lxc_mainloop_cleanup_t cleanup, void *data, bool oneshot, const char *name) { __do_free struct mainloop_handler *handler = NULL; int ret; struct epoll_event ev; if (fd < 0) return ret_errno(EBADF); if (!callback || !cleanup || !events || !name) return ret_errno(EINVAL); handler = zalloc(sizeof(*handler)); if (!handler) return ret_errno(ENOMEM); handler->callback = callback; handler->cleanup = cleanup; handler->fd = fd; handler->data = data; handler->name = name; if (descr->type == LXC_MAINLOOP_IO_URING) { ret = __io_uring_arm(descr, handler, oneshot); } else { ev.events = events; ev.data.ptr = handler; ret = epoll_ctl(descr->epfd, EPOLL_CTL_ADD, fd, &ev); } if (ret < 0) return -errno; list_add_tail(&handler->head, &descr->handlers); move_ptr(handler); return 0; } int lxc_mainloop_add_handler_events(struct lxc_async_descr *descr, int fd, int events, lxc_mainloop_callback_t callback, lxc_mainloop_cleanup_t cleanup, void *data, const char *name) { return __lxc_mainloop_add_handler_events(descr, fd, events, callback, cleanup, data, false, name); } int lxc_mainloop_add_handler(struct lxc_async_descr *descr, int fd, lxc_mainloop_callback_t callback, lxc_mainloop_cleanup_t cleanup, void *data, const char *name) { return __lxc_mainloop_add_handler_events(descr, fd, EPOLLIN, callback, cleanup, data, false, name); } int lxc_mainloop_add_oneshot_handler(struct lxc_async_descr *descr, int fd, lxc_mainloop_callback_t callback, lxc_mainloop_cleanup_t cleanup, void *data, const char *name) { return __lxc_mainloop_add_handler_events(descr, fd, EPOLLIN, callback, cleanup, data, true, name); } int lxc_mainloop_del_handler(struct lxc_async_descr *descr, int fd) { int ret; struct mainloop_handler *handler; list_for_each_entry(handler, &descr->handlers, head) { if (handler->fd != fd) continue; if (descr->type == LXC_MAINLOOP_IO_URING) ret = __io_uring_disarm(descr, handler); else ret = epoll_ctl(descr->epfd, EPOLL_CTL_DEL, fd, NULL); if (ret < 0) return syserror("Failed to disarm \"%s\"", handler->name); /* * For io_uring the deletion happens at completion time. Either * we get ENOENT if the request was oneshot and it had already * triggered or we get ECANCELED for the original sqe and 0 for * the cancellation request. */ if (descr->type == LXC_MAINLOOP_EPOLL) { list_del(&handler->head); free(handler); } return 0; } return ret_errno(EINVAL); } static inline int __epoll_open(struct lxc_async_descr *descr) { *descr = (struct lxc_async_descr){ .epfd = -EBADF, }; descr->epfd = epoll_create1(EPOLL_CLOEXEC); if (descr->epfd < 0) return syserror("Failed to create epoll instance"); descr->type = LXC_MAINLOOP_EPOLL; TRACE("Created epoll instance"); return 0; } int lxc_mainloop_open(struct lxc_async_descr *descr) { int ret; ret = __io_uring_open(descr); if (ret == -ENOSYS) ret = __epoll_open(descr); if (ret < 0) return syserror("Failed to create mainloop instance"); INIT_LIST_HEAD(&descr->handlers); return 0; } void lxc_mainloop_close(struct lxc_async_descr *descr) { struct mainloop_handler *handler, *nhandler; list_for_each_entry_safe(handler, nhandler, &descr->handlers, head) { list_del(&handler->head); free(handler); } if (descr->type == LXC_MAINLOOP_IO_URING) { #if HAVE_LIBURING if (descr->ring) { io_uring_queue_exit(descr->ring); munmap(descr->ring, sizeof(struct io_uring)); } #else ERROR("Unsupported io_uring mainloop"); #endif } else { close_prot_errno_disarm(descr->epfd); } INIT_LIST_HEAD(&descr->handlers); } lxc-4.0.12/src/lxc/af_unix.c0000644061062106075000000003122614176403775012511 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "af_unix.h" #include "log.h" #include "macro.h" #include "memory_utils.h" #include "process_utils.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif lxc_log_define(af_unix, lxc); static ssize_t lxc_abstract_unix_set_sockaddr(struct sockaddr_un *addr, const char *path) { size_t len; if (!addr || !path) return ret_errno(EINVAL); /* Clear address structure */ memset(addr, 0, sizeof(*addr)); addr->sun_family = AF_UNIX; len = strlen(&path[1]); /* do not enforce \0-termination */ if (len >= INT_MAX || len >= sizeof(addr->sun_path)) return ret_errno(ENAMETOOLONG); /* do not enforce \0-termination */ memcpy(&addr->sun_path[1], &path[1], len); return len; } int lxc_abstract_unix_open(const char *path, int type, int flags) { __do_close int fd = -EBADF; int ret; ssize_t len; struct sockaddr_un addr; fd = socket(PF_UNIX, type | SOCK_CLOEXEC, 0); if (fd < 0) return -1; if (!path) return move_fd(fd); len = lxc_abstract_unix_set_sockaddr(&addr, path); if (len < 0) return -1; ret = bind(fd, (struct sockaddr *)&addr, offsetof(struct sockaddr_un, sun_path) + len + 1); if (ret < 0) return -1; if (type == SOCK_STREAM) { ret = listen(fd, 100); if (ret < 0) return -1; } return move_fd(fd); } void lxc_abstract_unix_close(int fd) { close(fd); } int lxc_abstract_unix_connect(const char *path) { __do_close int fd = -EBADF; int ret; ssize_t len; struct sockaddr_un addr; fd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0); if (fd < 0) return -1; len = lxc_abstract_unix_set_sockaddr(&addr, path); if (len < 0) return -1; ret = connect(fd, (struct sockaddr *)&addr, offsetof(struct sockaddr_un, sun_path) + len + 1); if (ret < 0) return -1; return move_fd(fd); } int lxc_abstract_unix_send_fds_iov(int fd, const int *sendfds, int num_sendfds, struct iovec *const iov, size_t iovlen) { __do_free char *cmsgbuf = NULL; int ret; struct msghdr msg = {}; struct cmsghdr *cmsg = NULL; size_t cmsgbufsize = CMSG_SPACE(num_sendfds * sizeof(int)); if (num_sendfds <= 0) return ret_errno(EINVAL); cmsgbuf = malloc(cmsgbufsize); if (!cmsgbuf) return ret_errno(-ENOMEM); msg.msg_control = cmsgbuf; msg.msg_controllen = cmsgbufsize; cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; cmsg->cmsg_len = CMSG_LEN(num_sendfds * sizeof(int)); msg.msg_controllen = cmsg->cmsg_len; memcpy(CMSG_DATA(cmsg), sendfds, num_sendfds * sizeof(int)); msg.msg_iov = iov; msg.msg_iovlen = iovlen; do { ret = sendmsg(fd, &msg, MSG_NOSIGNAL); } while (ret < 0 && errno == EINTR); return ret; } int lxc_abstract_unix_send_fds(int fd, const int *sendfds, int num_sendfds, void *data, size_t size) { char buf[1] = {}; struct iovec iov = { .iov_base = data ? data : buf, .iov_len = data ? size : sizeof(buf), }; return lxc_abstract_unix_send_fds_iov(fd, sendfds, num_sendfds, &iov, 1); } int lxc_unix_send_fds(int fd, int *sendfds, int num_sendfds, void *data, size_t size) { return lxc_abstract_unix_send_fds(fd, sendfds, num_sendfds, data, size); } int __lxc_abstract_unix_send_two_fds(int fd, int fd_first, int fd_second, void *data, size_t size) { int fd_send[2] = { fd_first, fd_second, }; return lxc_abstract_unix_send_fds(fd, fd_send, 2, data, size); } static ssize_t lxc_abstract_unix_recv_fds_iov(int fd, struct unix_fds *ret_fds, struct iovec *ret_iov, size_t size_ret_iov) { __do_free char *cmsgbuf = NULL; ssize_t ret; struct msghdr msg = {}; struct cmsghdr *cmsg = NULL; size_t cmsgbufsize = CMSG_SPACE(sizeof(struct ucred)) + CMSG_SPACE(ret_fds->fd_count_max * sizeof(int)); if (ret_fds->flags & ~UNIX_FDS_ACCEPT_MASK) return ret_errno(EINVAL); if (hweight32((ret_fds->flags & ~UNIX_FDS_ACCEPT_NONE)) > 1) return ret_errno(EINVAL); if (ret_fds->fd_count_max >= KERNEL_SCM_MAX_FD) return ret_errno(EINVAL); if (ret_fds->fd_count_ret != 0) return ret_errno(EINVAL); cmsgbuf = zalloc(cmsgbufsize); if (!cmsgbuf) return ret_errno(ENOMEM); msg.msg_control = cmsgbuf; msg.msg_controllen = cmsgbufsize; msg.msg_iov = ret_iov; msg.msg_iovlen = size_ret_iov; again: ret = recvmsg(fd, &msg, MSG_CMSG_CLOEXEC); if (ret < 0) { if (errno == EINTR) goto again; return syserror("Failed to receive response"); } if (ret == 0) return 0; /* If SO_PASSCRED is set we will always get a ucred message. */ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { __u32 idx; /* * This causes some compilers to complain about * increased alignment requirements but I haven't found * a better way to deal with this yet. Suggestions * welcome! */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" int *fds_raw = (int *)CMSG_DATA(cmsg); #pragma GCC diagnostic pop __u32 num_raw = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int); /* * We received an insane amount of file descriptors * which exceeds the kernel limit we know about so * close them and return an error. */ if (num_raw >= KERNEL_SCM_MAX_FD) { for (idx = 0; idx < num_raw; idx++) close(fds_raw[idx]); return syserror_set(-EFBIG, "Received excessive number of file descriptors"); } if (msg.msg_flags & MSG_CTRUNC) { for (idx = 0; idx < num_raw; idx++) close(fds_raw[idx]); return syserror_set(-EFBIG, "Control message was truncated; closing all fds and rejecting incomplete message"); } if (ret_fds->fd_count_max > num_raw) { if (!(ret_fds->flags & UNIX_FDS_ACCEPT_LESS)) { for (idx = 0; idx < num_raw; idx++) close(fds_raw[idx]); return syserror_set(-EINVAL, "Received fewer file descriptors than we expected %u != %u", ret_fds->fd_count_max, num_raw); } /* * Make sure any excess entries in the fd array * are set to -EBADF so our cleanup functions * can safely be called. */ for (idx = num_raw; idx < ret_fds->fd_count_max; idx++) ret_fds->fd[idx] = -EBADF; ret_fds->flags |= UNIX_FDS_RECEIVED_LESS; } else if (ret_fds->fd_count_max < num_raw) { if (!(ret_fds->flags & UNIX_FDS_ACCEPT_MORE)) { for (idx = 0; idx < num_raw; idx++) close(fds_raw[idx]); return syserror_set(-EINVAL, "Received more file descriptors than we expected %u != %u", ret_fds->fd_count_max, num_raw); } /* Make sure we close any excess fds we received. */ for (idx = ret_fds->fd_count_max; idx < num_raw; idx++) close(fds_raw[idx]); /* Cap the number of received file descriptors. */ num_raw = ret_fds->fd_count_max; ret_fds->flags |= UNIX_FDS_RECEIVED_MORE; } else { ret_fds->flags |= UNIX_FDS_RECEIVED_EXACT; } if (hweight32((ret_fds->flags & ~UNIX_FDS_ACCEPT_MASK)) > 1) { for (idx = 0; idx < num_raw; idx++) close(fds_raw[idx]); return syserror_set(-EINVAL, "Invalid flag combination; closing to not risk leaking fds %u != %u", ret_fds->fd_count_max, num_raw); } memcpy(ret_fds->fd, CMSG_DATA(cmsg), num_raw * sizeof(int)); ret_fds->fd_count_ret = num_raw; break; } } if (ret_fds->fd_count_ret == 0) { ret_fds->flags |= UNIX_FDS_RECEIVED_NONE; /* We expected to receive file descriptors. */ if ((ret_fds->flags & UNIX_FDS_ACCEPT_MASK) && !(ret_fds->flags & UNIX_FDS_ACCEPT_NONE)) return syserror_set(-EINVAL, "Received no file descriptors"); } return ret; } ssize_t lxc_abstract_unix_recv_fds(int fd, struct unix_fds *ret_fds, void *ret_data, size_t size_ret_data) { char buf[1] = {}; struct iovec iov = { .iov_base = ret_data ? ret_data : buf, .iov_len = ret_data ? size_ret_data : sizeof(buf), }; ssize_t ret; ret = lxc_abstract_unix_recv_fds_iov(fd, ret_fds, &iov, 1); if (ret < 0) return ret; return ret; } ssize_t lxc_abstract_unix_recv_one_fd(int fd, int *ret_fd, void *ret_data, size_t size_ret_data) { call_cleaner(put_unix_fds) struct unix_fds *fds = NULL; char buf[1] = {}; struct iovec iov = { .iov_base = ret_data ? ret_data : buf, .iov_len = ret_data ? size_ret_data : sizeof(buf), }; ssize_t ret; fds = &(struct unix_fds){ .fd_count_max = 1, }; ret = lxc_abstract_unix_recv_fds_iov(fd, fds, &iov, 1); if (ret < 0) return ret; if (ret == 0) return ret_errno(ENODATA); if (fds->fd_count_ret != fds->fd_count_max) *ret_fd = -EBADF; else *ret_fd = move_fd(fds->fd[0]); return ret; } ssize_t __lxc_abstract_unix_recv_two_fds(int fd, int *fd_first, int *fd_second, void *data, size_t size) { call_cleaner(put_unix_fds) struct unix_fds *fds = NULL; char buf[1] = {}; struct iovec iov = { .iov_base = data ?: buf, .iov_len = size ?: sizeof(buf), }; ssize_t ret; fds = &(struct unix_fds){ .fd_count_max = 2, }; ret = lxc_abstract_unix_recv_fds_iov(fd, fds, &iov, 1); if (ret < 0) return ret; if (ret == 0) return ret_errno(ENODATA); if (fds->fd_count_ret != fds->fd_count_max) { *fd_first = -EBADF; *fd_second = -EBADF; } else { *fd_first = move_fd(fds->fd[0]); *fd_second = move_fd(fds->fd[1]); } return 0; } int lxc_abstract_unix_send_credential(int fd, void *data, size_t size) { struct msghdr msg = {0}; struct iovec iov; struct cmsghdr *cmsg; struct ucred cred = { .pid = lxc_raw_getpid(), .uid = getuid(), .gid = getgid(), }; char cmsgbuf[CMSG_SPACE(sizeof(cred))] = {0}; char buf[1] = {0}; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_CREDENTIALS; memcpy(CMSG_DATA(cmsg), &cred, sizeof(cred)); msg.msg_name = NULL; msg.msg_namelen = 0; iov.iov_base = data ? data : buf; iov.iov_len = data ? size : sizeof(buf); msg.msg_iov = &iov; msg.msg_iovlen = 1; return sendmsg(fd, &msg, MSG_NOSIGNAL); } int lxc_abstract_unix_rcv_credential(int fd, void *data, size_t size) { struct msghdr msg = {0}; struct iovec iov; struct cmsghdr *cmsg; struct ucred cred; int ret; char cmsgbuf[CMSG_SPACE(sizeof(cred))] = {0}; char buf[1] = {0}; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_control = cmsgbuf; msg.msg_controllen = sizeof(cmsgbuf); iov.iov_base = data ? data : buf; iov.iov_len = data ? size : sizeof(buf); msg.msg_iov = &iov; msg.msg_iovlen = 1; ret = recvmsg(fd, &msg, 0); if (ret <= 0) return ret; cmsg = CMSG_FIRSTHDR(&msg); if (cmsg && cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)) && cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDENTIALS) { memcpy(&cred, CMSG_DATA(cmsg), sizeof(cred)); if (cred.uid && (cred.uid != getuid() || cred.gid != getgid())) return syserror_set(-EACCES, "Message denied for '%d/%d'", cred.uid, cred.gid); } return ret; } int lxc_unix_sockaddr(struct sockaddr_un *ret, const char *path) { size_t len; len = strlen(path); if (len == 0) return ret_errno(EINVAL); if (path[0] != '/' && path[0] != '@') return ret_errno(EINVAL); if (path[1] == '\0') return ret_errno(EINVAL); if (len + 1 > sizeof(ret->sun_path)) return ret_errno(EINVAL); *ret = (struct sockaddr_un){ .sun_family = AF_UNIX, }; if (path[0] == '@') { memcpy(ret->sun_path + 1, path + 1, len); return (int)(offsetof(struct sockaddr_un, sun_path) + len); } memcpy(ret->sun_path, path, len + 1); return (int)(offsetof(struct sockaddr_un, sun_path) + len + 1); } int lxc_unix_connect_type(struct sockaddr_un *addr, int type) { __do_close int fd = -EBADF; int ret; ssize_t len; fd = socket(AF_UNIX, type | SOCK_CLOEXEC, 0); if (fd < 0) return syserror("Failed to open new AF_UNIX socket"); if (addr->sun_path[0] == '\0') len = strlen(&addr->sun_path[1]); else len = strlen(&addr->sun_path[0]); ret = connect(fd, (struct sockaddr *)addr, offsetof(struct sockaddr_un, sun_path) + len); if (ret < 0) return syserror("Failed to connect AF_UNIX socket"); return move_fd(fd); } int lxc_unix_connect(struct sockaddr_un *addr) { return lxc_unix_connect_type(addr, SOCK_STREAM); } int lxc_socket_set_timeout(int fd, int rcv_timeout, int snd_timeout) { struct timeval out = {0}; int ret; out.tv_sec = snd_timeout; ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, (const void *)&out, sizeof(out)); if (ret < 0) return -1; out.tv_sec = rcv_timeout; ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const void *)&out, sizeof(out)); if (ret < 0) return -1; return 0; } lxc-4.0.12/src/lxc/criu.h0000644061062106075000000000075314176403775012030 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_CRIU_H #define __LXC_CRIU_H #include "config.h" #include #include "lxc.h" __hidden extern bool __criu_pre_dump(struct lxc_container *c, struct migrate_opts *opts); __hidden extern bool __criu_dump(struct lxc_container *c, struct migrate_opts *opts); __hidden extern bool __criu_restore(struct lxc_container *c, struct migrate_opts *opts); __hidden extern bool __criu_check_feature(uint64_t *features_to_check); #endif lxc-4.0.12/src/lxc/nl.c0000644061062106075000000001554314176403775011475 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "log.h" #include "nl.h" lxc_log_define(nl, lxc); static size_t nlmsg_len(const struct nlmsg *nlmsg) { return nlmsg->nlmsghdr->nlmsg_len - NLMSG_HDRLEN; } void *nlmsg_data(struct nlmsg *nlmsg) { char *data; data = ((char *)nlmsg) + NLMSG_HDRLEN; if (!nlmsg_len(nlmsg)) return ret_set_errno(NULL, EINVAL); return data; } static int nla_put(struct nlmsg *nlmsg, int attr, const void *data, size_t len) { struct rtattr *rta; size_t rtalen = RTA_LENGTH(len); size_t tlen = NLMSG_ALIGN(nlmsg->nlmsghdr->nlmsg_len) + RTA_ALIGN(rtalen); if (tlen > (size_t)nlmsg->cap) return ret_errno(ENOMEM); rta = NLMSG_TAIL(nlmsg->nlmsghdr); rta->rta_type = attr; rta->rta_len = rtalen; if (data && len) memcpy(RTA_DATA(rta), data, len); nlmsg->nlmsghdr->nlmsg_len = tlen; return 0; } int nla_put_buffer(struct nlmsg *nlmsg, int attr, const void *data, size_t size) { return nla_put(nlmsg, attr, data, size); } int nla_put_string(struct nlmsg *nlmsg, int attr, const char *string) { return nla_put(nlmsg, attr, string, strlen(string) + 1); } int nla_put_u32(struct nlmsg *nlmsg, int attr, int value) { return nla_put(nlmsg, attr, &value, sizeof(value)); } int nla_put_u16(struct nlmsg *nlmsg, int attr, unsigned short value) { return nla_put(nlmsg, attr, &value, 2); } int nla_put_attr(struct nlmsg *nlmsg, int attr) { return nla_put(nlmsg, attr, NULL, 0); } struct rtattr *nla_begin_nested(struct nlmsg *nlmsg, int attr) { struct rtattr *rtattr; rtattr = NLMSG_TAIL(nlmsg->nlmsghdr); if (nla_put_attr(nlmsg, attr)) return ret_set_errno(NULL, ENOMEM); return rtattr; } void nla_end_nested(struct nlmsg *nlmsg, struct rtattr *attr) { attr->rta_len = (void *)NLMSG_TAIL(nlmsg->nlmsghdr) - (void *)attr; } struct nlmsg *nlmsg_alloc(size_t size) { __do_free struct nlmsg *nlmsg = NULL; size_t len = NLMSG_HDRLEN + NLMSG_ALIGN(size); nlmsg = malloc(sizeof(struct nlmsg)); if (!nlmsg) return ret_set_errno(NULL, ENOMEM); nlmsg->nlmsghdr = malloc(len); if (!nlmsg->nlmsghdr) return ret_set_errno(NULL, ENOMEM); memset(nlmsg->nlmsghdr, 0, len); nlmsg->cap = len; nlmsg->nlmsghdr->nlmsg_len = NLMSG_HDRLEN; return move_ptr(nlmsg); } void *nlmsg_reserve(struct nlmsg *nlmsg, size_t len) { void *buf; size_t nlmsg_len = nlmsg->nlmsghdr->nlmsg_len; size_t tlen = NLMSG_ALIGN(len); if (nlmsg_len + tlen > (size_t)nlmsg->cap) return ret_set_errno(NULL, ENOMEM); buf = ((char *)(nlmsg->nlmsghdr)) + nlmsg_len; nlmsg->nlmsghdr->nlmsg_len += tlen; if (tlen > len) memset(buf + len, 0, tlen - len); return buf; } struct nlmsg *nlmsg_alloc_reserve(size_t size) { struct nlmsg *nlmsg; nlmsg = nlmsg_alloc(size); if (!nlmsg) return ret_set_errno(NULL, ENOMEM); /* Just set message length to cap directly. */ nlmsg->nlmsghdr->nlmsg_len = nlmsg->cap; return nlmsg; } void nlmsg_free(struct nlmsg *nlmsg) { if (nlmsg) { free(nlmsg->nlmsghdr); free(nlmsg); } } int __netlink_recv(struct nl_handler *handler, struct nlmsghdr *nlmsghdr) { int ret; struct sockaddr_nl nladdr; struct iovec iov = { .iov_base = nlmsghdr, .iov_len = nlmsghdr->nlmsg_len, }; struct msghdr msg = { .msg_name = &nladdr, .msg_namelen = sizeof(nladdr), .msg_iov = &iov, .msg_iovlen = 1, }; memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; nladdr.nl_pid = 0; nladdr.nl_groups = 0; again: ret = recvmsg(handler->fd, &msg, 0); if (ret < 0) { if (errno == EINTR) goto again; return ret_errno(errno); } if (!ret) return 0; if (msg.msg_flags & MSG_TRUNC && ((__u32)ret == nlmsghdr->nlmsg_len)) return ret_errno(EMSGSIZE); return ret; } int netlink_rcv(struct nl_handler *handler, struct nlmsg *answer) { return __netlink_recv(handler, answer->nlmsghdr); } int __netlink_send(struct nl_handler *handler, struct nlmsghdr *nlmsghdr) { int ret; struct sockaddr_nl nladdr; struct iovec iov = { .iov_base = nlmsghdr, .iov_len = nlmsghdr->nlmsg_len, }; struct msghdr msg = { .msg_name = &nladdr, .msg_namelen = sizeof(nladdr), .msg_iov = &iov, .msg_iovlen = 1, }; memset(&nladdr, 0, sizeof(nladdr)); nladdr.nl_family = AF_NETLINK; nladdr.nl_pid = 0; nladdr.nl_groups = 0; ret = sendmsg(handler->fd, &msg, MSG_NOSIGNAL); if (ret < 0) return ret_errno(errno); return ret; } extern int netlink_send(struct nl_handler *handler, struct nlmsg *nlmsg) { return __netlink_send(handler, nlmsg->nlmsghdr); } extern int __netlink_transaction(struct nl_handler *handler, struct nlmsghdr *request, struct nlmsghdr *answer) { int ret; ret = __netlink_send(handler, request); if (ret < 0) return ret; ret = __netlink_recv(handler, answer); if (ret < 0) return ret; if (answer->nlmsg_type == NLMSG_ERROR) { struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(answer); if (err->error < 0) return ret_errno(-err->error); } return 0; } extern int netlink_transaction(struct nl_handler *handler, struct nlmsg *request, struct nlmsg *answer) { return __netlink_transaction(handler, request->nlmsghdr, answer->nlmsghdr); } extern int netlink_open(struct nl_handler *handler, int protocol) { __do_close int fd = -EBADF; socklen_t socklen; int sndbuf = 32768; int rcvbuf = 32768; memset(handler, 0, sizeof(*handler)); handler->fd = -EBADF; fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol); if (fd < 0) return ret_errno(errno); if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) < 0) return ret_errno(errno); if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf,sizeof(rcvbuf)) < 0) return ret_errno(errno); memset(&handler->local, 0, sizeof(handler->local)); handler->local.nl_family = AF_NETLINK; handler->local.nl_groups = 0; if (bind(fd, (struct sockaddr*)&handler->local, sizeof(handler->local)) < 0) return ret_errno(errno); socklen = sizeof(handler->local); if (getsockname(fd, (struct sockaddr*)&handler->local, &socklen) < 0) return ret_errno(errno); if (socklen != sizeof(handler->local)) return ret_errno(EINVAL); if (handler->local.nl_family != AF_NETLINK) return ret_errno(EINVAL); handler->seq = time(NULL); handler->fd = move_fd(fd); return 0; } extern void netlink_close(struct nl_handler *handler) { close_prot_errno_disarm(handler->fd); } int addattr(struct nlmsghdr *n, size_t maxlen, int type, const void *data, size_t alen) { int len = RTA_LENGTH(alen); struct rtattr *rta; if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) return ret_errno(EMSGSIZE); rta = NLMSG_TAIL(n); rta->rta_type = type; rta->rta_len = len; if (alen) memcpy(RTA_DATA(rta), data, alen); n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len); return 0; } lxc-4.0.12/src/lxc/attach.c0000644061062106075000000014323514176403775012330 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "attach.h" #include "af_unix.h" #include "attach.h" #include "caps.h" #include "cgroups/cgroup.h" #include "cgroups/cgroup_utils.h" #include "commands.h" #include "conf.h" #include "confile.h" #include "log.h" #include "lsm/lsm.h" #include "lxclock.h" #include "lxcseccomp.h" #include "macro.h" #include "mainloop.h" #include "memory_utils.h" #include "mount_utils.h" #include "namespace.h" #include "process_utils.h" #include "sync.h" #include "syscall_wrappers.h" #include "terminal.h" #include "utils.h" lxc_log_define(attach, lxc); /* Define default options if no options are supplied by the user. */ static lxc_attach_options_t attach_static_default_options = LXC_ATTACH_OPTIONS_DEFAULT; /* * The context used to attach to the container. * @attach_flags : the attach flags specified in lxc_attach_options_t * @init_pid : the PID of the container's init process * @dfd_init_pid : file descriptor to /proc/@init_pid * __Must be closed in attach_context_security_barrier()__! * @dfd_self_pid : file descriptor to /proc/self * __Must be closed in attach_context_security_barrier()__! * @setup_ns_uid : if CLONE_NEWUSER is specified will contain the uid used * during attach setup. * @setup_ns_gid : if CLONE_NEWUSER is specified will contain the gid used * during attach setup. * @target_ns_uid : if CLONE_NEWUSER is specified the uid that the final * program will be run with. * @target_ns_gid : if CLONE_NEWUSER is specified the gid that the final * program will be run with. * @target_host_uid : if CLONE_NEWUSER is specified the uid that the final * program will be run with on the host. * @target_host_gid : if CLONE_NEWUSER is specified the gid that the final * program will be run with on the host. * @lsm_label : LSM label to be used for the attaching process * @container : the container we're attaching o * @personality : the personality to use for the final program * @capability : the capability mask of the @init_pid * @ns_inherited : flags of namespaces that the final program will inherit * from @init_pid * @ns_fd : file descriptors to @init_pid's namespaces * @core_sched_cookie : core scheduling cookie */ struct attach_context { unsigned int ns_clone_flags; unsigned int attach_flags; int init_pid; int init_pidfd; int dfd_init_pid; int dfd_self_pid; uid_t setup_ns_uid; gid_t setup_ns_gid; uid_t target_ns_uid; gid_t target_ns_gid; uid_t target_host_uid; uid_t target_host_gid; char *lsm_label; struct lxc_container *container; personality_t personality; unsigned long long capability_mask; int ns_inherited; int ns_fd[LXC_NS_MAX]; struct lsm_ops *lsm_ops; __u64 core_sched_cookie; }; static pid_t pidfd_get_pid(int dfd_init_pid, int pidfd) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; size_t len = 0; char path[STRLITERALLEN("fdinfo/") + INTTYPE_TO_STRLEN(int) + 1 ] = "fdinfo/"; int ret; if (dfd_init_pid < 0 || pidfd < 0) return ret_errno(EBADF); ret = strnprintf(path + STRLITERALLEN("fdinfo/"), INTTYPE_TO_STRLEN(int), "%d", pidfd); if (ret < 0) return ret_errno(EIO); f = fdopen_at(dfd_init_pid, path, "re", PROTECT_OPEN, PROTECT_LOOKUP_BENEATH); if (!f) return -errno; while (getline(&line, &len, f) != -1) { const char *prefix = "Pid:\t"; const size_t prefix_len = STRLITERALLEN("Pid:\t"); int pid = -ESRCH; char *slider = line; if (!strnequal(slider, prefix, prefix_len)) continue; slider += prefix_len; slider = lxc_trim_whitespace_in_place(slider); ret = lxc_safe_int(slider, &pid); if (ret) return -ret; return pid; } return ret_errno(ENOENT); } static inline bool sync_wake_pid(int fd, pid_t pid) { return lxc_write_nointr(fd, &pid, sizeof(pid_t)) == sizeof(pid_t); } static inline bool sync_wait_pid(int fd, pid_t *pid) { return lxc_read_nointr(fd, pid, sizeof(pid_t)) == sizeof(pid_t); } static inline bool sync_wake_fd(int fd, int fd_send) { return lxc_abstract_unix_send_fds(fd, &fd_send, 1, NULL, 0) > 0; } static inline bool sync_wait_fd(int fd, int *fd_recv) { return lxc_abstract_unix_recv_one_fd(fd, fd_recv, NULL, 0) > 0; } static inline bool attach_lsm(lxc_attach_options_t *options) { return (options->attach_flags & (LXC_ATTACH_LSM | LXC_ATTACH_LSM_LABEL)); } static struct attach_context *alloc_attach_context(void) { struct attach_context *ctx; ctx = zalloc(sizeof(struct attach_context)); if (!ctx) return ret_set_errno(NULL, ENOMEM); ctx->init_pid = -ESRCH; ctx->dfd_self_pid = -EBADF; ctx->dfd_init_pid = -EBADF; ctx->init_pidfd = -EBADF; ctx->setup_ns_uid = LXC_INVALID_UID; ctx->setup_ns_gid = LXC_INVALID_GID; ctx->target_ns_uid = LXC_INVALID_UID; ctx->target_ns_gid = LXC_INVALID_GID; ctx->target_host_uid = LXC_INVALID_UID; ctx->target_host_gid = LXC_INVALID_GID; ctx->core_sched_cookie = INVALID_SCHED_CORE_COOKIE; for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) ctx->ns_fd[i] = -EBADF; return ctx; } static int get_personality(const char *name, const char *lxcpath, personality_t *personality) { __do_free char *p = NULL; int ret; signed long per; p = lxc_cmd_get_config_item(name, "lxc.arch", lxcpath); if (!p) { *personality = LXC_ARCH_UNCHANGED; return 0; } ret = lxc_config_parse_arch(p, &per); if (ret < 0) return syserror("Failed to parse personality"); *personality = per; return 0; } static int userns_setup_ids(struct attach_context *ctx, lxc_attach_options_t *options) { __do_free char *line = NULL; __do_fclose FILE *f_gidmap = NULL, *f_uidmap = NULL; size_t len = 0; uid_t init_ns_uid = LXC_INVALID_UID; gid_t init_ns_gid = LXC_INVALID_GID; uid_t nsuid, hostuid, range_uid; gid_t nsgid, hostgid, range_gid; if (!(options->namespaces & CLONE_NEWUSER)) return 0; f_uidmap = fdopen_at(ctx->dfd_init_pid, "uid_map", "re", PROTECT_OPEN, PROTECT_LOOKUP_BENEATH); if (!f_uidmap) return syserror("Failed to open uid_map"); while (getline(&line, &len, f_uidmap) != -1) { if (sscanf(line, "%u %u %u", &nsuid, &hostuid, &range_uid) != 3) continue; if (0 >= nsuid && 0 < nsuid + range_uid) { ctx->setup_ns_uid = 0; TRACE("Container has mapping for uid 0"); break; } if (ctx->target_host_uid >= hostuid && ctx->target_host_uid < hostuid + range_uid) { init_ns_uid = (ctx->target_host_uid - hostuid) + nsuid; TRACE("Container runs with uid %d", init_ns_uid); } } f_gidmap = fdopen_at(ctx->dfd_init_pid, "gid_map", "re", PROTECT_OPEN, PROTECT_LOOKUP_BENEATH); if (!f_gidmap) return syserror("Failed to open gid_map"); while (getline(&line, &len, f_gidmap) != -1) { if (sscanf(line, "%u %u %u", &nsgid, &hostgid, &range_gid) != 3) continue; if (0 >= nsgid && 0 < nsgid + range_gid) { ctx->setup_ns_gid = 0; TRACE("Container has mapping for gid 0"); break; } if (ctx->target_host_gid >= hostgid && ctx->target_host_gid < hostgid + range_gid) { init_ns_gid = (ctx->target_host_gid - hostgid) + nsgid; TRACE("Container runs with gid %d", init_ns_gid); } } if (ctx->setup_ns_uid == LXC_INVALID_UID) ctx->setup_ns_uid = init_ns_uid; if (ctx->setup_ns_gid == LXC_INVALID_UID) ctx->setup_ns_gid = init_ns_gid; return 0; } static void userns_target_ids(struct attach_context *ctx, lxc_attach_options_t *options) { if (options->uid != LXC_INVALID_UID) ctx->target_ns_uid = options->uid; else if (options->namespaces & CLONE_NEWUSER) ctx->target_ns_uid = ctx->setup_ns_uid; else ctx->target_ns_uid = 0; if (ctx->target_ns_uid == LXC_INVALID_UID) WARN("Invalid uid specified"); if (options->gid != LXC_INVALID_GID) ctx->target_ns_gid = options->gid; else if (options->namespaces & CLONE_NEWUSER) ctx->target_ns_gid = ctx->setup_ns_gid; else ctx->target_ns_gid = 0; if (ctx->target_ns_gid == LXC_INVALID_GID) WARN("Invalid gid specified"); } static int parse_init_status(struct attach_context *ctx, lxc_attach_options_t *options) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; size_t len = 0; bool caps_found = false; int ret; f = fdopen_at(ctx->dfd_init_pid, "status", "re", PROTECT_OPEN, PROTECT_LOOKUP_BENEATH); if (!f) return syserror("Failed to open status file"); while (getline(&line, &len, f) != -1) { signed long value = -1; /* * Format is: real, effective, saved set user, fs we only care * about real uid. */ ret = sscanf(line, "Uid: %ld", &value); if (ret != EOF && ret == 1) { ctx->target_host_uid = (uid_t)value; TRACE("Container's init process runs with hostuid %d", ctx->target_host_uid); goto next; } ret = sscanf(line, "Gid: %ld", &value); if (ret != EOF && ret == 1) { ctx->target_host_gid = (gid_t)value; TRACE("Container's init process runs with hostgid %d", ctx->target_host_gid); goto next; } ret = sscanf(line, "CapBnd: %llx", &ctx->capability_mask); if (ret != EOF && ret == 1) { caps_found = true; goto next; } next: if (ctx->target_host_uid != LXC_INVALID_UID && ctx->target_host_gid != LXC_INVALID_GID && caps_found) break; } ret = userns_setup_ids(ctx, options); if (ret) return syserror_ret(ret, "Failed to get setup ids"); userns_target_ids(ctx, options); return 0; } static bool pidfd_setns_supported(struct attach_context *ctx) { int ret; /* * The ability to attach to time namespaces came after the introduction * of of using pidfds for attaching to namespaces. To avoid having to * special-case both CLONE_NEWUSER and CLONE_NEWTIME handling, let's * use CLONE_NEWTIME as gatekeeper. */ if (ctx->init_pidfd >= 0) ret = setns(ctx->init_pidfd, CLONE_NEWTIME); else ret = -EOPNOTSUPP; TRACE("Attaching to namespaces via pidfds %s", ret ? "unsupported" : "supported"); return ret == 0; } static int get_attach_context(struct attach_context *ctx, struct lxc_container *container, lxc_attach_options_t *options) { __do_free char *lsm_label = NULL; int ret; char path[LXC_PROC_PID_LEN]; ctx->container = container; ctx->attach_flags = options->attach_flags; ctx->dfd_self_pid = open_at(-EBADF, "/proc/self", PROTECT_OPATH_FILE & ~O_NOFOLLOW, (PROTECT_LOOKUP_ABSOLUTE_WITH_SYMLINKS & ~RESOLVE_NO_XDEV), 0); if (ctx->dfd_self_pid < 0) return syserror("Failed to open /proc/self"); ctx->init_pidfd = lxc_cmd_get_init_pidfd(container->name, container->config_path); if (ctx->init_pidfd >= 0) ctx->init_pid = pidfd_get_pid(ctx->dfd_self_pid, ctx->init_pidfd); else ctx->init_pid = lxc_cmd_get_init_pid(container->name, container->config_path); if (ctx->init_pid < 0) return syserror_ret(-1, "Failed to get init pid"); ret = lxc_cmd_get_clone_flags(container->name, container->config_path); if (ret < 0) SYSERROR("Failed to retrieve namespace flags"); ctx->ns_clone_flags = ret; ret = core_scheduling_cookie_get(ctx->init_pid, &ctx->core_sched_cookie); if (ret || !core_scheduling_cookie_valid(ctx->core_sched_cookie)) INFO("Container does not run in a separate core scheduling domain"); else INFO("Container runs in separate core scheduling domain %llu", (llu)ctx->core_sched_cookie); ret = strnprintf(path, sizeof(path), "/proc/%d", ctx->init_pid); if (ret < 0) return ret_errno(EIO); ctx->dfd_init_pid = open_at(-EBADF, path, PROTECT_OPATH_DIRECTORY, (PROTECT_LOOKUP_ABSOLUTE & ~RESOLVE_NO_XDEV), 0); if (ctx->dfd_init_pid < 0) return syserror("Failed to open /proc/%d", ctx->init_pid); if (ctx->init_pidfd >= 0) { ret = lxc_raw_pidfd_send_signal(ctx->init_pidfd, 0, NULL, 0); if (ret) return syserror("Container process exited or PID has been recycled"); else TRACE("Container process still running and PID was not recycled"); if (!pidfd_setns_supported(ctx)) { /* We can't risk leaking file descriptors during attach. */ if (close(ctx->init_pidfd)) return syserror("Failed to close pidfd"); ctx->init_pidfd = -EBADF; TRACE("Attaching to namespaces via pidfds not supported"); } } /* Determine which namespaces the container was created with. */ if (options->namespaces == -1) { options->namespaces = ctx->ns_clone_flags; if (options->namespaces == -1) return syserror_set(-EINVAL, "Failed to automatically determine the namespaces which the container uses"); for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) { if (ns_info[i].clone_flag & CLONE_NEWCGROUP) if (!(options->attach_flags & LXC_ATTACH_MOVE_TO_CGROUP) || !cgns_supported()) continue; if (ns_info[i].clone_flag & options->namespaces) continue; ctx->ns_inherited |= ns_info[i].clone_flag; } } ret = parse_init_status(ctx, options); if (ret) return syserror("Failed to open parse file"); ctx->lsm_ops = lsm_init_static(); if (attach_lsm(options)) { if (ctx->attach_flags & LXC_ATTACH_LSM_LABEL) lsm_label = options->lsm_label; else lsm_label = ctx->lsm_ops->process_label_get_at(ctx->lsm_ops, ctx->dfd_init_pid); if (!lsm_label) WARN("No security context received"); else INFO("Retrieved security context %s", lsm_label); } ret = get_personality(container->name, container->config_path, &ctx->personality); if (ret) return syserror_ret(ret, "Failed to get personality of the container"); if (!ctx->container->lxc_conf) { ctx->container->lxc_conf = lxc_conf_init(); if (!ctx->container->lxc_conf) return syserror_set(-ENOMEM, "Failed to allocate new lxc config"); } ctx->lsm_label = move_ptr(lsm_label); return 0; } static int same_nsfd(int dfd_pid1, int dfd_pid2, const char *ns_path) { int ret; struct stat ns_st1, ns_st2; ret = fstatat(dfd_pid1, ns_path, &ns_st1, 0); if (ret) return -errno; ret = fstatat(dfd_pid2, ns_path, &ns_st2, 0); if (ret) return -errno; /* processes are in the same namespace */ if ((ns_st1.st_dev == ns_st2.st_dev) && (ns_st1.st_ino == ns_st2.st_ino)) return 1; return 0; } static int same_ns(int dfd_pid1, int dfd_pid2, const char *ns_path) { __do_close int ns_fd2 = -EBADF; int ret = -1; ns_fd2 = open_at(dfd_pid2, ns_path, PROTECT_OPEN_WITH_TRAILING_SYMLINKS, (PROTECT_LOOKUP_BENEATH_WITH_MAGICLINKS & ~(RESOLVE_NO_XDEV | RESOLVE_BENEATH)), 0); if (ns_fd2 < 0) { if (errno == ENOENT) return -ENOENT; return syserror("Failed to open %d(%s)", dfd_pid2, ns_path); } ret = same_nsfd(dfd_pid1, dfd_pid2, ns_path); switch (ret) { case -ENOENT: __fallthrough; case 1: return ret_errno(ENOENT); case 0: /* processes are in different namespaces */ return move_fd(ns_fd2); } return ret; } static int __prepare_namespaces_pidfd(struct attach_context *ctx) { for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) { int ret; ret = same_nsfd(ctx->dfd_self_pid, ctx->dfd_init_pid, ns_info[i].proc_path); switch (ret) { case -ENOENT: __fallthrough; case 1: ctx->ns_inherited &= ~ns_info[i].clone_flag; TRACE("Shared %s namespace doesn't need attach", ns_info[i].proc_name); continue; case 0: TRACE("Different %s namespace needs attach", ns_info[i].proc_name); continue; } return syserror("Failed to determine whether %s namespace is shared", ns_info[i].proc_name); } return 0; } static int __prepare_namespaces_nsfd(struct attach_context *ctx, lxc_attach_options_t *options) { for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) { lxc_namespace_t j; if (options->namespaces & ns_info[i].clone_flag) ctx->ns_fd[i] = open_at(ctx->dfd_init_pid, ns_info[i].proc_path, PROTECT_OPEN_WITH_TRAILING_SYMLINKS, (PROTECT_LOOKUP_BENEATH_WITH_MAGICLINKS & ~(RESOLVE_NO_XDEV | RESOLVE_BENEATH)), 0); else if (ctx->ns_inherited & ns_info[i].clone_flag) ctx->ns_fd[i] = same_ns(ctx->dfd_self_pid, ctx->dfd_init_pid, ns_info[i].proc_path); else continue; if (ctx->ns_fd[i] >= 0) continue; if (ctx->ns_fd[i] == -ENOENT) { ctx->ns_inherited &= ~ns_info[i].clone_flag; continue; } /* We failed to preserve the namespace. */ SYSERROR("Failed to preserve %s namespace of %d", ns_info[i].proc_name, ctx->init_pid); /* Close all already opened file descriptors before we return an * error, so we don't leak them. */ for (j = 0; j < i; j++) close_prot_errno_disarm(ctx->ns_fd[j]); return ret_errno(EINVAL); } return 0; } static int prepare_namespaces(struct attach_context *ctx, lxc_attach_options_t *options) { if (ctx->init_pidfd < 0) return __prepare_namespaces_nsfd(ctx, options); return __prepare_namespaces_pidfd(ctx); } static inline void put_namespaces(struct attach_context *ctx) { if (ctx->init_pidfd < 0) { for (int i = 0; i < LXC_NS_MAX; i++) close_prot_errno_disarm(ctx->ns_fd[i]); } } static int __attach_namespaces_pidfd(struct attach_context *ctx, lxc_attach_options_t *options) { unsigned int ns_flags = options->namespaces | ctx->ns_inherited; int ret; /* The common case is to attach to all namespaces. */ ret = setns(ctx->init_pidfd, ns_flags); if (ret) return syserror("Failed to attach to namespaces via pidfd"); /* We can't risk leaking file descriptors into the container. */ if (close(ctx->init_pidfd)) return syserror("Failed to close pidfd"); ctx->init_pidfd = -EBADF; return log_trace(0, "Attached to container namespaces via pidfd"); } static int __attach_namespaces_nsfd(struct attach_context *ctx, lxc_attach_options_t *options) { int fret = 0; for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) { int ret; if (ctx->ns_fd[i] < 0) continue; ret = setns(ctx->ns_fd[i], ns_info[i].clone_flag); if (ret) return syserror("Failed to attach to %s namespace of %d", ns_info[i].proc_name, ctx->init_pid); if (close(ctx->ns_fd[i])) { fret = -errno; SYSERROR("Failed to close file descriptor for %s namespace", ns_info[i].proc_name); } ctx->ns_fd[i] = -EBADF; } return fret; } static int attach_namespaces(struct attach_context *ctx, lxc_attach_options_t *options) { if (lxc_log_trace()) { for (lxc_namespace_t i = 0; i < LXC_NS_MAX; i++) { if (ns_info[i].clone_flag & options->namespaces) { TRACE("Attaching to %s namespace", ns_info[i].proc_name); continue; } if (ns_info[i].clone_flag & ctx->ns_inherited) { TRACE("Sharing %s namespace", ns_info[i].proc_name); continue; } TRACE("Inheriting %s namespace", ns_info[i].proc_name); } } if (ctx->init_pidfd < 0) return __attach_namespaces_nsfd(ctx, options); return __attach_namespaces_pidfd(ctx, options); } static void put_attach_context(struct attach_context *ctx) { if (ctx) { if (!(ctx->attach_flags & LXC_ATTACH_LSM_LABEL)) free_disarm(ctx->lsm_label); close_prot_errno_disarm(ctx->dfd_init_pid); if (ctx->container) { lxc_container_put(ctx->container); ctx->container = NULL; } put_namespaces(ctx); free(ctx); } } /* * Place anything in here that needs to be get rid of before we move into the * container's context and fail hard if we can't. */ static bool attach_context_security_barrier(struct attach_context *ctx) { if (ctx) { if (close(ctx->dfd_self_pid)) return false; ctx->dfd_self_pid = -EBADF; if (close(ctx->dfd_init_pid)) return false; ctx->dfd_init_pid = -EBADF; } return true; } int lxc_attach_remount_sys_proc(void) { int ret; ret = unshare(CLONE_NEWNS); if (ret < 0) return syserror("Failed to unshare mount namespace"); if (detect_shared_rootfs() && mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL)) SYSERROR("Failed to recursively turn root mount tree into dependent mount. Continuing..."); /* Assume /proc is always mounted, so remount it. */ ret = umount2("/proc", MNT_DETACH); if (ret < 0) return syserror("Failed to unmount /proc"); ret = mount("none", "/proc", "proc", 0, NULL); if (ret < 0) return syserror("Failed to remount /proc"); /* * Try to umount /sys. If it's not a mount point, we'll get EINVAL, then * we ignore it because it may not have been mounted in the first place. */ ret = umount2("/sys", MNT_DETACH); if (ret < 0 && errno != EINVAL) return syserror("Failed to unmount /sys"); /* Remount it. */ if (ret == 0 && mount("none", "/sys", "sysfs", 0, NULL)) return syserror("Failed to remount /sys"); return 0; } static int drop_capabilities(struct attach_context *ctx) { int ret; __u32 last_cap; ret = lxc_caps_last_cap(&last_cap); if (ret) return syserror_ret(ret, "%d - Failed to drop capabilities", ret); for (__u32 cap = 0; cap <= last_cap; cap++) { if (ctx->capability_mask & (1LL << cap)) continue; if (prctl(PR_CAPBSET_DROP, prctl_arg(cap), prctl_arg(0), prctl_arg(0), prctl_arg(0))) return syserror("Failed to drop capability %d", cap); TRACE("Dropped capability %d", cap); } return 0; } static int lxc_attach_set_environment(struct attach_context *ctx, enum lxc_attach_env_policy_t policy, char **extra_env, char **extra_keep) { int ret; if (policy == LXC_ATTACH_CLEAR_ENV) { int path_kept = 0; char **extra_keep_store = NULL; if (extra_keep) { size_t count, i; for (count = 0; extra_keep[count]; count++) ; extra_keep_store = zalloc(count * sizeof(char *)); if (!extra_keep_store) return -1; for (i = 0; i < count; i++) { char *v = getenv(extra_keep[i]); if (v) { extra_keep_store[i] = strdup(v); if (!extra_keep_store[i]) { while (i > 0) free(extra_keep_store[--i]); free(extra_keep_store); return -1; } if (strequal(extra_keep[i], "PATH")) path_kept = 1; } } } if (clearenv()) { if (extra_keep_store) { char **p; for (p = extra_keep_store; *p; p++) free(*p); free(extra_keep_store); } return syserror("Failed to clear environment"); } if (extra_keep_store) { size_t i; for (i = 0; extra_keep[i]; i++) { if (extra_keep_store[i]) { ret = setenv(extra_keep[i], extra_keep_store[i], 1); if (ret < 0) SYSWARN("Failed to set environment variable"); } free(extra_keep_store[i]); } free(extra_keep_store); } /* Always set a default path; shells and execlp tend to be fine * without it, but there is a disturbing number of C programs * out there that just assume that getenv("PATH") is never NULL * and then die a painful segfault death. */ if (!path_kept) { ret = setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 1); if (ret < 0) SYSWARN("Failed to set environment variable"); } } ret = putenv("container=lxc"); if (ret < 0) return log_warn(-1, "Failed to set environment variable"); /* Set container environment variables.*/ if (ctx->container->lxc_conf) { ret = lxc_set_environment(ctx->container->lxc_conf); if (ret < 0) return -1; } /* Set extra environment variables. */ if (extra_env) { for (; *extra_env; extra_env++) { char *p; /* We just assume the user knows what they are doing, so * we don't do any checks. */ p = strdup(*extra_env); if (!p) return -1; ret = putenv(p); if (ret < 0) SYSWARN("Failed to set environment variable"); } } return 0; } static char *lxc_attach_getpwshell(uid_t uid) { __do_free char *line = NULL, *result = NULL; __do_fclose FILE *pipe_f = NULL; int fd, ret; pid_t pid; int pipes[2]; bool found = false; size_t line_bufsz = 0; /* We need to fork off a process that runs the getent program, and we * need to capture its output, so we use a pipe for that purpose. */ ret = pipe2(pipes, O_CLOEXEC); if (ret < 0) return NULL; pid = fork(); if (pid < 0) { close(pipes[0]); close(pipes[1]); return NULL; } if (!pid) { char uid_buf[32]; char *arguments[] = { "getent", "passwd", uid_buf, NULL }; close(pipes[0]); /* We want to capture stdout. */ ret = dup2(pipes[1], STDOUT_FILENO); close(pipes[1]); if (ret < 0) _exit(EXIT_FAILURE); /* Get rid of stdin/stderr, so we try to associate it with * /dev/null. */ fd = open_devnull(); if (fd < 0) { close(STDIN_FILENO); close(STDERR_FILENO); } else { (void)dup3(fd, STDIN_FILENO, O_CLOEXEC); (void)dup3(fd, STDERR_FILENO, O_CLOEXEC); close(fd); } /* Finish argument list. */ ret = strnprintf(uid_buf, sizeof(uid_buf), "%ld", (long)uid); if (ret <= 0) _exit(EXIT_FAILURE); /* Try to run getent program. */ (void)execvp("getent", arguments); _exit(EXIT_FAILURE); } close(pipes[1]); pipe_f = fdopen(pipes[0], "re"); if (!pipe_f) { close(pipes[0]); goto reap_child; } /* Transfer ownership of pipes[0] to pipe_f. */ move_fd(pipes[0]); while (getline(&line, &line_bufsz, pipe_f) != -1) { int i; long value; char *token; char *endptr = NULL, *saveptr = NULL; /* If we already found something, just continue to read * until the pipe doesn't deliver any more data, but * don't modify the existing data structure. */ if (found) continue; if (!line) continue; /* Trim line on the right hand side. */ for (i = strlen(line); i > 0 && (line[i - 1] == '\n' || line[i - 1] == '\r'); --i) line[i - 1] = '\0'; /* Split into tokens: first: user name. */ token = strtok_r(line, ":", &saveptr); if (!token) continue; /* next: placeholder password field */ token = strtok_r(NULL, ":", &saveptr); if (!token) continue; /* next: user id */ token = strtok_r(NULL, ":", &saveptr); value = token ? strtol(token, &endptr, 10) : 0; if (!token || !endptr || *endptr || value == LONG_MIN || value == LONG_MAX) continue; /* placeholder conherence check: user id matches */ if ((uid_t)value != uid) continue; /* skip fields: gid, gecos, dir, go to next field 'shell' */ for (i = 0; i < 4; i++) { token = strtok_r(NULL, ":", &saveptr); if (!token) continue; } if (!token) continue; free_disarm(result); result = strdup(token); /* Sanity check that there are no fields after that. */ token = strtok_r(NULL, ":", &saveptr); if (token) continue; found = true; } reap_child: ret = wait_for_pid(pid); if (ret < 0) return NULL; if (!found) return NULL; return move_ptr(result); } static bool fetch_seccomp(struct lxc_container *c, lxc_attach_options_t *options) { __do_free char *path = NULL; int ret; bool bret; if (!attach_lsm(options)) { free_disarm(c->lxc_conf->seccomp.seccomp); return true; } /* Remove current setting. */ if (!c->set_config_item(c, "lxc.seccomp.profile", "") && !c->set_config_item(c, "lxc.seccomp", "")) return false; /* Fetch the current profile path over the cmd interface. */ path = c->get_running_config_item(c, "lxc.seccomp.profile"); if (!path) { INFO("Failed to retrieve lxc.seccomp.profile"); path = c->get_running_config_item(c, "lxc.seccomp"); if (!path) return log_info(true, "Failed to retrieve lxc.seccomp"); } /* Copy the value into the new lxc_conf. */ bret = c->set_config_item(c, "lxc.seccomp.profile", path); if (!bret) return false; /* Attempt to parse the resulting config. */ ret = lxc_read_seccomp_config(c->lxc_conf); if (ret < 0) return log_error(false, "Failed to retrieve seccomp policy"); return log_info(true, "Retrieved seccomp policy"); } static bool no_new_privs(struct lxc_container *c, lxc_attach_options_t *options) { __do_free char *val = NULL; /* Remove current setting. */ if (!c->set_config_item(c, "lxc.no_new_privs", "")) return log_info(false, "Failed to unset lxc.no_new_privs"); /* Retrieve currently active setting. */ val = c->get_running_config_item(c, "lxc.no_new_privs"); if (!val) return log_info(false, "Failed to retrieve lxc.no_new_privs"); /* Set currently active setting. */ return c->set_config_item(c, "lxc.no_new_privs", val); } struct attach_payload { int ipc_socket; int terminal_pts_fd; lxc_attach_options_t *options; struct attach_context *ctx; lxc_attach_exec_t exec_function; void *exec_payload; }; static void put_attach_payload(struct attach_payload *p) { if (p) { close_prot_errno_disarm(p->ipc_socket); close_prot_errno_disarm(p->terminal_pts_fd); put_attach_context(p->ctx); p->ctx = NULL; } } __noreturn static void do_attach(struct attach_payload *ap) { lxc_attach_exec_t attach_function = move_ptr(ap->exec_function); void *attach_function_args = move_ptr(ap->exec_payload); int fd_lsm, ret; lxc_attach_options_t* options = ap->options; struct attach_context *ctx = ap->ctx; struct lxc_conf *conf = ctx->container->lxc_conf; /* * We currently artificially restrict core scheduling to be a pid * namespace concept since this makes the code easier. We can revisit * this no problem and make this work with shared pid namespaces as * well. This check here makes sure that the container was created with * a separate pid namespace (ctx->ns_clone_flags) and whether we are * actually attaching to this pid namespace (options->namespaces). */ if (core_scheduling_cookie_valid(ctx->core_sched_cookie) && (ctx->ns_clone_flags & CLONE_NEWPID) && (options->namespaces & CLONE_NEWPID)) { __u64 core_sched_cookie; ret = core_scheduling_cookie_share_with(1); if (ret < 0) { SYSERROR("Failed to join core scheduling domain of %d", ctx->init_pid); goto on_error; } ret = core_scheduling_cookie_get(getpid(), &core_sched_cookie); if (ret || !core_scheduling_cookie_valid(core_sched_cookie) || (ctx->core_sched_cookie != core_sched_cookie)) { SYSERROR("Invalid core scheduling domain cookie %llu != %llu", (llu)core_sched_cookie, (llu)ctx->core_sched_cookie); goto on_error; } INFO("Joined core scheduling domain of %d with cookie %lld", ctx->init_pid, (llu)core_sched_cookie); } /* A description of the purpose of this functionality is provided in the * lxc-attach(1) manual page. We have to remount here and not in the * parent process, otherwise /proc may not properly reflect the new pid * namespace. */ if (!(options->namespaces & CLONE_NEWNS) && (options->attach_flags & LXC_ATTACH_REMOUNT_PROC_SYS)) { ret = lxc_attach_remount_sys_proc(); if (ret < 0) goto on_error; TRACE("Remounted \"/proc\" and \"/sys\""); } /* Now perform additional attachments. */ if (options->attach_flags & LXC_ATTACH_SET_PERSONALITY) { long new_personality; if (options->personality == LXC_ATTACH_DETECT_PERSONALITY) new_personality = ctx->personality; else new_personality = options->personality; if (new_personality != LXC_ARCH_UNCHANGED) { ret = lxc_personality(new_personality); if (ret < 0) goto on_error; TRACE("Set new personality"); } } if (options->attach_flags & LXC_ATTACH_DROP_CAPABILITIES) { ret = drop_capabilities(ctx); if (ret < 0) goto on_error; TRACE("Dropped capabilities"); } /* Always set the environment (specify (LXC_ATTACH_KEEP_ENV, NULL, NULL) * if you want this to be a no-op). */ ret = lxc_attach_set_environment(ctx, options->env_policy, options->extra_env_vars, options->extra_keep_env); if (ret < 0) goto on_error; TRACE("Set up environment"); /* * This remark only affects fully unprivileged containers: * Receive fd for LSM security module before we set{g,u}id(). The reason * is that on set{g,u}id() the kernel will a) make us undumpable and b) * we will change our effective uid. This means our effective uid will * be different from the effective uid of the process that created us * which means that this processs no longer has capabilities in our * namespace including CAP_SYS_PTRACE. This means we will not be able to * read and /proc/ files for the process anymore when /proc is * mounted with hidepid={1,2}. So let's get the lsm label fd before the * set{g,u}id(). */ if (attach_lsm(options) && ctx->lsm_label) { if (!sync_wait_fd(ap->ipc_socket, &fd_lsm)) { SYSERROR("Failed to receive lsm label fd"); goto on_error; } TRACE("Received LSM label file descriptor %d from parent", fd_lsm); } if (options->stdin_fd > 0 && isatty(options->stdin_fd)) { ret = lxc_make_controlling_terminal(options->stdin_fd); if (ret < 0) goto on_error; } if ((options->attach_flags & LXC_ATTACH_SETGROUPS) && options->groups.size > 0) { if (!lxc_setgroups(options->groups.list, options->groups.size)) goto on_error; } else { if (!lxc_drop_groups() && errno != EPERM) goto on_error; } if (options->namespaces & CLONE_NEWUSER) if (!lxc_switch_uid_gid(ctx->setup_ns_uid, ctx->setup_ns_gid)) goto on_error; if (attach_lsm(options) && ctx->lsm_label) { bool on_exec; /* Change into our new LSM profile. */ on_exec = options->attach_flags & LXC_ATTACH_LSM_EXEC ? true : false; ret = ctx->lsm_ops->process_label_set_at(ctx->lsm_ops, fd_lsm, ctx->lsm_label, on_exec); close_prot_errno_disarm(fd_lsm); if (ret < 0) goto on_error; TRACE("Set %s LSM label to \"%s\"", ctx->lsm_ops->name, ctx->lsm_label); } if (conf->no_new_privs || (options->attach_flags & LXC_ATTACH_NO_NEW_PRIVS)) { ret = prctl(PR_SET_NO_NEW_PRIVS, prctl_arg(1), prctl_arg(0), prctl_arg(0), prctl_arg(0)); if (ret < 0) goto on_error; TRACE("Set PR_SET_NO_NEW_PRIVS"); } /* The following is done after the communication socket is shut down. * That way, all errors that might (though unlikely) occur up until this * point will have their messages printed to the original stderr (if * logging is so configured) and not the fd the user supplied, if any. */ /* Fd handling for stdin, stdout and stderr; ignore errors here, user * may want to make sure the fds are closed, for example. */ if (options->stdin_fd >= 0 && options->stdin_fd != STDIN_FILENO) if (dup2(options->stdin_fd, STDIN_FILENO) < 0) SYSDEBUG("Failed to replace stdin with %d", options->stdin_fd); if (options->stdout_fd >= 0 && options->stdout_fd != STDOUT_FILENO) if (dup2(options->stdout_fd, STDOUT_FILENO) < 0) SYSDEBUG("Failed to replace stdout with %d", options->stdout_fd); if (options->stderr_fd >= 0 && options->stderr_fd != STDERR_FILENO) if (dup2(options->stderr_fd, STDERR_FILENO) < 0) SYSDEBUG("Failed to replace stderr with %d", options->stderr_fd); /* close the old fds */ if (options->stdin_fd > STDERR_FILENO) close(options->stdin_fd); if (options->stdout_fd > STDERR_FILENO) close(options->stdout_fd); if (options->stderr_fd > STDERR_FILENO) close(options->stderr_fd); /* * Try to remove FD_CLOEXEC flag from stdin/stdout/stderr, but also * here, ignore errors. */ for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd++) { ret = fd_cloexec(fd, false); if (ret < 0) { SYSERROR("Failed to clear FD_CLOEXEC from file descriptor %d", fd); goto on_error; } } if (options->attach_flags & LXC_ATTACH_TERMINAL) { ret = lxc_terminal_prepare_login(ap->terminal_pts_fd); if (ret < 0) { SYSERROR("Failed to prepare terminal file descriptor %d", ap->terminal_pts_fd); goto on_error; } TRACE("Prepared terminal file descriptor %d", ap->terminal_pts_fd); } /* Avoid unnecessary syscalls. */ if (ctx->setup_ns_uid == ctx->target_ns_uid) ctx->target_ns_uid = LXC_INVALID_UID; if (ctx->setup_ns_gid == ctx->target_ns_gid) ctx->target_ns_gid = LXC_INVALID_GID; /* * Make sure that the processes STDIO is correctly owned by the user * that we are switching to. */ ret = fix_stdio_permissions(ctx->target_ns_uid); if (ret) INFO("Failed to adjust stdio permissions"); if (conf->seccomp.seccomp) { ret = lxc_seccomp_load(conf); if (ret < 0) goto on_error; TRACE("Loaded seccomp profile"); ret = lxc_seccomp_send_notifier_fd(&conf->seccomp, ap->ipc_socket); if (ret < 0) goto on_error; lxc_seccomp_close_notifier_fd(&conf->seccomp); } if (!lxc_switch_uid_gid(ctx->target_ns_uid, ctx->target_ns_gid)) goto on_error; put_attach_payload(ap); /* We're done, so we can now do whatever the user intended us to do. */ _exit(attach_function(attach_function_args)); on_error: ERROR("Failed to attach to container"); put_attach_payload(ap); _exit(EXIT_FAILURE); } static int lxc_attach_terminal(const char *name, const char *lxcpath, struct lxc_conf *conf, struct lxc_terminal *terminal) { int ret; lxc_terminal_init(terminal); ret = lxc_terminal_create(name, lxcpath, conf, terminal); if (ret < 0) return syserror("Failed to create terminal"); return 0; } static int lxc_attach_terminal_mainloop_init(struct lxc_terminal *terminal, struct lxc_async_descr *descr) { int ret; ret = lxc_mainloop_open(descr); if (ret < 0) return syserror("Failed to create mainloop"); ret = lxc_terminal_mainloop_add(descr, terminal); if (ret < 0) { lxc_mainloop_close(descr); return syserror("Failed to add handlers to mainloop"); } return 0; } static inline void lxc_attach_terminal_close_ptx(struct lxc_terminal *terminal) { close_prot_errno_disarm(terminal->ptx); } static inline void lxc_attach_terminal_close_pts(struct lxc_terminal *terminal) { close_prot_errno_disarm(terminal->pty); } static inline void lxc_attach_terminal_close_peer(struct lxc_terminal *terminal) { close_prot_errno_disarm(terminal->peer); } static inline void lxc_attach_terminal_close_log(struct lxc_terminal *terminal) { close_prot_errno_disarm(terminal->log_fd); } int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function, void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process) { int ret_parent = -1; struct lxc_async_descr descr = {}; int ret; char *name, *lxcpath; int ipc_sockets[2]; pid_t attached_pid, pid, to_cleanup_pid; struct attach_context *ctx; struct lxc_terminal terminal; struct lxc_conf *conf; if (!container) return ret_errno(EINVAL); if (!lxc_container_get(container)) return ret_errno(EINVAL); name = container->name; lxcpath = container->config_path; if (!options) { options = &attach_static_default_options; options->lsm_label = NULL; } ctx = alloc_attach_context(); if (!ctx) { lxc_container_put(container); return syserror_set(-ENOMEM, "Failed to allocate attach context"); } ret = get_attach_context(ctx, container, options); if (ret) { put_attach_context(ctx); return syserror("Failed to get attach context"); } conf = ctx->container->lxc_conf; if (!fetch_seccomp(ctx->container, options)) WARN("Failed to get seccomp policy"); if (!no_new_privs(ctx->container, options)) WARN("Could not determine whether PR_SET_NO_NEW_PRIVS is set"); ret = prepare_namespaces(ctx, options); if (ret) { put_attach_context(ctx); return syserror("Failed to get namespace file descriptors"); } if (options->attach_flags & LXC_ATTACH_TERMINAL) { ret = lxc_attach_terminal(name, lxcpath, conf, &terminal); if (ret < 0) { put_attach_context(ctx); return syserror("Failed to setup new terminal"); } terminal.log_fd = options->log_fd; } else { lxc_terminal_init(&terminal); } /* Create a socket pair for IPC communication; set SOCK_CLOEXEC in order * to make sure we don't irritate other threads that want to fork+exec * away * * IMPORTANT: if the initial process is multithreaded and another call * just fork()s away without exec'ing directly after, the socket fd will * exist in the forked process from the other thread and any close() in * our own child process will not really cause the socket to close * properly, potentially causing the parent to get stuck. * * For this reason, while IPC is still active, we have to use shutdown() * if the child exits prematurely in order to signal that the socket is * closed and cannot assume that the child exiting will automatically do * that. * * IPC mechanism: (X is receiver) * initial process transient process attached process * X <--- send pid of * attached proc, * then exit * send 0 ------------------------------------> X * [do initialization] * X <------------------------------------ send 1 * [add to cgroup, ...] * send 2 ------------------------------------> X * [set LXC_ATTACH_NO_NEW_PRIVS] * X <------------------------------------ send 3 * [open LSM label fd] * send 4 ------------------------------------> X * [set LSM label] * close socket close socket * run program */ ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, ipc_sockets); if (ret < 0) { put_attach_context(ctx); return syserror("Could not set up required IPC mechanism for attaching"); } /* Create transient process, two reasons: * 1. We can't setns() in the child itself, since we want to make * sure we are properly attached to the pidns. * 2. Also, the initial thread has to put the attached process * into the cgroup, which we can only do if we didn't already * setns() (otherwise, user namespaces will hate us). */ pid = fork(); if (pid < 0) { put_attach_context(ctx); return syserror("Failed to create first subprocess"); } if (pid == 0) { char *cwd, *new_cwd; /* close unneeded file descriptors */ close_prot_errno_disarm(ipc_sockets[0]); if (options->attach_flags & LXC_ATTACH_TERMINAL) { lxc_attach_terminal_close_ptx(&terminal); lxc_attach_terminal_close_peer(&terminal); lxc_attach_terminal_close_log(&terminal); } /* Wait for the parent to have setup cgroups. */ if (!sync_wait(ipc_sockets[1], ATTACH_SYNC_CGROUP)) { shutdown(ipc_sockets[1], SHUT_RDWR); put_attach_context(ctx); _exit(EXIT_FAILURE); } if (!attach_context_security_barrier(ctx)) { shutdown(ipc_sockets[1], SHUT_RDWR); put_attach_context(ctx); _exit(EXIT_FAILURE); } cwd = getcwd(NULL, 0); /* * Attach now, create another subprocess later, since pid * namespaces only really affect the children of the current * process. * * Note that this is a crucial barrier. We're no moving into * the container's context so we need to make sure to not leak * anything sensitive. That especially means things such as * open file descriptors! */ ret = attach_namespaces(ctx, options); if (ret < 0) { ERROR("Failed to enter namespaces"); shutdown(ipc_sockets[1], SHUT_RDWR); put_attach_context(ctx); _exit(EXIT_FAILURE); } /* Attach succeeded, try to cwd. */ if (options->initial_cwd) new_cwd = options->initial_cwd; else new_cwd = cwd; if (new_cwd) { ret = chdir(new_cwd); if (ret < 0) WARN("Could not change directory to \"%s\"", new_cwd); } free_disarm(cwd); /* Create attached process. */ pid = lxc_raw_clone(CLONE_PARENT, NULL); if (pid < 0) { SYSERROR("Failed to clone attached process"); shutdown(ipc_sockets[1], SHUT_RDWR); put_attach_context(ctx); _exit(EXIT_FAILURE); } if (pid == 0) { struct attach_payload ap = { .ipc_socket = ipc_sockets[1], .options = options, .ctx = ctx, .terminal_pts_fd = terminal.pty, .exec_function = exec_function, .exec_payload = exec_payload, }; if (options->attach_flags & LXC_ATTACH_TERMINAL) { ret = lxc_terminal_signal_sigmask_safe_blocked(&terminal); if (ret < 0) { SYSERROR("Failed to reset signal mask"); _exit(EXIT_FAILURE); } } /* Does not return. */ do_attach(&ap); } TRACE("Attached process %d started initializing", pid); if (options->attach_flags & LXC_ATTACH_TERMINAL) lxc_attach_terminal_close_pts(&terminal); /* Tell grandparent the pid of the pid of the newly created child. */ if (!sync_wake_pid(ipc_sockets[1], pid)) { /* If this really happens here, this is very unfortunate, since * the parent will not know the pid of the attached process and * will not be able to wait for it (and we won't either due to * CLONE_PARENT) so the parent won't be able to reap it and the * attached process will remain a zombie. */ shutdown(ipc_sockets[1], SHUT_RDWR); put_attach_context(ctx); _exit(EXIT_FAILURE); } /* The rest is in the hands of the initial and the attached process. */ put_attach_context(ctx); _exit(EXIT_SUCCESS); } TRACE("Transient process %d started initializing", pid); to_cleanup_pid = pid; /* close unneeded file descriptors */ close_prot_errno_disarm(ipc_sockets[1]); put_namespaces(ctx); if (options->attach_flags & LXC_ATTACH_TERMINAL) lxc_attach_terminal_close_pts(&terminal); /* Attach to cgroup, if requested. */ if (options->attach_flags & LXC_ATTACH_MOVE_TO_CGROUP) { /* * If this is the unified hierarchy cgroup_attach() is * enough. */ ret = cgroup_attach(conf, name, lxcpath, pid); if (ret) { call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL; if (!ERRNO_IS_NOT_SUPPORTED(ret)) { SYSERROR("Failed to attach cgroup"); goto on_error; } cgroup_ops = cgroup_init(conf); if (!cgroup_ops) goto on_error; if (!cgroup_ops->attach(cgroup_ops, conf, name, lxcpath, pid)) goto on_error; } TRACE("Moved transient process %d into container cgroup", pid); } /* * Close sensitive file descriptors we don't need anymore. Even if * we're the parent. */ if (!attach_context_security_barrier(ctx)) goto on_error; /* Setup /proc limits */ ret = setup_proc_filesystem(conf, pid); if (ret < 0) goto on_error; /* Setup resource limits */ ret = setup_resource_limits(conf, pid); if (ret < 0) goto on_error; if (options->attach_flags & LXC_ATTACH_TERMINAL) { ret = lxc_attach_terminal_mainloop_init(&terminal, &descr); if (ret < 0) goto on_error; TRACE("Initialized terminal mainloop"); } /* Let the child process know to go ahead. */ if (!sync_wake(ipc_sockets[0], ATTACH_SYNC_CGROUP)) goto close_mainloop; TRACE("Told transient process to start initializing"); /* Get pid of attached process from transient process. */ if (!sync_wait_pid(ipc_sockets[0], &attached_pid)) goto close_mainloop; TRACE("Received pid %d of attached process in parent pid namespace", attached_pid); /* Ignore SIGKILL (CTRL-C) and SIGQUIT (CTRL-\) - issue #313. */ if (options->stdin_fd == STDIN_FILENO) { signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN); } /* Reap transient process. */ ret = wait_for_pid(pid); if (ret < 0) goto close_mainloop; TRACE("Transient process %d exited", pid); /* We will always have to reap the attached process now. */ to_cleanup_pid = attached_pid; /* Open LSM fd and send it to child. */ if (attach_lsm(options) && ctx->lsm_label) { __do_close int fd_lsm = -EBADF; bool on_exec; on_exec = options->attach_flags & LXC_ATTACH_LSM_EXEC ? true : false; fd_lsm = ctx->lsm_ops->process_label_fd_get(ctx->lsm_ops, attached_pid, on_exec); if (fd_lsm < 0) goto close_mainloop; TRACE("Opened LSM label file descriptor %d", fd_lsm); /* Send child fd of the LSM security module to write to. */ if (!sync_wake_fd(ipc_sockets[0], fd_lsm)) { SYSERROR("Failed to send lsm label fd"); goto close_mainloop; } TRACE("Sent LSM label file descriptor %d to child", fd_lsm); } if (conf->seccomp.seccomp) { ret = lxc_seccomp_recv_notifier_fd(&conf->seccomp, ipc_sockets[0]); if (ret < 0) goto close_mainloop; ret = lxc_seccomp_add_notifier(name, lxcpath, &conf->seccomp); if (ret < 0) goto close_mainloop; } /* We're done, the child process should now execute whatever it * is that the user requested. The parent can now track it with * waitpid() or similar. */ *attached_process = attached_pid; /* Now shut down communication with child, we're done. */ shutdown(ipc_sockets[0], SHUT_RDWR); close_prot_errno_disarm(ipc_sockets[0]); ret_parent = 0; to_cleanup_pid = -1; if (options->attach_flags & LXC_ATTACH_TERMINAL) { ret = lxc_mainloop(&descr, -1); if (ret < 0) { ret_parent = -1; to_cleanup_pid = attached_pid; } } close_mainloop: if (options->attach_flags & LXC_ATTACH_TERMINAL) lxc_mainloop_close(&descr); on_error: if (ipc_sockets[0] >= 0) { shutdown(ipc_sockets[0], SHUT_RDWR); close_prot_errno_disarm(ipc_sockets[0]); } if (to_cleanup_pid > 0) (void)wait_for_pid(to_cleanup_pid); if (options->attach_flags & LXC_ATTACH_TERMINAL) { lxc_terminal_delete(&terminal); lxc_terminal_conf_free(&terminal); } put_attach_context(ctx); return ret_parent; } int lxc_attach_run_command(void *payload) { int ret = -1; lxc_attach_command_t *cmd = payload; ret = execvp(cmd->program, cmd->argv); if (ret < 0) { switch (errno) { case ENOEXEC: ret = 126; break; case ENOENT: ret = 127; break; } } return syserror_ret(ret, "Failed to exec \"%s\"", cmd->program); } int lxc_attach_run_shell(void* payload) { __do_free char *buf = NULL; uid_t uid; struct passwd pwent; struct passwd *pwentp = NULL; char *user_shell; ssize_t bufsize; int ret; /* Ignore payload parameter. */ (void)payload; uid = getuid(); bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize < 0) bufsize = 1024; buf = malloc(bufsize); if (buf) { ret = getpwuid_r(uid, &pwent, buf, bufsize, &pwentp); if (!pwentp) { if (ret == 0) WARN("Could not find matched password record"); WARN("Failed to get password record - %u", uid); } } /* This probably happens because of incompatible nss implementations in * host and container (remember, this code is still using the host's * glibc but our mount namespace is in the container) we may try to get * the information by spawning a [getent passwd uid] process and parsing * the result. */ if (!pwentp) user_shell = lxc_attach_getpwshell(uid); else user_shell = pwent.pw_shell; if (user_shell) execlp(user_shell, user_shell, (char *)NULL); /* Executed if either no passwd entry or execvp fails, we will fall back * on /bin/sh as a default shell. */ execlp("/bin/sh", "/bin/sh", (char *)NULL); SYSERROR("Failed to execute shell"); if (!pwentp) free(user_shell); return -1; } lxc-4.0.12/src/lxc/version.h.in0000644061062106075000000000052314176403775013153 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_VERSION_H #define __LXC_VERSION_H #define LXC_DEVEL @LXC_DEVEL@ #define LXC_VERSION_MAJOR @LXC_VERSION_MAJOR@ #define LXC_VERSION_MINOR @LXC_VERSION_MINOR@ #define LXC_VERSION_MICRO @LXC_VERSION_MICRO@ #define LXC_VERSION_ABI "@LXC_ABI@" #define LXC_VERSION "@LXC_VERSION@" #endif lxc-4.0.12/src/lxc/rtnl.c0000644061062106075000000000254314176403775012037 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "nl.h" #include "rtnl.h" int rtnetlink_open(struct rtnl_handler *handler) { return netlink_open(&handler->nlh, NETLINK_ROUTE); } void rtnetlink_close(struct rtnl_handler *handler) { netlink_close(&handler->nlh); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" int rtnetlink_rcv(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg) { return netlink_rcv(&handler->nlh, (struct nlmsg *)&rtnlmsg->nlmsghdr); } int rtnetlink_send(struct rtnl_handler *handler, struct rtnlmsg *rtnlmsg) { return netlink_send(&handler->nlh, (struct nlmsg *)&rtnlmsg->nlmsghdr); } int rtnetlink_transaction(struct rtnl_handler *handler, struct rtnlmsg *request, struct rtnlmsg *answer) { return netlink_transaction(&handler->nlh, (struct nlmsg *)&request->nlmsghdr, (struct nlmsg *)&answer->nlmsghdr); } #pragma GCC diagnostic pop struct rtnlmsg *rtnlmsg_alloc(size_t size) { /* size_t len; len = NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct rtnlmsghdr))) + size; return (struct rtnlmsg *)nlmsg_alloc(len); */ return NULL; } void rtnlmsg_free(struct rtnlmsg *rtnlmsg) { free(rtnlmsg); } lxc-4.0.12/src/lxc/string_utils.c0000644061062106075000000004415114176403775013607 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "string_utils.h" #include "macro.h" #include "memory_utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #if !HAVE_STRLCAT #include "strlcat.h" #endif char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup) { va_list ap2; size_t count = 1 + skip; char **result; /* first determine size of argument list, we don't want to reallocate * constantly... */ va_copy(ap2, ap); for (;;) { char *arg = va_arg(ap2, char *); if (!arg) break; count++; } va_end(ap2); result = calloc(count, sizeof(char *)); if (!result) return NULL; count = skip; for (;;) { char *arg = va_arg(ap, char *); if (!arg) break; arg = do_strdup ? strdup(arg) : arg; if (!arg) goto oom; result[count++] = arg; } /* calloc has already set last element to NULL*/ return result; oom: free(result); return NULL; } const char **lxc_va_arg_list_to_argv_const(va_list ap, size_t skip) { return (const char **)lxc_va_arg_list_to_argv(ap, skip, 0); } char *lxc_string_replace(const char *needle, const char *replacement, const char *haystack) { ssize_t len = -1, saved_len = -1; char *result = NULL; size_t replacement_len = strlen(replacement); size_t needle_len = strlen(needle); /* should be executed exactly twice */ while (len == -1 || result == NULL) { char *p; char *last_p; ssize_t part_len; if (len != -1) { result = calloc(1, len + 1); if (!result) return NULL; saved_len = len; } len = 0; for (last_p = (char *)haystack, p = strstr(last_p, needle); p; last_p = p, p = strstr(last_p, needle)) { part_len = (ssize_t)(p - last_p); if (result && part_len > 0) memcpy(&result[len], last_p, part_len); len += part_len; if (result && replacement_len > 0) memcpy(&result[len], replacement, replacement_len); len += replacement_len; p += needle_len; } part_len = strlen(last_p); if (result && part_len > 0) memcpy(&result[len], last_p, part_len); len += part_len; } /* make sure we did the same thing twice, * once for calculating length, the other * time for copying data */ if (saved_len != len) { free(result); return NULL; } /* make sure we didn't overwrite any buffer, * due to calloc the string should be 0-terminated */ if (result[len] != '\0') { free(result); return NULL; } return result; } bool lxc_string_in_array(const char *needle, const char **haystack) { for (; haystack && *haystack; haystack++) if (strequal(needle, *haystack)) return true; return false; } char *lxc_string_join(const char *sep, const char **parts, bool use_as_prefix) { char *result; char **p; size_t sep_len = strlen(sep); size_t result_len = use_as_prefix * sep_len; size_t buf_len; /* calculate new string length */ for (p = (char **)parts; *p; p++) result_len += (p > (char **)parts) * sep_len + strlen(*p); buf_len = result_len + 1; result = calloc(buf_len, 1); if (!result) return NULL; if (use_as_prefix) (void)strlcpy(result, sep, buf_len); for (p = (char **)parts; *p; p++) { if (p > (char **)parts) (void)strlcat(result, sep, buf_len); (void)strlcat(result, *p, buf_len); } return result; } /* taken from systemd */ char *path_simplify(const char *path) { __do_free char *path_new = NULL; char *f, *t; bool slash = false, ignore_slash = false, absolute; path_new = strdup(path); if (!path_new) return NULL; if (is_empty_string(path_new)) return move_ptr(path_new); absolute = abspath(path_new); f = path_new; if (*f == '.' && IN_SET(f[1], 0, '/')) { ignore_slash = true; f++; } for (t = path_new; *f; f++) { if (*f == '/') { slash = true; continue; } if (slash) { if (*f == '.' && IN_SET(f[1], 0, '/')) continue; slash = false; if (ignore_slash) ignore_slash = false; else *(t++) = '/'; } *(t++) = *f; } if (t == path_new) { if (absolute) *(t++) = '/'; else *(t++) = '.'; } *t = 0; return move_ptr(path_new); } char *lxc_append_paths(const char *first, const char *second) { __do_free char *result = NULL; int ret; size_t len; int pattern_type = 0; len = strlen(first) + strlen(second) + 1; if (second[0] != '/') { len += 1; pattern_type = 1; } result = zalloc(len); if (!result) return NULL; if (pattern_type == 0) ret = strnprintf(result, len, "%s%s", first, second); else ret = strnprintf(result, len, "%s/%s", first, second); if (ret < 0) return NULL; return move_ptr(result); } bool lxc_string_in_list(const char *needle, const char *haystack, char _sep) { __do_free char *str = NULL; char *token; char sep[2] = { _sep, '\0' }; if (!haystack || !needle) return 0; str = must_copy_string(haystack); lxc_iterate_parts(token, str, sep) if (strequal(needle, token)) return 1; return 0; } char **lxc_string_split(const char *string, char _sep) { __do_free char *str = NULL; char *token; char sep[2] = {_sep, '\0'}; char **tmp = NULL, **result = NULL; size_t result_capacity = 0; size_t result_count = 0; int r, saved_errno; if (!string) return calloc(1, sizeof(char *)); str = must_copy_string(string); lxc_iterate_parts(token, str, sep) { r = lxc_grow_array((void ***)&result, &result_capacity, result_count + 1, 16); if (r < 0) goto error_out; result[result_count] = strdup(token); if (!result[result_count]) goto error_out; result_count++; } /* if we allocated too much, reduce it */ tmp = realloc(result, (result_count + 1) * sizeof(char *)); if (!tmp) goto error_out; result = tmp; /* Make sure we don't return uninitialized memory. */ if (result_count == 0) *result = NULL; return result; error_out: saved_errno = errno; lxc_free_array((void **)result, free); errno = saved_errno; return NULL; } static bool complete_word(char ***result, char *start, char *end, size_t *cap, size_t *cnt) { int r; r = lxc_grow_array((void ***)result, cap, 2 + *cnt, 16); if (r < 0) return false; (*result)[*cnt] = strndup(start, end - start); if (!(*result)[*cnt]) return false; (*cnt)++; return true; } /* * Given a a string 'one two "three four"', split into three words, * one, two, and "three four" */ char **lxc_string_split_quoted(char *string) { char *nextword = string, *p, state; char **result = NULL; size_t result_capacity = 0; size_t result_count = 0; if (!string || !*string) return calloc(1, sizeof(char *)); // TODO I'm *not* handling escaped quote state = ' '; for (p = string; *p; p++) { switch(state) { case ' ': if (isspace(*p)) continue; else if (*p == '"' || *p == '\'') { nextword = p; state = *p; continue; } nextword = p; state = 'a'; continue; case 'a': if (isspace(*p)) { complete_word(&result, nextword, p, &result_capacity, &result_count); state = ' '; continue; } continue; case '"': case '\'': if (*p == state) { complete_word(&result, nextword+1, p, &result_capacity, &result_count); state = ' '; continue; } continue; } } if (state == 'a') complete_word(&result, nextword, p, &result_capacity, &result_count); if (result == NULL) return calloc(1, sizeof(char *)); return realloc(result, (result_count + 1) * sizeof(char *)); } char **lxc_string_split_and_trim(const char *string, char _sep) { __do_free char *str = NULL; char *token; char sep[2] = { _sep, '\0' }; char **result = NULL; size_t result_capacity = 0; size_t result_count = 0; int r, saved_errno; size_t i = 0; if (!string) return calloc(1, sizeof(char *)); str = must_copy_string(string); lxc_iterate_parts(token, str, sep) { while (token[0] == ' ' || token[0] == '\t') token++; i = strlen(token); while (i > 0 && (token[i - 1] == ' ' || token[i - 1] == '\t')) { token[i - 1] = '\0'; i--; } r = lxc_grow_array((void ***)&result, &result_capacity, result_count + 1, 16); if (r < 0) goto error_out; result[result_count] = strdup(token); if (!result[result_count]) goto error_out; result_count++; } if (result == NULL) return calloc(1, sizeof(char *)); /* if we allocated too much, reduce it */ return realloc(result, (result_count + 1) * sizeof(char *)); error_out: saved_errno = errno; lxc_free_array((void **)result, free); errno = saved_errno; return NULL; } void lxc_free_array(void **array, lxc_free_fn element_free_fn) { void **p; for (p = array; p && *p; p++) element_free_fn(*p); free((void*)array); } int lxc_grow_array(void ***array, size_t *capacity, size_t new_size, size_t capacity_increment) { size_t new_capacity; void **new_array; /* first time around, catch some trivial mistakes of the user * only initializing one of these */ if (!*array || !*capacity) { *array = NULL; *capacity = 0; } new_capacity = *capacity; while (new_size + 1 > new_capacity) new_capacity += capacity_increment; if (new_capacity != *capacity) { /* we have to reallocate */ new_array = realloc(*array, new_capacity * sizeof(void *)); if (!new_array) return -1; memset(&new_array[*capacity], 0, (new_capacity - (*capacity)) * sizeof(void *)); *array = new_array; *capacity = new_capacity; } /* array has sufficient elements */ return 0; } size_t lxc_array_len(void **array) { void **p; size_t result = 0; for (p = array; p && *p; p++) result++; return result; } void **lxc_append_null_to_array(void **array, size_t count) { void **temp; /* Append NULL to the array */ if (count) { temp = realloc(array, (count + 1) * sizeof(*array)); if (!temp) { size_t i; for (i = 0; i < count; i++) free(array[i]); free(array); return NULL; } array = temp; array[count] = NULL; } return array; } static int lxc_append_null_to_list(void ***list) { int newentry = 0; void **tmp; if (*list) for (; (*list)[newentry]; newentry++) { ; } tmp = realloc(*list, (newentry + 2) * sizeof(void **)); if (!tmp) return -1; *list = tmp; (*list)[newentry + 1] = NULL; return newentry; } int lxc_append_string(char ***list, char *entry) { char *copy; int newentry; newentry = lxc_append_null_to_list((void ***)list); if (newentry < 0) return -1; copy = strdup(entry); if (!copy) return -1; (*list)[newentry] = copy; return 0; } int lxc_safe_uint(const char *numstr, unsigned int *converted) { char *err = NULL; unsigned long int uli; while (isspace(*numstr)) numstr++; if (*numstr == '-') return -EINVAL; errno = 0; uli = strtoul(numstr, &err, 0); if (errno == ERANGE && uli == ULONG_MAX) return -ERANGE; if (err == numstr || *err != '\0') return -EINVAL; if (uli > UINT_MAX) return -ERANGE; *converted = (unsigned int)uli; return 0; } int lxc_safe_ulong(const char *numstr, unsigned long *converted) { char *err = NULL; unsigned long int uli; while (isspace(*numstr)) numstr++; if (*numstr == '-') return -EINVAL; errno = 0; uli = strtoul(numstr, &err, 0); if (errno == ERANGE && uli == ULONG_MAX) return -ERANGE; if (err == numstr || *err != '\0') return -EINVAL; *converted = uli; return 0; } int lxc_safe_uint64(const char *numstr, uint64_t *converted, int base) { char *err = NULL; uint64_t u; while (isspace(*numstr)) numstr++; if (*numstr == '-') return -EINVAL; errno = 0; u = strtoull(numstr, &err, base); if (errno == ERANGE && u == UINT64_MAX) return -ERANGE; if (err == numstr || *err != '\0') return -EINVAL; *converted = u; return 0; } int lxc_safe_int64_residual(const char *restrict numstr, int64_t *restrict converted, int base, char *restrict residual, size_t residual_len) { char *remaining = NULL; int64_t u; if (residual && residual_len == 0) return ret_errno(EINVAL); if (!residual && residual_len != 0) return ret_errno(EINVAL); memset(residual, 0, residual_len); while (isspace(*numstr)) numstr++; errno = 0; u = strtoll(numstr, &remaining, base); if (errno == ERANGE && u == INT64_MAX) return ret_errno(ERANGE); if (remaining == numstr) return -EINVAL; if (residual) { size_t len = 0; if (*remaining == '\0') goto out; len = strlen(remaining); if (len >= residual_len) return ret_errno(EINVAL); memcpy(residual, remaining, len); } else if (*remaining != '\0') { return ret_errno(EINVAL); } out: *converted = u; return 0; } int lxc_safe_int(const char *numstr, int *converted) { char *err = NULL; signed long int sli; errno = 0; sli = strtol(numstr, &err, 0); if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN)) return -ERANGE; if (errno != 0 && sli == 0) return -EINVAL; if (err == numstr || *err != '\0') return -EINVAL; if (sli > INT_MAX || sli < INT_MIN) return -ERANGE; *converted = (int)sli; return 0; } int lxc_safe_long(const char *numstr, long int *converted) { char *err = NULL; signed long int sli; errno = 0; sli = strtol(numstr, &err, 0); if (errno == ERANGE && (sli == LONG_MAX || sli == LONG_MIN)) return -ERANGE; if (errno != 0 && sli == 0) return -EINVAL; if (err == numstr || *err != '\0') return -EINVAL; *converted = sli; return 0; } int lxc_safe_long_long(const char *numstr, long long int *converted) { char *err = NULL; signed long long int sli; errno = 0; sli = strtoll(numstr, &err, 0); if (errno == ERANGE && (sli == LLONG_MAX || sli == LLONG_MIN)) return -ERANGE; if (errno != 0 && sli == 0) return -EINVAL; if (err == numstr || *err != '\0') return -EINVAL; *converted = sli; return 0; } char *must_concat(size_t *len, const char *first, ...) { va_list args; char *cur, *dest; size_t cur_len, it_len; dest = must_copy_string(first); cur_len = it_len = strlen(first); va_start(args, first); while ((cur = va_arg(args, char *)) != NULL) { it_len = strlen(cur); dest = must_realloc(dest, cur_len + it_len + 1); (void)memcpy(dest + cur_len, cur, it_len); cur_len += it_len; } va_end(args); dest[cur_len] = '\0'; if (len) *len = cur_len; return dest; } char *must_make_path(const char *first, ...) { va_list args; char *cur, *dest; size_t full_len = strlen(first); size_t buf_len; size_t cur_len; dest = must_copy_string(first); cur_len = full_len; va_start(args, first); while ((cur = va_arg(args, char *)) != NULL) { buf_len = strlen(cur); if (buf_len == 0) continue; full_len += buf_len; if (cur[0] != '/') full_len++; dest = must_realloc(dest, full_len + 1); if (cur[0] != '/') { memcpy(dest + cur_len, "/", 1); cur_len++; } memcpy(dest + cur_len, cur, buf_len); cur_len += buf_len; } va_end(args); dest[cur_len] = '\0'; return dest; } char *must_append_path(char *first, ...) { char *cur; size_t full_len; va_list args; char *dest = first; size_t buf_len; size_t cur_len; full_len = strlen(first); cur_len = full_len; va_start(args, first); while ((cur = va_arg(args, char *)) != NULL) { buf_len = strlen(cur); full_len += buf_len; if (cur[0] != '/') full_len++; dest = must_realloc(dest, full_len + 1); if (cur[0] != '/') { memcpy(dest + cur_len, "/", 1); cur_len++; } memcpy(dest + cur_len, cur, buf_len); cur_len += buf_len; } va_end(args); dest[cur_len] = '\0'; return dest; } char *must_copy_string(const char *entry) { char *ret; if (!entry) return NULL; do { ret = strdup(entry); } while (!ret); return ret; } void *must_realloc(void *orig, size_t sz) { void *ret; do { ret = realloc(orig, sz); } while (!ret); return ret; } int parse_byte_size_string(const char *s, long long int *converted) { int ret, suffix_len; long long int conv, mltpl; char *end; char dup[INTTYPE_TO_STRLEN(long long int)] = {0}; char suffix[3] = {0}; size_t len; if (!s) return ret_errno(EINVAL); len = strlen(s); if (len == 0 || len > sizeof(dup) - 1) return ret_errno(EINVAL); memcpy(dup, s, len); end = dup + len; if (isdigit(*(end - 1))) suffix_len = 0; else if (isalpha(*(end - 1))) suffix_len = 1; else return ret_errno(EINVAL); if (suffix_len > 0) { if ((end - 1) == dup) return ret_errno(EINVAL); if ((end - 2) == dup) { if (isalpha(*(end - 2))) return ret_errno(EINVAL); /* 1B */ } else { if (isalpha(*(end - 2))) /* 12MB */ suffix_len++; /* 12B */ } memcpy(suffix, end - suffix_len, suffix_len); *(suffix + suffix_len) = '\0'; *(end - suffix_len) = '\0'; } dup[lxc_char_right_gc(dup, strlen(dup))] = '\0'; ret = lxc_safe_long_long(dup, &conv); if (ret) return ret; if (suffix_len != 2) { *converted = conv; return 0; } if (strcasecmp(suffix, "KB") == 0) mltpl = 1024; else if (strcasecmp(suffix, "MB") == 0) mltpl = 1024 * 1024; else if (strcasecmp(suffix, "GB") == 0) mltpl = 1024 * 1024 * 1024; else return ret_errno(EINVAL); if (check_mul_overflow(conv, mltpl, converted)) return ret_errno(ERANGE); return 0; } void remove_trailing_newlines(char *l) { char *p = l; while (*p) p++; while (--p >= l && *p == '\n') *p = '\0'; } int lxc_char_left_gc(const char *buffer, size_t len) { size_t i; for (i = 0; i < len; i++) { if (buffer[i] == ' ' || buffer[i] == '\t') continue; return i; } return 0; } int lxc_char_right_gc(const char *buffer, size_t len) { int i; for (i = len - 1; i >= 0; i--) { if (buffer[i] == ' ' || buffer[i] == '\t' || buffer[i] == '\n' || buffer[i] == '\0') continue; return i + 1; } return 0; } char *lxc_trim_whitespace_in_place(char *buffer) { buffer += lxc_char_left_gc(buffer, strlen(buffer)); buffer[lxc_char_right_gc(buffer, strlen(buffer))] = '\0'; return buffer; } int lxc_is_line_empty(const char *line) { size_t len = strlen(line); for (size_t i = 0; i < len; i++) if (line[i] != ' ' && line[i] != '\t' && line[i] != '\n' && line[i] != '\r' && line[i] != '\f' && line[i] != '\0') return 0; return 1; } void remove_trailing_slashes(char *p) { int l = strlen(p); while (--l >= 0 && (p[l] == '/' || p[l] == '\n')) p[l] = '\0'; } lxc-4.0.12/src/lxc/confile_utils.h0000644061062106075000000000745414176403775013732 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_CONFILE_UTILS_H #define __LXC_CONFILE_UTILS_H #include "config.h" #include #include "compiler.h" #include "conf.h" #include "confile_utils.h" #define strprint(str, inlen, ...) \ do { \ if (str) \ len = snprintf(str, inlen, ##__VA_ARGS__); \ else \ len = snprintf((char *){""}, 0, ##__VA_ARGS__); \ if (len < 0) \ return log_error_errno(-EIO, EIO, "failed to create string"); \ fulllen += len; \ if (inlen > 0) { \ if (str) \ str += len; \ inlen -= len; \ if (inlen < 0) \ inlen = 0; \ } \ } while (0); __hidden extern int parse_idmaps(const char *idmap, char *type, unsigned long *nsid, unsigned long *hostid, unsigned long *range); __hidden extern bool lxc_config_value_empty(const char *value); __hidden extern struct lxc_netdev *lxc_get_netdev_by_idx(struct lxc_conf *conf, unsigned int idx, bool allocate); __hidden extern void lxc_log_configured_netdevs(const struct lxc_conf *conf); __hidden extern bool lxc_remove_nic_by_idx(struct lxc_conf *conf, unsigned int idx); __hidden extern void lxc_free_networks(struct lxc_conf *conf); __hidden extern void lxc_clear_netdev(struct lxc_netdev *netdev); __hidden extern int lxc_veth_mode_to_flag(int *mode, const char *value); __hidden extern char *lxc_veth_flag_to_mode(int mode); __hidden extern int lxc_macvlan_mode_to_flag(int *mode, const char *value); __hidden extern char *lxc_macvlan_flag_to_mode(int mode); __hidden extern int lxc_ipvlan_mode_to_flag(int *mode, const char *value); __hidden extern char *lxc_ipvlan_flag_to_mode(int mode); __hidden extern int lxc_ipvlan_isolation_to_flag(int *mode, const char *value); __hidden extern char *lxc_ipvlan_flag_to_isolation(int mode); __hidden extern int set_config_string_item(char **conf_item, const char *value); __hidden extern int set_config_string_item_max(char **conf_item, const char *value, size_t max) __access_r(2, 3); __hidden extern int set_config_path_item(char **conf_item, const char *value); __hidden extern int set_config_bool_item(bool *conf_item, const char *value, bool empty_conf_action); __hidden extern int config_ip_prefix(struct in_addr *addr); __hidden extern int network_ifname(char *valuep, const char *value, size_t size) __access_r(2, 3); __hidden extern void rand_complete_hwaddr(char *hwaddr); __hidden extern bool lxc_config_net_is_hwaddr(const char *line); __hidden extern bool new_hwaddr(char *hwaddr); __hidden extern int lxc_get_conf_str(char *retv, int inlen, const char *value); __hidden extern int lxc_get_conf_bool(struct lxc_conf *c, char *retv, int inlen, bool v); __hidden extern int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v); __hidden extern int lxc_get_conf_size_t(struct lxc_conf *c, char *retv, int inlen, size_t v); __hidden extern int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v); __hidden extern int lxc_inherit_namespace(const char *lxcname_or_pid, const char *lxcpath, const char *namespace); __hidden extern int sig_parse(const char *signame); #endif /* __LXC_CONFILE_UTILS_H */ lxc-4.0.12/src/lxc/monitor.c0000644061062106075000000002065514176403775012553 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "af_unix.h" #include "error.h" #include "log.h" #include "lxclock.h" #include "macro.h" #include "memory_utils.h" #include "monitor.h" #include "state.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif lxc_log_define(monitor, lxc); /* routines used by monitor publishers (containers) */ int lxc_monitor_fifo_name(const char *lxcpath, char *fifo_path, size_t fifo_path_sz, int do_mkdirp) { int ret; char *rundir; rundir = get_rundir(); if (!rundir) return -1; if (do_mkdirp) { ret = strnprintf(fifo_path, fifo_path_sz, "%s/lxc/%s", rundir, lxcpath); if (ret < 0) { ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo", rundir, lxcpath); free(rundir); return -1; } ret = mkdir_p(fifo_path, 0755); if (ret < 0) { ERROR("Unable to create monitor fifo directory %s", fifo_path); free(rundir); return ret; } } ret = strnprintf(fifo_path, fifo_path_sz, "%s/lxc/%s/monitor-fifo", rundir, lxcpath); if (ret < 0) { ERROR("rundir/lxcpath (%s/%s) too long for monitor fifo", rundir, lxcpath); free(rundir); return -1; } free(rundir); return 0; } static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath) { int fd,ret; char fifo_path[PATH_MAX]; BUILD_BUG_ON(sizeof(*msg) > PIPE_BUF); /* write not guaranteed atomic */ ret = lxc_monitor_fifo_name(lxcpath, fifo_path, sizeof(fifo_path), 0); if (ret < 0) return; /* Open the fifo nonblock in case the monitor is dead, we don't want the * open to wait for a reader since it may never come. */ fd = open(fifo_path, O_WRONLY | O_NONBLOCK); if (fd < 0) { /* It is normal for this open() to fail with ENXIO when there is * no monitor running, so we don't log it. */ if (errno == ENXIO || errno == ENOENT) return; SYSWARN("Failed to open fifo to send message"); return; } if (fcntl(fd, F_SETFL, O_WRONLY) < 0) { close(fd); return; } ret = lxc_write_nointr(fd, msg, sizeof(*msg)); if (ret != sizeof(*msg)) { close(fd); SYSERROR("Failed to write to monitor fifo \"%s\"", fifo_path); return; } close(fd); } void lxc_monitor_send_state(const char *name, lxc_state_t state, const char *lxcpath) { struct lxc_msg msg = {.type = lxc_msg_state, .value = state}; (void)strlcpy(msg.name, name, sizeof(msg.name)); lxc_monitor_fifo_send(&msg, lxcpath); } void lxc_monitor_send_exit_code(const char *name, int exit_code, const char *lxcpath) { struct lxc_msg msg = {.type = lxc_msg_exit_code, .value = exit_code}; (void)strlcpy(msg.name, name, sizeof(msg.name)); lxc_monitor_fifo_send(&msg, lxcpath); } /* routines used by monitor subscribers (lxc-monitor) */ int lxc_monitor_close(int fd) { return close(fd); } /* Enforces \0-termination for the abstract unix socket. This is not required * but allows us to print it out. * * Older version of liblxc only allowed for 105 bytes to be used for the * abstract unix domain socket name because the code for our abstract unix * socket handling performed invalid checks. Since we \0-terminate we could now * have a maximum of 106 chars. But to not break backwards compatibility we keep * the limit at 105. */ int lxc_monitor_sock_name(const char *lxcpath, struct sockaddr_un *addr) { __do_free char *path = NULL; size_t len; int ret; uint64_t hash; /* addr.sun_path is only 108 bytes, so we hash the full name and * then append as much of the name as we can fit. */ memset(addr, 0, sizeof(*addr)); addr->sun_family = AF_UNIX; /* strlen("lxc/") + strlen("/monitor-sock") + 1 = 18 */ len = strlen(lxcpath) + 18; path = must_realloc(NULL, len); ret = strnprintf(path, len, "lxc/%s/monitor-sock", lxcpath); if (ret < 0) { ERROR("Failed to create name for monitor socket"); return -1; } /* Note: strnprintf() will \0-terminate addr->sun_path on the 106th byte * and so the abstract socket name has 105 "meaningful" characters. This * is absolutely intentional. For further info read the comment for this * function above! */ len = sizeof(addr->sun_path) - 1; hash = fnv_64a_buf(path, ret, FNV1A_64_INIT); ret = strnprintf(addr->sun_path, len, "@lxc/%016" PRIx64 "/%s", hash, lxcpath); if (ret < 0) { ERROR("Failed to create hashed name for monitor socket"); goto on_error; } /* replace @ with \0 */ addr->sun_path[0] = '\0'; INFO("Using monitor socket name \"%s\" (length of socket name %zu must be <= %zu)", &addr->sun_path[1], strlen(&addr->sun_path[1]), sizeof(addr->sun_path) - 3); return 0; on_error: return -1; } int lxc_monitor_open(const char *lxcpath) { struct sockaddr_un addr; int fd; size_t retry; int backoff_ms[] = {10, 50, 100}; if (lxc_monitor_sock_name(lxcpath, &addr) < 0) return -1; DEBUG("Opening monitor socket %s with len %zu", &addr.sun_path[1], strlen(&addr.sun_path[1])); for (retry = 0; retry < sizeof(backoff_ms) / sizeof(backoff_ms[0]); retry++) { fd = lxc_abstract_unix_connect(addr.sun_path); if (fd != -1 || errno != ECONNREFUSED) break; SYSERROR("Failed to connect to monitor socket. Retrying in %d ms", backoff_ms[retry]); usleep(backoff_ms[retry] * 1000); } if (fd < 0) { SYSERROR("Failed to connect to monitor socket"); return -1; } return fd; } int lxc_monitor_read_fdset(struct pollfd *fds, nfds_t nfds, struct lxc_msg *msg, int timeout) { int ret; ret = poll(fds, nfds, timeout * 1000); if (ret == -1) return -1; else if (ret == 0) return -2; /* timed out */ /* Only read from the first ready fd, the others will remain ready for * when this routine is called again. */ for (size_t i = 0; i < nfds; i++) { if (fds[i].revents != 0) { fds[i].revents = 0; ret = recv(fds[i].fd, msg, sizeof(*msg), 0); if (ret <= 0) { SYSERROR("Failed to receive message. Did monitord die?"); return -1; } return ret; } } SYSERROR("No ready fd found"); return -1; } int lxc_monitor_read_timeout(int fd, struct lxc_msg *msg, int timeout) { struct pollfd fds; fds.fd = fd; fds.events = POLLIN | POLLPRI; fds.revents = 0; return lxc_monitor_read_fdset(&fds, 1, msg, timeout); } int lxc_monitor_read(int fd, struct lxc_msg *msg) { return lxc_monitor_read_timeout(fd, msg, -1); } #define LXC_MONITORD_PATH LIBEXECDIR "/lxc/lxc-monitord" /* Used to spawn a monitord either on startup of a daemon container, or when * lxc-monitor starts. */ int lxc_monitord_spawn(const char *lxcpath) { int ret; int pipefd[2]; char pipefd_str[INTTYPE_TO_STRLEN(int)]; pid_t pid1, pid2; char *const args[] = { LXC_MONITORD_PATH, (char *)lxcpath, pipefd_str, NULL, }; /* double fork to avoid zombies when monitord exits */ pid1 = fork(); if (pid1 < 0) { SYSERROR("Failed to fork()"); return -1; } if (pid1) { DEBUG("Going to wait for pid %d", pid1); if (waitpid(pid1, NULL, 0) != pid1) return -1; DEBUG("Finished waiting on pid %d", pid1); return 0; } if (pipe(pipefd) < 0) { SYSERROR("Failed to create pipe"); _exit(EXIT_FAILURE); } pid2 = fork(); if (pid2 < 0) { SYSERROR("Failed to fork()"); _exit(EXIT_FAILURE); } if (pid2) { DEBUG("Trying to sync with child process"); char c; /* Wait for daemon to create socket. */ close(pipefd[1]); /* Sync with child, we're ignoring the return from read * because regardless if it works or not, either way we've * synced with the child process. the if-empty-statement * construct is to quiet the warn-unused-result warning. */ if (lxc_read_nointr(pipefd[0], &c, 1)) { ; } close(pipefd[0]); DEBUG("Successfully synced with child process"); _exit(EXIT_SUCCESS); } if (setsid() < 0) { SYSERROR("Failed to setsid()"); _exit(EXIT_FAILURE); } lxc_check_inherited(NULL, true, &pipefd[1], 1); if (null_stdfds() < 0) { SYSERROR("Failed to dup2() standard file descriptors to /dev/null"); _exit(EXIT_FAILURE); } close(pipefd[0]); ret = strnprintf(pipefd_str, sizeof(pipefd_str), "%d", pipefd[1]); if (ret < 0) { ERROR("Failed to create pid argument to pass to monitord"); _exit(EXIT_FAILURE); } DEBUG("Using pipe file descriptor %d for monitord", pipefd[1]); execvp(args[0], args); SYSERROR("Failed to exec lxc-monitord"); _exit(EXIT_FAILURE); } lxc-4.0.12/src/lxc/conf.c0000644061062106075000000047305014176403775012012 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "conf.h" #include "af_unix.h" #include "caps.h" #include "cgroups/cgroup.h" #include "compiler.h" #include "confile.h" #include "confile_utils.h" #include "error.h" #include "log.h" #include "lsm/lsm.h" #include "lxclock.h" #include "lxcseccomp.h" #include "macro.h" #include "memory_utils.h" #include "mount_utils.h" #include "namespace.h" #include "network.h" #include "parse.h" #include "process_utils.h" #include "ringbuf.h" #include "start.h" #include "storage/storage.h" #include "storage/overlay.h" #include "sync.h" #include "syscall_wrappers.h" #include "terminal.h" #include "utils.h" #include "uuid.h" #ifdef MAJOR_IN_MKDEV #include #endif #ifdef HAVE_STATVFS #include #endif #if HAVE_OPENPTY #include #else #include "openpty.h" #endif #if HAVE_LIBCAP #include #endif #if !HAVE_STRLCAT #include "strlcat.h" #endif #if IS_BIONIC #include "lxcmntent.h" #else #include #endif #if !defined(HAVE_PRLIMIT) && defined(HAVE_PRLIMIT64) #include "prlimit.h" #endif #if !HAVE_STRLCPY #include "strlcpy.h" #endif #if !HAVE_STRCHRNUL #include "strchrnul.h" #endif lxc_log_define(conf, lxc); /* * The lxc_conf of the container currently being worked on in an API call. * This is used in the error calls. */ thread_local struct lxc_conf *current_config; char *lxchook_names[NUM_LXC_HOOKS] = { "pre-start", "pre-mount", "mount", "autodev", "start", "stop", "post-stop", "clone", "destroy", "start-host" }; struct mount_opt { char *name; int clear; bool recursive; __u64 flag; int legacy_flag; }; struct caps_opt { char *name; __u32 value; }; struct limit_opt { char *name; int value; }; static struct mount_opt mount_opt[] = { { "atime", 1, false, MOUNT_ATTR_NOATIME, MS_NOATIME }, { "dev", 1, false, MOUNT_ATTR_NODEV, MS_NODEV }, { "diratime", 1, false, MOUNT_ATTR_NODIRATIME, MS_NODIRATIME }, { "exec", 1, false, MOUNT_ATTR_NOEXEC, MS_NOEXEC }, { "noatime", 0, false, MOUNT_ATTR_NOATIME, MS_NOATIME }, { "nodev", 0, false, MOUNT_ATTR_NODEV, MS_NODEV }, { "nodiratime", 0, false, MOUNT_ATTR_NODIRATIME, MS_NODIRATIME }, { "noexec", 0, false, MOUNT_ATTR_NOEXEC, MS_NOEXEC }, { "norelatime", 1, false, MOUNT_ATTR_RELATIME, MS_RELATIME }, { "nostrictatime", 1, false, MOUNT_ATTR_STRICTATIME, MS_STRICTATIME }, { "nosuid", 0, false, MOUNT_ATTR_NOSUID, MS_NOSUID }, { "relatime", 0, false, MOUNT_ATTR_RELATIME, MS_RELATIME }, { "ro", 0, false, MOUNT_ATTR_RDONLY, MS_RDONLY }, { "rw", 1, false, MOUNT_ATTR_RDONLY, MS_RDONLY }, { "strictatime", 0, false, MOUNT_ATTR_STRICTATIME, MS_STRICTATIME }, { "suid", 1, false, MOUNT_ATTR_NOSUID, MS_NOSUID }, { "bind", 0, false, 0, MS_BIND }, { "defaults", 0, false, 0, 0 }, { "rbind", 0, true, 0, MS_BIND | MS_REC }, { "sync", 0, false, ~0, MS_SYNCHRONOUS }, { "async", 1, false, ~0, MS_SYNCHRONOUS }, { "dirsync", 0, false, ~0, MS_DIRSYNC }, { "lazytime", 0, false, ~0, MS_LAZYTIME }, { "mand", 0, false, ~0, MS_MANDLOCK }, { "nomand", 1, false, ~0, MS_MANDLOCK }, { "remount", 0, false, ~0, MS_REMOUNT }, { NULL, 0, false, ~0, ~0 }, }; static struct mount_opt propagation_opt[] = { { "private", 0, false, MS_PRIVATE, MS_PRIVATE }, { "shared", 0, false, MS_SHARED, MS_SHARED }, { "slave", 0, false, MS_SLAVE, MS_SLAVE }, { "unbindable", 0, false, MS_UNBINDABLE, MS_UNBINDABLE }, { "rprivate", 0, true, MS_PRIVATE, MS_PRIVATE | MS_REC }, { "rshared", 0, true, MS_SHARED, MS_SHARED | MS_REC }, { "rslave", 0, true, MS_SLAVE, MS_SLAVE | MS_REC }, { "runbindable", 0, true, MS_UNBINDABLE, MS_UNBINDABLE | MS_REC }, { NULL, 0, false, 0, 0 }, }; static struct caps_opt caps_opt[] = { #if HAVE_LIBCAP { "chown", CAP_CHOWN }, { "dac_override", CAP_DAC_OVERRIDE }, { "dac_read_search", CAP_DAC_READ_SEARCH }, { "fowner", CAP_FOWNER }, { "fsetid", CAP_FSETID }, { "kill", CAP_KILL }, { "setgid", CAP_SETGID }, { "setuid", CAP_SETUID }, { "setpcap", CAP_SETPCAP }, { "linux_immutable", CAP_LINUX_IMMUTABLE }, { "net_bind_service", CAP_NET_BIND_SERVICE }, { "net_broadcast", CAP_NET_BROADCAST }, { "net_admin", CAP_NET_ADMIN }, { "net_raw", CAP_NET_RAW }, { "ipc_lock", CAP_IPC_LOCK }, { "ipc_owner", CAP_IPC_OWNER }, { "sys_module", CAP_SYS_MODULE }, { "sys_rawio", CAP_SYS_RAWIO }, { "sys_chroot", CAP_SYS_CHROOT }, { "sys_ptrace", CAP_SYS_PTRACE }, { "sys_pacct", CAP_SYS_PACCT }, { "sys_admin", CAP_SYS_ADMIN }, { "sys_boot", CAP_SYS_BOOT }, { "sys_nice", CAP_SYS_NICE }, { "sys_resource", CAP_SYS_RESOURCE }, { "sys_time", CAP_SYS_TIME }, { "sys_tty_config", CAP_SYS_TTY_CONFIG }, { "mknod", CAP_MKNOD }, { "lease", CAP_LEASE }, { "audit_write", CAP_AUDIT_WRITE }, { "audit_control", CAP_AUDIT_CONTROL }, { "setfcap", CAP_SETFCAP }, { "mac_override", CAP_MAC_OVERRIDE }, { "mac_admin", CAP_MAC_ADMIN }, { "syslog", CAP_SYSLOG }, { "wake_alarm", CAP_WAKE_ALARM }, { "block_suspend", CAP_BLOCK_SUSPEND }, { "audit_read", CAP_AUDIT_READ }, { "perfmon", CAP_PERFMON }, { "bpf", CAP_BPF }, { "checkpoint_restore", CAP_CHECKPOINT_RESTORE }, #endif }; static struct limit_opt limit_opt[] = { #ifdef RLIMIT_AS { "as", RLIMIT_AS }, #endif #ifdef RLIMIT_CORE { "core", RLIMIT_CORE }, #endif #ifdef RLIMIT_CPU { "cpu", RLIMIT_CPU }, #endif #ifdef RLIMIT_DATA { "data", RLIMIT_DATA }, #endif #ifdef RLIMIT_FSIZE { "fsize", RLIMIT_FSIZE }, #endif #ifdef RLIMIT_LOCKS { "locks", RLIMIT_LOCKS }, #endif #ifdef RLIMIT_MEMLOCK { "memlock", RLIMIT_MEMLOCK }, #endif #ifdef RLIMIT_MSGQUEUE { "msgqueue", RLIMIT_MSGQUEUE }, #endif #ifdef RLIMIT_NICE { "nice", RLIMIT_NICE }, #endif #ifdef RLIMIT_NOFILE { "nofile", RLIMIT_NOFILE }, #endif #ifdef RLIMIT_NPROC { "nproc", RLIMIT_NPROC }, #endif #ifdef RLIMIT_RSS { "rss", RLIMIT_RSS }, #endif #ifdef RLIMIT_RTPRIO { "rtprio", RLIMIT_RTPRIO }, #endif #ifdef RLIMIT_RTTIME { "rttime", RLIMIT_RTTIME }, #endif #ifdef RLIMIT_SIGPENDING { "sigpending", RLIMIT_SIGPENDING }, #endif #ifdef RLIMIT_STACK { "stack", RLIMIT_STACK }, #endif }; static int run_buffer(char *buffer) { __do_free char *output = NULL; __do_lxc_pclose struct lxc_popen_FILE *f = NULL; int fd, ret; f = lxc_popen(buffer); if (!f) return log_error_errno(-1, errno, "Failed to popen() %s", buffer); output = zalloc(LXC_LOG_BUFFER_SIZE); if (!output) return log_error_errno(-1, ENOMEM, "Failed to allocate memory for %s", buffer); fd = fileno(f->f); if (fd < 0) return log_error_errno(-1, errno, "Failed to retrieve underlying file descriptor"); for (int i = 0; i < 10; i++) { ssize_t bytes_read; bytes_read = lxc_read_nointr(fd, output, LXC_LOG_BUFFER_SIZE - 1); if (bytes_read > 0) { output[bytes_read] = '\0'; DEBUG("Script %s produced output: %s", buffer, output); continue; } break; } ret = lxc_pclose(move_ptr(f)); if (ret == -1) return log_error_errno(-1, errno, "Script exited with error"); else if (WIFEXITED(ret) && WEXITSTATUS(ret) != 0) return log_error(-1, "Script exited with status %d", WEXITSTATUS(ret)); else if (WIFSIGNALED(ret)) return log_error(-1, "Script terminated by signal %d", WTERMSIG(ret)); return 0; } int run_script_argv(const char *name, unsigned int hook_version, const char *section, const char *script, const char *hookname, char **argv) { __do_free char *buffer = NULL; int buf_pos, i, ret; size_t size = 0; if (hook_version == 0) INFO("Executing script \"%s\" for container \"%s\", config section \"%s\"", script, name, section); else INFO("Executing script \"%s\" for container \"%s\"", script, name); for (i = 0; argv && argv[i]; i++) size += strlen(argv[i]) + 1; size += STRLITERALLEN("exec"); size++; size += strlen(script); size++; if (size > INT_MAX) return -EFBIG; if (hook_version == 0) { size += strlen(hookname); size++; size += strlen(name); size++; size += strlen(section); size++; if (size > INT_MAX) return -EFBIG; } buffer = zalloc(size); if (!buffer) return -ENOMEM; if (hook_version == 0) buf_pos = strnprintf(buffer, size, "exec %s %s %s %s", script, name, section, hookname); else buf_pos = strnprintf(buffer, size, "exec %s", script); if (buf_pos < 0) return log_error_errno(-1, errno, "Failed to create command line for script \"%s\"", script); if (hook_version == 1) { ret = setenv("LXC_HOOK_TYPE", hookname, 1); if (ret < 0) { return log_error_errno(-1, errno, "Failed to set environment variable: LXC_HOOK_TYPE=%s", hookname); } TRACE("Set environment variable: LXC_HOOK_TYPE=%s", hookname); ret = setenv("LXC_HOOK_SECTION", section, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_HOOK_SECTION=%s", section); TRACE("Set environment variable: LXC_HOOK_SECTION=%s", section); if (strequal(section, "net")) { char *parent; if (!argv || !argv[0]) return -1; ret = setenv("LXC_NET_TYPE", argv[0], 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_NET_TYPE=%s", argv[0]); TRACE("Set environment variable: LXC_NET_TYPE=%s", argv[0]); parent = argv[1] ? argv[1] : ""; if (strequal(argv[0], "macvlan")) { ret = setenv("LXC_NET_PARENT", parent, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_NET_PARENT=%s", parent); TRACE("Set environment variable: LXC_NET_PARENT=%s", parent); } else if (strequal(argv[0], "phys")) { ret = setenv("LXC_NET_PARENT", parent, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_NET_PARENT=%s", parent); TRACE("Set environment variable: LXC_NET_PARENT=%s", parent); } else if (strequal(argv[0], "veth")) { char *peer = argv[2] ? argv[2] : ""; ret = setenv("LXC_NET_PEER", peer, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_NET_PEER=%s", peer); TRACE("Set environment variable: LXC_NET_PEER=%s", peer); ret = setenv("LXC_NET_PARENT", parent, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to set environment variable: LXC_NET_PARENT=%s", parent); TRACE("Set environment variable: LXC_NET_PARENT=%s", parent); } } } for (i = 0; argv && argv[i]; i++) { size_t len = size - buf_pos; ret = strnprintf(buffer + buf_pos, len, " %s", argv[i]); if (ret < 0) return log_error_errno(-1, errno, "Failed to create command line for script \"%s\"", script); buf_pos += ret; } return run_buffer(buffer); } int run_script(const char *name, const char *section, const char *script, ...) { __do_free char *buffer = NULL; int ret; char *p; va_list ap; size_t size = 0; INFO("Executing script \"%s\" for container \"%s\", config section \"%s\"", script, name, section); va_start(ap, script); while ((p = va_arg(ap, char *))) size += strlen(p) + 1; va_end(ap); size += STRLITERALLEN("exec"); size += strlen(script); size += strlen(name); size += strlen(section); size += 4; if (size > INT_MAX) return -1; buffer = must_realloc(NULL, size); ret = strnprintf(buffer, size, "exec %s %s %s", script, name, section); if (ret < 0) return -1; va_start(ap, script); while ((p = va_arg(ap, char *))) { int len = size - ret; int rc; rc = strnprintf(buffer + ret, len, " %s", p); if (rc < 0) { va_end(ap); return -1; } ret += rc; } va_end(ap); return run_buffer(buffer); } int lxc_storage_prepare(struct lxc_conf *conf) { int ret; struct lxc_rootfs *rootfs = &conf->rootfs; if (!rootfs->path) { ret = mount("", "/", NULL, MS_SLAVE | MS_REC, 0); if (ret < 0) return log_error_errno(-1, errno, "Failed to recursively turn root mount tree into dependent mount"); rootfs->dfd_mnt = open_at(-EBADF, "/", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE, 0); if (rootfs->dfd_mnt < 0) return -errno; return 0; } ret = access(rootfs->mount, F_OK); if (ret != 0) return log_error_errno(-1, errno, "Failed to access to \"%s\". Check it is present", rootfs->mount); rootfs->storage = storage_init(conf); if (!rootfs->storage) return log_error(-1, "Failed to mount rootfs \"%s\" onto \"%s\" with options \"%s\"", rootfs->path, rootfs->mount, rootfs->mnt_opts.raw_options ? rootfs->mnt_opts.raw_options : "(null)"); return 0; } void lxc_storage_put(struct lxc_conf *conf) { storage_put(conf->rootfs.storage); conf->rootfs.storage = NULL; } /* lxc_rootfs_prepare * if rootfs is a directory, then open ${rootfs}/.lxc-keep for writing for * the duration of the container run, to prevent the container from marking * the underlying fs readonly on shutdown. unlink the file immediately so * no name pollution is happens. * don't unlink on NFS to avoid random named stale handles. */ int lxc_rootfs_init(struct lxc_conf *conf, bool userns) { __do_close int dfd_path = -EBADF, fd_pin = -EBADF; int ret; struct stat st; struct statfs stfs; struct lxc_rootfs *rootfs = &conf->rootfs; ret = lxc_storage_prepare(conf); if (ret) return syserror_set(-EINVAL, "Failed to prepare rootfs storage"); if (!is_empty_string(rootfs->mnt_opts.userns_path)) { if (!rootfs->path) return syserror_set(-EINVAL, "Idmapped rootfs currently only supported with separate rootfs for container"); if (rootfs->bdev_type && !strequal(rootfs->bdev_type, "dir")) return syserror_set(-EINVAL, "Idmapped rootfs currently only supports the \"dir\" storage driver"); } if (!rootfs->path) return log_trace(0, "Not pinning because container does not have a rootfs"); if (userns) return log_trace(0, "Not pinning because container runs in user namespace"); if (rootfs->bdev_type) { if (strequal(rootfs->bdev_type, "overlay") || strequal(rootfs->bdev_type, "overlayfs")) return log_trace_errno(0, EINVAL, "Not pinning on stacking filesystem"); if (strequal(rootfs->bdev_type, "zfs")) return log_trace_errno(0, EINVAL, "Not pinning on ZFS filesystem"); } dfd_path = open_at(-EBADF, rootfs->path, PROTECT_OPATH_FILE, 0, 0); if (dfd_path < 0) return syserror("Failed to open \"%s\"", rootfs->path); ret = fstat(dfd_path, &st); if (ret < 0) return log_trace_errno(-errno, errno, "Failed to retrieve file status"); if (!S_ISDIR(st.st_mode)) return log_trace_errno(0, ENOTDIR, "Not pinning because file descriptor is not a directory"); fd_pin = open_at(dfd_path, ".lxc_keep", PROTECT_OPEN | O_CREAT, PROTECT_LOOKUP_BENEATH, S_IWUSR | S_IRUSR); if (fd_pin < 0) { if (errno == EROFS) return log_trace_errno(0, EROFS, "Not pinning on read-only filesystem"); return syserror("Failed to pin rootfs"); } TRACE("Pinned rootfs %d(.lxc_keep)", fd_pin); ret = fstatfs(fd_pin, &stfs); if (ret < 0) { SYSWARN("Failed to retrieve filesystem status"); goto out; } if (stfs.f_type == NFS_SUPER_MAGIC) { DEBUG("Not unlinking pinned file on NFS"); goto out; } if (unlinkat(dfd_path, ".lxc_keep", 0)) SYSTRACE("Failed to unlink rootfs pinning file %d(.lxc_keep)", dfd_path); else TRACE("Unlinked pinned file %d(.lxc_keep)", dfd_path); out: rootfs->fd_path_pin = move_fd(fd_pin); return 0; } int lxc_rootfs_prepare_parent(struct lxc_handler *handler) { __do_close int dfd_idmapped = -EBADF, fd_userns = -EBADF; struct lxc_rootfs *rootfs = &handler->conf->rootfs; struct lxc_storage *storage = rootfs->storage; const struct lxc_mount_options *mnt_opts = &rootfs->mnt_opts; int ret; const char *path_source; if (list_empty(&handler->conf->id_map)) return 0; if (is_empty_string(rootfs->mnt_opts.userns_path)) return 0; if (handler->conf->rootfs_setup) return 0; if (rootfs_is_blockdev(handler->conf)) return syserror_set(-EOPNOTSUPP, "Idmapped mounts on block-backed storage not yet supported"); if (!can_use_bind_mounts()) return syserror_set(-EOPNOTSUPP, "Kernel does not support the new mount api"); if (strequal(rootfs->mnt_opts.userns_path, "container")) fd_userns = dup_cloexec(handler->nsfd[LXC_NS_USER]); else fd_userns = open_at(-EBADF, rootfs->mnt_opts.userns_path, PROTECT_OPEN_WITH_TRAILING_SYMLINKS, 0, 0); if (fd_userns < 0) return syserror("Failed to open user namespace"); path_source = lxc_storage_get_path(storage->src, storage->type); dfd_idmapped = create_detached_idmapped_mount(path_source, fd_userns, true, mnt_opts->attr.attr_set, mnt_opts->attr.attr_clr); if (dfd_idmapped < 0) return syserror("Failed to create detached idmapped mount"); ret = lxc_abstract_unix_send_fds(handler->data_sock[0], &dfd_idmapped, 1, NULL, 0); if (ret < 0) return syserror("Failed to send detached idmapped mount fd"); TRACE("Created detached idmapped mount %d", dfd_idmapped); return 0; } static int add_shmount_to_list(struct lxc_conf *conf) { char new_mount[PATH_MAX]; /* Offset for the leading '/' since the path_cont * is absolute inside the container. */ int offset = 1, ret = -1; ret = strnprintf(new_mount, sizeof(new_mount), "%s %s none bind,create=dir 0 0", conf->shmount.path_host, conf->shmount.path_cont + offset); if (ret < 0) return -1; return add_elem_to_mount_list(new_mount, conf); } static int lxc_mount_auto_mounts(struct lxc_handler *handler, int flags) { int i, ret; static struct { int match_mask; int match_flag; const char *source; const char *destination; const char *fstype; unsigned long flags; const char *options; bool requires_cap_net_admin; } default_mounts[] = { /* Read-only bind-mounting... In older kernels, doing that * required to do one MS_BIND mount and then * MS_REMOUNT|MS_RDONLY the same one. According to mount(2) * manpage, MS_BIND honors MS_RDONLY from kernel 2.6.26 * onwards. However, this apparently does not work on kernel * 3.8. Unfortunately, on that very same kernel, doing the same * trick as above doesn't seem to work either, there one needs * to ALSO specify MS_BIND for the remount, otherwise the * entire fs is remounted read-only or the mount fails because * it's busy... MS_REMOUNT|MS_BIND|MS_RDONLY seems to work for * kernels as low as 2.6.32... */ { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, "proc", "%r/proc", "proc", MS_NODEV|MS_NOEXEC|MS_NOSUID, NULL, false }, /* proc/tty is used as a temporary placeholder for proc/sys/net which we'll move back in a few steps */ { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, "%r/proc/sys/net", "%r/proc/tty", NULL, MS_BIND, NULL, true, }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, "%r/proc/sys", "%r/proc/sys", NULL, MS_BIND, NULL, false }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, NULL, "%r/proc/sys", NULL, MS_REMOUNT|MS_BIND|MS_RDONLY, NULL, false }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, "%r/proc/tty", "%r/proc/sys/net", NULL, MS_MOVE, NULL, true }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, "%r/proc/sysrq-trigger", "%r/proc/sysrq-trigger", NULL, MS_BIND, NULL, false }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_MIXED, NULL, "%r/proc/sysrq-trigger", NULL, MS_REMOUNT|MS_BIND|MS_RDONLY, NULL, false }, { LXC_AUTO_PROC_MASK, LXC_AUTO_PROC_RW, "proc", "%r/proc", "proc", MS_NODEV|MS_NOEXEC|MS_NOSUID, NULL, false }, { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RW, "sysfs", "%r/sys", "sysfs", 0, NULL, false }, { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_RO, "sysfs", "%r/sys", "sysfs", MS_RDONLY, NULL, false }, /* /proc/sys is used as a temporary staging directory for the read-write sysfs mount and unmounted after binding net */ { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, "sysfs", "%r/proc/sys", "sysfs", MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL, false }, { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, "sysfs", "%r/sys", "sysfs", MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL, false }, { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, "%r/proc/sys/devices/virtual/net", "%r/sys/devices/virtual/net", NULL, MS_BIND, NULL, false }, { LXC_AUTO_SYS_MASK, LXC_AUTO_SYS_MIXED, "%r/proc/sys", NULL, NULL, 0, NULL, false }, { 0, 0, NULL, NULL, NULL, 0, NULL, false } }; struct lxc_conf *conf = handler->conf; struct lxc_rootfs *rootfs = &conf->rootfs; bool has_cap_net_admin; if (flags & LXC_AUTO_PROC_MASK) { if (rootfs->path) { /* * Only unmount procfs if we have a separate rootfs so * we can still access it in safe_mount() below. */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/proc", rootfs->path ? rootfs->mount : ""); if (ret < 0) return ret_errno(EIO); ret = umount2(rootfs->buf, MNT_DETACH); if (ret) SYSDEBUG("Tried to ensure procfs is unmounted"); } ret = mkdirat(rootfs->dfd_mnt, "proc" , S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if (ret < 0 && errno != EEXIST) return syserror("Failed to create procfs mountpoint under %d", rootfs->dfd_mnt); TRACE("Created procfs mountpoint under %d", rootfs->dfd_mnt); } if (flags & LXC_AUTO_SYS_MASK) { if (rootfs->path) { /* * Only unmount sysfs if we have a separate rootfs so * we can still access it in safe_mount() below. */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/sys", rootfs->path ? rootfs->mount : ""); if (ret < 0) return ret_errno(EIO); ret = umount2(rootfs->buf, MNT_DETACH); if (ret) SYSDEBUG("Tried to ensure sysfs is unmounted"); } ret = mkdirat(rootfs->dfd_mnt, "sys" , S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if (ret < 0 && errno != EEXIST) return syserror("Failed to create sysfs mountpoint under %d", rootfs->dfd_mnt); TRACE("Created sysfs mountpoint under %d", rootfs->dfd_mnt); } has_cap_net_admin = lxc_wants_cap(CAP_NET_ADMIN, conf); for (i = 0; default_mounts[i].match_mask; i++) { __do_free char *destination = NULL, *source = NULL; unsigned long mflags = default_mounts[i].flags; if ((flags & default_mounts[i].match_mask) != default_mounts[i].match_flag) continue; if (default_mounts[i].source) { /* will act like strdup if %r is not present */ source = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].source); if (!source) return syserror_set(-ENOMEM, "Failed to create source path"); } if (!has_cap_net_admin && default_mounts[i].requires_cap_net_admin) { TRACE("Container does not have CAP_NET_ADMIN. Skipping \"%s\" mount", default_mounts[i].source ?: "(null)"); continue; } if (!default_mounts[i].destination) { ret = umount2(source, MNT_DETACH); if (ret < 0) return log_error_errno(-1, errno, "Failed to unmount \"%s\"", source); TRACE("Unmounted automount \"%s\"", source); continue; } /* will act like strdup if %r is not present */ destination = lxc_string_replace("%r", rootfs->path ? rootfs->mount : "", default_mounts[i].destination); if (!destination) return syserror_set(-ENOMEM, "Failed to create target path"); ret = safe_mount(source, destination, default_mounts[i].fstype, mflags, default_mounts[i].options, rootfs->path ? rootfs->mount : NULL); if (ret < 0) { if (errno != ENOENT) return syserror("Failed to mount \"%s\" on \"%s\" with flags %lu", source, destination, mflags); INFO("Mount source or target for \"%s\" on \"%s\" does not exist. Skipping", source, destination); continue; } if (mflags & MS_REMOUNT) TRACE("Remounted automount \"%s\" on \"%s\" %s with flags %lu", source, destination, (mflags & MS_RDONLY) ? "read-only" : "read-write", mflags); else TRACE("Mounted automount \"%s\" on \"%s\" %s with flags %lu", source, destination, (mflags & MS_RDONLY) ? "read-only" : "read-write", mflags); } if (flags & LXC_AUTO_CGROUP_MASK) { int cg_flags; cg_flags = flags & (LXC_AUTO_CGROUP_MASK & ~LXC_AUTO_CGROUP_FORCE); /* If the type of cgroup mount was not specified, it depends on * the container's capabilities as to what makes sense: if we * have CAP_SYS_ADMIN, the read-only part can be remounted * read-write anyway, so we may as well default to read-write; * then the admin will not be given a false sense of security. * (And if they really want mixed r/o r/w, then they can * explicitly specify :mixed.) OTOH, if the container lacks * CAP_SYS_ADMIN, do only default to :mixed, because then the * container can't remount it read-write. */ if ((cg_flags == LXC_AUTO_CGROUP_NOSPEC) || (cg_flags == LXC_AUTO_CGROUP_FULL_NOSPEC)) { if (cg_flags == LXC_AUTO_CGROUP_NOSPEC) cg_flags = has_cap(CAP_SYS_ADMIN, conf) ? LXC_AUTO_CGROUP_RW : LXC_AUTO_CGROUP_MIXED; else cg_flags = has_cap(CAP_SYS_ADMIN, conf) ? LXC_AUTO_CGROUP_FULL_RW : LXC_AUTO_CGROUP_FULL_MIXED; } if (flags & LXC_AUTO_CGROUP_FORCE) cg_flags |= LXC_AUTO_CGROUP_FORCE; if (!handler->cgroup_ops->mount(handler->cgroup_ops, handler, cg_flags)) return log_error_errno(-1, errno, "Failed to mount \"/sys/fs/cgroup\""); } if (flags & LXC_AUTO_SHMOUNTS_MASK) { ret = add_shmount_to_list(conf); if (ret < 0) return log_error(-1, "Failed to add shmount entry to container config"); } return 0; } static int setup_utsname(struct utsname *utsname) { int ret; if (!utsname) return 0; ret = sethostname(utsname->nodename, strlen(utsname->nodename)); if (ret < 0) return log_error_errno(-1, errno, "Failed to set the hostname to \"%s\"", utsname->nodename); INFO("Set hostname to \"%s\"", utsname->nodename); return 0; } struct dev_symlinks { const char *oldpath; const char *name; }; static const struct dev_symlinks dev_symlinks[] = { { "/proc/self/fd", "fd" }, { "/proc/self/fd/0", "stdin" }, { "/proc/self/fd/1", "stdout" }, { "/proc/self/fd/2", "stderr" }, }; static int lxc_setup_dev_symlinks(const struct lxc_rootfs *rootfs) { for (size_t i = 0; i < sizeof(dev_symlinks) / sizeof(dev_symlinks[0]); i++) { int ret; struct stat s; const struct dev_symlinks *d = &dev_symlinks[i]; /* * Stat the path first. If we don't get an error accept it as * is and don't try to create it */ ret = fstatat(rootfs->dfd_dev, d->name, &s, 0); if (ret == 0) continue; ret = symlinkat(d->oldpath, rootfs->dfd_dev, d->name); if (ret) { switch (errno) { case EROFS: WARN("Failed to create \"%s\" on read-only filesystem", d->name); __fallthrough; case EEXIST: break; default: return log_error_errno(-errno, errno, "Failed to create \"%s\"", d->name); } } } return 0; } /* Build a space-separate list of ptys to pass to systemd. */ static bool append_ttyname(char **pp, char *name) { char *p; size_t size; if (!*pp) { *pp = zalloc(strlen(name) + strlen("container_ttys=") + 1); if (!*pp) return false; sprintf(*pp, "container_ttys=%s", name); return true; } size = strlen(*pp) + strlen(name) + 2; p = realloc(*pp, size); if (!p) return false; *pp = p; (void)strlcat(p, " ", size); (void)strlcat(p, name, size); return true; } static int open_ttymnt_at(int dfd, const char *path) { int fd; fd = open_at(dfd, path, PROTECT_OPEN | O_CREAT | O_EXCL, PROTECT_LOOKUP_BENEATH, 0); if (fd < 0) { if (!IN_SET(errno, ENXIO, EEXIST)) return syserror("Failed to create \"%d/\%s\"", dfd, path); SYSINFO("Failed to create \"%d/\%s\"", dfd, path); fd = open_at(dfd, path, PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH, 0); } return fd; } static int lxc_setup_ttys(struct lxc_conf *conf) { int ret; struct lxc_rootfs *rootfs = &conf->rootfs; const struct lxc_tty_info *ttys = &conf->ttys; char *ttydir = ttys->dir; if (!conf->rootfs.path) return 0; for (size_t i = 0; i < ttys->max; i++) { __do_close int fd_to = -EBADF; struct lxc_terminal_info *tty = &ttys->tty[i]; if (ttydir) { char *tty_name, *tty_path; ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/dev/%s/tty%zu", ttydir, i + 1); if (ret < 0) return ret_errno(-EIO); tty_path = &rootfs->buf[STRLITERALLEN("/dev/")]; tty_name = tty_path + strlen(ttydir) + 1; /* create bind-mount target */ fd_to = open_ttymnt_at(rootfs->dfd_dev, tty_path); if (fd_to < 0) return log_error_errno(-errno, errno, "Failed to create tty mount target %d(%s)", rootfs->dfd_dev, tty_path); ret = unlinkat(rootfs->dfd_dev, tty_name, 0); if (ret < 0 && errno != ENOENT) return log_error_errno(-errno, errno, "Failed to unlink %d(%s)", rootfs->dfd_dev, tty_name); if (can_use_mount_api()) ret = fd_bind_mount(tty->pty, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, fd_to, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, 0, 0, 0, false); else ret = mount_fd(tty->pty, fd_to, "none", MS_BIND, 0); if (ret < 0) return log_error_errno(-errno, errno, "Failed to bind mount \"%s\" onto \"%s\"", tty->name, rootfs->buf); DEBUG("Bind mounted \"%s\" onto \"%s\"", tty->name, rootfs->buf); ret = symlinkat(tty_path, rootfs->dfd_dev, tty_name); if (ret < 0) return log_error_errno(-errno, errno, "Failed to create symlink \"%d(%s)\" -> \"%d(%s)\"", rootfs->dfd_dev, tty_name, rootfs->dfd_dev, tty_path); } else { ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "tty%zu", i + 1); if (ret < 0) return ret_errno(-EIO); /* If we populated /dev, then we need to create /dev/tty. */ fd_to = open_ttymnt_at(rootfs->dfd_dev, rootfs->buf); if (fd_to < 0) return log_error_errno(-errno, errno, "Failed to create tty mount target %d(%s)", rootfs->dfd_dev, rootfs->buf); if (can_use_mount_api()) ret = fd_bind_mount(tty->pty, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, fd_to, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH, 0, 0, 0, false); else ret = mount_fd(tty->pty, fd_to, "none", MS_BIND, 0); if (ret < 0) return log_error_errno(-errno, errno, "Failed to bind mount \"%s\" onto \"%s\"", tty->name, rootfs->buf); DEBUG("Bind mounted \"%s\" onto \"%s\"", tty->name, rootfs->buf); } if (!append_ttyname(&conf->ttys.tty_names, tty->name)) return log_error(-1, "Error setting up container_ttys string"); } INFO("Finished setting up %zu /dev/tty device(s)", ttys->max); return 0; } define_cleanup_function(struct lxc_tty_info *, lxc_delete_tty); static int lxc_allocate_ttys(struct lxc_conf *conf) { call_cleaner(lxc_delete_tty) struct lxc_tty_info *ttys = &conf->ttys; int ret; /* no tty in the configuration */ if (ttys->max == 0) return 0; ttys->tty = zalloc(sizeof(struct lxc_terminal_info) * ttys->max); if (!ttys->tty) return -ENOMEM; for (size_t i = 0; i < conf->ttys.max; i++) { int pty_nr = -1; struct lxc_terminal_info *tty = &ttys->tty[i]; ret = lxc_devpts_terminal(conf->devpts_fd, &tty->ptx, &tty->pty, &pty_nr, false); if (ret < 0) { conf->ttys.max = i; return syserror_set(-ENOTTY, "Failed to create tty %zu", i); } DEBUG("Created tty with ptx fd %d and pty fd %d and index %d", tty->ptx, tty->pty, pty_nr); tty->busy = -1; } INFO("Finished creating %zu tty devices", ttys->max); move_ptr(ttys); return 0; } void lxc_delete_tty(struct lxc_tty_info *ttys) { if (!ttys || !ttys->tty) return; for (size_t i = 0; i < ttys->max; i++) { struct lxc_terminal_info *tty = &ttys->tty[i]; close_prot_errno_disarm(tty->ptx); close_prot_errno_disarm(tty->pty); } free_disarm(ttys->tty); } static int __lxc_send_ttys_to_parent(struct lxc_handler *handler) { int ret = -1; struct lxc_conf *conf = handler->conf; struct lxc_tty_info *ttys = &conf->ttys; int sock = handler->data_sock[0]; if (ttys->max == 0) return 0; for (size_t i = 0; i < ttys->max; i++) { int ttyfds[2]; struct lxc_terminal_info *tty = &ttys->tty[i]; ttyfds[0] = tty->ptx; ttyfds[1] = tty->pty; ret = lxc_abstract_unix_send_fds(sock, ttyfds, 2, NULL, 0); if (ret < 0) break; TRACE("Sent tty \"%s\" with ptx fd %d and pty fd %d to parent", tty->name, tty->ptx, tty->pty); } if (ret < 0) SYSERROR("Failed to send %zu ttys to parent", ttys->max); else TRACE("Sent %zu ttys to parent", ttys->max); return ret; } static int lxc_create_ttys(struct lxc_handler *handler) { int ret = -1; struct lxc_conf *conf = handler->conf; ret = lxc_allocate_ttys(conf); if (ret < 0) { ERROR("Failed to allocate ttys"); goto on_error; } if (!conf->is_execute) { ret = lxc_setup_ttys(conf); if (ret < 0) { ERROR("Failed to setup ttys"); goto on_error; } } if (conf->ttys.tty_names) { ret = setenv("container_ttys", conf->ttys.tty_names, 1); if (ret < 0) { SYSERROR("Failed to set \"container_ttys=%s\"", conf->ttys.tty_names); goto on_error; } } return 0; on_error: lxc_delete_tty(&conf->ttys); return -1; } static int lxc_send_ttys_to_parent(struct lxc_handler *handler) { int ret = -1; ret = __lxc_send_ttys_to_parent(handler); lxc_delete_tty(&handler->conf->ttys); return ret; } /* Just create a path for /dev under $lxcpath/$name and in rootfs If we hit an * error, log it but don't fail yet. */ static int mount_autodev(const char *name, const struct lxc_rootfs *rootfs, int autodevtmpfssize, const char *lxcpath) { __do_close int fd_fs = -EBADF; const char *path = rootfs->path ? rootfs->mount : NULL; size_t tmpfs_size = (autodevtmpfssize != 0) ? autodevtmpfssize : 500000; int ret; mode_t cur_mask; char mount_options[128]; INFO("Preparing \"/dev\""); cur_mask = umask(S_IXUSR | S_IXGRP | S_IXOTH); ret = mkdirat(rootfs->dfd_mnt, "dev" , S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create \"/dev\" directory"); ret = -errno; goto reset_umask; } if (can_use_mount_api()) { fd_fs = fs_prepare("tmpfs", -EBADF, "", 0, 0); if (fd_fs < 0) return log_error_errno(-errno, errno, "Failed to prepare filesystem context for tmpfs"); sprintf(mount_options, "%zu", tmpfs_size); ret = fs_set_property(fd_fs, "mode", "0755"); if (ret < 0) return log_error_errno(-errno, errno, "Failed to mount tmpfs onto %d(dev)", fd_fs); ret = fs_set_property(fd_fs, "size", mount_options); if (ret < 0) return log_error_errno(-errno, errno, "Failed to mount tmpfs onto %d(dev)", fd_fs); ret = fs_attach(fd_fs, rootfs->dfd_mnt, "dev", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH_XDEV, 0); } else { __do_free char *fallback_path = NULL; sprintf(mount_options, "size=%zu,mode=755", tmpfs_size); DEBUG("Using mount options: %s", mount_options); if (path) { fallback_path = must_make_path(path, "/dev", NULL); ret = safe_mount("none", fallback_path, "tmpfs", 0, mount_options, path); } else { ret = safe_mount("none", "dev", "tmpfs", 0, mount_options, NULL); } } if (ret < 0) { SYSERROR("Failed to mount tmpfs on \"%s\"", path); goto reset_umask; } /* If we are running on a devtmpfs mapping, dev/pts may already exist. * If not, then create it and exit if that fails... */ ret = mkdirat(rootfs->dfd_mnt, "dev/pts", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create directory \"dev/pts\""); ret = -errno; goto reset_umask; } ret = 0; reset_umask: (void)umask(cur_mask); INFO("Prepared \"/dev\""); return ret; } struct lxc_device_node { const char *name; const mode_t mode; const int maj; const int min; }; static const struct lxc_device_node lxc_devices[] = { { "full", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 1, 7 }, { "null", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 1, 3 }, { "random", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 1, 8 }, { "tty", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 5, 0 }, { "urandom", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 1, 9 }, { "zero", S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO, 1, 5 }, }; enum { LXC_DEVNODE_BIND, LXC_DEVNODE_MKNOD, LXC_DEVNODE_PARTIAL, LXC_DEVNODE_OPEN, }; static int lxc_fill_autodev(struct lxc_rootfs *rootfs) { int ret; mode_t cmask; int use_mknod = LXC_DEVNODE_MKNOD; if (rootfs->dfd_dev < 0) return log_info(0, "No /dev directory found, skipping setup"); INFO("Populating \"/dev\""); cmask = umask(S_IXUSR | S_IXGRP | S_IXOTH); for (size_t i = 0; i < sizeof(lxc_devices) / sizeof(lxc_devices[0]); i++) { const struct lxc_device_node *device = &lxc_devices[i]; if (use_mknod >= LXC_DEVNODE_MKNOD) { ret = mknodat(rootfs->dfd_dev, device->name, device->mode, makedev(device->maj, device->min)); if (ret == 0 || (ret < 0 && errno == EEXIST)) { DEBUG("Created device node \"%s\"", device->name); } else if (ret < 0) { if (errno != EPERM) return log_error_errno(-1, errno, "Failed to create device node \"%s\"", device->name); use_mknod = LXC_DEVNODE_BIND; } /* Device nodes are fully useable. */ if (use_mknod == LXC_DEVNODE_OPEN) continue; if (use_mknod == LXC_DEVNODE_MKNOD) { __do_close int fd = -EBADF; /* See * - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=55956b59df336f6738da916dbb520b6e37df9fbd * - https://lists.linuxfoundation.org/pipermail/containers/2018-June/039176.html */ fd = open_at(rootfs->dfd_dev, device->name, PROTECT_OPEN, PROTECT_LOOKUP_BENEATH, 0); if (fd >= 0) { /* Device nodes are fully useable. */ use_mknod = LXC_DEVNODE_OPEN; continue; } SYSTRACE("Failed to open \"%s\" device", device->name); /* Device nodes are only partially useable. */ use_mknod = LXC_DEVNODE_PARTIAL; } } if (use_mknod != LXC_DEVNODE_PARTIAL) { /* If we are dealing with partially functional device * nodes the prio mknod() call will have created the * device node so we can use it as a bind-mount target. */ ret = mknodat(rootfs->dfd_dev, device->name, S_IFREG | 0000, 0); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create file \"%s\"", device->name); } /* Fallback to bind-mounting the device from the host. */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "dev/%s", device->name); if (ret < 0) return ret_errno(EIO); if (can_use_mount_api()) { ret = fd_bind_mount(rootfs->dfd_host, rootfs->buf, PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, rootfs->dfd_dev, device->name, PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH, 0, 0, 0, false); } else { char path[PATH_MAX]; ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/dev/%s", device->name); if (ret < 0) return ret_errno(EIO); ret = strnprintf(path, sizeof(path), "%s/dev/%s", get_rootfs_mnt(rootfs), device->name); if (ret < 0) return log_error(-1, "Failed to create device path for %s", device->name); ret = safe_mount(rootfs->buf, path, 0, MS_BIND, NULL, get_rootfs_mnt(rootfs)); if (ret < 0) return log_error_errno(-1, errno, "Failed to bind mount host device node \"%s\" to \"%s\"", rootfs->buf, path); DEBUG("Bind mounted host device node \"%s\" to \"%s\"", rootfs->buf, path); continue; } DEBUG("Bind mounted host device %d(%s) to %d(%s)", rootfs->dfd_host, rootfs->buf, rootfs->dfd_dev, device->name); } (void)umask(cmask); INFO("Populated \"/dev\""); return 0; } static int lxc_mount_rootfs(struct lxc_rootfs *rootfs) { int ret; if (!rootfs->path) { ret = mount("", "/", NULL, MS_SLAVE | MS_REC, 0); if (ret < 0) return log_error_errno(-1, errno, "Failed to recursively turn root mount tree into dependent mount"); rootfs->dfd_mnt = open_at(-EBADF, "/", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE, 0); if (rootfs->dfd_mnt < 0) return -errno; return log_trace(0, "Container doesn't use separate rootfs. Opened host's rootfs"); } ret = access(rootfs->mount, F_OK); if (ret != 0) return log_error_errno(-1, errno, "Failed to access to \"%s\". Check it is present", rootfs->mount); ret = rootfs->storage->ops->mount(rootfs->storage); if (ret < 0) return log_error(-1, "Failed to mount rootfs \"%s\" onto \"%s\" with options \"%s\"", rootfs->path, rootfs->mount, rootfs->mnt_opts.raw_options ? rootfs->mnt_opts.raw_options : "(null)"); DEBUG("Mounted rootfs \"%s\" onto \"%s\" with options \"%s\"", rootfs->path, rootfs->mount, rootfs->mnt_opts.raw_options ? rootfs->mnt_opts.raw_options : "(null)"); rootfs->dfd_mnt = open_at(-EBADF, rootfs->mount, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (rootfs->dfd_mnt < 0) return -errno; return log_trace(0, "Container uses separate rootfs. Opened container's rootfs"); } static bool lxc_rootfs_overmounted(struct lxc_rootfs *rootfs) { __do_close int fd_rootfs = -EBADF; if (!rootfs->path) fd_rootfs = open_at(-EBADF, "/", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE, 0); else fd_rootfs = open_at(-EBADF, rootfs->mount, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (fd_rootfs < 0) return true; if (!same_file_lax(rootfs->dfd_mnt, fd_rootfs)) return syswarn_ret(true, "Rootfs seems to have changed after setting up mounts"); return false; } static int lxc_chroot(const struct lxc_rootfs *rootfs) { __do_free char *nroot = NULL; int i, ret; char *root = rootfs->mount; nroot = realpath(root, NULL); if (!nroot) return log_error_errno(-1, errno, "Failed to resolve \"%s\"", root); ret = chdir("/"); if (ret < 0) return -1; /* We could use here MS_MOVE, but in userns this mount is locked and * can't be moved. */ ret = mount(nroot, "/", NULL, MS_REC | MS_BIND, NULL); if (ret < 0) return log_error_errno(-1, errno, "Failed to mount \"%s\" onto \"/\" as MS_REC | MS_BIND", nroot); ret = mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL); if (ret < 0) return log_error_errno(-1, errno, "Failed to remount \"/\""); /* The following code cleans up inherited mounts which are not required * for CT. * * The mountinfo file shows not all mounts, if a few points have been * unmounted between read operations from the mountinfo. So we need to * read mountinfo a few times. * * This loop can be skipped if a container uses userns, because all * inherited mounts are locked and we should live with all this trash. */ for (;;) { __do_fclose FILE *f = NULL; __do_free char *line = NULL; char *slider1, *slider2; int progress = 0; size_t len = 0; f = fopen("./proc/self/mountinfo", "re"); if (!f) return log_error_errno(-1, errno, "Failed to open \"/proc/self/mountinfo\""); while (getline(&line, &len, f) > 0) { for (slider1 = line, i = 0; slider1 && i < 4; i++) slider1 = strchr(slider1 + 1, ' '); if (!slider1) continue; slider2 = strchr(slider1 + 1, ' '); if (!slider2) continue; *slider2 = '\0'; *slider1 = '.'; if (strequal(slider1 + 1, "/")) continue; if (strequal(slider1 + 1, "/proc")) continue; ret = umount2(slider1, MNT_DETACH); if (ret == 0) progress++; } if (!progress) break; } /* This also can be skipped if a container uses userns. */ (void)umount2("./proc", MNT_DETACH); /* It is weird, but chdir("..") moves us in a new root */ ret = chdir(".."); if (ret < 0) return log_error_errno(-1, errno, "Failed to chdir(\"..\")"); ret = chroot("."); if (ret < 0) return log_error_errno(-1, errno, "Failed to chroot(\".\")"); return 0; } /* (The following explanation is copied verbatim from the kernel.) * * pivot_root Semantics: * Moves the root file system of the current process to the directory put_old, * makes new_root as the new root file system of the current process, and sets * root/cwd of all processes which had them on the current root to new_root. * * Restrictions: * The new_root and put_old must be directories, and must not be on the * same file system as the current process root. The put_old must be * underneath new_root, i.e. adding a non-zero number of /.. to the string * pointed to by put_old must yield the same directory as new_root. No other * file system may be mounted on put_old. After all, new_root is a mountpoint. * * Also, the current root cannot be on the 'rootfs' (initial ramfs) filesystem. * See Documentation/filesystems/ramfs-rootfs-initramfs.txt for alternatives * in this situation. * * Notes: * - we don't move root/cwd if they are not at the root (reason: if something * cared enough to change them, it's probably wrong to force them elsewhere) * - it's okay to pick a root that isn't the root of a file system, e.g. * /nfs/my_root where /nfs is the mount point. It must be a mountpoint, * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root * first. */ static int lxc_pivot_root(const struct lxc_rootfs *rootfs) { __do_close int fd_oldroot = -EBADF; int ret; fd_oldroot = open_at(-EBADF, "/", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE, 0); if (fd_oldroot < 0) return log_error_errno(-1, errno, "Failed to open old root directory"); /* change into new root fs */ ret = fchdir(rootfs->dfd_mnt); if (ret < 0) return log_error_errno(-errno, errno, "Failed to change into new root directory \"%s\"", rootfs->mount); /* pivot_root into our new root fs */ ret = pivot_root(".", "."); if (ret < 0) return log_error_errno(-errno, errno, "Failed to pivot into new root directory \"%s\"", rootfs->mount); /* At this point the old-root is mounted on top of our new-root. To * unmounted it we must not be chdir'd into it, so escape back to * old-root. */ ret = fchdir(fd_oldroot); if (ret < 0) return log_error_errno(-errno, errno, "Failed to enter old root directory"); /* * Make fd_oldroot a depedent mount to make sure our umounts don't * propagate to the host. */ ret = mount("", ".", "", MS_SLAVE | MS_REC, NULL); if (ret < 0) return log_error_errno(-errno, errno, "Failed to recursively turn old root mount tree into dependent mount"); ret = umount2(".", MNT_DETACH); if (ret < 0) return log_error_errno(-errno, errno, "Failed to detach old root directory"); ret = fchdir(rootfs->dfd_mnt); if (ret < 0) return log_error_errno(-errno, errno, "Failed to re-enter new root directory \"%s\"", rootfs->mount); TRACE("Changed into new rootfs \"%s\"", rootfs->mount); return 0; } static int lxc_setup_rootfs_switch_root(const struct lxc_rootfs *rootfs) { if (!rootfs->path) return log_debug(0, "Container does not have a rootfs"); if (detect_ramfs_rootfs()) return lxc_chroot(rootfs); return lxc_pivot_root(rootfs); } static const struct id_map *find_mapped_nsid_entry(const struct lxc_conf *conf, unsigned id, enum idtype idtype) { struct id_map *map; struct id_map *retmap = NULL; /* Shortcut for container's root mappings. */ if (id == 0) { if (idtype == ID_TYPE_UID) return conf->root_nsuid_map; if (idtype == ID_TYPE_GID) return conf->root_nsgid_map; } list_for_each_entry(map, &conf->id_map, head) { if (map->idtype != idtype) continue; if (id >= map->nsid && id < map->nsid + map->range) { retmap = map; break; } } return retmap; } static int lxc_recv_devpts_from_child(struct lxc_handler *handler) { int ret; if (handler->conf->pty_max <= 0) return 0; ret = lxc_abstract_unix_recv_one_fd(handler->data_sock[1], &handler->conf->devpts_fd, &handler->conf->devpts_fd, sizeof(handler->conf->devpts_fd)); if (ret < 0) return log_error_errno(-1, errno, "Failed to receive devpts fd from child"); TRACE("Received devpts file descriptor %d from child", handler->conf->devpts_fd); return 0; } static int lxc_setup_devpts_child(struct lxc_handler *handler) { __do_close int devpts_fd = -EBADF, fd_fs = -EBADF; struct lxc_conf *conf = handler->conf; struct lxc_rootfs *rootfs = &conf->rootfs; size_t pty_max = conf->pty_max; int ret; pty_max += conf->ttys.max; if (pty_max <= 0) return log_debug(0, "No new devpts instance will be mounted since no pts devices are required"); ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/proc/self/fd/%d/pts", rootfs->dfd_dev); if (ret < 0) return syserror("Failed to create path"); (void)umount2(rootfs->buf, MNT_DETACH); /* Create mountpoint for devpts instance. */ ret = mkdirat(rootfs->dfd_dev, "pts", 0755); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create \"/dev/pts\" directory"); if (can_use_mount_api()) { fd_fs = fs_prepare("devpts", -EBADF, "", 0, 0); if (fd_fs < 0) return syserror("Failed to prepare filesystem context for devpts"); ret = fs_set_property(fd_fs, "source", "devpts"); if (ret < 0) SYSTRACE("Failed to set \"source=devpts\" on devpts filesystem context %d", fd_fs); ret = fs_set_property(fd_fs, "gid", "5"); if (ret < 0) SYSTRACE("Failed to set \"gid=5\" on devpts filesystem context %d", fd_fs); ret = fs_set_flag(fd_fs, "newinstance"); if (ret < 0) return syserror("Failed to set \"newinstance\" property on devpts filesystem context %d", fd_fs); ret = fs_set_property(fd_fs, "ptmxmode", "0666"); if (ret < 0) return syserror("Failed to set \"ptmxmode=0666\" property on devpts filesystem context %d", fd_fs); ret = fs_set_property(fd_fs, "mode", "0620"); if (ret < 0) return syserror("Failed to set \"mode=0620\" property on devpts filesystem context %d", fd_fs); ret = fs_set_property(fd_fs, "max", fdstr(pty_max)); if (ret < 0) return syserror("Failed to set \"max=%zu\" property on devpts filesystem context %d", conf->pty_max, fd_fs); ret = fsconfig(fd_fs, FSCONFIG_CMD_CREATE, NULL, NULL, 0); if (ret < 0) return syserror("Failed to finalize filesystem context %d", fd_fs); devpts_fd = fsmount(fd_fs, FSMOUNT_CLOEXEC, MOUNT_ATTR_NOSUID | MOUNT_ATTR_NOEXEC); if (devpts_fd < 0) return syserror("Failed to create new mount for filesystem context %d", fd_fs); TRACE("Created detached devpts mount %d", devpts_fd); ret = move_mount(devpts_fd, "", rootfs->dfd_dev, "pts", MOVE_MOUNT_F_EMPTY_PATH); if (ret) return syserror("Failed to attach devpts mount %d to %d/pts", conf->devpts_fd, rootfs->dfd_dev); DEBUG("Attached detached devpts mount %d to %d/pts", devpts_fd, rootfs->dfd_dev); } else { char **opts; char devpts_mntopts[256]; char *mntopt_sets[5]; char default_devpts_mntopts[256] = "gid=5,newinstance,ptmxmode=0666,mode=0620"; /* * Fallback codepath in case the new mount API can't be used to * create detached mounts. */ ret = strnprintf(devpts_mntopts, sizeof(devpts_mntopts), "%s,max=%zu", default_devpts_mntopts, pty_max); if (ret < 0) return -1; /* Create mountpoint for devpts instance. */ ret = mkdirat(rootfs->dfd_dev, "pts", 0755); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create \"/dev/pts\" directory"); /* gid=5 && max= */ mntopt_sets[0] = devpts_mntopts; /* !gid=5 && max= */ mntopt_sets[1] = devpts_mntopts + STRLITERALLEN("gid=5") + 1; /* gid=5 && !max= */ mntopt_sets[2] = default_devpts_mntopts; /* !gid=5 && !max= */ mntopt_sets[3] = default_devpts_mntopts + STRLITERALLEN("gid=5") + 1; /* end */ mntopt_sets[4] = NULL; for (ret = -1, opts = mntopt_sets; opts && *opts; opts++) { /* mount new devpts instance */ ret = mount_at(rootfs->dfd_dev, "", 0, rootfs->dfd_dev, "pts", PROTECT_LOOKUP_BENEATH, "devpts", MS_NOSUID | MS_NOEXEC, *opts); if (ret == 0) break; } if (ret < 0) return log_error_errno(-1, errno, "Failed to mount new devpts instance"); devpts_fd = open_at(rootfs->dfd_dev, "pts", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH_XDEV, 0); if (devpts_fd < 0) { devpts_fd = -EBADF; TRACE("Failed to create detached devpts mount"); } DEBUG("Mounted new devpts instance with options \"%s\"", *opts); } handler->conf->devpts_fd = move_fd(devpts_fd); /* * In order to allocate terminal devices the devpts filesystem will * have to be attached to the filesystem at least ones in the new mount * api. The reason is lengthy but the gist is that until the new mount * has been attached to the filesystem it is a detached mount with an * anonymous mount mamespace attached to it for which the kernel * refuses certain operations. * We end up here if the user has requested to allocate tty devices * while not requestig pty devices be made available to the container. * We only need the devpts_fd to allocate tty devices. */ if (conf->pty_max <= 0) return 0; /* Remove any pre-existing /dev/ptmx file. */ ret = unlinkat(rootfs->dfd_dev, "ptmx", 0); if (ret < 0) { if (errno != ENOENT) return log_error_errno(-1, errno, "Failed to remove existing \"/dev/ptmx\" file"); } else { DEBUG("Removed existing \"/dev/ptmx\" file"); } /* Create placeholder /dev/ptmx file as bind mountpoint for /dev/pts/ptmx. */ ret = mknodat(rootfs->dfd_dev, "ptmx", S_IFREG | 0000, 0); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create \"/dev/ptmx\" file as bind mount target"); DEBUG("Created \"/dev/ptmx\" file as bind mount target"); /* Main option: use a bind-mount to please AppArmor */ ret = mount_at(rootfs->dfd_dev, "pts/ptmx", (PROTECT_LOOKUP_BENEATH_WITH_SYMLINKS & ~RESOLVE_NO_XDEV), rootfs->dfd_dev, "ptmx", (PROTECT_LOOKUP_BENEATH_WITH_SYMLINKS & ~RESOLVE_NO_XDEV), NULL, MS_BIND, NULL); if (!ret) return log_debug(0, "Bind mounted \"/dev/pts/ptmx\" to \"/dev/ptmx\""); else /* Fallthrough and try to create a symlink. */ ERROR("Failed to bind mount \"/dev/pts/ptmx\" to \"/dev/ptmx\""); /* Remove the placeholder /dev/ptmx file we created above. */ ret = unlinkat(rootfs->dfd_dev, "ptmx", 0); if (ret < 0) return log_error_errno(-1, errno, "Failed to remove existing \"/dev/ptmx\""); /* Fallback option: Create symlink /dev/ptmx -> /dev/pts/ptmx. */ ret = symlinkat("/dev/pts/ptmx", rootfs->dfd_dev, "dev/ptmx"); if (ret < 0) return log_error_errno(-1, errno, "Failed to create symlink from \"/dev/ptmx\" to \"/dev/pts/ptmx\""); DEBUG("Created symlink from \"/dev/ptmx\" to \"/dev/pts/ptmx\""); return 0; } static int lxc_finish_devpts_child(struct lxc_handler *handler) { struct lxc_conf *conf = handler->conf; struct lxc_rootfs *rootfs = &conf->rootfs; int ret; if (conf->pty_max > 0) return 0; /* * We end up here if the user has requested to allocate tty devices * while not requestig pty devices be made available to the container. * This means we can unmount the devpts instance. We only need the * devpts_fd to allocate tty devices. */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/proc/self/fd/%d/pts", rootfs->dfd_dev); if (ret < 0) return syserror("Failed to create path"); close_prot_errno_disarm(conf->devpts_fd); (void)umount2(rootfs->buf, MNT_DETACH); return 0; } static int lxc_send_devpts_to_parent(struct lxc_handler *handler) { int ret; if (handler->conf->pty_max <= 0) return log_debug(0, "No devpts file descriptor will be sent since no pts devices are requested"); ret = lxc_abstract_unix_send_fds(handler->data_sock[0], &handler->conf->devpts_fd, 1, NULL, 0); if (ret < 0) SYSERROR("Failed to send devpts file descriptor %d to parent", handler->conf->devpts_fd); else TRACE("Sent devpts file descriptor %d to parent", handler->conf->devpts_fd); close_prot_errno_disarm(handler->conf->devpts_fd); return 0; } static int setup_personality(personality_t persona) { int ret; if (persona == LXC_ARCH_UNCHANGED) return log_debug(0, "Retaining original personality"); ret = lxc_personality(persona); if (ret < 0) return syserror("Failed to set personality to \"0lx%lx\"", persona); INFO("Set personality to \"0lx%lx\"", persona); return 0; } static int bind_mount_console(int fd_devpts, struct lxc_rootfs *rootfs, struct lxc_terminal *console, int fd_to) { __do_close int fd_pty = -EBADF; if (is_empty_string(console->name)) return ret_errno(EINVAL); /* * When the pty fd stashed in console->pty has been retrieved via the * TIOCGPTPEER ioctl() to avoid dangerous path-based lookups when * allocating new pty devices we can't reopen it through openat2() or * created a detached mount through open_tree() from it. This means we * would need to mount using the path stased in console->name which is * unsafe. We could be mounting a device that isn't identical to the * one we've already safely opened and stashed in console->pty. * So, what we do is we open an O_PATH file descriptor for * console->name and verify that the opened fd and the fd we stashed in * console->pty refer to the same device. If they do we can go on and * created a detached mount based on the newly opened O_PATH file * descriptor and then safely mount. */ fd_pty = open_at_same(console->pty, fd_devpts, fdstr(console->pty_nr), PROTECT_OPATH_FILE, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (fd_pty < 0) return syserror("Failed to open \"%s\"", console->name); /* * Note, there are intentionally no open or lookup restrictions since * we're operating directly on the fd. */ if (can_use_mount_api()) return fd_bind_mount(fd_pty, "", 0, 0, fd_to, "", 0, 0, 0, 0, 0, false); return mount_fd(fd_pty, fd_to, "none", MS_BIND, 0); } static int lxc_setup_dev_console(int fd_devpts, struct lxc_rootfs *rootfs, struct lxc_terminal *console) { __do_close int fd_console = -EBADF; int ret; /* * When we are asked to setup a console we remove any previous * /dev/console bind-mounts. */ if (exists_file_at(rootfs->dfd_dev, "console")) { char *rootfs_path = rootfs->path ? rootfs->mount : ""; ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/dev/console", rootfs_path); if (ret < 0) return -1; ret = lxc_unstack_mountpoint(rootfs->buf, false); if (ret < 0) return log_error_errno(-ret, errno, "Failed to unmount \"%s\"", rootfs->buf); else DEBUG("Cleared all (%d) mounts from \"%s\"", ret, rootfs->buf); } /* * For unprivileged containers autodev or automounts will already have * taken care of creating /dev/console. */ fd_console = open_at(rootfs->dfd_dev, "console", PROTECT_OPEN | O_CREAT, PROTECT_LOOKUP_BENEATH, 0000); if (fd_console < 0) return syserror("Failed to create \"%d/console\"", rootfs->dfd_dev); ret = fchmod(console->pty, 0620); if (ret < 0) return syserror("Failed to change console mode"); ret = bind_mount_console(fd_devpts, rootfs, console, fd_console); if (ret < 0) return syserror("Failed to mount \"%d(%s)\" on \"%d\"", console->pty, console->name, fd_console); TRACE("Setup console \"%s\"", console->name); return 0; } static int lxc_setup_ttydir_console(int fd_devpts, struct lxc_rootfs *rootfs, struct lxc_terminal *console, char *ttydir) { __do_close int fd_ttydir = -EBADF, fd_dev_console = -EBADF, fd_reg_console = -EBADF, fd_reg_ttydir_console = -EBADF; int ret; /* create dev/ */ ret = mkdirat(rootfs->dfd_dev, ttydir, 0755); if (ret < 0 && errno != EEXIST) return syserror("Failed to create \"%d/%s\"", rootfs->dfd_dev, ttydir); fd_ttydir = open_at(rootfs->dfd_dev, ttydir, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH, 0); if (fd_ttydir < 0) return syserror("Failed to open \"%d/%s\"", rootfs->dfd_dev, ttydir); ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/console", ttydir); if (ret < 0) return -1; /* create dev//console */ fd_reg_ttydir_console = open_at(fd_ttydir, "console", PROTECT_OPEN | O_CREAT, PROTECT_LOOKUP_BENEATH, 0000); if (fd_reg_ttydir_console < 0) return syserror("Failed to create \"%d/console\"", fd_ttydir); if (file_exists(rootfs->buf)) { char *rootfs_path = rootfs->path ? rootfs->mount : ""; ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/dev/console", rootfs_path); if (ret < 0) return -1; ret = lxc_unstack_mountpoint(rootfs->buf, false); if (ret < 0) return log_error_errno(-ret, errno, "Failed to unmount \"%s\"", rootfs->buf); else DEBUG("Cleared all (%d) mounts from \"%s\"", ret, rootfs->buf); } /* create dev/console */ fd_reg_console = open_at(rootfs->dfd_dev, "console", PROTECT_OPEN | O_CREAT, PROTECT_LOOKUP_BENEATH, 0000); if (fd_reg_console < 0) return syserror("Failed to create \"%d/console\"", rootfs->dfd_dev); ret = fchmod(console->pty, 0620); if (ret < 0) return syserror("Failed to change console mode"); /* bind mount console to '/dev//console' */ ret = bind_mount_console(fd_devpts, rootfs, console, fd_reg_ttydir_console); if (ret < 0) return syserror("Failed to mount \"%d(%s)\" on \"%d\"", console->pty, console->name, fd_reg_ttydir_console); fd_dev_console = open_at_same(console->pty, fd_ttydir, "console", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, 0); if (fd_dev_console < 0) return syserror("Failed to open \"%d/console\"", fd_ttydir); /* bind mount '/dev//console' to '/dev/console' */ if (can_use_mount_api()) ret = fd_bind_mount(fd_dev_console, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_XDEV, fd_reg_console, "", PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH, 0, 0, 0, false); else ret = mount_fd(fd_dev_console, fd_reg_console, "none", MS_BIND, 0); if (ret < 0) return syserror("Failed to mount \"%d\" on \"%d\"", fd_dev_console, fd_reg_console); TRACE("Setup console \"%s\"", console->name); return 0; } static int lxc_setup_console(const struct lxc_handler *handler, struct lxc_rootfs *rootfs, struct lxc_terminal *console, char *ttydir) { __do_close int fd_devpts_host = -EBADF; int fd_devpts = handler->conf->devpts_fd; int ret = -1; if (!wants_console(console)) return log_trace(0, "Skipping console setup"); if (console->pty < 0) { /* * Allocate a console from the container's devpts instance. We * have checked on the host that we have enough pty devices * available. */ ret = lxc_devpts_terminal(handler->conf->devpts_fd, &console->ptx, &console->pty, &console->pty_nr, false); if (ret < 0) return syserror("Failed to allocate console from container's devpts instance"); ret = strnprintf(console->name, sizeof(console->name), "/dev/pts/%d", console->pty_nr); if (ret < 0) return syserror("Failed to create console path"); } else { /* * We're using a console from the host's devpts instance. Open * it again so we can later verify that the console we're * supposed to use is still the same as the one we opened on * the host. */ fd_devpts_host = open_at(rootfs->dfd_host, "dev/pts", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH_XDEV, 0); if (fd_devpts_host < 0) return syserror("Failed to open host devpts"); fd_devpts = fd_devpts_host; } if (ttydir) ret = lxc_setup_ttydir_console(fd_devpts, rootfs, console, ttydir); else ret = lxc_setup_dev_console(fd_devpts, rootfs, console); if (ret < 0) return syserror("Failed to setup console"); /* * Some init's such as busybox will set sane tty settings on stdin, * stdout, stderr which it thinks is the console. We already set them * the way we wanted on the real terminal, and we want init to do its * setup on its console ie. the pty allocated in lxc_terminal_setup() so * make sure that that pty is stdin,stdout,stderr. */ if (console->pty >= 0) { if (handler->daemonize || !handler->conf->is_execute) ret = set_stdfds(console->pty); else ret = lxc_terminal_set_stdfds(console->pty); if (ret < 0) return syserror("Failed to redirect std{in,out,err} to pty file descriptor %d", console->pty); /* * If the console has been allocated from the host's devpts * we're done and we don't need to send fds to the parent. */ if (fd_devpts_host >= 0) lxc_terminal_delete(console); } return ret; } static int parse_mntopt(char *opt, unsigned long *flags, char **data, size_t size) { ssize_t ret; /* If '=' is contained in opt, the option must go into data. */ if (!strchr(opt, '=')) { /* * If opt is found in mount_opt, set or clear flags. * Otherwise append it to data. */ size_t opt_len = strlen(opt); for (struct mount_opt *mo = &mount_opt[0]; mo->name != NULL; mo++) { size_t mo_name_len = strlen(mo->name); if (opt_len == mo_name_len && strnequal(opt, mo->name, mo_name_len)) { if (mo->clear) *flags &= ~mo->legacy_flag; else *flags |= mo->legacy_flag; return 0; } } } if (strlen(*data)) { ret = strlcat(*data, ",", size); if (ret < 0) return log_error_errno(ret, errno, "Failed to append \",\" to %s", *data); } ret = strlcat(*data, opt, size); if (ret < 0) return log_error_errno(ret, errno, "Failed to append \"%s\" to %s", opt, *data); return 0; } int parse_mntopts_legacy(const char *mntopts, unsigned long *mntflags, char **mntdata) { __do_free char *mntopts_new = NULL, *mntopts_dup = NULL; char *mntopt_cur = NULL; size_t size; if (*mntdata || *mntflags) return ret_errno(EINVAL); if (!mntopts) return 0; mntopts_dup = strdup(mntopts); if (!mntopts_dup) return ret_errno(ENOMEM); size = strlen(mntopts_dup) + 1; mntopts_new = zalloc(size); if (!mntopts_new) return ret_errno(ENOMEM); lxc_iterate_parts(mntopt_cur, mntopts_dup, ",") if (parse_mntopt(mntopt_cur, mntflags, &mntopts_new, size) < 0) return ret_errno(EINVAL); if (*mntopts_new) *mntdata = move_ptr(mntopts_new); return 0; } static int parse_vfs_attr(struct lxc_mount_options *opts, char *opt, size_t size) { /* * If opt is found in mount_opt, set or clear flags. * Otherwise append it to data. */ for (struct mount_opt *mo = &mount_opt[0]; mo->name != NULL; mo++) { if (!strnequal(opt, mo->name, strlen(mo->name))) continue; /* This is a recursive bind-mount. */ if (strequal(mo->name, "rbind")) { opts->bind_recursively = 1; opts->bind = 1; opts->mnt_flags |= mo->legacy_flag; /* MS_BIND | MS_REC */ return 0; } /* This is a bind-mount. */ if (strequal(mo->name, "bind")) { opts->bind = 1; opts->mnt_flags |= mo->legacy_flag; /* MS_BIND */ return 0; } if (mo->flag == (__u64)~0) return log_info(0, "Ignoring %s mount option", mo->name); if (mo->clear) { opts->attr.attr_clr |= mo->flag; opts->mnt_flags &= ~mo->legacy_flag; TRACE("Lowering %s", mo->name); } else { opts->attr.attr_set |= mo->flag; opts->mnt_flags |= mo->legacy_flag; TRACE("Raising %s", mo->name); } return 0; } for (struct mount_opt *mo = &propagation_opt[0]; mo->name != NULL; mo++) { if (!strnequal(opt, mo->name, strlen(mo->name))) continue; if (strequal(mo->name, "rslave") || strequal(mo->name, "rshared") || strequal(mo->name, "runbindable") || strequal(mo->name, "rprivate")) opts->propagate_recursively = 1; opts->attr.propagation = mo->flag; opts->prop_flags |= mo->legacy_flag; return 0; } return 0; } int parse_mount_attrs(struct lxc_mount_options *opts, const char *mntopts) { __do_free char *mntopts_new = NULL, *mntopts_dup = NULL; char *end = NULL, *mntopt_cur = NULL; int ret; size_t size; if (!opts) return ret_errno(EINVAL); if (!mntopts) return 0; mntopts_dup = strdup(mntopts); if (!mntopts_dup) return ret_errno(ENOMEM); size = strlen(mntopts_dup) + 1; mntopts_new = zalloc(size); if (!mntopts_new) return ret_errno(ENOMEM); lxc_iterate_parts(mntopt_cur, mntopts_dup, ",") { /* This is a filesystem specific option. */ if (strchr(mntopt_cur, '=')) { if (!end) { end = stpcpy(mntopts_new, mntopt_cur); } else { end = stpcpy(end, ","); end = stpcpy(end, mntopt_cur); } continue; } /* This is a generic vfs option. */ ret = parse_vfs_attr(opts, mntopt_cur, size); if (ret < 0) return syserror("Failed to parse mount attributes: \"%s\"", mntopt_cur); } if (*mntopts_new) opts->data = move_ptr(mntopts_new); return 0; } static void null_endofword(char *word) { while (*word && *word != ' ' && *word != '\t') word++; *word = '\0'; } /* skip @nfields spaces in @src */ static char *get_field(char *src, int nfields) { int i; char *p = src; for (i = 0; i < nfields; i++) { while (*p && *p != ' ' && *p != '\t') p++; if (!*p) break; p++; } return p; } static int mount_entry(const char *fsname, const char *target, const char *fstype, unsigned long mountflags, unsigned long pflags, const char *data, bool optional, bool dev, bool relative, const char *rootfs) { int ret; char srcbuf[PATH_MAX]; const char *srcpath = fsname; #ifdef HAVE_STATVFS struct statvfs sb; #endif if (relative) { ret = strnprintf(srcbuf, sizeof(srcbuf), "%s/%s", rootfs ? rootfs : "/", fsname ? fsname : ""); if (ret < 0) return log_error_errno(-1, errno, "source path is too long"); srcpath = srcbuf; } ret = safe_mount(srcpath, target, fstype, mountflags & ~MS_REMOUNT, data, rootfs); if (ret < 0) { if (optional) return log_info_errno(0, errno, "Failed to mount \"%s\" on \"%s\" (optional)", srcpath ? srcpath : "(null)", target); return log_error_errno(-1, errno, "Failed to mount \"%s\" on \"%s\"", srcpath ? srcpath : "(null)", target); } if ((mountflags & MS_REMOUNT) || (mountflags & MS_BIND)) { DEBUG("Remounting \"%s\" on \"%s\" to respect bind or remount options", srcpath ? srcpath : "(none)", target ? target : "(none)"); #ifdef HAVE_STATVFS if (srcpath && statvfs(srcpath, &sb) == 0) { unsigned long required_flags = 0; if (sb.f_flag & MS_NOSUID) required_flags |= MS_NOSUID; if (sb.f_flag & MS_NODEV && !dev) required_flags |= MS_NODEV; if (sb.f_flag & MS_RDONLY) required_flags |= MS_RDONLY; if (sb.f_flag & MS_NOEXEC) required_flags |= MS_NOEXEC; DEBUG("Flags for \"%s\" were %lu, required extra flags are %lu", srcpath, sb.f_flag, required_flags); /* If this was a bind mount request, and required_flags * does not have any flags which are not already in * mountflags, then skip the remount. */ if (!(mountflags & MS_REMOUNT) && (!(required_flags & ~mountflags) && !(mountflags & MS_RDONLY))) { DEBUG("Mountflags already were %lu, skipping remount", mountflags); goto skipremount; } mountflags |= required_flags; } #endif ret = mount(srcpath, target, fstype, mountflags | MS_REMOUNT, data); if (ret < 0) { if (optional) return log_info_errno(0, errno, "Failed to mount \"%s\" on \"%s\" (optional)", srcpath ? srcpath : "(null)", target); return log_error_errno(-1, errno, "Failed to mount \"%s\" on \"%s\"", srcpath ? srcpath : "(null)", target); } } #ifdef HAVE_STATVFS skipremount: #endif if (pflags) { ret = mount(NULL, target, NULL, pflags, NULL); if (ret < 0) { if (optional) return log_info_errno(0, errno, "Failed to change mount propagation for \"%s\" (optional)", target); else return log_error_errno(-1, errno, "Failed to change mount propagation for \"%s\" (optional)", target); } DEBUG("Changed mount propagation for \"%s\"", target); } DEBUG("Mounted \"%s\" on \"%s\" with filesystem type \"%s\"", srcpath ? srcpath : "(null)", target, fstype); return 0; } const char *lxc_mount_options_info[LXC_MOUNT_MAX] = { "create=dir", "create=file", "optional", "relative", "idmap=", }; /* Remove "optional", "create=dir", and "create=file" from mntopt */ int parse_lxc_mount_attrs(struct lxc_mount_options *opts, char *mnt_opts) { for (size_t i = LXC_MOUNT_CREATE_DIR; i < LXC_MOUNT_MAX; i++) { __do_close int fd_userns = -EBADF; const char *opt_name = lxc_mount_options_info[i]; size_t len; char *idmap_path, *opt, *opt_next; opt = strstr(mnt_opts, opt_name); if (!opt) continue; switch (i) { case LXC_MOUNT_CREATE_DIR: opts->create_dir = 1; break; case LXC_MOUNT_CREATE_FILE: opts->create_file = 1; break; case LXC_MOUNT_OPTIONAL: opts->optional = 1; break; case LXC_MOUNT_RELATIVE: opts->relative = 1; break; case LXC_MOUNT_IDMAP: opt_next = opt; opt_next += STRLITERALLEN("idmap="); idmap_path = strchrnul(opt_next, ','); len = idmap_path - opt_next + 1; if (len >= sizeof(opts->userns_path)) return syserror_set(-EIO, "Excessive idmap path length for \"idmap=\" LXC specific mount option"); strlcpy(opts->userns_path, opt_next, len); if (is_empty_string(opts->userns_path)) return syserror_set(-EINVAL, "Missing idmap path for \"idmap=\" LXC specific mount option"); if (!strequal(opts->userns_path, "container")) { fd_userns = open(opts->userns_path, O_RDONLY | O_NOCTTY | O_CLOEXEC); if (fd_userns < 0) return syserror("Failed to open user namespace %s", opts->userns_path); } TRACE("Parse LXC specific mount option %d->\"idmap=%s\"", fd_userns, opts->userns_path); break; default: return syserror_set(-EINVAL, "Unknown LXC specific mount option"); } opt_next = strchr(opt, ','); if (!opt_next) *opt = '\0'; /* no more mntopts, so just chop it here */ else memmove(opt, opt_next + 1, strlen(opt_next + 1) + 1); } return 0; } static int mount_entry_create_dir_file(const struct mntent *mntent, const char *path, const struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { __do_free char *p1 = NULL; int ret; char *p2; if (strnequal(mntent->mnt_type, "overlay", 7)) { ret = ovl_mkdir(mntent, rootfs, lxc_name, lxc_path); if (ret < 0) return -1; } if (hasmntopt(mntent, "create=dir")) { ret = mkdir_p(path, 0755); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create directory \"%s\"", path); } if (!hasmntopt(mntent, "create=file")) return 0; ret = access(path, F_OK); if (ret == 0) return 0; p1 = strdup(path); if (!p1) return -1; p2 = dirname(p1); ret = mkdir_p(p2, 0755); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create directory \"%s\"", path); ret = mknod(path, S_IFREG | 0000, 0); if (ret < 0 && errno != EEXIST) return -errno; return 0; } /* rootfs, lxc_name, and lxc_path can be NULL when the container is created * without a rootfs. */ static inline int mount_entry_on_generic(struct mntent *mntent, const char *path, const struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { __do_free char *mntdata = NULL; char *rootfs_path = NULL; int ret; bool dev, optional, relative; struct lxc_mount_options opts = {}; optional = hasmntopt(mntent, "optional") != NULL; dev = hasmntopt(mntent, "dev") != NULL; relative = hasmntopt(mntent, "relative") != NULL; if (rootfs && rootfs->path) rootfs_path = rootfs->mount; ret = mount_entry_create_dir_file(mntent, path, rootfs, lxc_name, lxc_path); if (ret < 0) { if (optional) return 0; return -1; } ret = parse_lxc_mount_attrs(&opts, mntent->mnt_opts); if (ret < 0) return ret; /* * Idmapped mount entries will be setup by the parent for us. Note that * we rely on mount_entry_create_dir_file() above to have already * created the target path for us. So the parent can just open the * target and send us the target fd. */ errno = EOPNOTSUPP; if (!is_empty_string(opts.userns_path)) return systrace_ret(0, "Skipping idmapped mount entry"); ret = parse_mount_attrs(&opts, mntent->mnt_opts); if (ret < 0) return -1; ret = mount_entry(mntent->mnt_fsname, path, mntent->mnt_type, opts.mnt_flags, opts.prop_flags, opts.data, optional, dev, relative, rootfs_path); return ret; } static inline int mount_entry_on_systemfs(struct lxc_rootfs *rootfs, struct mntent *mntent) { int ret; /* For containers created without a rootfs all mounts are treated as * absolute paths starting at / on the host. */ if (mntent->mnt_dir[0] != '/') ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/%s", mntent->mnt_dir); else ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s", mntent->mnt_dir); if (ret < 0) return -1; return mount_entry_on_generic(mntent, rootfs->buf, NULL, NULL, NULL); } static int mount_entry_on_absolute_rootfs(struct mntent *mntent, struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { int offset; char *aux; const char *lxcpath; int ret = 0; lxcpath = lxc_global_config_value("lxc.lxcpath"); if (!lxcpath) return -1; /* If rootfs->path is a blockdev path, allow container fstab to use * //rootfs" as the target prefix. */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/%s/rootfs", lxcpath, lxc_name); if (ret < 0) goto skipvarlib; aux = strstr(mntent->mnt_dir, rootfs->buf); if (aux) { offset = strlen(rootfs->buf); goto skipabs; } skipvarlib: aux = strstr(mntent->mnt_dir, rootfs->path); if (!aux) return log_warn(ret, "Ignoring mount point \"%s\"", mntent->mnt_dir); offset = strlen(rootfs->path); skipabs: ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/%s", rootfs->mount, aux + offset); if (ret < 0) return -1; return mount_entry_on_generic(mntent, rootfs->buf, rootfs, lxc_name, lxc_path); } static int mount_entry_on_relative_rootfs(struct mntent *mntent, struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { int ret; /* relative to root mount point */ ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/%s", rootfs->mount, mntent->mnt_dir); if (ret < 0) return -1; return mount_entry_on_generic(mntent, rootfs->buf, rootfs, lxc_name, lxc_path); } static int mount_file_entries(struct lxc_rootfs *rootfs, FILE *file, const char *lxc_name, const char *lxc_path) { char buf[PATH_MAX]; struct mntent mntent; while (getmntent_r(file, &mntent, buf, sizeof(buf))) { int ret; if (!rootfs->path) ret = mount_entry_on_systemfs(rootfs, &mntent); else if (mntent.mnt_dir[0] != '/') ret = mount_entry_on_relative_rootfs(&mntent, rootfs, lxc_name, lxc_path); else ret = mount_entry_on_absolute_rootfs(&mntent, rootfs, lxc_name, lxc_path); if (ret < 0) return -1; } if (!feof(file) || ferror(file)) return log_error(-1, "Failed to parse mount entries"); return 0; } static inline void __auto_endmntent__(FILE **f) { if (*f) endmntent(*f); } #define __do_endmntent __attribute__((__cleanup__(__auto_endmntent__))) static int setup_mount_fstab(struct lxc_rootfs *rootfs, const char *fstab, const char *lxc_name, const char *lxc_path) { __do_endmntent FILE *f = NULL; int ret; if (!fstab) return 0; f = setmntent(fstab, "re"); if (!f) return log_error_errno(-1, errno, "Failed to open \"%s\"", fstab); ret = mount_file_entries(rootfs, f, lxc_name, lxc_path); if (ret < 0) ERROR("Failed to set up mount entries"); return ret; } /* * In order for nested containers to be able to mount /proc and /sys they need * to see a "pure" proc and sysfs mount points with nothing mounted on top * (like lxcfs). * For this we provide proc and sysfs in /dev/.lxc/{proc,sys} while using an * apparmor rule to deny access to them. This is mostly for convenience: The * container's root user can mount them anyway and thus has access to the two * file systems. But a non-root user in the container should not be allowed to * access them as a side effect without explicitly allowing it. */ static const char nesting_helpers[] = "proc dev/.lxc/proc proc create=dir,optional 0 0\n" "sys dev/.lxc/sys sysfs create=dir,optional 0 0\n"; FILE *make_anonymous_mount_file(const struct list_head *mount_entries, bool include_nesting_helpers) { __do_close int fd = -EBADF; FILE *f; int ret; struct string_entry *entry; fd = memfd_create(".lxc_mount_file", MFD_CLOEXEC); if (fd < 0) { char template[] = P_tmpdir "/.lxc_mount_file_XXXXXX"; if (errno != ENOSYS) return NULL; fd = lxc_make_tmpfile(template, true); if (fd < 0) return log_error_errno(NULL, errno, "Could not create temporary mount file"); TRACE("Created temporary mount file"); } list_for_each_entry(entry, mount_entries, head) { size_t len; len = strlen(entry->val); ret = lxc_write_nointr(fd, entry->val, len); if (ret < 0 || (size_t)ret != len) return NULL; ret = lxc_write_nointr(fd, "\n", 1); if (ret != 1) return NULL; } if (include_nesting_helpers) { ret = lxc_write_nointr(fd, nesting_helpers, STRARRAYLEN(nesting_helpers)); if (ret != STRARRAYLEN(nesting_helpers)) return NULL; } ret = lseek(fd, 0, SEEK_SET); if (ret < 0) return NULL; f = fdopen(fd, "re+"); if (f) move_fd(fd); /* Transfer ownership of fd. */ return f; } static int setup_mount_entries(const struct lxc_conf *conf, struct lxc_rootfs *rootfs, const char *lxc_name, const char *lxc_path) { __do_fclose FILE *f = NULL; f = make_anonymous_mount_file(&conf->mount_entries, conf->lsm_aa_allow_nesting); if (!f) return -1; return mount_file_entries(rootfs, f, lxc_name, lxc_path); } static int __lxc_idmapped_mounts_child(struct lxc_handler *handler, FILE *f) { struct lxc_conf *conf = handler->conf; struct lxc_rootfs *rootfs = &conf->rootfs; int mnt_seq = 0; int ret; char buf[PATH_MAX]; struct mntent mntent; while (getmntent_r(f, &mntent, buf, sizeof(buf))) { __do_close int fd_from = -EBADF, fd_to = -EBADF, fd_userns = -EBADF; __do_free char *__data = NULL; int cur_mnt_seq = -1; struct lxc_mount_options opts = {}; int dfd_from; const char *source_relative, *target_relative; struct lxc_mount_attr attr = {}; ret = parse_lxc_mount_attrs(&opts, mntent.mnt_opts); if (ret < 0) return syserror("Failed to parse LXC specific mount options"); __data = opts.data; ret = parse_mount_attrs(&opts, mntent.mnt_opts); if (ret < 0) return syserror("Failed to parse mount options"); /* No idmapped mount entry so skip it. */ if (is_empty_string(opts.userns_path)) continue; if (!can_use_bind_mounts()) return syserror_set(-EINVAL, "Kernel does not support idmapped mounts"); if (!opts.bind) return syserror_set(-EINVAL, "Only bind mounts can currently be idmapped"); /* We don't support new filesystem mounts yet. */ if (!is_empty_string(mntent.mnt_type) && !strequal(mntent.mnt_type, "none")) return syserror_set(-EINVAL, "Only bind mounts can currently be idmapped"); /* Someone specified additional mount options for a bind-mount. */ if (!is_empty_string(opts.data)) return syserror_set(-EINVAL, "Bind mounts don't support non-generic mount options"); /* * The source path is supposed to be taken relative to the * container's rootfs mount or - if the container does not have * a separate rootfs - to the host's /. */ source_relative = deabs(mntent.mnt_fsname); if (opts.relative || !rootfs->path) dfd_from = rootfs->dfd_mnt; else dfd_from = rootfs->dfd_host; fd_from = open_tree(dfd_from, source_relative, OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC | (opts.bind_recursively ? AT_RECURSIVE : 0)); if (fd_from < 0) return syserror("Failed to create detached %smount of %d/%s", opts.bind_recursively ? "recursive " : "", dfd_from, source_relative); if (strequal(opts.userns_path, "container")) fd_userns = openat(dfd_from, "proc/self/ns/user", O_RDONLY | O_CLOEXEC); else fd_userns = open_at(-EBADF, opts.userns_path, PROTECT_OPEN_WITH_TRAILING_SYMLINKS, 0, 0); if (fd_userns < 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to open user namespace \"%s\" for detached %smount of %d/%s", opts.userns_path, opts.bind_recursively ? "recursive " : "", dfd_from, source_relative); } ret = __lxc_abstract_unix_send_two_fds(handler->data_sock[0], fd_from, fd_userns, &opts, sizeof(opts)); if (ret <= 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to send file descriptor %d for detached %smount of %d/%s and file descriptor %d of user namespace \"%s\" to parent", fd_from, opts.bind_recursively ? "recursive " : "", dfd_from, source_relative, fd_userns, opts.userns_path); } ret = lxc_abstract_unix_rcv_credential(handler->data_sock[0], &cur_mnt_seq, sizeof(cur_mnt_seq)); if (ret <= 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to receive notification that parent idmapped detached %smount %d/%s to user namespace %d", opts.bind_recursively ? "recursive " : "", dfd_from, source_relative, fd_userns); } if (mnt_seq != cur_mnt_seq) return syserror("Expected mount sequence number and mount sequence number from parent mismatch: %d != %d", mnt_seq, cur_mnt_seq); mnt_seq++; /* Set regular mount options. */ attr = opts.attr; attr.propagation = 0; ret = mount_setattr(fd_from, "", AT_EMPTY_PATH | (opts.bind_recursively ? AT_RECURSIVE : 0), &attr, sizeof(attr)); if (ret < 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to set %smount options on detached %d/%s", opts.bind_recursively ? "recursive " : "", dfd_from, source_relative); } /* Set propagation mount options. */ if (opts.attr.propagation) { attr = (struct lxc_mount_attr) { .propagation = opts.attr.propagation, }; ret = mount_setattr(fd_from, "", AT_EMPTY_PATH | (opts.propagate_recursively ? AT_RECURSIVE : 0), &attr, sizeof(attr)); if (ret < 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to set %spropagation mount options on detached %d/%s", opts.bind_recursively ? "recursive " : "", dfd_from, source_relative); } } /* * In contrast to the legacy mount codepath we will simplify * our lifes and just always treat the target mountpoint to be * relative to the container's rootfs mountpoint or - if the * container does not have a separate rootfs - to the host's /. */ target_relative = deabs(mntent.mnt_dir); if (rootfs->path) dfd_from = rootfs->dfd_mnt; else dfd_from = rootfs->dfd_host; fd_to = open_at(dfd_from, target_relative, PROTECT_OPATH_FILE, PROTECT_LOOKUP_BENEATH_WITH_SYMLINKS, 0); if (fd_to < 0) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to open target mountpoint %d/%s for detached idmapped %smount %d:%d/%s", dfd_from, target_relative, opts.bind_recursively ? "recursive " : "", fd_userns, dfd_from, source_relative); } ret = move_detached_mount(fd_from, fd_to, "", 0, 0); if (ret) { if (opts.optional) { TRACE("Skipping optional idmapped mount"); continue; } return syserror("Failed to attach detached idmapped %smount %d:%d/%s to target mountpoint %d/%s", opts.bind_recursively ? "recursive " : "", fd_userns, dfd_from, source_relative, dfd_from, target_relative); } TRACE("Attached detached idmapped %smount %d:%d/%s to target mountpoint %d/%s", opts.bind_recursively ? "recursive " : "", fd_userns, dfd_from, source_relative, dfd_from, target_relative); } if (!feof(f) || ferror(f)) return syserror_set(-EINVAL, "Failed to parse mount entries"); return 0; } static int lxc_idmapped_mounts_child(struct lxc_handler *handler) { __do_fclose FILE *f_entries = NULL; int fret = -1; struct lxc_conf *conf = handler->conf; const char *fstab = conf->fstab; int ret; f_entries = make_anonymous_mount_file(&conf->mount_entries, conf->lsm_aa_allow_nesting); if (!f_entries) { SYSERROR("Failed to create anonymous mount file"); goto out; } ret = __lxc_idmapped_mounts_child(handler, f_entries); if (ret) { SYSERROR("Failed to setup idmapped mount entries"); goto out; } TRACE("Finished setting up idmapped mounts"); if (fstab) { __do_endmntent FILE *f_fstab = NULL; f_fstab = setmntent(fstab, "re"); if (!f_fstab) { SYSERROR("Failed to open fstab format file \"%s\"", fstab); goto out; } ret = __lxc_idmapped_mounts_child(handler, f_fstab); if (ret) { SYSERROR("Failed to setup idmapped mount entries specified in fstab"); goto out; } TRACE("Finished setting up idmapped mounts specified in fstab"); } fret = 0; out: ret = lxc_abstract_unix_send_credential(handler->data_sock[0], NULL, 0); if (ret < 0) return syserror("Failed to inform parent that we are done setting up mounts"); return fret; } int parse_cap(const char *cap_name, __u32 *cap) { size_t end = sizeof(caps_opt) / sizeof(caps_opt[0]); int ret; unsigned int res; __u32 last_cap; if (strequal(cap_name, "none")) return -2; for (size_t i = 0; i < end; i++) { if (!strequal(cap_name, caps_opt[i].name)) continue; *cap = caps_opt[i].value; return 0; } /* * Try to see if it's numeric, so the user may specify * capabilities that the running kernel knows about but we * don't. */ ret = lxc_safe_uint(cap_name, &res); if (ret < 0) return -1; ret = lxc_caps_last_cap(&last_cap); if (ret) return -1; if ((__u32)res > last_cap) return -1; *cap = (__u32)res; return 0; } bool has_cap(__u32 cap, struct lxc_conf *conf) { bool cap_in_list = false; struct cap_entry *cap_entry; list_for_each_entry(cap_entry, &conf->caps.list, head) { if (cap_entry->cap != cap) continue; cap_in_list = true; } /* The capability is kept. */ if (conf->caps.keep) return cap_in_list; /* The capability is not dropped. */ return !cap_in_list; } static int capabilities_deny(struct lxc_conf *conf) { struct cap_entry *cap; list_for_each_entry(cap, &conf->caps.list, head) { int ret; ret = prctl(PR_CAPBSET_DROP, prctl_arg(cap->cap), prctl_arg(0), prctl_arg(0), prctl_arg(0)); if (ret < 0) return syserror("Failed to remove %s capability", cap->cap_name); DEBUG("Dropped %s (%d) capability", cap->cap_name, cap->cap); } DEBUG("Capabilities have been setup"); return 0; } static int capabilities_allow(struct lxc_conf *conf) { __do_free __u32 *keep_bits = NULL; int ret; struct cap_entry *cap; __u32 last_cap, nr_u32; ret = lxc_caps_last_cap(&last_cap); if (ret || last_cap > 200) return ret_errno(EINVAL); TRACE("Found %d capabilities", last_cap); nr_u32 = BITS_TO_LONGS(last_cap); keep_bits = zalloc(nr_u32 * sizeof(__u32)); if (!keep_bits) return ret_errno(ENOMEM); list_for_each_entry(cap, &conf->caps.list, head) { if (cap->cap > last_cap) continue; set_bit(cap->cap, keep_bits); DEBUG("Keeping %s (%d) capability", cap->cap_name, cap->cap); } for (__u32 cap_bit = 0; cap_bit <= last_cap; cap_bit++) { if (is_set(cap_bit, keep_bits)) continue; ret = prctl(PR_CAPBSET_DROP, prctl_arg(cap_bit), prctl_arg(0), prctl_arg(0), prctl_arg(0)); if (ret < 0) return syserror("Failed to remove capability %d", cap_bit); TRACE("Dropped capability %d", cap_bit); } DEBUG("Capabilities have been setup"); return 0; } static int parse_resource(const char *res) { int ret; size_t i; int resid = -1; for (i = 0; i < sizeof(limit_opt) / sizeof(limit_opt[0]); ++i) if (strequal(res, limit_opt[i].name)) return limit_opt[i].value; /* Try to see if it's numeric, so the user may specify * resources that the running kernel knows about but * we don't. */ ret = lxc_safe_int(res, &resid); if (ret < 0) return -1; return resid; } int setup_resource_limits(struct lxc_conf *conf, pid_t pid) { int resid; struct lxc_limit *lim; if (list_empty(&conf->limits)) return 0; list_for_each_entry(lim, &conf->limits, head) { resid = parse_resource(lim->resource); if (resid < 0) return log_error(-1, "Unknown resource %s", lim->resource); #if HAVE_PRLIMIT || HAVE_PRLIMIT64 if (prlimit(pid, resid, &lim->limit, NULL) != 0) return log_error_errno(-1, errno, "Failed to set limit %s", lim->resource); TRACE("Setup \"%s\" limit", lim->resource); #else return log_error(-1, "Cannot set limit \"%s\" as prlimit is missing", lim->resource); #endif } TRACE("Setup resource limits"); return 0; } int setup_sysctl_parameters(struct lxc_conf *conf) { __do_free char *tmp = NULL; int ret = 0; char filename[PATH_MAX] = {0}; struct lxc_sysctl *sysctl, *nsysctl; if (list_empty(&conf->sysctls)) return 0; list_for_each_entry_safe(sysctl, nsysctl, &conf->sysctls, head) { tmp = lxc_string_replace(".", "/", sysctl->key); if (!tmp) return log_error(-1, "Failed to replace key %s", sysctl->key); ret = strnprintf(filename, sizeof(filename), "/proc/sys/%s", tmp); if (ret < 0) return log_error(-1, "Error setting up sysctl parameters path"); ret = lxc_write_to_file(filename, sysctl->value, strlen(sysctl->value), false, 0666); if (ret < 0) return log_error_errno(-1, errno, "Failed to setup sysctl parameters %s to %s", sysctl->key, sysctl->value); TRACE("Setting %s to %s", filename, sysctl->value); } TRACE("Setup /proc/sys settings"); return 0; } int setup_proc_filesystem(struct lxc_conf *conf, pid_t pid) { __do_free char *tmp = NULL; int ret = 0; char filename[PATH_MAX] = {0}; struct lxc_proc *proc; if (list_empty(&conf->procs)) return 0; list_for_each_entry(proc, &conf->procs, head) { tmp = lxc_string_replace(".", "/", proc->filename); if (!tmp) return log_error(-1, "Failed to replace key %s", proc->filename); ret = strnprintf(filename, sizeof(filename), "/proc/%d/%s", pid, tmp); if (ret < 0) return log_error(-1, "Error setting up proc filesystem path"); ret = lxc_write_to_file(filename, proc->value, strlen(proc->value), false, 0666); if (ret < 0) return log_error_errno(-1, errno, "Failed to setup proc filesystem %s to %s", proc->filename, proc->value); TRACE("Setting %s to %s", filename, proc->value); } TRACE("Setup /proc/%d settings", pid); return 0; } static char *default_rootfs_mount = LXCROOTFSMOUNT; struct lxc_conf *lxc_conf_init(void) { int i; struct lxc_conf *new; new = zalloc(sizeof(*new)); if (!new) return NULL; new->loglevel = LXC_LOG_LEVEL_NOTSET; new->personality = LXC_ARCH_UNCHANGED; new->autodev = 1; new->console.buffer_size = 0; new->console.log_path = NULL; new->console.log_fd = -1; new->console.log_size = 0; new->console.path = NULL; new->console.peer = -1; new->console.proxy.busy = -1; new->console.proxy.ptx = -1; new->console.proxy.pty = -1; new->console.ptx = -EBADF; new->console.pty = -EBADF; new->console.pty_nr = -1; new->console.name[0] = '\0'; new->devpts_fd = -EBADF; memset(&new->console.ringbuf, 0, sizeof(struct lxc_ringbuf)); new->maincmd_fd = -1; new->monitor_signal_pdeath = SIGKILL; new->nbd_idx = -1; new->rootfs.mount = strdup(default_rootfs_mount); if (!new->rootfs.mount) { free(new); return NULL; } new->rootfs.managed = true; new->rootfs.dfd_mnt = -EBADF; new->rootfs.dfd_dev = -EBADF; new->rootfs.dfd_host = -EBADF; new->rootfs.fd_path_pin = -EBADF; new->rootfs.dfd_idmapped = -EBADF; new->logfd = -1; INIT_LIST_HEAD(&new->cgroup); INIT_LIST_HEAD(&new->cgroup2); /* Block ("allowlist") all devices by default. */ new->bpf_devices.list_type = LXC_BPF_DEVICE_CGROUP_ALLOWLIST; INIT_LIST_HEAD(&(new->bpf_devices).devices); INIT_LIST_HEAD(&new->mount_entries); INIT_LIST_HEAD(&new->caps.list); INIT_LIST_HEAD(&new->id_map); new->root_nsuid_map = NULL; new->root_nsgid_map = NULL; INIT_LIST_HEAD(&new->environment); INIT_LIST_HEAD(&new->limits); INIT_LIST_HEAD(&new->sysctls); INIT_LIST_HEAD(&new->procs); new->hooks_version = 0; for (i = 0; i < NUM_LXC_HOOKS; i++) INIT_LIST_HEAD(&new->hooks[i]); INIT_LIST_HEAD(&new->groups); INIT_LIST_HEAD(&new->state_clients); new->lsm_aa_profile = NULL; INIT_LIST_HEAD(&new->lsm_aa_raw); new->lsm_se_context = NULL; new->lsm_se_keyring_context = NULL; new->keyring_disable_session = false; new->transient_procfs_mnt = false; new->shmount.path_host = NULL; new->shmount.path_cont = NULL; new->sched_core = false; new->sched_core_cookie = INVALID_SCHED_CORE_COOKIE; /* if running in a new user namespace, init and COMMAND * default to running as UID/GID 0 when using lxc-execute */ new->init_uid = 0; new->init_gid = 0; memset(&new->init_groups, 0, sizeof(lxc_groups_t)); memset(&new->cgroup_meta, 0, sizeof(struct lxc_cgroup)); memset(&new->ns_share, 0, sizeof(char *) * LXC_NS_MAX); memset(&new->timens, 0, sizeof(struct timens_offsets)); seccomp_conf_init(new); INIT_LIST_HEAD(&new->netdevs); return new; } int write_id_mapping(enum idtype idtype, pid_t pid, const char *buf, size_t buf_size) { __do_close int fd = -EBADF; int ret; char path[PATH_MAX]; if (geteuid() != 0 && idtype == ID_TYPE_GID) { __do_close int setgroups_fd = -EBADF; ret = strnprintf(path, sizeof(path), "/proc/%d/setgroups", pid); if (ret < 0) return -E2BIG; setgroups_fd = open(path, O_WRONLY); if (setgroups_fd < 0 && errno != ENOENT) return log_error_errno(-1, errno, "Failed to open \"%s\"", path); if (setgroups_fd >= 0) { ret = lxc_write_nointr(setgroups_fd, "deny\n", STRLITERALLEN("deny\n")); if (ret != STRLITERALLEN("deny\n")) return log_error_errno(-1, errno, "Failed to write \"deny\" to \"/proc/%d/setgroups\"", pid); TRACE("Wrote \"deny\" to \"/proc/%d/setgroups\"", pid); } } ret = strnprintf(path, sizeof(path), "/proc/%d/%cid_map", pid, idtype == ID_TYPE_UID ? 'u' : 'g'); if (ret < 0) return -E2BIG; fd = open(path, O_WRONLY | O_CLOEXEC); if (fd < 0) return log_error_errno(-1, errno, "Failed to open \"%s\"", path); ret = lxc_write_nointr(fd, buf, buf_size); if (ret < 0 || (size_t)ret != buf_size) return log_error_errno(-1, errno, "Failed to write %cid mapping to \"%s\"", idtype == ID_TYPE_UID ? 'u' : 'g', path); return 0; } /* Check whether a binary exist and has either CAP_SETUID, CAP_SETGID or both. * * @return 1 if functional binary was found * @return 0 if binary exists but is lacking privilege * @return -ENOENT if binary does not exist * @return -EINVAL if cap to check is neither CAP_SETUID nor CAP_SETGID */ static int idmaptool_on_path_and_privileged(const char *binary, cap_value_t cap) { __do_free char *path = NULL; int ret; struct stat st; if (cap != CAP_SETUID && cap != CAP_SETGID) return ret_errno(EINVAL); path = on_path(binary, NULL); if (!path) return ret_errno(ENOENT); ret = stat(path, &st); if (ret < 0) return -errno; /* Check if the binary is setuid. */ if (st.st_mode & S_ISUID) return log_debug(1, "The binary \"%s\" does have the setuid bit set", path); #if HAVE_LIBCAP && LIBCAP_SUPPORTS_FILE_CAPABILITIES /* Check if it has the CAP_SETUID capability. */ if ((cap & CAP_SETUID) && lxc_file_cap_is_set(path, CAP_SETUID, CAP_EFFECTIVE) && lxc_file_cap_is_set(path, CAP_SETUID, CAP_PERMITTED)) return log_debug(1, "The binary \"%s\" has CAP_SETUID in its CAP_EFFECTIVE and CAP_PERMITTED sets", path); /* Check if it has the CAP_SETGID capability. */ if ((cap & CAP_SETGID) && lxc_file_cap_is_set(path, CAP_SETGID, CAP_EFFECTIVE) && lxc_file_cap_is_set(path, CAP_SETGID, CAP_PERMITTED)) return log_debug(1, "The binary \"%s\" has CAP_SETGID in its CAP_EFFECTIVE and CAP_PERMITTED sets", path); return 0; #else /* * If we cannot check for file capabilities we need to give the benefit * of the doubt. Otherwise we might fail even though all the necessary * file capabilities are set. */ DEBUG("Cannot check for file capabilities as full capability support is missing. Manual intervention needed"); return 1; #endif } static int lxc_map_ids_exec_wrapper(void *args) { execl("/bin/sh", "sh", "-c", (char *)args, (char *)NULL); return -1; } static struct id_map *find_mapped_hostid_entry(const struct list_head *idmap, unsigned id, enum idtype idtype); int lxc_map_ids(struct list_head *idmap, pid_t pid) { int fill, left; uid_t hostuid; gid_t hostgid; char u_or_g; char *pos; char cmd_output[PATH_MAX]; struct id_map *map; enum idtype type; int ret = 0, gidmap = 0, uidmap = 0; char mapbuf[STRLITERALLEN("new@idmap") + STRLITERALLEN(" ") + INTTYPE_TO_STRLEN(pid_t) + STRLITERALLEN(" ") + LXC_IDMAPLEN] = {0}; bool had_entry = false, maps_host_root = false, use_shadow = false; hostuid = geteuid(); hostgid = getegid(); /* * Check whether caller wants to map host root. * Due to a security fix newer kernels require CAP_SETFCAP when mapping * host root into the child userns as you would be able to write fscaps * that would be valid in the ancestor userns. Mapping host root should * rarely be the case but LXC is being clever in a bunch of cases. */ if (find_mapped_hostid_entry(idmap, 0, ID_TYPE_UID)) maps_host_root = true; /* If new{g,u}idmap exists, that is, if shadow is handing out subuid * ranges, then insist that root also reserve ranges in subuid. This * will protected it by preventing another user from being handed the * range by shadow. */ uidmap = idmaptool_on_path_and_privileged("newuidmap", CAP_SETUID); if (uidmap == -ENOENT) WARN("newuidmap binary is missing"); else if (!uidmap) WARN("newuidmap is lacking necessary privileges"); gidmap = idmaptool_on_path_and_privileged("newgidmap", CAP_SETGID); if (gidmap == -ENOENT) WARN("newgidmap binary is missing"); else if (!gidmap) WARN("newgidmap is lacking necessary privileges"); if (maps_host_root) { INFO("Caller maps host root. Writing mapping directly"); } else if (uidmap > 0 && gidmap > 0) { DEBUG("Functional newuidmap and newgidmap binary found"); use_shadow = true; } else { /* In case unprivileged users run application containers via * execute() or a start*() there are valid cases where they may * only want to map their own {g,u}id. Let's not block them from * doing so by requiring geteuid() == 0. */ DEBUG("No newuidmap and newgidmap binary found. Trying to " "write directly with euid %d", hostuid); } /* Check if we really need to use newuidmap and newgidmap. * If the user is only remapping their own {g,u}id, we don't need it. */ if (use_shadow && list_len(map, idmap, head) == 2) { use_shadow = false; list_for_each_entry(map, idmap, head) { if (map->idtype == ID_TYPE_UID && map->range == 1 && map->nsid == hostuid && map->hostid == hostuid) continue; if (map->idtype == ID_TYPE_GID && map->range == 1 && map->nsid == hostgid && map->hostid == hostgid) continue; use_shadow = true; break; } } for (type = ID_TYPE_UID, u_or_g = 'u'; type <= ID_TYPE_GID; type++, u_or_g = 'g') { pos = mapbuf; if (use_shadow) pos += sprintf(mapbuf, "new%cidmap %d", u_or_g, pid); list_for_each_entry(map, idmap, head) { if (map->idtype != type) continue; had_entry = true; left = LXC_IDMAPLEN - (pos - mapbuf); fill = strnprintf(pos, left, "%s%lu %lu %lu%s", use_shadow ? " " : "", map->nsid, map->hostid, map->range, use_shadow ? "" : "\n"); /* * The kernel only takes <= 4k for writes to * /proc//{g,u}id_map */ if (fill <= 0) return log_error_errno(-1, errno, "Too many %cid mappings defined", u_or_g); pos += fill; } if (!had_entry) continue; /* Try to catch the output of new{g,u}idmap to make debugging * easier. */ if (use_shadow) { ret = run_command(cmd_output, sizeof(cmd_output), lxc_map_ids_exec_wrapper, (void *)mapbuf); if (ret < 0) return log_error(-1, "new%cidmap failed to write mapping \"%s\": %s", u_or_g, cmd_output, mapbuf); TRACE("new%cidmap wrote mapping \"%s\"", u_or_g, mapbuf); } else { ret = write_id_mapping(type, pid, mapbuf, pos - mapbuf); if (ret < 0) return log_error(-1, "Failed to write mapping: %s", mapbuf); TRACE("Wrote mapping \"%s\"", mapbuf); } memset(mapbuf, 0, sizeof(mapbuf)); } return 0; } /* * Return the host uid/gid to which the container root is mapped in val. * Return true if id was found, false otherwise. */ static id_t get_mapped_rootid(const struct lxc_conf *conf, enum idtype idtype) { unsigned nsid; struct id_map *map; if (idtype == ID_TYPE_UID) nsid = (conf->root_nsuid_map != NULL) ? 0 : conf->init_uid; else nsid = (conf->root_nsgid_map != NULL) ? 0 : conf->init_gid; list_for_each_entry (map, &conf->id_map, head) { if (map->idtype != idtype) continue; if (map->nsid != nsid) continue; return map->hostid; } if (idtype == ID_TYPE_UID) return LXC_INVALID_UID; return LXC_INVALID_GID; } int mapped_hostid(unsigned id, const struct lxc_conf *conf, enum idtype idtype) { struct id_map *map; list_for_each_entry(map, &conf->id_map, head) { if (map->idtype != idtype) continue; if (id >= map->hostid && id < map->hostid + map->range) return (id - map->hostid) + map->nsid; } return -1; } int find_unmapped_nsid(const struct lxc_conf *conf, enum idtype idtype) { struct id_map *map; unsigned int freeid = 0; again: list_for_each_entry(map, &conf->id_map, head) { if (map->idtype != idtype) continue; if (freeid >= map->nsid && freeid < map->nsid + map->range) { freeid = map->nsid + map->range; goto again; } } return freeid; } /* * Mount a proc under @rootfs if proc self points to a pid other than * my own. This is needed to have a known-good proc mount for setting * up LSMs both at container startup and attach. * * NOTE: not to be called from inside the container namespace! */ static int lxc_transient_proc(struct lxc_rootfs *rootfs) { __do_close int fd_proc = -EBADF; int link_to_pid, link_len, pid_self, ret; char link[INTTYPE_TO_STRLEN(pid_t) + 1]; link_len = readlinkat(rootfs->dfd_mnt, "proc/self", link, sizeof(link)); if (link_len < 0) { ret = mkdirat(rootfs->dfd_mnt, "proc", 0000); if (ret < 0 && errno != EEXIST) return log_error_errno(-errno, errno, "Failed to create %d(proc)", rootfs->dfd_mnt); goto domount; } else if ((size_t)link_len >= sizeof(link)) { return log_error_errno(-EIO, EIO, "Truncated link target"); } link[link_len] = '\0'; pid_self = lxc_raw_getpid(); INFO("Caller's PID is %d; /proc/self points to %s", pid_self, link); ret = lxc_safe_int(link, &link_to_pid); if (ret) return log_error_errno(-ret, ret, "Failed to parse %s", link); /* Correct procfs is already mounted. */ if (link_to_pid == pid_self) return log_trace(0, "Correct procfs instance mounted"); fd_proc = open_at(rootfs->dfd_mnt, "proc", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH_XDEV, 0); if (fd_proc < 0) return log_error_errno(-errno, errno, "Failed to open transient procfs mountpoint"); ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "/proc/self/fd/%d", fd_proc); if (ret < 0) return ret_errno(EIO); ret = umount2(rootfs->buf, MNT_DETACH); if (ret < 0) SYSWARN("Failed to umount \"%s\" with MNT_DETACH", rootfs->buf); domount: /* rootfs is NULL */ if (!rootfs->path) { ret = mount("proc", rootfs->buf, "proc", 0, NULL); } else { ret = safe_mount_beneath_at(rootfs->dfd_mnt, "none", "proc", "proc", 0, NULL); if (ret < 0) { ret = strnprintf(rootfs->buf, sizeof(rootfs->buf), "%s/proc", rootfs->path ? rootfs->mount : ""); if (ret < 0) return ret_errno(EIO); ret = safe_mount("proc", rootfs->buf, "proc", 0, NULL, rootfs->mount); } } if (ret < 0) return log_error_errno(-1, errno, "Failed to mount temporary procfs"); INFO("Created transient procfs mount"); return 1; } /* NOTE: Must not be called from inside the container namespace! */ static int lxc_create_tmp_proc_mount(struct lxc_conf *conf) { int mounted; mounted = lxc_transient_proc(&conf->rootfs); if (mounted == -1) { /* continue only if there is no rootfs */ if (conf->rootfs.path) return log_error_errno(-EPERM, EPERM, "Failed to create transient procfs mount"); } else if (mounted == 1) { conf->transient_procfs_mnt = true; } return 0; } void tmp_proc_unmount(struct lxc_conf *lxc_conf) { if (lxc_conf->transient_procfs_mnt) { (void)umount2("/proc", MNT_DETACH); lxc_conf->transient_procfs_mnt = false; } } /* Walk /proc/mounts and change any shared entries to dependent mounts. */ static void turn_into_dependent_mounts(const struct lxc_rootfs *rootfs) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; __do_close int memfd = -EBADF, mntinfo_fd = -EBADF; size_t len = 0; ssize_t copied; int ret; mntinfo_fd = open_at(rootfs->dfd_host, "proc/self/mountinfo", PROTECT_OPEN, (PROTECT_LOOKUP_BENEATH_XDEV & ~RESOLVE_NO_SYMLINKS), 0); if (mntinfo_fd < 0) { SYSERROR("Failed to open %d/proc/self/mountinfo", rootfs->dfd_host); return; } memfd = memfd_create(".lxc_mountinfo", MFD_CLOEXEC); if (memfd < 0) { char template[] = P_tmpdir "/.lxc_mountinfo_XXXXXX"; if (errno != ENOSYS) { SYSERROR("Failed to create temporary in-memory file"); return; } memfd = lxc_make_tmpfile(template, true); if (memfd < 0) { WARN("Failed to create temporary file"); return; } } copied = fd_to_fd(mntinfo_fd, memfd); if (copied < 0) { SYSERROR("Failed to copy \"/proc/self/mountinfo\""); return; } ret = lseek(memfd, 0, SEEK_SET); if (ret < 0) { SYSERROR("Failed to reset file descriptor offset"); return; } f = fdopen(memfd, "re"); if (!f) { SYSERROR("Failed to open copy of \"/proc/self/mountinfo\" to mark all shared. Continuing"); return; } /* * After a successful fdopen() memfd will be closed when calling * fclose(f). Calling close(memfd) afterwards is undefined. */ move_fd(memfd); while (getline(&line, &len, f) != -1) { char *opts, *target; target = get_field(line, 4); if (!target) continue; opts = get_field(target, 2); if (!opts) continue; null_endofword(opts); if (!strstr(opts, "shared")) continue; null_endofword(target); ret = mount(NULL, target, NULL, MS_SLAVE, NULL); if (ret < 0) { SYSERROR("Failed to recursively turn old root mount tree into dependent mount. Continuing..."); continue; } } TRACE("Turned all mount table entries into dependent mount"); } /* This does the work of remounting / if it is shared, calling the container * pre-mount hooks, and mounting the rootfs. */ int lxc_setup_rootfs_prepare_root(struct lxc_conf *conf, const char *name, const char *lxcpath) { int ret; conf->rootfs.dfd_host = open_at(-EBADF, "/", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE, 0); if (conf->rootfs.dfd_host < 0) return log_error_errno(-errno, errno, "Failed to open \"/\""); turn_into_dependent_mounts(&conf->rootfs); if (conf->rootfs_setup) { const char *path = conf->rootfs.mount; /* * The rootfs was set up in another namespace. bind-mount it to * give us a mount in our own ns so we can pivot_root to it */ ret = mount(path, path, "rootfs", MS_BIND, NULL); if (ret < 0) return log_error(-1, "Failed to bind mount container / onto itself"); conf->rootfs.dfd_mnt = openat(-EBADF, path, O_RDONLY | O_CLOEXEC | O_DIRECTORY | O_PATH | O_NOCTTY); if (conf->rootfs.dfd_mnt < 0) return log_error_errno(-errno, errno, "Failed to open file descriptor for container rootfs"); return log_trace(0, "Bind mounted container / onto itself"); } ret = run_lxc_hooks(name, "pre-mount", conf, NULL); if (ret < 0) return log_error(-1, "Failed to run pre-mount hooks"); ret = lxc_mount_rootfs(&conf->rootfs); if (ret < 0) return log_error(-1, "Failed to setup rootfs for"); conf->rootfs_setup = true; return 0; } static bool verify_start_hooks(struct lxc_conf *conf) { char path[PATH_MAX]; struct string_entry *hook; list_for_each_entry(hook, &conf->hooks[LXCHOOK_START], head) { int ret; char *hookname = hook->val; ret = strnprintf(path, sizeof(path), "%s%s", conf->rootfs.path ? conf->rootfs.mount : "", hookname); if (ret < 0) return false; ret = access(path, X_OK); if (ret < 0) return log_error_errno(false, errno, "Start hook \"%s\" not found in container", hookname); return true; } return true; } static int lxc_setup_boot_id(void) { int ret; const char *boot_id_path = "/proc/sys/kernel/random/boot_id"; const char *mock_boot_id_path = "/dev/.lxc-boot-id"; lxc_id128_t n; if (access(boot_id_path, F_OK)) return 0; memset(&n, 0, sizeof(n)); if (lxc_id128_randomize(&n)) { SYSERROR("Failed to generate random data for uuid"); return -1; } ret = lxc_id128_write(mock_boot_id_path, n); if (ret < 0) { SYSERROR("Failed to write uuid to %s", mock_boot_id_path); return -1; } ret = chmod(mock_boot_id_path, 0444); if (ret < 0) { SYSERROR("Failed to chown %s", mock_boot_id_path); (void)unlink(mock_boot_id_path); return -1; } ret = mount(mock_boot_id_path, boot_id_path, NULL, MS_BIND, NULL); if (ret < 0) { SYSERROR("Failed to mount %s to %s", mock_boot_id_path, boot_id_path); (void)unlink(mock_boot_id_path); return -1; } ret = mount(NULL, boot_id_path, NULL, (MS_BIND | MS_REMOUNT | MS_RDONLY | MS_NOSUID | MS_NOEXEC | MS_NODEV), NULL); if (ret < 0) { SYSERROR("Failed to remount %s read-only", boot_id_path); (void)unlink(mock_boot_id_path); return -1; } return 0; } static int lxc_setup_keyring(struct lsm_ops *lsm_ops, const struct lxc_conf *conf) { key_serial_t keyring; int ret = 0; if (conf->lsm_se_keyring_context) ret = lsm_ops->keyring_label_set(lsm_ops, conf->lsm_se_keyring_context); else if (conf->lsm_se_context) ret = lsm_ops->keyring_label_set(lsm_ops, conf->lsm_se_context); if (ret < 0) return syserror("Failed to set keyring context"); /* * Try to allocate a new session keyring for the container to prevent * information leaks. */ keyring = keyctl(KEYCTL_JOIN_SESSION_KEYRING, prctl_arg(0), prctl_arg(0), prctl_arg(0), prctl_arg(0)); if (keyring < 0) { switch (errno) { case ENOSYS: DEBUG("The keyctl() syscall is not supported or blocked"); break; case EACCES: __fallthrough; case EPERM: DEBUG("Failed to access kernel keyring. Continuing..."); break; default: SYSWARN("Failed to create kernel keyring"); break; } } return ret; } static int lxc_rootfs_prepare_child(struct lxc_handler *handler) { struct lxc_rootfs *rootfs = &handler->conf->rootfs; int dfd_idmapped = -EBADF; int ret; if (list_empty(&handler->conf->id_map)) return 0; if (is_empty_string(rootfs->mnt_opts.userns_path)) return 0; if (handler->conf->rootfs_setup) return 0; ret = lxc_abstract_unix_recv_one_fd(handler->data_sock[1], &dfd_idmapped, NULL, 0); if (ret < 0) return syserror("Failed to receive idmapped mount fd"); rootfs->dfd_idmapped = dfd_idmapped; TRACE("Received detached idmapped mount %d", rootfs->dfd_idmapped); return 0; } int lxc_idmapped_mounts_parent(struct lxc_handler *handler) { int mnt_seq = 0; for (;;) { __do_close int fd_from = -EBADF, fd_userns = -EBADF; struct lxc_mount_attr attr = {}; struct lxc_mount_options opts = {}; ssize_t ret; ret = __lxc_abstract_unix_recv_two_fds(handler->data_sock[1], &fd_from, &fd_userns, &opts, sizeof(opts)); if (ret < 0) return syserror("Failed to receive idmapped mount file descriptors from child"); if (fd_from < 0 || fd_userns < 0) return log_trace(0, "Finished receiving idmapped mount file descriptors from child"); attr.attr_set = MOUNT_ATTR_IDMAP; attr.userns_fd = fd_userns; ret = mount_setattr(fd_from, "", AT_EMPTY_PATH | (opts.bind_recursively ? AT_RECURSIVE : 0), &attr, sizeof(attr)); if (ret) return syserror("Failed to idmap detached %smount %d to %d", opts.bind_recursively ? "recursive " : "", fd_from, fd_userns); ret = lxc_abstract_unix_send_credential(handler->data_sock[1], &mnt_seq, sizeof(mnt_seq)); if (ret < 0) return syserror("Parent failed to notify child that detached %smount %d was idmapped to user namespace %d", opts.bind_recursively ? "recursive " : "", fd_from, fd_userns); TRACE("Parent idmapped detached %smount %d to user namespace %d", opts.bind_recursively ? "recursive " : "", fd_from, fd_userns); mnt_seq++; } } static int lxc_recv_ttys_from_child(struct lxc_handler *handler) { call_cleaner(lxc_delete_tty) struct lxc_tty_info *info_new = &(struct lxc_tty_info){}; int sock = handler->data_sock[1]; struct lxc_conf *conf = handler->conf; struct lxc_tty_info *tty_info = &conf->ttys; size_t ttys_max = tty_info->max; struct lxc_terminal_info *terminal_info; int ret; if (!ttys_max) return 0; info_new->tty = malloc(sizeof(*(info_new->tty)) * ttys_max); if (!info_new->tty) return ret_errno(ENOMEM); for (size_t i = 0; i < ttys_max; i++) { terminal_info = &info_new->tty[i]; terminal_info->busy = -1; terminal_info->ptx = -EBADF; terminal_info->pty = -EBADF; } for (size_t i = 0; i < ttys_max; i++) { int ptx = -EBADF, pty = -EBADF; ret = lxc_abstract_unix_recv_two_fds(sock, &ptx, &pty); if (ret < 0) return syserror("Failed to receive %zu ttys from child", ttys_max); terminal_info = &info_new->tty[i]; terminal_info->ptx = ptx; terminal_info->pty = pty; TRACE("Received pty with ptx fd %d and pty fd %d from child", terminal_info->ptx, terminal_info->pty); } tty_info->tty = move_ptr(info_new->tty); TRACE("Received %zu ttys from child", ttys_max); return 0; } static int lxc_send_console_to_parent(struct lxc_handler *handler) { struct lxc_terminal *console = &handler->conf->console; int ret; if (!wants_console(console)) return 0; /* We've already allocated a console from the host's devpts instance. */ if (console->pty < 0) return 0; ret = __lxc_abstract_unix_send_two_fds(handler->data_sock[0], console->ptx, console->pty, console, sizeof(struct lxc_terminal)); if (ret < 0) return syserror("Fail to send console to parent"); TRACE("Sent console to parent"); return 0; } static int lxc_recv_console_from_child(struct lxc_handler *handler) { __do_close int fd_ptx = -EBADF, fd_pty = -EBADF; struct lxc_terminal *console = &handler->conf->console; int ret; if (!wants_console(console)) return 0; /* We've already allocated a console from the host's devpts instance. */ if (console->pty >= 0) return 0; ret = __lxc_abstract_unix_recv_two_fds(handler->data_sock[1], &fd_ptx, &fd_pty, console, sizeof(struct lxc_terminal)); if (ret < 0) return syserror("Fail to receive console from child"); console->ptx = move_fd(fd_ptx); console->pty = move_fd(fd_pty); TRACE("Received console from child"); return 0; } int lxc_sync_fds_parent(struct lxc_handler *handler) { int ret; ret = lxc_seccomp_recv_notifier_fd(&handler->conf->seccomp, handler->data_sock[1]); if (ret < 0) return syserror_ret(ret, "Failed to receive seccomp notify fd from child"); ret = lxc_recv_devpts_from_child(handler); if (ret < 0) return syserror_ret(ret, "Failed to receive devpts fd from child"); /* Read tty fds allocated by child. */ ret = lxc_recv_ttys_from_child(handler); if (ret < 0) return syserror_ret(ret, "Failed to receive tty info from child process"); if (handler->ns_clone_flags & CLONE_NEWNET) { ret = lxc_network_recv_name_and_ifindex_from_child(handler); if (ret < 0) return syserror_ret(ret, "Failed to receive names and ifindices for network devices from child"); } ret = lxc_recv_console_from_child(handler); if (ret < 0) return syserror_ret(ret, "Failed to receive console from child"); TRACE("Finished syncing file descriptors with child"); return 0; } int lxc_sync_fds_child(struct lxc_handler *handler) { int ret; ret = lxc_seccomp_send_notifier_fd(&handler->conf->seccomp, handler->data_sock[0]); if (ret < 0) return syserror_ret(ret, "Failed to send seccomp notify fd to parent"); ret = lxc_send_devpts_to_parent(handler); if (ret < 0) return syserror_ret(ret, "Failed to send seccomp devpts fd to parent"); ret = lxc_send_ttys_to_parent(handler); if (ret < 0) return syserror_ret(ret, "Failed to send tty file descriptors to parent"); if (handler->ns_clone_flags & CLONE_NEWNET) { ret = lxc_network_send_name_and_ifindex_to_parent(handler); if (ret < 0) return syserror_ret(ret, "Failed to send network device names and ifindices to parent"); } ret = lxc_send_console_to_parent(handler); if (ret < 0) return syserror_ret(ret, "Failed to send console to parent"); TRACE("Finished syncing file descriptors with parent"); return 0; } static int setup_capabilities(struct lxc_conf *conf) { int ret; if (conf->caps.keep) ret = capabilities_allow(conf); else ret = capabilities_deny(conf); if (ret < 0) return syserror_ret(ret, "Failed to %s capabilities", conf->caps.keep ? "allow" : "deny"); return 0; } int lxc_setup(struct lxc_handler *handler) { int ret; const char *lxcpath = handler->lxcpath, *name = handler->name; struct lxc_conf *lxc_conf = handler->conf; ret = lxc_rootfs_prepare_child(handler); if (ret < 0) return syserror("Failed to prepare rootfs"); ret = lxc_setup_rootfs_prepare_root(lxc_conf, name, lxcpath); if (ret < 0) return log_error(-1, "Failed to setup rootfs"); if (handler->nsfd[LXC_NS_UTS] == -EBADF) { ret = setup_utsname(lxc_conf->utsname); if (ret < 0) return log_error(-1, "Failed to setup the utsname %s", name); } if (!lxc_conf->keyring_disable_session) { ret = lxc_setup_keyring(handler->lsm_ops, lxc_conf); if (ret < 0) return log_error(-1, "Failed to setup container keyring"); } if (handler->ns_clone_flags & CLONE_NEWNET) { ret = lxc_network_recv_from_parent(handler); if (ret < 0) return log_error(-1, "Failed to receive veth names from parent"); ret = lxc_setup_network_in_child_namespaces(lxc_conf); if (ret < 0) return log_error(-1, "Failed to setup network"); } if (lxc_conf->autodev > 0) { ret = mount_autodev(name, &lxc_conf->rootfs, lxc_conf->autodevtmpfssize, lxcpath); if (ret < 0) return log_error(-1, "Failed to mount \"/dev\""); } /* Do automatic mounts (mainly /proc and /sys), but exclude those that * need to wait until other stuff has finished. */ ret = lxc_mount_auto_mounts(handler, lxc_conf->auto_mounts & ~LXC_AUTO_CGROUP_MASK); if (ret < 0) return log_error(-1, "Failed to setup first automatic mounts"); ret = setup_mount_fstab(&lxc_conf->rootfs, lxc_conf->fstab, name, lxcpath); if (ret < 0) return log_error(-1, "Failed to setup mounts"); if (!list_empty(&lxc_conf->mount_entries)) { ret = setup_mount_entries(lxc_conf, &lxc_conf->rootfs, name, lxcpath); if (ret < 0) return log_error(-1, "Failed to setup mount entries"); } if (!lxc_sync_wake_parent(handler, START_SYNC_IDMAPPED_MOUNTS)) return -1; ret = lxc_idmapped_mounts_child(handler); if (ret) return syserror("Failed to attached detached idmapped mounts"); lxc_conf->rootfs.dfd_dev = open_at(lxc_conf->rootfs.dfd_mnt, "dev", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_BENEATH_XDEV, 0); if (lxc_conf->rootfs.dfd_dev < 0 && errno != ENOENT) return log_error_errno(-errno, errno, "Failed to open \"/dev\""); /* Now mount only cgroups, if wanted. Before, /sys could not have been * mounted. It is guaranteed to be mounted now either through * automatically or via fstab entries. */ ret = lxc_mount_auto_mounts(handler, lxc_conf->auto_mounts & LXC_AUTO_CGROUP_MASK); if (ret < 0) return log_error(-1, "Failed to setup remaining automatic mounts"); ret = run_lxc_hooks(name, "mount", lxc_conf, NULL); if (ret < 0) return log_error(-1, "Failed to run mount hooks"); if (lxc_rootfs_overmounted(&lxc_conf->rootfs)) return log_error(-1, "Rootfs overmounted"); if (lxc_conf->autodev > 0) { ret = run_lxc_hooks(name, "autodev", lxc_conf, NULL); if (ret < 0) return log_error(-1, "Failed to run autodev hooks"); ret = lxc_fill_autodev(&lxc_conf->rootfs); if (ret < 0) return log_error(-1, "Failed to populate \"/dev\""); } /* Make sure any start hooks are in the container */ if (!verify_start_hooks(lxc_conf)) return log_error(-1, "Failed to verify start hooks"); ret = lxc_create_tmp_proc_mount(lxc_conf); if (ret < 0) return log_error(-1, "Failed to mount transient procfs instance for LSMs"); ret = lxc_setup_devpts_child(handler); if (ret < 0) return log_error(-1, "Failed to prepare new devpts instance"); ret = lxc_finish_devpts_child(handler); if (ret < 0) return log_error(-1, "Failed to finish devpts setup"); ret = lxc_setup_console(handler, &lxc_conf->rootfs, &lxc_conf->console, lxc_conf->ttys.dir); if (ret < 0) return log_error(-1, "Failed to setup console"); ret = lxc_create_ttys(handler); if (ret < 0) return log_error(-1, "Failed to create ttys"); ret = lxc_setup_dev_symlinks(&lxc_conf->rootfs); if (ret < 0) return log_error(-1, "Failed to setup \"/dev\" symlinks"); ret = lxc_setup_rootfs_switch_root(&lxc_conf->rootfs); if (ret < 0) return log_error(-1, "Failed to pivot root into rootfs"); /* Setting the boot-id is best-effort for now. */ if (lxc_conf->autodev > 0) (void)lxc_setup_boot_id(); ret = setup_personality(lxc_conf->personality); if (ret < 0) return syserror("Failed to set personality"); /* Set sysctl value to a path under /proc/sys as determined from the * key. For e.g. net.ipv4.ip_forward translated to * /proc/sys/net/ipv4/ip_forward. */ ret = setup_sysctl_parameters(lxc_conf); if (ret < 0) return log_error(-1, "Failed to setup sysctl parameters"); ret = setup_capabilities(lxc_conf); if (ret < 0) return log_error(-1, "Failed to setup capabilities"); put_lxc_rootfs(&handler->conf->rootfs, true); NOTICE("The container \"%s\" is set up", name); return 0; } int run_lxc_hooks(const char *name, char *hookname, struct lxc_conf *conf, char *argv[]) { int which; struct string_entry *entry; for (which = 0; which < NUM_LXC_HOOKS; which ++) { if (strequal(hookname, lxchook_names[which])) break; } if (which >= NUM_LXC_HOOKS) return -1; list_for_each_entry(entry, &conf->hooks[which], head) { int ret; char *hook = entry->val; ret = run_script_argv(name, conf->hooks_version, "lxc", hook, hookname, argv); if (ret < 0) return -1; } return 0; } int lxc_clear_config_caps(struct lxc_conf *c) { struct cap_entry *cap, *ncap; list_for_each_entry_safe(cap, ncap, &c->caps.list, head) { list_del(&cap->head); free(cap->cap_name); free(cap); } c->caps.keep = false; INIT_LIST_HEAD(&c->caps.list); return 0; } static int lxc_free_idmap(struct list_head *id_map) { struct id_map *map, *nmap; list_for_each_entry_safe(map, nmap, id_map, head) { list_del(&map->head); free(map); } INIT_LIST_HEAD(id_map); return 0; } static int __lxc_free_idmap(struct list_head *id_map) { lxc_free_idmap(id_map); return 0; } define_cleanup_function(struct list_head *, __lxc_free_idmap); int lxc_clear_idmaps(struct lxc_conf *c) { return lxc_free_idmap(&c->id_map); } int lxc_clear_namespace(struct lxc_conf *c) { for (int i = 0; i < LXC_NS_MAX; i++) free_disarm(c->ns_share[i]); return 0; } int lxc_clear_cgroups(struct lxc_conf *c, const char *key, int version) { const char *k = key; bool all = false; char *global_token, *namespaced_token; size_t namespaced_token_len; struct list_head *list; struct lxc_cgroup *cgroup, *ncgroup; if (version == CGROUP2_SUPER_MAGIC) { global_token = "lxc.cgroup2"; namespaced_token = "lxc.cgroup2."; namespaced_token_len = STRLITERALLEN("lxc.cgroup2."); list = &c->cgroup2; } else if (version == CGROUP_SUPER_MAGIC) { global_token = "lxc.cgroup"; namespaced_token = "lxc.cgroup."; namespaced_token_len = STRLITERALLEN("lxc.cgroup."); list = &c->cgroup; } else { return ret_errno(EINVAL); } if (strequal(key, global_token)) all = true; else if (strnequal(key, namespaced_token, namespaced_token_len)) k += namespaced_token_len; else return ret_errno(EINVAL); list_for_each_entry_safe(cgroup, ncgroup, list, head) { if (!all && !strequal(cgroup->subsystem, k)) continue; list_del(&cgroup->head); free(cgroup->subsystem); free(cgroup->value); free(cgroup); } if (all) INIT_LIST_HEAD(list); return 0; } static inline void lxc_clear_cgroups_devices(struct lxc_conf *conf) { lxc_clear_cgroup2_devices(&conf->bpf_devices); } int lxc_clear_limits(struct lxc_conf *c, const char *key) { const char *k = NULL; bool all = false; struct lxc_limit *lim, *nlim; if (strequal(key, "lxc.limit") || strequal(key, "lxc.prlimit")) all = true; else if (strnequal(key, "lxc.limit.", STRLITERALLEN("lxc.limit."))) k = key + STRLITERALLEN("lxc.limit."); else if (strnequal(key, "lxc.prlimit.", STRLITERALLEN("lxc.prlimit."))) k = key + STRLITERALLEN("lxc.prlimit."); else return ret_errno(EINVAL); list_for_each_entry_safe(lim, nlim, &c->limits, head) { if (!all && !strequal(lim->resource, k)) continue; list_del(&lim->head); free_disarm(lim->resource); free(lim); } if (all) INIT_LIST_HEAD(&c->limits); return 0; } int lxc_clear_sysctls(struct lxc_conf *c, const char *key) { const char *k = NULL; bool all = false; struct lxc_sysctl *sysctl, *nsysctl; if (strequal(key, "lxc.sysctl")) all = true; else if (strnequal(key, "lxc.sysctl.", STRLITERALLEN("lxc.sysctl."))) k = key + STRLITERALLEN("lxc.sysctl."); else return -1; list_for_each_entry_safe(sysctl, nsysctl, &c->sysctls, head) { if (!all && !strequal(sysctl->key, k)) continue; list_del(&sysctl->head); free(sysctl->key); free(sysctl->value); free(sysctl); } if (all) INIT_LIST_HEAD(&c->sysctls); return 0; } int lxc_clear_procs(struct lxc_conf *c, const char *key) { const char *k = NULL; bool all = false; struct lxc_proc *proc, *nproc; if (strequal(key, "lxc.proc")) all = true; else if (strnequal(key, "lxc.proc.", STRLITERALLEN("lxc.proc."))) k = key + STRLITERALLEN("lxc.proc."); else return -1; list_for_each_entry_safe(proc, nproc, &c->procs, head) { if (!all && !strequal(proc->filename, k)) continue; list_del(&proc->head); free(proc->filename); free(proc->value); free(proc); } if (all) INIT_LIST_HEAD(&c->procs); return 0; } int lxc_clear_groups(struct lxc_conf *c) { struct string_entry *entry, *nentry; list_for_each_entry_safe(entry, nentry, &c->groups, head) { list_del(&entry->head); free(entry->val); free(entry); } INIT_LIST_HEAD(&c->groups); return 0; } int lxc_clear_environment(struct lxc_conf *c) { struct environment_entry *env, *nenv; list_for_each_entry_safe(env, nenv, &c->environment, head) { list_del(&env->head); free(env->key); free(env->val); free(env); } INIT_LIST_HEAD(&c->environment); return 0; } int lxc_clear_mount_entries(struct lxc_conf *c) { struct string_entry *entry, *nentry; list_for_each_entry_safe(entry, nentry, &c->mount_entries, head) { list_del(&entry->head); free(entry->val); free(entry); } INIT_LIST_HEAD(&c->mount_entries); return 0; } int lxc_clear_automounts(struct lxc_conf *c) { c->auto_mounts = 0; return 0; } int lxc_clear_hooks(struct lxc_conf *c, const char *key) { const char *k = NULL; bool all = false, done = false; struct string_entry *entry, *nentry; if (strequal(key, "lxc.hook")) all = true; else if (strnequal(key, "lxc.hook.", STRLITERALLEN("lxc.hook."))) k = key + STRLITERALLEN("lxc.hook."); else return -1; for (int i = 0; i < NUM_LXC_HOOKS; i++) { if (all || strequal(k, lxchook_names[i])) { list_for_each_entry_safe(entry, nentry, &c->hooks[i], head) { list_del(&entry->head); free(entry->val); free(entry); } INIT_LIST_HEAD(&c->hooks[i]); done = true; } } if (!done) return log_error(-1, "Invalid hook key: %s", key); return 0; } int lxc_clear_apparmor_raw(struct lxc_conf *c) { struct string_entry *entry, *nentry; list_for_each_entry_safe(entry, nentry, &c->lsm_aa_raw, head) { list_del(&entry->head); free(entry->val); free(entry); } INIT_LIST_HEAD(&c->lsm_aa_raw); return 0; } void lxc_conf_free(struct lxc_conf *conf) { if (!conf) return; if (current_config == conf) current_config = NULL; lxc_terminal_conf_free(&conf->console); free(conf->rootfs.mount); free(conf->rootfs.bdev_type); free(conf->rootfs.path); put_lxc_rootfs(&conf->rootfs, true); free(conf->logfile); if (conf->logfd != -1) close(conf->logfd); free(conf->utsname); free(conf->ttys.dir); free(conf->ttys.tty_names); free(conf->fstab); free(conf->rcfile); free(conf->execute_cmd); free(conf->init_cmd); free(conf->init_groups.list); free(conf->init_cwd); free(conf->unexpanded_config); free(conf->syslog); lxc_free_networks(conf); free(conf->lsm_aa_profile); free(conf->lsm_aa_profile_computed); free(conf->lsm_se_context); free(conf->lsm_se_keyring_context); lxc_seccomp_free(&conf->seccomp); lxc_clear_config_caps(conf); lxc_clear_cgroups(conf, "lxc.cgroup", CGROUP_SUPER_MAGIC); lxc_clear_cgroups(conf, "lxc.cgroup2", CGROUP2_SUPER_MAGIC); lxc_clear_cgroups_devices(conf); lxc_clear_hooks(conf, "lxc.hook"); lxc_clear_mount_entries(conf); lxc_clear_idmaps(conf); lxc_clear_groups(conf); lxc_clear_environment(conf); lxc_clear_limits(conf, "lxc.prlimit"); lxc_clear_sysctls(conf, "lxc.sysctl"); lxc_clear_procs(conf, "lxc.proc"); lxc_clear_apparmor_raw(conf); lxc_clear_namespace(conf); free(conf->cgroup_meta.dir); free(conf->cgroup_meta.monitor_dir); free(conf->cgroup_meta.monitor_pivot_dir); free(conf->cgroup_meta.container_dir); free(conf->cgroup_meta.namespace_dir); free(conf->cgroup_meta.controllers); free(conf->shmount.path_host); free(conf->shmount.path_cont); free(conf); } struct userns_fn_data { int (*fn)(void *); const char *fn_name; void *arg; int p[2]; }; static int run_userns_fn(void *data) { struct userns_fn_data *d = data; int ret; char c; close_prot_errno_disarm(d->p[1]); /* * Wait for parent to finish establishing a new mapping in the user * namespace we are executing in. */ ret = lxc_read_nointr(d->p[0], &c, 1); close_prot_errno_disarm(d->p[0]); if (ret != 1) return -1; if (d->fn_name) TRACE("Calling function \"%s\"", d->fn_name); /* Call function to run. */ return d->fn(d->arg); } static struct id_map *mapped_nsid_add(const struct lxc_conf *conf, unsigned id, enum idtype idtype) { const struct id_map *map; struct id_map *retmap; map = find_mapped_nsid_entry(conf, id, idtype); if (!map) return NULL; retmap = zalloc(sizeof(*retmap)); if (!retmap) return NULL; memcpy(retmap, map, sizeof(*retmap)); return retmap; } static struct id_map *find_mapped_hostid_entry(const struct list_head *idmap, unsigned id, enum idtype idtype) { struct id_map *retmap = NULL; struct id_map *map; list_for_each_entry(map, idmap, head) { if (map->idtype != idtype) continue; if (id >= map->hostid && id < map->hostid + map->range) { retmap = map; break; } } return retmap; } /* Allocate a new {g,u}id mapping for the given {g,u}id. Re-use an already * existing one or establish a new one. */ static struct id_map *mapped_hostid_add(const struct lxc_conf *conf, uid_t id, enum idtype type) { __do_free struct id_map *entry = NULL; int hostid_mapped; struct id_map *tmp = NULL; entry = zalloc(sizeof(*entry)); if (!entry) return NULL; /* Reuse existing mapping. */ tmp = find_mapped_hostid_entry(&conf->id_map, id, type); if (tmp) { memcpy(entry, tmp, sizeof(*entry)); } else { /* Find new mapping. */ hostid_mapped = find_unmapped_nsid(conf, type); if (hostid_mapped < 0) return log_debug(NULL, "Failed to find free mapping for id %d", id); entry->idtype = type; entry->nsid = hostid_mapped; entry->hostid = (unsigned long)id; entry->range = 1; } return move_ptr(entry); } static int get_minimal_idmap(const struct lxc_conf *conf, uid_t *resuid, gid_t *resgid, struct list_head *head_ret) { __do_free struct id_map *container_root_uid = NULL, *container_root_gid = NULL, *host_uid_map = NULL, *host_gid_map = NULL; uid_t euid, egid; uid_t nsuid = (conf->root_nsuid_map != NULL) ? 0 : conf->init_uid; gid_t nsgid = (conf->root_nsgid_map != NULL) ? 0 : conf->init_gid; /* Find container root mappings. */ container_root_uid = mapped_nsid_add(conf, nsuid, ID_TYPE_UID); if (!container_root_uid) return sysdebug("Failed to find mapping for namespace uid %d", 0); euid = geteuid(); if (euid >= container_root_uid->hostid && euid < (container_root_uid->hostid + container_root_uid->range)) host_uid_map = move_ptr(container_root_uid); container_root_gid = mapped_nsid_add(conf, nsgid, ID_TYPE_GID); if (!container_root_gid) return sysdebug("Failed to find mapping for namespace gid %d", 0); egid = getegid(); if (egid >= container_root_gid->hostid && egid < (container_root_gid->hostid + container_root_gid->range)) host_gid_map = move_ptr(container_root_gid); /* Check whether the {g,u}id of the user has a mapping. */ if (!host_uid_map) host_uid_map = mapped_hostid_add(conf, euid, ID_TYPE_UID); if (!host_uid_map) return sysdebug("Failed to find mapping for uid %d", euid); if (!host_gid_map) host_gid_map = mapped_hostid_add(conf, egid, ID_TYPE_GID); if (!host_gid_map) return sysdebug("Failed to find mapping for gid %d", egid); /* idmap will now keep track of that memory. */ list_add_tail(&host_uid_map->head, head_ret); move_ptr(host_uid_map); if (container_root_uid) { /* idmap will now keep track of that memory. */ list_add_tail(&container_root_uid->head, head_ret); move_ptr(container_root_uid); } /* idmap will now keep track of that memory. */ list_add_tail(&host_gid_map->head, head_ret); move_ptr(host_gid_map); if (container_root_gid) { /* idmap will now keep track of that memory. */ list_add_tail(&container_root_gid->head, head_ret); move_ptr(container_root_gid); } TRACE("Allocated minimal idmapping for ns uid %d and ns gid %d", nsuid, nsgid); if (resuid) *resuid = nsuid; if (resgid) *resgid = nsgid; return 0; } /* * Run a function in a new user namespace. * The caller's euid/egid will be mapped if it is not already. * Afaict, userns_exec_1() is only used to operate based on privileges for the * user's own {g,u}id on the host and for the container root's unmapped {g,u}id. * This means we require only to establish a mapping from: * - the container root {g,u}id as seen from the host > user's host {g,u}id * - the container root -> some sub{g,u}id * The former we add, if the user did not specify a mapping. The latter we * retrieve from the container's configured {g,u}id mappings as it must have been * there to start the container in the first place. */ int userns_exec_1(const struct lxc_conf *conf, int (*fn)(void *), void *data, const char *fn_name) { LIST_HEAD(minimal_idmap); call_cleaner(__lxc_free_idmap) struct list_head *idmap = &minimal_idmap; int ret = -1, status = -1; char c = '1'; struct userns_fn_data d = { .arg = data, .fn = fn, .fn_name = fn_name, }; pid_t pid; int pipe_fds[2]; if (!conf) return -EINVAL; ret = get_minimal_idmap(conf, NULL, NULL, idmap); if (ret) return ret_errno(ENOENT); ret = pipe2(pipe_fds, O_CLOEXEC); if (ret < 0) return -errno; d.p[0] = pipe_fds[0]; d.p[1] = pipe_fds[1]; /* Clone child in new user namespace. */ pid = lxc_raw_clone_cb(run_userns_fn, &d, CLONE_NEWUSER, NULL); if (pid < 0) { ERROR("Failed to clone process in new user namespace"); goto on_error; } close_prot_errno_disarm(pipe_fds[0]); if (lxc_log_trace()) { struct id_map *map; list_for_each_entry(map, idmap, head) TRACE("Establishing %cid mapping for \"%d\" in new user namespace: nsuid %lu - hostid %lu - range %lu", (map->idtype == ID_TYPE_UID) ? 'u' : 'g', pid, map->nsid, map->hostid, map->range); } /* Set up {g,u}id mapping for user namespace of child process. */ ret = lxc_map_ids(idmap, pid); if (ret < 0) { ERROR("Error setting up {g,u}id mappings for child process \"%d\"", pid); goto on_error; } /* Tell child to proceed. */ if (lxc_write_nointr(pipe_fds[1], &c, 1) != 1) { SYSERROR("Failed telling child process \"%d\" to proceed", pid); goto on_error; } on_error: close_prot_errno_disarm(pipe_fds[0]); close_prot_errno_disarm(pipe_fds[1]); /* Wait for child to finish. */ if (pid > 0) status = wait_for_pid(pid); if (status < 0) ret = -1; return ret; } int userns_exec_minimal(const struct lxc_conf *conf, int (*fn_parent)(void *), void *fn_parent_data, int (*fn_child)(void *), void *fn_child_data) { LIST_HEAD(minimal_idmap); call_cleaner(__lxc_free_idmap) struct list_head *idmap = &minimal_idmap; uid_t resuid = LXC_INVALID_UID; gid_t resgid = LXC_INVALID_GID; char c = '1'; ssize_t ret; pid_t pid; int sock_fds[2]; if (!conf || !fn_child) return ret_errno(EINVAL); ret = get_minimal_idmap(conf, &resuid, &resgid, idmap); if (ret) return ret_errno(ENOENT); ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, sock_fds); if (ret < 0) return -errno; pid = fork(); if (pid < 0) { SYSERROR("Failed to create new process"); goto on_error; } if (pid == 0) { close_prot_errno_disarm(sock_fds[1]); ret = unshare(CLONE_NEWUSER); if (ret < 0) { SYSERROR("Failed to unshare new user namespace"); _exit(EXIT_FAILURE); } ret = lxc_write_nointr(sock_fds[0], &c, 1); if (ret != 1) _exit(EXIT_FAILURE); ret = lxc_read_nointr(sock_fds[0], &c, 1); if (ret != 1) _exit(EXIT_FAILURE); close_prot_errno_disarm(sock_fds[0]); if (!lxc_drop_groups() && errno != EPERM) _exit(EXIT_FAILURE); ret = setresgid(resgid, resgid, resgid); if (ret < 0) { SYSERROR("Failed to setresgid(%d, %d, %d)", resgid, resgid, resgid); _exit(EXIT_FAILURE); } ret = setresuid(resuid, resuid, resuid); if (ret < 0) { SYSERROR("Failed to setresuid(%d, %d, %d)", resuid, resuid, resuid); _exit(EXIT_FAILURE); } ret = fn_child(fn_child_data); if (ret) { SYSERROR("Running function in new user namespace failed"); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } close_prot_errno_disarm(sock_fds[0]); if (lxc_log_trace()) { struct id_map *map; list_for_each_entry(map, idmap, head) TRACE("Establishing %cid mapping for \"%d\" in new user namespace: nsuid %lu - hostid %lu - range %lu", (map->idtype == ID_TYPE_UID) ? 'u' : 'g', pid, map->nsid, map->hostid, map->range); } ret = lxc_read_nointr(sock_fds[1], &c, 1); if (ret != 1) { SYSERROR("Failed waiting for child process %d\" to tell us to proceed", pid); goto on_error; } /* Set up {g,u}id mapping for user namespace of child process. */ ret = lxc_map_ids(idmap, pid); if (ret < 0) { ERROR("Error setting up {g,u}id mappings for child process \"%d\"", pid); goto on_error; } /* Tell child to proceed. */ ret = lxc_write_nointr(sock_fds[1], &c, 1); if (ret != 1) { SYSERROR("Failed telling child process \"%d\" to proceed", pid); goto on_error; } if (fn_parent && fn_parent(fn_parent_data)) { SYSERROR("Running parent function failed"); _exit(EXIT_FAILURE); } on_error: close_prot_errno_disarm(sock_fds[0]); close_prot_errno_disarm(sock_fds[1]); /* Wait for child to finish. */ if (pid < 0) return -1; return wait_for_pid(pid); } int userns_exec_full(struct lxc_conf *conf, int (*fn)(void *), void *data, const char *fn_name) { LIST_HEAD(full_idmap); int ret = -1; char c = '1'; struct id_map *container_root_uid = NULL, *container_root_gid = NULL, *host_uid_map = NULL, *host_gid_map = NULL; pid_t pid; uid_t euid, egid; int p[2]; struct id_map *map; struct userns_fn_data d; if (!conf) return -EINVAL; ret = pipe2(p, O_CLOEXEC); if (ret < 0) return -errno; d.fn = fn; d.fn_name = fn_name; d.arg = data; d.p[0] = p[0]; d.p[1] = p[1]; /* Clone child in new user namespace. */ pid = lxc_clone(run_userns_fn, &d, CLONE_NEWUSER, NULL); if (pid < 0) { ERROR("Failed to clone process in new user namespace"); goto on_error; } close(p[0]); p[0] = -1; euid = geteuid(); egid = getegid(); /* Find container root. */ list_for_each_entry(map, &conf->id_map, head) { __do_free struct id_map *dup_map = NULL; dup_map = memdup(map, sizeof(struct id_map)); if (!dup_map) goto on_error; list_add_tail(&dup_map->head, &full_idmap); move_ptr(dup_map); if (map->idtype == ID_TYPE_UID) if (euid >= map->hostid && euid < map->hostid + map->range) host_uid_map = map; if (map->idtype == ID_TYPE_GID) if (egid >= map->hostid && egid < map->hostid + map->range) host_gid_map = map; if (map->nsid != 0) continue; if (map->idtype == ID_TYPE_UID) if (container_root_uid == NULL) container_root_uid = map; if (map->idtype == ID_TYPE_GID) if (container_root_gid == NULL) container_root_gid = map; } if (!container_root_uid || !container_root_gid) { ERROR("No mapping for container root found"); goto on_error; } /* Check whether the {g,u}id of the user has a mapping. */ if (!host_uid_map) host_uid_map = mapped_hostid_add(conf, euid, ID_TYPE_UID); else host_uid_map = container_root_uid; if (!host_gid_map) host_gid_map = mapped_hostid_add(conf, egid, ID_TYPE_GID); else host_gid_map = container_root_gid; if (!host_uid_map) { DEBUG("Failed to find mapping for uid %d", euid); goto on_error; } if (!host_gid_map) { DEBUG("Failed to find mapping for gid %d", egid); goto on_error; } if (host_uid_map && (host_uid_map != container_root_uid)) { /* idmap will now keep track of that memory. */ list_add_tail(&host_uid_map->head, &full_idmap); move_ptr(host_uid_map); } if (host_gid_map && (host_gid_map != container_root_gid)) { /* idmap will now keep track of that memory. */ list_add_tail(&host_gid_map->head, &full_idmap); move_ptr(host_gid_map); } if (lxc_log_trace()) { list_for_each_entry(map, &full_idmap, head) { TRACE("establishing %cid mapping for \"%d\" in new user namespace: nsuid %lu - hostid %lu - range %lu", (map->idtype == ID_TYPE_UID) ? 'u' : 'g', pid, map->nsid, map->hostid, map->range); } } /* Set up {g,u}id mapping for user namespace of child process. */ ret = lxc_map_ids(&full_idmap, pid); if (ret < 0) { ERROR("error setting up {g,u}id mappings for child process \"%d\"", pid); goto on_error; } /* Tell child to proceed. */ if (lxc_write_nointr(p[1], &c, 1) != 1) { SYSERROR("Failed telling child process \"%d\" to proceed", pid); goto on_error; } on_error: if (p[0] != -1) close(p[0]); close(p[1]); /* Wait for child to finish. */ if (pid > 0) ret = wait_for_pid(pid); __lxc_free_idmap(&full_idmap); if (host_uid_map && (host_uid_map != container_root_uid)) free(host_uid_map); if (host_gid_map && (host_gid_map != container_root_gid)) free(host_gid_map); return ret; } static int add_idmap_entry(struct list_head *idmap_list, enum idtype idtype, unsigned long nsid, unsigned long hostid, unsigned long range) { __do_free struct id_map *new_idmap = NULL; new_idmap = zalloc(sizeof(*new_idmap)); if (!new_idmap) return ret_errno(ENOMEM); new_idmap->idtype = idtype; new_idmap->hostid = hostid; new_idmap->nsid = nsid; new_idmap->range = range; list_add_tail(&new_idmap->head, idmap_list); move_ptr(new_idmap); INFO("Adding id map: type %c nsid %lu hostid %lu range %lu", idtype == ID_TYPE_UID ? 'u' : 'g', nsid, hostid, range); return 0; } int userns_exec_mapped_root(const char *path, int path_fd, const struct lxc_conf *conf) { LIST_HEAD(idmap_list); call_cleaner(__lxc_free_idmap) struct list_head *idmap = &idmap_list; __do_close int fd = -EBADF; int target_fd = -EBADF; char c = '1'; ssize_t ret; pid_t pid; int sock_fds[2]; uid_t container_host_uid, hostuid; gid_t container_host_gid, hostgid; struct stat st; if (!conf || (!path && path_fd < 0)) return ret_errno(EINVAL); if (!path) path = "(null)"; container_host_uid = get_mapped_rootid(conf, ID_TYPE_UID); if (!uid_valid(container_host_uid)) return log_error(-1, "No uid mapping for container root"); container_host_gid = get_mapped_rootid(conf, ID_TYPE_GID); if (!gid_valid(container_host_gid)) return log_error(-1, "No gid mapping for container root"); if (path_fd < 0) { fd = open(path, O_CLOEXEC | O_NOCTTY); if (fd < 0) return log_error_errno(-errno, errno, "Failed to open \"%s\"", path); target_fd = fd; } else { target_fd = path_fd; } hostuid = geteuid(); /* We are root so chown directly. */ if (hostuid == 0) { ret = fchown(target_fd, container_host_uid, container_host_gid); if (ret) return log_error_errno(-errno, errno, "Failed to fchown(%d(%s), %d, %d)", target_fd, path, container_host_uid, container_host_gid); return log_trace(0, "Chowned %d(%s) to uid %d and %d", target_fd, path, container_host_uid, container_host_gid); } /* The container's root host id matches */ if (container_host_uid == hostuid) return log_info(0, "Container root id is mapped to our uid"); /* Get the current ids of our target. */ ret = fstat(target_fd, &st); if (ret) return log_error_errno(-errno, errno, "Failed to stat \"%s\"", path); hostgid = getegid(); if (st.st_uid == hostuid && mapped_hostid(st.st_gid, conf, ID_TYPE_GID) < 0) { ret = fchown(target_fd, -1, hostgid); if (ret) return log_error_errno(-errno, errno, "Failed to fchown(%d(%s), -1, %d)", target_fd, path, hostgid); TRACE("Chowned %d(%s) to -1:%d", target_fd, path, hostgid); } /* "u:0:rootuid:1" */ ret = add_idmap_entry(idmap, ID_TYPE_UID, 0, container_host_uid, 1); if (ret < 0) return log_error_errno(ret, -ret, "Failed to add idmap entry"); /* "u:hostuid:hostuid:1" */ ret = add_idmap_entry(idmap, ID_TYPE_UID, hostuid, hostuid, 1); if (ret < 0) return log_error_errno(ret, -ret, "Failed to add idmap entry"); /* "g:0:rootgid:1" */ ret = add_idmap_entry(idmap, ID_TYPE_GID, 0, container_host_gid, 1); if (ret < 0) return log_error_errno(ret, -ret, "Failed to add idmap entry"); /* "g:hostgid:hostgid:1" */ ret = add_idmap_entry(idmap, ID_TYPE_GID, hostgid, hostgid, 1); if (ret < 0) return log_error_errno(ret, -ret, "Failed to add idmap entry"); if (hostgid != st.st_gid) { /* "g:pathgid:rootgid+pathgid:1" */ ret = add_idmap_entry(idmap, ID_TYPE_GID, st.st_gid, container_host_gid + (gid_t)st.st_gid, 1); if (ret < 0) return log_error_errno(ret, -ret, "Failed to add idmap entry"); } ret = socketpair(PF_LOCAL, SOCK_STREAM | SOCK_CLOEXEC, 0, sock_fds); if (ret < 0) return -errno; pid = fork(); if (pid < 0) { SYSERROR("Failed to create new process"); goto on_error; } if (pid == 0) { close_prot_errno_disarm(sock_fds[1]); ret = unshare(CLONE_NEWUSER); if (ret < 0) { SYSERROR("Failed to unshare new user namespace"); _exit(EXIT_FAILURE); } ret = lxc_write_nointr(sock_fds[0], &c, 1); if (ret != 1) _exit(EXIT_FAILURE); ret = lxc_read_nointr(sock_fds[0], &c, 1); if (ret != 1) _exit(EXIT_FAILURE); close_prot_errno_disarm(sock_fds[0]); if (!lxc_drop_groups() && errno != EPERM) _exit(EXIT_FAILURE); ret = setresgid(0, 0, 0); if (ret < 0) { SYSERROR("Failed to setresgid(0, 0, 0)"); _exit(EXIT_FAILURE); } ret = setresuid(0, 0, 0); if (ret < 0) { SYSERROR("Failed to setresuid(0, 0, 0)"); _exit(EXIT_FAILURE); } ret = fchown(target_fd, 0, st.st_gid); if (ret) { SYSERROR("Failed to chown %d(%s) to 0:%d", target_fd, path, st.st_gid); _exit(EXIT_FAILURE); } TRACE("Chowned %d(%s) to 0:%d", target_fd, path, st.st_gid); _exit(EXIT_SUCCESS); } close_prot_errno_disarm(sock_fds[0]); if (lxc_log_trace()) { struct id_map *map; list_for_each_entry(map, idmap, head) TRACE("Establishing %cid mapping for \"%d\" in new user namespace: nsuid %lu - hostid %lu - range %lu", (map->idtype == ID_TYPE_UID) ? 'u' : 'g', pid, map->nsid, map->hostid, map->range); } ret = lxc_read_nointr(sock_fds[1], &c, 1); if (ret != 1) { SYSERROR("Failed waiting for child process %d\" to tell us to proceed", pid); goto on_error; } /* Set up {g,u}id mapping for user namespace of child process. */ ret = lxc_map_ids(idmap, pid); if (ret < 0) { ERROR("Error setting up {g,u}id mappings for child process \"%d\"", pid); goto on_error; } /* Tell child to proceed. */ ret = lxc_write_nointr(sock_fds[1], &c, 1); if (ret != 1) { SYSERROR("Failed telling child process \"%d\" to proceed", pid); goto on_error; } on_error: close_prot_errno_disarm(sock_fds[0]); close_prot_errno_disarm(sock_fds[1]); /* Wait for child to finish. */ if (pid < 0) return log_error(-1, "Failed to create child process"); if (!wait_exited(pid)) return -1; return 0; } /* not thread-safe, do not use from api without first forking */ static char *getuname(void) { __do_free char *buf = NULL; struct passwd pwent; struct passwd *pwentp = NULL; ssize_t bufsize; int ret; bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize < 0) bufsize = 1024; buf = zalloc(bufsize); if (!buf) return NULL; ret = getpwuid_r(geteuid(), &pwent, buf, bufsize, &pwentp); if (!pwentp) { if (ret == 0) WARN("Could not find matched password record."); return log_error(NULL, "Failed to get password record - %u", geteuid()); } return strdup(pwent.pw_name); } /* not thread-safe, do not use from api without first forking */ static char *getgname(void) { __do_free char *buf = NULL; struct group grent; struct group *grentp = NULL; ssize_t bufsize; int ret; bufsize = sysconf(_SC_GETGR_R_SIZE_MAX); if (bufsize < 0) bufsize = 1024; buf = zalloc(bufsize); if (!buf) return NULL; ret = getgrgid_r(getegid(), &grent, buf, bufsize, &grentp); if (!grentp) { if (ret == 0) WARN("Could not find matched group record"); return log_error(NULL, "Failed to get group record - %u", getegid()); } return strdup(grent.gr_name); } /* not thread-safe, do not use from api without first forking */ void suggest_default_idmap(void) { __do_free char *gname = NULL, *line = NULL, *uname = NULL; __do_fclose FILE *subuid_f = NULL, *subgid_f = NULL; unsigned int uid = 0, urange = 0, gid = 0, grange = 0; size_t len = 0; uname = getuname(); if (!uname) return; gname = getgname(); if (!gname) return; subuid_f = fopen(subuidfile, "re"); if (!subuid_f) { ERROR("Your system is not configured with subuids"); return; } while (getline(&line, &len, subuid_f) != -1) { char *p, *p2; size_t no_newline = 0; p = strchr(line, ':'); if (*line == '#') continue; if (!p) continue; *p = '\0'; p++; if (!strequal(line, uname)) continue; p2 = strchr(p, ':'); if (!p2) continue; *p2 = '\0'; p2++; if (!*p2) continue; no_newline = strcspn(p2, "\n"); p2[no_newline] = '\0'; if (lxc_safe_uint(p, &uid) < 0) WARN("Could not parse UID"); if (lxc_safe_uint(p2, &urange) < 0) WARN("Could not parse UID range"); } subgid_f = fopen(subgidfile, "re"); if (!subgid_f) { ERROR("Your system is not configured with subgids"); return; } while (getline(&line, &len, subgid_f) != -1) { char *p, *p2; size_t no_newline = 0; p = strchr(line, ':'); if (*line == '#') continue; if (!p) continue; *p = '\0'; p++; if (!strequal(line, uname)) continue; p2 = strchr(p, ':'); if (!p2) continue; *p2 = '\0'; p2++; if (!*p2) continue; no_newline = strcspn(p2, "\n"); p2[no_newline] = '\0'; if (lxc_safe_uint(p, &gid) < 0) WARN("Could not parse GID"); if (lxc_safe_uint(p2, &grange) < 0) WARN("Could not parse GID range"); } if (!urange || !grange) { ERROR("You do not have subuids or subgids allocated"); ERROR("Unprivileged containers require subuids and subgids"); return; } ERROR("You must either run as root, or define uid mappings"); ERROR("To pass uid mappings to lxc-create, you could create"); ERROR("~/.config/lxc/default.conf:"); ERROR("lxc.include = %s", LXC_DEFAULT_CONFIG); ERROR("lxc.idmap = u 0 %u %u", uid, urange); ERROR("lxc.idmap = g 0 %u %u", gid, grange); } int lxc_set_environment(const struct lxc_conf *conf) { struct environment_entry *env; list_for_each_entry(env, &conf->environment, head) { int ret; ret = setenv(env->key, env->val, 1); if (ret < 0) return syserror("Failed to set environment variable: %s=%s", env->key, env->val); TRACE("Set environment variable: %s=%s", env->key, env->val); } return 0; } lxc-4.0.12/src/lxc/namespace.c0000644061062106075000000000730614176403775013016 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "log.h" #include "memory_utils.h" #include "namespace.h" #include "utils.h" lxc_log_define(namespace, lxc); /* Leave the user namespace at the first position in the array of structs so * that we always attach to it first when iterating over the struct and using * setns() to switch namespaces. This especially affects lxc_attach(): Suppose * you cloned a new user namespace and mount namespace as an unprivileged user * on the host and want to setns() to the mount namespace. This requires you to * attach to the user namespace first otherwise the kernel will fail this check: * * if (!ns_capable(mnt_ns->user_ns, CAP_SYS_ADMIN) || * !ns_capable(current_user_ns(), CAP_SYS_CHROOT) || * !ns_capable(current_user_ns(), CAP_SYS_ADMIN)) * return -EPERM; * * in * * linux/fs/namespace.c:mntns_install(). */ const struct ns_info ns_info[LXC_NS_MAX] = { [LXC_NS_USER] = { "user", "ns/user", CLONE_NEWUSER, "CLONE_NEWUSER", "LXC_USER_NS" }, [LXC_NS_MNT] = { "mnt", "ns/mnt", CLONE_NEWNS, "CLONE_NEWNS", "LXC_MNT_NS" }, [LXC_NS_PID] = { "pid", "ns/pid", CLONE_NEWPID, "CLONE_NEWPID", "LXC_PID_NS" }, [LXC_NS_UTS] = { "uts", "ns/uts", CLONE_NEWUTS, "CLONE_NEWUTS", "LXC_UTS_NS" }, [LXC_NS_IPC] = { "ipc", "ns/ipc", CLONE_NEWIPC, "CLONE_NEWIPC", "LXC_IPC_NS" }, [LXC_NS_NET] = { "net", "ns/net", CLONE_NEWNET, "CLONE_NEWNET", "LXC_NET_NS" }, [LXC_NS_CGROUP] = { "cgroup", "ns/cgroup", CLONE_NEWCGROUP, "CLONE_NEWCGROUP", "LXC_CGROUP_NS" }, [LXC_NS_TIME] = { "time", "ns/time", CLONE_NEWTIME, "CLONE_NEWTIME", "LXC_TIME_NS" }, }; int lxc_namespace_2_cloneflag(const char *namespace) { int i; for (i = 0; i < LXC_NS_MAX; i++) if (!strcasecmp(ns_info[i].proc_name, namespace)) return ns_info[i].clone_flag; ERROR("Invalid namespace name \"%s\"", namespace); return -EINVAL; } int lxc_namespace_2_ns_idx(const char *namespace) { for (int i = 0; i < LXC_NS_MAX; i++) { if (strequal(ns_info[i].proc_name, namespace)) return i; } ERROR("Invalid namespace name \"%s\"", namespace); return -EINVAL; } extern int lxc_namespace_2_std_identifiers(char *namespaces) { char **it; char *del; /* The identifiers for namespaces used with lxc-attach and lxc-unshare * as given on the manpage do not align with the standard identifiers. * This affects network, mount, and uts namespaces. The standard identifiers * are: "mnt", "uts", and "net" whereas lxc-attach and lxc-unshare uses * "MOUNT", "UTSNAME", and "NETWORK". So let's use some cheap memmove()s * to replace them by their standard identifiers. * Let's illustrate this with an example: * Assume the string: * * "IPC|MOUNT|PID" * * then we memmove() * * dest: del + 1 == OUNT|PID * src: del + 3 == NT|PID */ if (!namespaces) return -1; while ((del = strstr(namespaces, "MOUNT"))) memmove(del + 1, del + 3, strlen(del) - 2); for (it = (char *[]){"NETWORK", "UTSNAME", NULL}; it && *it; it++) while ((del = strstr(namespaces, *it))) memmove(del + 3, del + 7, strlen(del) - 6); return 0; } int lxc_fill_namespace_flags(char *flaglist, int *flags) { char *token; int aflag; if (!flaglist) { ERROR("At least one namespace is needed."); return -1; } lxc_iterate_parts(token, flaglist, "|") { aflag = lxc_namespace_2_cloneflag(token); if (aflag < 0) return -1; *flags |= aflag; } return 0; } lxc-4.0.12/src/lxc/network.h0000644061062106075000000002354014176403775012556 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_NETWORK_H #define __LXC_NETWORK_H #include "config.h" #include #include #include #include #include #include #include "compiler.h" #include "hlist.h" #include "list.h" struct lxc_conf; struct lxc_handler; struct lxc_netdev; enum { LXC_NET_EMPTY, LXC_NET_VETH, LXC_NET_MACVLAN, LXC_NET_IPVLAN, LXC_NET_PHYS, LXC_NET_VLAN, LXC_NET_NONE, LXC_NET_MAXCONFTYPE, }; /* * Defines the structure to configure an ipv4 address * @address : ipv4 address * @broadcast : ipv4 broadcast address * @mask : network mask */ struct lxc_inetdev { struct in_addr addr; struct in_addr bcast; unsigned int prefix; struct list_head head; }; /* * Defines the structure to configure an ipv6 address * @flags : set the address up * @address : ipv6 address * @broadcast : ipv6 broadcast address * @mask : network mask */ struct lxc_inet6dev { struct in6_addr addr; struct in6_addr mcast; struct in6_addr acast; unsigned int prefix; struct list_head head; }; /* Contains information about the host side veth device. * @pair : Name of the host side veth device. * If the user requested that the host veth device be created with a * specific names this field will be set. If this field is set @veth1 * is not set. * @veth1 : Name of the host side veth device. * If the user did not request that the host veth device be created * with a specific name this field will be set. If this field is set * @pair is not set. * @ifindex : Ifindex of the network device. */ struct ifla_veth { char pair[IFNAMSIZ]; char veth1[IFNAMSIZ]; int ifindex; struct list_head ipv4_routes; struct list_head ipv6_routes; int mode; /* bridge, router */ short vlan_id; bool vlan_id_set; struct lxc_list vlan_tagged_ids; }; struct ifla_vlan { unsigned int flags; unsigned int fmask; unsigned short vid; unsigned short pad; }; struct ifla_macvlan { int mode; /* private, vepa, bridge, passthru */ }; struct ifla_ipvlan { int mode; /* l3, l3s, l2 */ int isolation; /* bridge, private, vepa */ }; /* Contains information about the physical network device as seen from the host. * @ifindex : The ifindex of the physical network device in the host's network * namespace. */ struct ifla_phys { int ifindex; int mtu; }; union netdev_p { struct ifla_macvlan macvlan_attr; struct ifla_ipvlan ipvlan_attr; struct ifla_phys phys_attr; struct ifla_veth veth_attr; struct ifla_vlan vlan_attr; }; /* * Defines a structure to configure a network device * @idx : network counter * @ifindex : ifindex of the network device * Note that this is the ifindex of the network device in * the container's network namespace. If the network device * consists of a pair of network devices (e.g. veth pairs * attached to a network bridge) then this index cannot be * used to identify or modify the host veth device. See * struct ifla_veth for the host side information. * @type : network type (veth, macvlan, vlan, ...) * @flags : flag of the network device (IFF_UP, ... ) * @link : lxc.net.[i].link, name of bridge or host iface to attach * if any * @name : lxc.net.[i].name, name of iface on the container side * @created_name : the name with which this interface got created before * being renamed to final_name. * Currenly only used for veth devices. * @transient_name : temporary name to avoid namespace collisions * @hwaddr : mac address * @mtu : maximum transmission unit * @priv : information specific to the specificed network type * Note that this is a union so whether accessing a struct * is possible is dependent on the network type. * @ipv4 : a list of ipv4 addresses to be set on the network device * @ipv6 : a list of ipv6 addresses to be set on the network device * @ipv4_gateway_auto : whether the ipv4 gateway is to be automatically gathered * from the associated @link * @ipv4_gateway_dev : whether the ipv4 gateway is to be set as a device route * @ipv4_gateway : ipv4 gateway * @ipv6_gateway_auto : whether the ipv6 gateway is to be automatically gathered * from the associated @link * @ipv6_gateway_dev : whether the ipv6 gateway is to be set as a device route * @ipv6_gateway : ipv6 gateway * @upscript : a script filename to be executed during interface * configuration * @downscript : a script filename to be executed during interface * destruction */ struct lxc_netdev { ssize_t idx; int ifindex; int type; int flags; char link[IFNAMSIZ]; bool l2proxy; char name[IFNAMSIZ]; char created_name[IFNAMSIZ]; char transient_name[IFNAMSIZ]; char *hwaddr; char *mtu; union netdev_p priv; struct list_head ipv4_addresses; struct list_head ipv6_addresses; bool ipv4_gateway_auto; bool ipv4_gateway_dev; struct in_addr *ipv4_gateway; bool ipv6_gateway_auto; bool ipv6_gateway_dev; struct in6_addr *ipv6_gateway; char *upscript; char *downscript; struct list_head head; }; /* Convert a string mac address to a socket structure. */ __hidden extern int lxc_convert_mac(char *macaddr, struct sockaddr *sockaddr); /* Move a device between namespaces. */ __hidden extern int lxc_netdev_move_by_index(int ifindex, pid_t pid, const char *ifname); __hidden extern int lxc_netdev_move_by_name(const char *ifname, pid_t pid, const char *newname); /* Delete a network device. */ __hidden extern int lxc_netdev_delete_by_name(const char *name); __hidden extern int lxc_netdev_delete_by_index(int ifindex); /* Change the device name. */ __hidden extern int lxc_netdev_rename_by_name(const char *oldname, const char *newname); __hidden extern int lxc_netdev_rename_by_index(int ifindex, const char *newname); __hidden extern int netdev_set_flag(const char *name, int flag); /* Set the device network up or down. */ __hidden extern int lxc_netdev_isup(const char *name); __hidden extern int lxc_netdev_up(const char *name); __hidden extern int lxc_netdev_down(const char *name); /* Change the mtu size for the specified device. */ __hidden extern int lxc_netdev_set_mtu(const char *name, int mtu); /* Create a virtual network devices. */ __hidden extern int lxc_veth_create(const char *name1, const char *name2, pid_t pid, unsigned int mtu); __hidden extern int lxc_macvlan_create(const char *parent, const char *name, int mode); __hidden extern int lxc_vlan_create(const char *parent, const char *name, unsigned short vid); /* Set ip address. */ __hidden extern int lxc_ipv6_addr_add(int ifindex, struct in6_addr *addr, struct in6_addr *mcast, struct in6_addr *acast, int prefix); __hidden extern int lxc_ipv4_addr_add(int ifindex, struct in_addr *addr, struct in_addr *bcast, int prefix); /* Get ip address. */ __hidden extern int lxc_ipv4_addr_get(int ifindex, struct in_addr **res); __hidden extern int lxc_ipv6_addr_get(int ifindex, struct in6_addr **res); /* Set default route. */ __hidden extern int lxc_ipv4_gateway_add(int ifindex, struct in_addr *gw); __hidden extern int lxc_ipv6_gateway_add(int ifindex, struct in6_addr *gw); /* Attach an interface to the bridge. */ __hidden extern int lxc_bridge_attach(const char *bridge, const char *ifname); __hidden extern int lxc_ovs_delete_port(const char *bridge, const char *nic); __hidden extern bool is_ovs_bridge(const char *bridge); /* Create default gateway. */ __hidden extern int lxc_route_create_default(const char *addr, const char *ifname, int gateway); /* Delete default gateway. */ __hidden extern int lxc_route_delete_default(const char *addr, const char *ifname, int gateway); /* Activate neighbor proxying. */ __hidden extern int lxc_neigh_proxy_on(const char *name, int family); /* Disable neighbor proxying. */ __hidden extern int lxc_neigh_proxy_off(const char *name, int family); /* Activate IP forwarding. */ __hidden extern int lxc_ip_forwarding_on(const char *name, int family); /* Disable IP forwarding. */ __hidden extern int lxc_ip_forwarding_off(const char *name, int family); /* * Generate a new unique network interface name. * * Allows for 62^n unique combinations. */ __hidden extern char *lxc_ifname_alnum_case_sensitive(char *template); __hidden extern const char *lxc_net_type_to_str(int type); __hidden extern int setup_private_host_hw_addr(char *veth1); __hidden extern int netdev_get_mtu(int ifindex); __hidden extern int lxc_network_move_created_netdev_priv(struct lxc_handler *handler); __hidden extern void lxc_delete_network(struct lxc_handler *handler); __hidden extern int lxc_find_gateway_addresses(struct lxc_handler *handler); __hidden extern int lxc_requests_empty_network(struct lxc_handler *handler); __hidden extern int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler); __hidden extern int lxc_setup_network_in_child_namespaces(const struct lxc_conf *conf); __hidden extern int lxc_network_send_to_child(struct lxc_handler *handler); __hidden extern int lxc_network_recv_from_parent(struct lxc_handler *handler); __hidden extern int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handler); __hidden extern int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *handler); __hidden extern int lxc_netns_set_nsid(int netns_fd); __hidden extern int lxc_netns_get_nsid(__s32 fd); __hidden extern int lxc_create_network(struct lxc_handler *handler); __hidden extern char *is_wlan(const char *ifname); __hidden extern int lxc_netdev_move_wlan(char *physname, const char *ifname, pid_t pid, const char *newname); #endif /* __LXC_NETWORK_H */ lxc-4.0.12/src/lxc/freezer.c0000644061062106075000000000414014176403775012515 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "attach_options.h" #include "cgroups/cgroup.h" #include "cgroups/cgroup_utils.h" #include "commands.h" #include "commands_utils.h" #include "error.h" #include "log.h" #include "lxc.h" #include "monitor.h" #include "state.h" #include "string_utils.h" lxc_log_define(freezer, lxc); static int do_freeze_thaw(bool freeze, struct lxc_conf *conf, const char *name, const char *lxcpath) { call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL; lxc_state_t new_state = freeze ? FROZEN : THAWED; int ret; const char *state; size_t state_len; state = lxc_state2str(new_state); state_len = strlen(state); cgroup_ops = cgroup_init(conf); if (!cgroup_ops) return -1; ret = cgroup_ops->set(cgroup_ops, "freezer.state", state, name, lxcpath); if (ret < 0) return log_error(-1, "Failed to %s %s", freeze ? "freeze" : "unfreeze", name); for (;;) { char cur_state[MAX_STATE_LENGTH] = ""; ret = cgroup_ops->get(cgroup_ops, "freezer.state", cur_state, sizeof(cur_state), name, lxcpath); if (ret < 0) return log_error(-1, "Failed to get freezer state of %s", name); cur_state[lxc_char_right_gc(cur_state, strlen(cur_state))] = '\0'; if (strnequal(cur_state, state, state_len)) { lxc_cmd_notify_state_listeners(name, lxcpath, new_state); return 0; } sleep(1); } return 0; } int lxc_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath) { int ret; lxc_cmd_notify_state_listeners(name, lxcpath, FREEZING); ret = do_freeze_thaw(true, conf, name, lxcpath); lxc_cmd_notify_state_listeners(name, lxcpath, !ret ? FROZEN : RUNNING); return ret; } int lxc_unfreeze(struct lxc_conf *conf, const char *name, const char *lxcpath) { int ret; lxc_cmd_notify_state_listeners(name, lxcpath, THAWED); ret = do_freeze_thaw(false, conf, name, lxcpath); lxc_cmd_notify_state_listeners(name, lxcpath, !ret ? RUNNING : FROZEN); return ret; } lxc-4.0.12/src/lxc/commands_utils.h0000644061062106075000000000560614176403775014111 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_COMMANDS_UTILS_H #define __LXC_COMMANDS_UTILS_H #include "config.h" #include #include "state.h" #include "commands.h" __hidden extern int lxc_make_abstract_socket_name(char *path, size_t pathlen, const char *lxcname, const char *lxcpath, const char *hashed_sock_name, const char *suffix); /* lxc_cmd_sock_get_state Register a new state client fd in the container's * in-memory handler and retrieve the requested * states. * * @param[in] name Name of container to connect to. * @param[in] lxcpath The lxcpath in which the container is running. * @param[in] states The states to wait for. * @return Return < 0 on error * < MAX_STATE current container state */ __hidden extern int lxc_cmd_sock_get_state(const char *name, const char *lxcpath, lxc_state_t states[MAX_STATE], int timeout); /* lxc_cmd_sock_rcv_state Retrieve the requested state from a state client * fd registerd in the container's in-memory * handler. * * @param[int] state_client_fd The state client fd from which the state can be * received. * @return Return < 0 on error * < MAX_STATE current container state */ __hidden extern int lxc_cmd_sock_rcv_state(int state_client_fd, int timeout); /* lxc_add_state_client Add a new state client to the container's * in-memory handler. * * @param[int] state_client_fd The state client fd to add. * @param[int] handler The container's in-memory handler. * @param[in] states The states to wait for. * * @return Return < 0 on error * 0 on success */ __hidden extern int lxc_add_state_client(int state_client_fd, struct lxc_handler *handler, lxc_state_t states[MAX_STATE]); /* lxc_cmd_connect Connect to the container's command socket. * * @param[in] name Name of container to connect to. * @param[in] lxcpath The lxcpath in which the container is running. * @param[in] hashed_sock_name The hashed name of the socket (optional). Can be * NULL. * * @return Return < 0 on error * >= 0 client fd */ __hidden extern int lxc_cmd_connect(const char *name, const char *lxcpath, const char *hashed_sock_name, const char *suffix); __hidden extern void lxc_cmd_notify_state_listeners(const char *name, const char *lxcpath, lxc_state_t state); #endif /* __LXC_COMMANDS_UTILS_H */ lxc-4.0.12/src/lxc/commands.c0000644061062106075000000016074414176403775012671 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "af_unix.h" #include "cgroups/cgroup.h" #include "cgroups/cgroup2_devices.h" #include "commands.h" #include "commands_utils.h" #include "conf.h" #include "confile.h" #include "log.h" #include "lxc.h" #include "lxclock.h" #include "lxcseccomp.h" #include "mainloop.h" #include "memory_utils.h" #include "monitor.h" #include "start.h" #include "terminal.h" #include "utils.h" /* * This file provides the different functions for clients to query/command the * server. The client is typically some lxc tool and the server is typically the * container (ie. lxc-start). * * Each command is transactional, the clients send a request to the server and * the server answers the request with a message giving the request's status * (zero or a negative errno value). Both the request and response may contain * additional data. * * Each command is wrapped in a ancillary message in order to pass a credential * making possible to the server to check if the client is allowed to ask for * this command or not. * * IMPORTANTLY: Note that semantics for current commands are fixed. If you wish * to make any changes to how, say, LXC_CMD_GET_CONFIG_ITEM works by adding * information to the end of cmd.data, then you must introduce a new * LXC_CMD_GET_CONFIG_ITEM_V2 define with a new number. You may wish to also * mark LXC_CMD_GET_CONFIG_ITEM deprecated in commands.h. * * This is necessary in order to avoid having a newly compiled lxc command * communicating with a running (old) monitor from crashing the running * container. */ lxc_log_define(commands, lxc); static const char *lxc_cmd_str(lxc_cmd_t cmd) { static const char *const cmdname[LXC_CMD_MAX] = { [LXC_CMD_GET_TTY_FD] = "get_tty_fd", [LXC_CMD_TERMINAL_WINCH] = "terminal_winch", [LXC_CMD_STOP] = "stop", [LXC_CMD_GET_STATE] = "get_state", [LXC_CMD_GET_INIT_PID] = "get_init_pid", [LXC_CMD_GET_CLONE_FLAGS] = "get_clone_flags", [LXC_CMD_GET_CGROUP] = "get_cgroup", [LXC_CMD_GET_CONFIG_ITEM] = "get_config_item", [LXC_CMD_GET_NAME] = "get_name", [LXC_CMD_GET_LXCPATH] = "get_lxcpath", [LXC_CMD_ADD_STATE_CLIENT] = "add_state_client", [LXC_CMD_CONSOLE_LOG] = "console_log", [LXC_CMD_SERVE_STATE_CLIENTS] = "serve_state_clients", [LXC_CMD_SECCOMP_NOTIFY_ADD_LISTENER] = "seccomp_notify_add_listener", [LXC_CMD_ADD_BPF_DEVICE_CGROUP] = "add_bpf_device_cgroup", [LXC_CMD_FREEZE] = "freeze", [LXC_CMD_UNFREEZE] = "unfreeze", [LXC_CMD_GET_CGROUP2_FD] = "get_cgroup2_fd", [LXC_CMD_GET_INIT_PIDFD] = "get_init_pidfd", [LXC_CMD_GET_LIMIT_CGROUP] = "get_limit_cgroup", [LXC_CMD_GET_LIMIT_CGROUP2_FD] = "get_limit_cgroup2_fd", [LXC_CMD_GET_DEVPTS_FD] = "get_devpts_fd", [LXC_CMD_GET_SECCOMP_NOTIFY_FD] = "get_seccomp_notify_fd", [LXC_CMD_GET_CGROUP_CTX] = "get_cgroup_ctx", [LXC_CMD_GET_CGROUP_FD] = "get_cgroup_fd", [LXC_CMD_GET_LIMIT_CGROUP_FD] = "get_limit_cgroup_fd", }; if (cmd >= LXC_CMD_MAX) return "Invalid request"; return cmdname[cmd]; } static int __transfer_cgroup_ctx_fds(struct unix_fds *fds, struct cgroup_ctx *ctx) { /* This shouldn't be able to happen but better safe than sorry. */ if (ctx->fd_len != fds->fd_count_ret || fds->fd_count_ret > CGROUP_CTX_MAX_FD) return syswarn_set(-EINVAL, "Unexpected number of file descriptors received %u != %u", ctx->fd_len, fds->fd_count_ret); memcpy(ctx->fd, fds->fd, ctx->fd_len * sizeof(__s32)); fds->fd_count_ret = 0; return 0; } static int __transfer_cgroup_fd(struct unix_fds *fds, struct cgroup_fd *fd) { fd->fd = move_fd(fds->fd[0]); return 0; } static ssize_t lxc_cmd_rsp_recv_fds(int fd_sock, struct unix_fds *fds, struct lxc_cmd_rsp *rsp, const char *cur_cmdstr) { ssize_t ret; ret = lxc_abstract_unix_recv_fds(fd_sock, fds, rsp, sizeof(*rsp)); if (ret < 0) return log_error(ret, "Failed to receive file descriptors for command \"%s\"", cur_cmdstr); /* * If we end up here with fewer or more file descriptors the caller * must have set flags to indicate that they are fine with this. * Otherwise the call would have failed. */ if (fds->flags & UNIX_FDS_RECEIVED_EXACT) return log_debug(ret, "Received exact number of file descriptors %u == %u for command \"%s\"", fds->fd_count_max, fds->fd_count_ret, cur_cmdstr); if (fds->flags & UNIX_FDS_RECEIVED_LESS) return log_debug(ret, "Received less file descriptors %u < %u for command \"%s\"", fds->fd_count_ret, fds->fd_count_max, cur_cmdstr); if (fds->flags & UNIX_FDS_RECEIVED_MORE) return log_debug(ret, "Received more file descriptors (excessive fds were automatically closed) %u > %u for command \"%s\"", fds->fd_count_ret, fds->fd_count_max, cur_cmdstr); DEBUG("Command \"%s\" received response", cur_cmdstr); return ret; } /* * lxc_cmd_rsp_recv: Receive a response to a command * * @sock : the socket connected to the container * @cmd : command to put response in * * Returns the size of the response message or < 0 on failure * * Note that if the command response datalen > 0, then data is * a malloc()ed buffer and should be free()ed by the caller. If * the response data is <= a void * worth of data, it will be * stored directly in data and datalen will be 0. * * As a special case, the response for LXC_CMD_GET_TTY_FD is created here as * it contains an fd for the ptx pty passed through the unix socket. */ static ssize_t lxc_cmd_rsp_recv(int sock, struct lxc_cmd_rr *cmd) { __do_free void *__data = NULL; call_cleaner(put_unix_fds) struct unix_fds *fds = &(struct unix_fds){ .fd[0 ... KERNEL_SCM_MAX_FD - 1] = -EBADF, }; struct lxc_cmd_rsp *rsp = &cmd->rsp; int cur_cmd = cmd->req.cmd; const char *cur_cmdstr; ssize_t bytes_recv; /* * Determine whether this command will receive file descriptors and how * many at most. */ cur_cmdstr = lxc_cmd_str(cur_cmd); switch (cur_cmd) { case LXC_CMD_GET_CGROUP_FD: __fallthrough; case LXC_CMD_GET_LIMIT_CGROUP_FD: __fallthrough; case LXC_CMD_GET_CGROUP2_FD: __fallthrough; case LXC_CMD_GET_LIMIT_CGROUP2_FD: __fallthrough; case LXC_CMD_GET_INIT_PIDFD: __fallthrough; case LXC_CMD_GET_SECCOMP_NOTIFY_FD: __fallthrough; case LXC_CMD_GET_DEVPTS_FD: fds->fd_count_max = 1; /* * The kernel might not support the required features or the * server might be too old. */ fds->flags = UNIX_FDS_ACCEPT_EXACT | UNIX_FDS_ACCEPT_NONE; break; case LXC_CMD_GET_TTY_FD: /* * The requested terminal can be busy so it's perfectly fine * for LXC_CMD_GET_TTY to receive no file descriptor. */ fds->fd_count_max = 1; fds->flags = UNIX_FDS_ACCEPT_EXACT | UNIX_FDS_ACCEPT_NONE; break; case LXC_CMD_GET_CGROUP_CTX: fds->fd_count_max = CGROUP_CTX_MAX_FD; /* * The container might run without any cgroup support at all, * i.e. no writable cgroup hierarchy was found. */ fds->flags |= UNIX_FDS_ACCEPT_LESS | UNIX_FDS_ACCEPT_NONE ; break; default: fds->fd_count_max = 0; break; } /* Receive the first response including file descriptors if any. */ bytes_recv = lxc_cmd_rsp_recv_fds(sock, fds, rsp, cur_cmdstr); if (bytes_recv < 0) return bytes_recv; /* * Ensure that no excessive data is sent unless someone retrieves the * console ringbuffer. */ if ((rsp->datalen > LXC_CMD_DATA_MAX) && (cur_cmd != LXC_CMD_CONSOLE_LOG)) return syserror_set(-E2BIG, "Response data for command \"%s\" is too long: %d bytes > %d", cur_cmdstr, rsp->datalen, LXC_CMD_DATA_MAX); /* * Prepare buffer for any command that expects to receive additional * data. Note that some don't want any additional data. */ switch (cur_cmd) { case LXC_CMD_GET_CGROUP2_FD: /* no data */ __fallthrough; case LXC_CMD_GET_LIMIT_CGROUP2_FD: /* no data */ __fallthrough; case LXC_CMD_GET_INIT_PIDFD: /* no data */ __fallthrough; case LXC_CMD_GET_DEVPTS_FD: /* no data */ __fallthrough; case LXC_CMD_GET_SECCOMP_NOTIFY_FD: /* no data */ rsp->data = INT_TO_PTR(move_fd(fds->fd[0])); return log_debug(0, "Finished processing \"%s\" with file descriptor %d", cur_cmdstr, PTR_TO_INT(rsp->data)); case LXC_CMD_GET_CGROUP_FD: /* data */ __fallthrough; case LXC_CMD_GET_LIMIT_CGROUP_FD: /* data */ if ((size_t)rsp->datalen > sizeof(struct cgroup_fd)) return syserror_set(-EINVAL, "Invalid response size from server for \"%s\"", cur_cmdstr); /* Don't pointlessly allocate. */ rsp->data = (void *)cmd->req.data; break; case LXC_CMD_GET_CGROUP_CTX: /* data */ if ((size_t)rsp->datalen > sizeof(struct cgroup_ctx)) return syserror_set(-EINVAL, "Invalid response size from server for \"%s\"", cur_cmdstr); /* Don't pointlessly allocate. */ rsp->data = (void *)cmd->req.data; break; case LXC_CMD_GET_TTY_FD: /* data */ /* * recv() returns 0 bytes when a tty cannot be allocated, * rsp->ret is < 0 when the peer permission check failed. */ if (bytes_recv == 0 || rsp->ret < 0) return 0; __data = malloc(sizeof(struct lxc_cmd_tty_rsp_data)); if (__data) { struct lxc_cmd_tty_rsp_data *tty = __data; tty->ptxfd = move_fd(fds->fd[0]); tty->ttynum = PTR_TO_INT(rsp->data); rsp->datalen = 0; rsp->data = tty; break; } return syserror_set(-ENOMEM, "Failed to receive response for command \"%s\"", cur_cmdstr); case LXC_CMD_CONSOLE_LOG: /* data */ if (rsp->datalen > 0) __data = zalloc(rsp->datalen + 1); rsp->data = __data; break; default: /* catch any additional command */ if (rsp->datalen > 0) { __data = zalloc(rsp->datalen); rsp->data = __data; } break; } if (rsp->datalen > 0) { int err; /* * All commands ending up here expect data so rsp->data must be valid. * Either static or allocated memory. */ if (!rsp->data) return syserror_set(-ENOMEM, "Failed to prepare response buffer for command \"%s\"", cur_cmdstr); bytes_recv = lxc_recv_nointr(sock, rsp->data, rsp->datalen, 0); if (bytes_recv != rsp->datalen) return syserror("Failed to receive response data for command \"%s\": %zd != %d", cur_cmdstr, bytes_recv, rsp->datalen); switch (cur_cmd) { case LXC_CMD_GET_CGROUP_CTX: err = __transfer_cgroup_ctx_fds(fds, rsp->data); break; case LXC_CMD_GET_CGROUP_FD: __fallthrough; case LXC_CMD_GET_LIMIT_CGROUP_FD: err = __transfer_cgroup_fd(fds, rsp->data); break; default: err = 0; } if (err < 0) return syserror_ret(err, "Failed to transfer file descriptors for command \"%s\"", cur_cmdstr); } move_ptr(__data); return bytes_recv; } /* * lxc_cmd_rsp_send: Send a command response * * @fd : file descriptor of socket to send response on * @rsp : response to send * * Returns 0 on success, < 0 on failure */ static int __lxc_cmd_rsp_send(int fd, struct lxc_cmd_rsp *rsp) { ssize_t ret; ret = lxc_send_nointr(fd, rsp, sizeof(*rsp), MSG_NOSIGNAL); if (ret < 0 || (size_t)ret != sizeof(*rsp)) return syserror("Failed to send command response %zd", ret); if (!rsp->data || rsp->datalen <= 0) return 0; ret = lxc_send_nointr(fd, rsp->data, rsp->datalen, MSG_NOSIGNAL); if (ret < 0 || ret != (ssize_t)rsp->datalen) return syswarn("Failed to send command response %zd", ret); return 0; } static inline int lxc_cmd_rsp_send_reap(int fd, struct lxc_cmd_rsp *rsp) { int ret; ret = __lxc_cmd_rsp_send(fd, rsp); if (ret < 0) return ret; return LXC_CMD_REAP_CLIENT_FD; } static inline int lxc_cmd_rsp_send_keep(int fd, struct lxc_cmd_rsp *rsp) { int ret; ret = __lxc_cmd_rsp_send(fd, rsp); if (ret < 0) return ret; return 0; } static inline int rsp_one_fd_reap(int fd, int fd_send, struct lxc_cmd_rsp *rsp) { ssize_t ret; ret = lxc_abstract_unix_send_fds(fd, &fd_send, 1, rsp, sizeof(*rsp)); if (ret < 0) return ret; if (rsp->data && rsp->datalen > 0) { ret = lxc_send_nointr(fd, rsp->data, rsp->datalen, MSG_NOSIGNAL); if (ret < 0 || ret != (ssize_t)rsp->datalen) return syswarn("Failed to send command response %zd", ret); } return LXC_CMD_REAP_CLIENT_FD; } static inline int rsp_one_fd_keep(int fd, int fd_send, struct lxc_cmd_rsp *rsp) { int ret; ret = rsp_one_fd_reap(fd, fd_send, rsp); if (ret == LXC_CMD_REAP_CLIENT_FD) ret = LXC_CMD_KEEP_CLIENT_FD; return ret; } __access_r(3, 2) static int rsp_many_fds_reap(int fd, __u32 fds_len, const __s32 fds[static 2], struct lxc_cmd_rsp *rsp) { ssize_t ret; if (fds_len > KERNEL_SCM_MAX_FD) { rsp->ret = -E2BIG; return lxc_cmd_rsp_send_reap(fd, rsp); } else if (fds_len == 0) { rsp->ret = -ENOENT; return lxc_cmd_rsp_send_reap(fd, rsp); } ret = lxc_abstract_unix_send_fds(fd, fds, fds_len, rsp, sizeof(*rsp)); if (ret < 0) return ret; if (rsp->data && rsp->datalen > 0) { ret = lxc_send_nointr(fd, rsp->data, rsp->datalen, MSG_NOSIGNAL); if (ret < 0 || ret != (ssize_t)rsp->datalen) return syswarn("Failed to send command response %zd", ret); } return LXC_CMD_REAP_CLIENT_FD; } static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd, const char *lxcpath, const char *hashed_sock_name) { __do_close int client_fd = -EBADF; ssize_t ret = -1; client_fd = lxc_cmd_connect(name, lxcpath, hashed_sock_name, "command"); if (client_fd < 0) return -1; ret = lxc_abstract_unix_send_credential(client_fd, &cmd->req, sizeof(cmd->req)); if (ret < 0 || (size_t)ret != sizeof(cmd->req)) return -1; if (cmd->req.cmd == LXC_CMD_SECCOMP_NOTIFY_ADD_LISTENER) { int notify_fd = PTR_TO_INT(cmd->req.data); ret = lxc_abstract_unix_send_fds(client_fd, ¬ify_fd, 1, NULL, 0); if (ret <= 0) return -1; } else { if (cmd->req.datalen <= 0) return move_fd(client_fd); errno = EMSGSIZE; ret = lxc_send_nointr(client_fd, (void *)cmd->req.data, cmd->req.datalen, MSG_NOSIGNAL); if (ret < 0 || ret != (ssize_t)cmd->req.datalen) return -1; } return move_fd(client_fd); } /* * lxc_cmd: Connect to the specified running container, send it a command * request and collect the response * * @name : name of container to connect to * @cmd : command with initialized request to send * @stopped : output indicator if the container was not running * @lxcpath : the lxcpath in which the container is running * * Returns the size of the response message on success, < 0 on failure * * Note that there is a special case for LXC_CMD_GET_TTY_FD. For this command * the fd cannot be closed because it is used as a placeholder to indicate that * a particular tty slot is in use. The fd is also used as a signal to the * container that when the caller dies or closes the fd, the container will * notice the fd on its side of the socket in its mainloop select and then free * the slot with lxc_cmd_fd_cleanup(). The socket fd will be returned in the * cmd response structure. */ static ssize_t lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, bool *stopped, const char *lxcpath, const char *hashed_sock_name) { __do_close int client_fd = -EBADF; bool stay_connected = false; ssize_t ret; if (cmd->req.cmd == LXC_CMD_GET_TTY_FD || cmd->req.cmd == LXC_CMD_ADD_STATE_CLIENT) stay_connected = true; *stopped = 0; client_fd = lxc_cmd_send(name, cmd, lxcpath, hashed_sock_name); if (client_fd < 0) { if (IN_SET(errno, ECONNREFUSED, EPIPE)) *stopped = 1; return systrace("Command \"%s\" failed to connect command socket", lxc_cmd_str(cmd->req.cmd)); } ret = lxc_cmd_rsp_recv(client_fd, cmd); if (ret < 0 && errno == ECONNRESET) *stopped = 1; TRACE("Opened new command socket connection fd %d for command \"%s\"", client_fd, lxc_cmd_str(cmd->req.cmd)); if (stay_connected && ret > 0) cmd->rsp.ret = move_fd(client_fd); return ret; } int lxc_try_cmd(const char *name, const char *lxcpath) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_INIT_PID); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (stopped) return 0; if (ret > 0 && cmd.rsp.ret < 0) { errno = cmd.rsp.ret; return -1; } if (ret > 0) return 0; /* * At this point we weren't denied access, and the container *was* * started. There was some inexplicable error in the protocol. I'm not * clear on whether we should return -1 here, but we didn't receive a * -EACCES, so technically it's not that we're not allowed to control * the container - it's just not behaving. */ return 0; } /* * Validate that the input is a proper string parameter. If not, * send an EINVAL response and return -1. * * Precondition: there is non-zero-length data available. */ static int validate_string_request(int fd, const struct lxc_cmd_req *req) { size_t maxlen = req->datalen - 1; const char *data = req->data; if (data[maxlen] == 0 && strnlen(data, maxlen) == maxlen) return 0; struct lxc_cmd_rsp rsp = { .ret = -EINVAL, .datalen = 0, .data = NULL, }; return lxc_cmd_rsp_send_reap(fd, &rsp); } /* Implementations of the commands and their callbacks */ /* * lxc_cmd_get_init_pid: Get pid of the container's init process * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * * Returns the pid on success, < 0 on failure */ pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath) { bool stopped = false; ssize_t ret; pid_t pid; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_INIT_PID); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return -1; pid = PTR_TO_PID(cmd.rsp.data); if (pid < 0) return -1; /* * We need to assume that pid_t can actually hold any pid given to us * by the kernel. If it can't it's a libc bug. */ return (pid_t)pid; } static int lxc_cmd_get_init_pid_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .data = PID_TO_PTR(handler->pid), }; return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_get_init_pidfd(const char *name, const char *lxcpath) { bool stopped = false; int fd; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_INIT_PIDFD); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_INIT_PIDFD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_INIT_PIDFD)); fd = PTR_TO_INT(cmd.rsp.data); if (fd < 0) return sysdebug_set(fd, "Received invalid file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_INIT_PIDFD)); return fd; } static int lxc_cmd_get_init_pidfd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = -EBADF, }; if (handler->pidfd < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); rsp.ret = 0; return rsp_one_fd_reap(fd, handler->pidfd, &rsp); } int lxc_cmd_get_devpts_fd(const char *name, const char *lxcpath) { bool stopped = false; int fd; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_DEVPTS_FD); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_DEVPTS_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_DEVPTS_FD)); fd = PTR_TO_INT(cmd.rsp.data); if (fd < 0) return sysdebug_set(fd, "Received invalid file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_DEVPTS_FD)); return fd; } static int lxc_cmd_get_devpts_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = -EBADF, }; if (handler->conf->devpts_fd < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); rsp.ret = 0; return rsp_one_fd_reap(fd, handler->conf->devpts_fd, &rsp); } int lxc_cmd_get_seccomp_notify_fd(const char *name, const char *lxcpath) { #if HAVE_DECL_SECCOMP_NOTIFY_FD bool stopped = false; int fd; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_SECCOMP_NOTIFY_FD); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_SECCOMP_NOTIFY_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_SECCOMP_NOTIFY_FD)); fd = PTR_TO_INT(cmd.rsp.data); if (fd < 0) return sysdebug_set(fd, "Received invalid file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_SECCOMP_NOTIFY_FD)); return fd; #else return ret_errno(ENOSYS); #endif } static int lxc_cmd_get_seccomp_notify_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { #if HAVE_DECL_SECCOMP_NOTIFY_FD struct lxc_cmd_rsp rsp = { .ret = -EBADF, }; if (handler->conf->seccomp.notifier.notify_fd < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); rsp.ret = 0; return rsp_one_fd_reap(fd, handler->conf->seccomp.notifier.notify_fd, &rsp); #else return syserror_set(-EOPNOTSUPP, "Seccomp notifier not supported"); #endif } int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath, size_t size_ret_ctx, struct cgroup_ctx *ret_ctx) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_CGROUP_CTX); lxc_cmd_data(&cmd, size_ret_ctx, ret_ctx); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_CTX)); if (cmd.rsp.ret < 0) { /* Container does not have any writable cgroups. */ if (ret_ctx->fd_len == 0) return 0; return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_CTX)); } return 0; } static int lxc_cmd_get_cgroup_ctx_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = EINVAL, }; struct cgroup_ops *cgroup_ops = handler->cgroup_ops; struct cgroup_ctx ctx_server = {}; ssize_t ret; ret = copy_struct_from_client(sizeof(struct cgroup_ctx), &ctx_server, req->datalen, req->data); if (ret < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); ret = prepare_cgroup_ctx(cgroup_ops, &ctx_server); if (ret < 0) { rsp.ret = ret; return lxc_cmd_rsp_send_reap(fd, &rsp); } rsp.ret = 0; rsp.data = &ctx_server; rsp.datalen = min(sizeof(struct cgroup_ctx), (size_t)req->datalen); return rsp_many_fds_reap(fd, ctx_server.fd_len, ctx_server.fd, &rsp); } /* * lxc_cmd_get_clone_flags: Get clone flags container was spawned with * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * * Returns the clone flags on success, < 0 on failure */ int lxc_cmd_get_clone_flags(const char *name, const char *lxcpath) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_CLONE_FLAGS); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return ret; return PTR_TO_INT(cmd.rsp.data); } static int lxc_cmd_get_clone_flags_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .data = INT_TO_PTR(handler->ns_clone_flags), }; return lxc_cmd_rsp_send_reap(fd, &rsp); } static char *lxc_cmd_get_cgroup_path_callback(const char *name, const char *lxcpath, const char *controller, lxc_cmd_t command) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, command); if (controller) lxc_cmd_data(&cmd, strlen(controller) + 1, controller); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return NULL; if (ret == 0) { if (command == LXC_CMD_GET_LIMIT_CGROUP) { /* * This may indicate that the container was started * under an ealier version before * `cgroup_advanced_isolation` as implemented, there * it sees an unknown command and just closes the * socket, sending us an EOF. */ return lxc_cmd_get_cgroup_path_callback(name, lxcpath, controller, LXC_CMD_GET_CGROUP); } return NULL; } if (cmd.rsp.ret < 0 || cmd.rsp.datalen < 0) return NULL; return cmd.rsp.data; } /* * lxc_cmd_get_cgroup_path: Calculate a container's cgroup path for a * particular controller. This is the cgroup path relative to the root * of the cgroup filesystem. * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * @controller : the controller being asked about * * Returns the path on success, NULL on failure. The caller must free() the * returned path. */ char *lxc_cmd_get_cgroup_path(const char *name, const char *lxcpath, const char *controller) { return lxc_cmd_get_cgroup_path_callback(name, lxcpath, controller, LXC_CMD_GET_CGROUP); } /* * lxc_cmd_get_limit_cgroup_path: Calculate a container's limit cgroup * path for a particular controller. This is the cgroup path relative to the * root of the cgroup filesystem. This may be the same as the path returned by * lxc_cmd_get_cgroup_path if the container doesn't have a limit path prefix * set. * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * @controller : the controller being asked about * * Returns the path on success, NULL on failure. The caller must free() the * returned path. */ char *lxc_cmd_get_limit_cgroup_path(const char *name, const char *lxcpath, const char *controller) { return lxc_cmd_get_cgroup_path_callback(name, lxcpath, controller, LXC_CMD_GET_LIMIT_CGROUP); } static int __lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr, bool limiting_cgroup) { ssize_t ret; const char *path; const void *reqdata; struct lxc_cmd_rsp rsp; struct cgroup_ops *cgroup_ops = handler->cgroup_ops; const char *(*get_fn)(struct cgroup_ops *ops, const char *controller); if (req->datalen > 0) { ret = validate_string_request(fd, req); if (ret != 0) return ret; reqdata = req->data; } else { reqdata = NULL; } get_fn = (limiting_cgroup ? cgroup_ops->get_limit_cgroup : cgroup_ops->get_cgroup); path = get_fn(cgroup_ops, reqdata); if (!path) return -1; rsp.ret = 0; rsp.datalen = strlen(path) + 1; rsp.data = (char *)path; return lxc_cmd_rsp_send_reap(fd, &rsp); } static int lxc_cmd_get_cgroup_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup_callback(fd, req, handler, descr, false); } static int lxc_cmd_get_limit_cgroup_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup_callback(fd, req, handler, descr, true); } /* * lxc_cmd_get_config_item: Get config item the running container * * @name : name of container to connect to * @item : the configuration item to retrieve (ex: lxc.net.0.veth.pair) * @lxcpath : the lxcpath in which the container is running * * Returns the item on success, NULL on failure. The caller must free() the * returned item. */ char *lxc_cmd_get_config_item(const char *name, const char *item, const char *lxcpath) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; if (is_empty_string(item)) return NULL; lxc_cmd_init(&cmd, LXC_CMD_GET_CONFIG_ITEM); lxc_cmd_data(&cmd, strlen(item) + 1, item); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return NULL; if (cmd.rsp.ret == 0) return cmd.rsp.data; return NULL; } static int lxc_cmd_get_config_item_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { __do_free char *cidata = NULL; int cilen; struct lxc_config_t *item; struct lxc_cmd_rsp rsp; memset(&rsp, 0, sizeof(rsp)); item = lxc_get_config(req->data); cilen = item->get(req->data, NULL, 0, handler->conf, NULL); if (cilen <= 0) goto err1; cidata = must_realloc(NULL, cilen + 1); if (item->get(req->data, cidata, cilen + 1, handler->conf, NULL) != cilen) goto err1; cidata[cilen] = '\0'; rsp.data = cidata; rsp.datalen = cilen + 1; rsp.ret = 0; goto out; err1: rsp.ret = -1; out: return lxc_cmd_rsp_send_reap(fd, &rsp); } /* * lxc_cmd_get_state: Get current state of the container * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * * Returns the state on success, < 0 on failure */ int lxc_cmd_get_state(const char *name, const char *lxcpath) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_STATE); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0 && stopped) return STOPPED; if (ret < 0) return -1; if (!ret) return log_warn(-1, "Container \"%s\" has stopped before sending its state", name); return log_debug(PTR_TO_INT(cmd.rsp.data), "Container \"%s\" is in \"%s\" state", name, lxc_state2str(PTR_TO_INT(cmd.rsp.data))); } static int lxc_cmd_get_state_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .data = INT_TO_PTR(handler->state), }; return lxc_cmd_rsp_send_reap(fd, &rsp); } /* * lxc_cmd_stop: Stop the container previously started with lxc_start. All * the processes running inside this container will be killed. * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * * Returns 0 on success, < 0 on failure */ int lxc_cmd_stop(const char *name, const char *lxcpath) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_STOP); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) { if (stopped) return log_info(0, "Container \"%s\" is already stopped", name); return -1; } /* We do not expect any answer, because we wait for the connection to be * closed. */ if (ret > 0) return log_error_errno(-1, -cmd.rsp.ret, "Failed to stop container \"%s\"", name); return log_info(0, "Container \"%s\" has stopped", name); } static int lxc_cmd_stop_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp; int stopsignal = SIGKILL; struct cgroup_ops *cgroup_ops = handler->cgroup_ops; int ret; if (handler->conf->stopsignal) stopsignal = handler->conf->stopsignal; memset(&rsp, 0, sizeof(rsp)); if (handler->pidfd >= 0) rsp.ret = lxc_raw_pidfd_send_signal(handler->pidfd, stopsignal, NULL, 0); else rsp.ret = kill(handler->pid, stopsignal); if (!rsp.ret) { if (handler->pidfd >= 0) TRACE("Sent signal %d to pidfd %d", stopsignal, handler->pidfd); else TRACE("Sent signal %d to pidfd %d", stopsignal, handler->pid); if (pure_unified_layout(cgroup_ops)) ret = __cgroup_unfreeze(cgroup_ops->unified->dfd_lim, -1); else ret = cgroup_ops->unfreeze(cgroup_ops, -1); if (ret) WARN("Failed to unfreeze container \"%s\"", handler->name); return 0; } else { rsp.ret = -errno; } return lxc_cmd_rsp_send_reap(fd, &rsp); } /* * lxc_cmd_terminal_winch: noop * * @name : name of container to connect to * @lxcpath : the lxcpath in which the container is running * * Returns 0 on success, < 0 on failure */ int lxc_cmd_terminal_winch(const char *name, const char *lxcpath) { return 0; } static int lxc_cmd_terminal_winch_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { /* should never be called */ return syserror_set(-ENOSYS, "Called lxc_cmd_terminal_winch_callback()"); } /* * lxc_cmd_get_tty_fd: Open an fd to a tty in the container * * @name : name of container to connect to * @ttynum : in: the tty to open or -1 for next available * : out: the tty allocated * @fd : out: file descriptor for ptx side of pty * @lxcpath : the lxcpath in which the container is running * * Returns fd holding tty allocated on success, < 0 on failure */ int lxc_cmd_get_tty_fd(const char *name, int *ttynum, int *fd, const char *lxcpath) { __do_free struct lxc_cmd_tty_rsp_data *rspdata = NULL; bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_TTY_FD); lxc_cmd_data(&cmd, ENCODE_INTO_PTR_LEN, INT_TO_PTR(*ttynum)); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_TTY_FD)); rspdata = cmd.rsp.data; if (cmd.rsp.ret < 0) return log_error_errno(-1, -cmd.rsp.ret, "Denied access to tty"); if (ret == 0) return log_error(-1, "tty number %d invalid, busy or all ttys busy", *ttynum); if (rspdata->ptxfd < 0) return log_error(-1, "Unable to allocate fd for tty %d", rspdata->ttynum); ret = cmd.rsp.ret; /* socket fd */ *fd = rspdata->ptxfd; *ttynum = rspdata->ttynum; INFO("Alloced fd %d for tty %d via socket %zd", *fd, rspdata->ttynum, ret); return ret; } static int lxc_cmd_get_tty_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = -EBADF, }; int ptxfd, ret, ttynum; ttynum = PTR_TO_INT(req->data); ptxfd = lxc_terminal_allocate(handler->conf, fd, &ttynum); if (ptxfd < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); rsp.ret = 0; rsp.data = INT_TO_PTR(ttynum); ret = rsp_one_fd_keep(fd, ptxfd, &rsp); if (ret < 0) { lxc_terminal_free(handler->conf, fd); return ret; } DEBUG("Send tty to client"); return ret; } /* * lxc_cmd_get_name: Returns the name of the container * * @hashed_sock_name: hashed socket name * * Returns the name on success, NULL on failure. */ char *lxc_cmd_get_name(const char *hashed_sock_name) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_NAME); ret = lxc_cmd(NULL, &cmd, &stopped, NULL, hashed_sock_name); if (ret < 0) return NULL; if (cmd.rsp.ret == 0) return cmd.rsp.data; return NULL; } static int lxc_cmd_get_name_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp; memset(&rsp, 0, sizeof(rsp)); rsp.data = (char *)handler->name; rsp.datalen = strlen(handler->name) + 1; rsp.ret = 0; return lxc_cmd_rsp_send_reap(fd, &rsp); } /* * lxc_cmd_get_lxcpath: Returns the lxcpath of the container * * @hashed_sock_name: hashed socket name * * Returns the lxcpath on success, NULL on failure. */ char *lxc_cmd_get_lxcpath(const char *hashed_sock_name) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_LXCPATH); ret = lxc_cmd(NULL, &cmd, &stopped, NULL, hashed_sock_name); if (ret < 0) return NULL; if (cmd.rsp.ret == 0) return cmd.rsp.data; return NULL; } static int lxc_cmd_get_lxcpath_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = 0, .data = (char *)handler->lxcpath, .datalen = strlen(handler->lxcpath) + 1, }; return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_add_state_client(const char *name, const char *lxcpath, lxc_state_t states[static MAX_STATE], int *state_client_fd) { __do_close int clientfd = -EBADF; bool stopped = false; int state; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_ADD_STATE_CLIENT); lxc_cmd_data(&cmd, (sizeof(lxc_state_t) * MAX_STATE), states); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (states[STOPPED] != 0 && stopped != 0) return STOPPED; if (ret < 0) { if (errno != ECONNREFUSED) SYSERROR("Failed to execute command"); return -1; } /* We should now be guaranteed to get an answer from the state sending * function. */ clientfd = cmd.rsp.ret; if (clientfd < 0) return log_error_errno(-1, -clientfd, "Failed to receive socket fd"); state = PTR_TO_INT(cmd.rsp.data); if (state < MAX_STATE) return log_trace(state, "Container is already in requested state %s", lxc_state2str(state)); *state_client_fd = move_fd(clientfd); TRACE("State connection fd %d ready to listen for container state changes", *state_client_fd); return MAX_STATE; } static int lxc_cmd_add_state_client_callback(__owns int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = -EINVAL, }; if (req->datalen < 0) goto reap_fd; if (req->datalen != (sizeof(lxc_state_t) * MAX_STATE)) goto reap_fd; if (!req->data) goto reap_fd; rsp.ret = lxc_add_state_client(fd, handler, (lxc_state_t *)req->data); if (rsp.ret < 0) goto reap_fd; rsp.data = INT_TO_PTR(rsp.ret); return lxc_cmd_rsp_send_keep(fd, &rsp); reap_fd: return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_add_bpf_device_cgroup(const char *name, const char *lxcpath, struct device_item *device) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; if (strlen(device->access) > STRLITERALLEN("rwm")) return syserror_set(-EINVAL, "Invalid access mode specified %s", device->access); lxc_cmd_init(&cmd, LXC_CMD_ADD_BPF_DEVICE_CGROUP); lxc_cmd_data(&cmd, sizeof(struct device_item), device); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return syserror_set(ret, "Failed to process new bpf device cgroup command"); if (cmd.rsp.ret < 0) return syserror_set(cmd.rsp.ret, "Failed to add new bpf device cgroup rule"); return 0; } static int lxc_cmd_add_bpf_device_cgroup_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = { .ret = -EINVAL, }; struct lxc_conf *conf; if (req->datalen <= 0) goto out; if (req->datalen != sizeof(struct device_item)) goto out; if (!req->data) goto out; conf = handler->conf; if (!bpf_cgroup_devices_update(handler->cgroup_ops, &conf->bpf_devices, (struct device_item *)req->data)) rsp.ret = -1; else rsp.ret = 0; out: return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_console_log(const char *name, const char *lxcpath, struct lxc_console_log *log) { bool stopped = false; struct lxc_cmd_console_log data = { .clear = log->clear, .read = log->read, .read_max = *log->read_max, }; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_CONSOLE_LOG); lxc_cmd_data(&cmd, sizeof(struct lxc_cmd_console_log), &data); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return ret; /* There is nothing to be read from the buffer. So clear any values we * where passed to clearly indicate to the user that nothing went wrong. */ if (cmd.rsp.ret == -ENODATA || cmd.rsp.ret == -EFAULT || cmd.rsp.ret == -ENOENT) { *log->read_max = 0; log->data = NULL; } /* This is a proper error so don't touch any values we were passed. */ if (cmd.rsp.ret < 0) return cmd.rsp.ret; *log->read_max = cmd.rsp.datalen; log->data = cmd.rsp.data; return 0; } static int lxc_cmd_console_log_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp; uint64_t buffer_size = handler->conf->console.buffer_size; const struct lxc_cmd_console_log *log = req->data; struct lxc_ringbuf *buf = &handler->conf->console.ringbuf; rsp.ret = -EFAULT; rsp.datalen = 0; rsp.data = NULL; if (buffer_size <= 0) goto out; if (log->read || log->write_logfile) rsp.datalen = lxc_ringbuf_used(buf); if (log->read) rsp.data = lxc_ringbuf_get_read_addr(buf); if (log->read_max > 0 && (log->read_max <= (uint64_t)rsp.datalen)) rsp.datalen = log->read_max; /* there's nothing to read */ rsp.ret = -ENODATA; if (log->read && (buf->r_off == buf->w_off)) goto out; rsp.ret = 0; if (log->clear) lxc_ringbuf_clear(buf); /* clear the ringbuffer */ else if (rsp.datalen > 0) lxc_ringbuf_move_read_addr(buf, rsp.datalen); out: return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_serve_state_clients(const char *name, const char *lxcpath, lxc_state_t state) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_SERVE_STATE_CLIENTS); lxc_cmd_data(&cmd, ENCODE_INTO_PTR_LEN, INT_TO_PTR(state)); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return log_error_errno(-1, errno, "Failed to serve state clients"); return 0; } static int lxc_cmd_serve_state_clients_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { int ret; lxc_state_t state = PTR_TO_INT(req->data); struct lxc_cmd_rsp rsp = {0}; ret = lxc_serve_state_clients(handler->name, handler, state); if (ret < 0) return ret; return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_seccomp_notify_add_listener(const char *name, const char *lxcpath, int fd, /* unused */ unsigned int command, /* unused */ unsigned int flags) { #if HAVE_DECL_SECCOMP_NOTIFY_FD bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_SECCOMP_NOTIFY_ADD_LISTENER); lxc_cmd_data(&cmd, ENCODE_INTO_PTR_LEN, INT_TO_PTR(fd)); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return log_error_errno(-1, errno, "Failed to add seccomp listener"); return cmd.rsp.ret; #else return ret_set_errno(-1, ENOSYS); #endif } static int lxc_cmd_seccomp_notify_add_listener_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { struct lxc_cmd_rsp rsp = {0}; #if HAVE_DECL_SECCOMP_NOTIFY_FD int ret; __do_close int recv_fd = -EBADF; ret = lxc_abstract_unix_recv_one_fd(fd, &recv_fd, NULL, 0); if (ret <= 0) { rsp.ret = -errno; goto out; } if (!handler->conf->seccomp.notifier.wants_supervision || handler->conf->seccomp.notifier.proxy_fd < 0) { SYSERROR("No seccomp proxy fd specified"); rsp.ret = -EINVAL; goto out; } ret = lxc_mainloop_add_handler(descr, recv_fd, seccomp_notify_handler, seccomp_notify_cleanup_handler, handler, "seccomp_notify_handler"); if (ret < 0) { rsp.ret = -errno; goto out; } move_fd(recv_fd); out: #else rsp.ret = -ENOSYS; #endif return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_freeze(const char *name, const char *lxcpath, int timeout) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_FREEZE); lxc_cmd_data(&cmd, ENCODE_INTO_PTR_LEN, INT_TO_PTR(timeout)); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret <= 0 || cmd.rsp.ret < 0) return log_error_errno(-1, errno, "Failed to freeze container"); return cmd.rsp.ret; } static int lxc_cmd_freeze_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { int timeout = PTR_TO_INT(req->data); struct lxc_cmd_rsp rsp = { .ret = -ENOENT, }; struct cgroup_ops *ops = handler->cgroup_ops; if (pure_unified_layout(ops)) rsp.ret = ops->freeze(ops, timeout); return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_unfreeze(const char *name, const char *lxcpath, int timeout) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_UNFREEZE); lxc_cmd_data(&cmd, ENCODE_INTO_PTR_LEN, INT_TO_PTR(timeout)); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret <= 0 || cmd.rsp.ret < 0) return log_error_errno(-1, errno, "Failed to unfreeze container"); return cmd.rsp.ret; } static int lxc_cmd_unfreeze_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { int timeout = PTR_TO_INT(req->data); struct lxc_cmd_rsp rsp = { .ret = -ENOENT, }; struct cgroup_ops *ops = handler->cgroup_ops; if (pure_unified_layout(ops)) rsp.ret = ops->unfreeze(ops, timeout); return lxc_cmd_rsp_send_reap(fd, &rsp); } int lxc_cmd_get_cgroup_fd(const char *name, const char *lxcpath, size_t size_ret_fd, struct cgroup_fd *ret_fd) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_CGROUP_FD); lxc_cmd_data(&cmd, sizeof(struct cgroup_fd), ret_fd); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_FD)); return 0; } int lxc_cmd_get_limit_cgroup_fd(const char *name, const char *lxcpath, size_t size_ret_fd, struct cgroup_fd *ret_fd) { bool stopped = false; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_LIMIT_CGROUP_FD); lxc_cmd_data(&cmd, sizeof(struct cgroup_fd), ret_fd); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP_FD)); return 0; } static int __lxc_cmd_get_cgroup_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr, bool limit) { struct lxc_cmd_rsp rsp = { .ret = -EINVAL, }; struct cgroup_ops *ops = handler->cgroup_ops; struct cgroup_fd fd_server = {}; int ret; ret = copy_struct_from_client(sizeof(struct cgroup_fd), &fd_server, req->datalen, req->data); if (ret < 0) return lxc_cmd_rsp_send_reap(fd, &rsp); if (strnlen(fd_server.controller, MAX_CGROUP_ROOT_NAMELEN) == 0) return lxc_cmd_rsp_send_reap(fd, &rsp); ret = prepare_cgroup_fd(ops, &fd_server, limit); if (ret < 0) { rsp.ret = ret; return lxc_cmd_rsp_send_reap(fd, &rsp); } rsp.ret = 0; rsp.data = &fd_server; rsp.datalen = min(sizeof(struct cgroup_fd), (size_t)req->datalen); return rsp_one_fd_reap(fd, fd_server.fd, &rsp); } static int lxc_cmd_get_cgroup_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup_fd_callback(fd, req, handler, descr, false); } static int lxc_cmd_get_limit_cgroup_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup_fd_callback(fd, req, handler, descr, true); } int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath) { bool stopped = false; int fd; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_CGROUP2_FD); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); fd = PTR_TO_INT(cmd.rsp.data); if (fd < 0) return sysdebug_set(fd, "Received invalid file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); return fd; } int lxc_cmd_get_limit_cgroup2_fd(const char *name, const char *lxcpath) { bool stopped = false; int fd; ssize_t ret; struct lxc_cmd_rr cmd; lxc_cmd_init(&cmd, LXC_CMD_GET_LIMIT_CGROUP2_FD); ret = lxc_cmd(name, &cmd, &stopped, lxcpath, NULL); if (ret < 0) return sysdebug("Failed to process \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); if (cmd.rsp.ret < 0) return sysdebug_set(cmd.rsp.ret, "Failed to receive file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); fd = PTR_TO_INT(cmd.rsp.data); if (fd < 0) return sysdebug_set(fd, "Received invalid file descriptor for \"%s\"", lxc_cmd_str(LXC_CMD_GET_CGROUP2_FD)); return fd; } static int __lxc_cmd_get_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr, bool limiting_cgroup) { struct lxc_cmd_rsp rsp = { .ret = -EINVAL, }; struct cgroup_ops *ops = handler->cgroup_ops; int send_fd; if (!pure_unified_layout(ops) || !ops->unified) return lxc_cmd_rsp_send_reap(fd, &rsp); send_fd = limiting_cgroup ? ops->unified->dfd_lim : ops->unified->dfd_con; if (send_fd < 0) { rsp.ret = -EBADF; return lxc_cmd_rsp_send_reap(fd, &rsp); } rsp.ret = 0; return rsp_one_fd_reap(fd, send_fd, &rsp); } static int lxc_cmd_get_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup2_fd_callback(fd, req, handler, descr, false); } static int lxc_cmd_get_limit_cgroup2_fd_callback(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { return __lxc_cmd_get_cgroup2_fd_callback(fd, req, handler, descr, true); } static int lxc_cmd_rsp_send_enosys(int fd, int id) { struct lxc_cmd_rsp rsp = { .ret = -ENOSYS, }; __lxc_cmd_rsp_send(fd, &rsp); return syserror_set(-ENOSYS, "Invalid command id %d", id); } static int lxc_cmd_process(int fd, struct lxc_cmd_req *req, struct lxc_handler *handler, struct lxc_async_descr *descr) { typedef int (*callback)(int, struct lxc_cmd_req *, struct lxc_handler *, struct lxc_async_descr *); callback cb[LXC_CMD_MAX] = { [LXC_CMD_GET_TTY_FD] = lxc_cmd_get_tty_fd_callback, [LXC_CMD_TERMINAL_WINCH] = lxc_cmd_terminal_winch_callback, [LXC_CMD_STOP] = lxc_cmd_stop_callback, [LXC_CMD_GET_STATE] = lxc_cmd_get_state_callback, [LXC_CMD_GET_INIT_PID] = lxc_cmd_get_init_pid_callback, [LXC_CMD_GET_CLONE_FLAGS] = lxc_cmd_get_clone_flags_callback, [LXC_CMD_GET_CGROUP] = lxc_cmd_get_cgroup_callback, [LXC_CMD_GET_CONFIG_ITEM] = lxc_cmd_get_config_item_callback, [LXC_CMD_GET_NAME] = lxc_cmd_get_name_callback, [LXC_CMD_GET_LXCPATH] = lxc_cmd_get_lxcpath_callback, [LXC_CMD_ADD_STATE_CLIENT] = lxc_cmd_add_state_client_callback, [LXC_CMD_CONSOLE_LOG] = lxc_cmd_console_log_callback, [LXC_CMD_SERVE_STATE_CLIENTS] = lxc_cmd_serve_state_clients_callback, [LXC_CMD_SECCOMP_NOTIFY_ADD_LISTENER] = lxc_cmd_seccomp_notify_add_listener_callback, [LXC_CMD_ADD_BPF_DEVICE_CGROUP] = lxc_cmd_add_bpf_device_cgroup_callback, [LXC_CMD_FREEZE] = lxc_cmd_freeze_callback, [LXC_CMD_UNFREEZE] = lxc_cmd_unfreeze_callback, [LXC_CMD_GET_CGROUP2_FD] = lxc_cmd_get_cgroup2_fd_callback, [LXC_CMD_GET_INIT_PIDFD] = lxc_cmd_get_init_pidfd_callback, [LXC_CMD_GET_LIMIT_CGROUP] = lxc_cmd_get_limit_cgroup_callback, [LXC_CMD_GET_LIMIT_CGROUP2_FD] = lxc_cmd_get_limit_cgroup2_fd_callback, [LXC_CMD_GET_DEVPTS_FD] = lxc_cmd_get_devpts_fd_callback, [LXC_CMD_GET_SECCOMP_NOTIFY_FD] = lxc_cmd_get_seccomp_notify_fd_callback, [LXC_CMD_GET_CGROUP_CTX] = lxc_cmd_get_cgroup_ctx_callback, [LXC_CMD_GET_CGROUP_FD] = lxc_cmd_get_cgroup_fd_callback, [LXC_CMD_GET_LIMIT_CGROUP_FD] = lxc_cmd_get_limit_cgroup_fd_callback, }; if (req->cmd >= LXC_CMD_MAX) return lxc_cmd_rsp_send_enosys(fd, req->cmd); return cb[req->cmd](fd, req, handler, descr); } static void lxc_cmd_fd_cleanup(int fd, struct lxc_handler *handler, const lxc_cmd_t cmd) { if (cmd == LXC_CMD_ADD_STATE_CLIENT) { struct lxc_state_client *client, *nclient; list_for_each_entry_safe(client, nclient, &handler->conf->state_clients, head) { if (client->clientfd != fd) continue; list_del(&client->head); free(client); /* * No need to walk the whole list. If we found the state * client fd there can't be a second one. */ TRACE("Found state client fd %d in state client list for command \"%s\"", fd, lxc_cmd_str(cmd)); break; } /* * We didn't add the state client to the list. Either because * we failed to allocate memory (unlikely) or because the state * was already reached by the time we were ready to add it. So * fallthrough and clean it up. */ TRACE("Deleted state client fd %d for command \"%s\"", fd, lxc_cmd_str(cmd)); } /* * We're not closing the client fd here. They will instead be notified * from the mainloop when it calls the cleanup handler. This will cause * a slight delay but is semantically cleaner then what we used to do. */ } static int lxc_cmd_cleanup_handler(int fd, void *data) { struct lxc_handler *handler = data; lxc_terminal_free(handler->conf, fd); close(fd); TRACE("Closing client fd %d for \"%s\"", fd, __FUNCTION__); return 0; } static int lxc_cmd_handler(int fd, uint32_t events, void *data, struct lxc_async_descr *descr) { __do_free void *reqdata = NULL; int ret; struct lxc_cmd_req req; struct lxc_handler *handler = data; ret = lxc_abstract_unix_rcv_credential(fd, &req, sizeof(req)); if (ret < 0) { SYSERROR("Failed to receive data on command socket for command \"%s\"", lxc_cmd_str(req.cmd)); if (errno == EACCES) { /* We don't care for the peer, just send and close. */ struct lxc_cmd_rsp rsp = { .ret = -EPERM, }; __lxc_cmd_rsp_send(fd, &rsp); } goto out; } if (ret == 0) goto out; if (ret != sizeof(req)) { WARN("Failed to receive full command request. Ignoring request for \"%s\"", lxc_cmd_str(req.cmd)); goto out; } if ((req.datalen > LXC_CMD_DATA_MAX) && (req.cmd != LXC_CMD_CONSOLE_LOG)) { ERROR("Received command data length %d is too large for command \"%s\"", req.datalen, lxc_cmd_str(req.cmd)); goto out; } if (req.datalen > 0) { reqdata = must_realloc(NULL, req.datalen); ret = lxc_recv_nointr(fd, reqdata, req.datalen, 0); if (ret != req.datalen) { WARN("Failed to receive full command request. Ignoring request for \"%s\"", lxc_cmd_str(req.cmd)); goto out; } req.data = reqdata; } ret = lxc_cmd_process(fd, &req, handler, descr); if (ret < 0) { DEBUG("Failed to process command %s; cleaning up client fd %d", lxc_cmd_str(req.cmd), fd); goto out; } if (ret == LXC_CMD_REAP_CLIENT_FD) { TRACE("Processed command %s; cleaning up client fd %d", lxc_cmd_str(req.cmd), fd); goto out; } TRACE("Processed command %s; keeping client fd %d", lxc_cmd_str(req.cmd), fd); return LXC_MAINLOOP_CONTINUE; out: lxc_cmd_fd_cleanup(fd, handler, req.cmd); return LXC_MAINLOOP_DISARM; } static int lxc_cmd_accept(int fd, uint32_t events, void *data, struct lxc_async_descr *descr) { __do_close int connection = -EBADF; int opt = 1, ret = -1; connection = accept(fd, NULL, 0); if (connection < 0) return log_error_errno(LXC_MAINLOOP_ERROR, errno, "Failed to accept connection to run command"); ret = fcntl(connection, F_SETFD, FD_CLOEXEC); if (ret < 0) return log_error_errno(ret, errno, "Failed to set close-on-exec on incoming command connection"); ret = setsockopt(connection, SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt)); if (ret < 0) return log_error_errno(ret, errno, "Failed to enable necessary credentials on command socket"); ret = lxc_mainloop_add_oneshot_handler(descr, connection, lxc_cmd_handler, lxc_cmd_cleanup_handler, data, "lxc_cmd_handler"); if (ret) return log_error(ret, "Failed to add command handler"); TRACE("Accepted new client as fd %d on command server fd %d", connection, fd); move_fd(connection); return ret; } int lxc_server_init(const char *name, const char *lxcpath, const char *suffix) { __do_close int fd = -EBADF; int ret; char path[LXC_AUDS_ADDR_LEN] = {0}; ret = lxc_make_abstract_socket_name(path, sizeof(path), name, lxcpath, NULL, suffix); if (ret < 0) return -1; fd = lxc_abstract_unix_open(path, SOCK_STREAM, 0); if (fd < 0) { if (errno == EADDRINUSE) ERROR("Container \"%s\" appears to be already running", name); return log_error_errno(-1, errno, "Failed to create command socket %s", &path[1]); } ret = fcntl(fd, F_SETFD, FD_CLOEXEC); if (ret < 0) return log_error_errno(-1, errno, "Failed to set FD_CLOEXEC on command socket file descriptor"); return log_trace(move_fd(fd), "Created abstract unix socket \"%s\"", &path[1]); } int lxc_cmd_mainloop_add(const char *name, struct lxc_async_descr *descr, struct lxc_handler *handler) { int ret; ret = lxc_mainloop_add_handler(descr, handler->conf->maincmd_fd, lxc_cmd_accept, default_cleanup_handler, handler, "lxc_cmd_accept"); if (ret < 0) return log_error(ret, "Failed to add handler for command socket fd %d", handler->conf->maincmd_fd); return ret; } lxc-4.0.12/src/lxc/list.h0000644061062106075000000000720414176403775012037 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_LIST_H #define __LXC_LIST_H #include "config.h" #include #include "memory_utils.h" struct lxc_list { void *elem; struct lxc_list *next; struct lxc_list *prev; }; #define lxc_init_list(l) \ { \ .next = l, .prev = l \ } /* * Iterate through an lxc list. An example for an idiom would be: * * struct lxc_list *iterator; * lxc_list_for_each(iterator, list) { * type *tmp; * tmp = iterator->elem; * } */ #define lxc_list_for_each(__iterator, __list) \ for (__iterator = (__list)->next; __iterator != __list; \ __iterator = __iterator->next) /* Iterate safely through an lxc list. An example for an appropriate use case * would be: * * struct lxc_list *cur, *next; * lxc_list_for_each_safe(cur, list, next) { * type *tmp; * tmp = cur->elem; * } */ #define lxc_list_for_each_safe(__iterator, __list, __next) \ for (__iterator = (__list)->next, __next = __iterator->next; \ __iterator != __list; __iterator = __next, __next = __next->next) /* Initialize list. */ static inline void lxc_list_init(struct lxc_list *list) { list->elem = NULL; list->next = list->prev = list; } /* Add an element to a list. See lxc_list_add() and lxc_list_add_tail() for an * idiom. */ static inline void lxc_list_add_elem(struct lxc_list *list, void *elem) { list->elem = elem; } /* Retrieve first element of list. */ static inline void *lxc_list_first_elem(const struct lxc_list *list) { return list->next->elem; } /* Retrieve last element of list. */ static inline void *lxc_list_last_elem(const struct lxc_list *list) { return list->prev->elem; } /* Determine if list is empty. */ static inline int lxc_list_empty(const struct lxc_list *list) { return list == list->next; } /* Workhorse to be called from lxc_list_add() and lxc_list_add_tail(). */ static inline void __lxc_list_add(struct lxc_list *new, struct lxc_list *prev, struct lxc_list *next) { next->prev = new; new->next = next; new->prev = prev; prev->next = new; } /* Idiom to add an element to the beginning of an lxc list: * * struct lxc_list *tmp = malloc(sizeof(*tmp)); * if (tmp == NULL) * return 1; * lxc_list_add_elem(tmp, elem); * lxc_list_add(list, tmp); */ static inline void lxc_list_add(struct lxc_list *head, struct lxc_list *list) { __lxc_list_add(list, head, head->next); } /* Idiom to add an element to the end of an lxc list: * * struct lxc_list *tmp = malloc(sizeof(*tmp)); * if (tmp == NULL) * return 1; * lxc_list_add_elem(tmp, elem); * lxc_list_add_tail(list, tmp); */ static inline void lxc_list_add_tail(struct lxc_list *head, struct lxc_list *list) { __lxc_list_add(list, head->prev, head); } /* Idiom to remove an element from a list: * struct lxc_list *cur, *next; * lxc_list_for_each_safe(cur, list, next) { * lxc_list_del(cur); * free(cur->elem); * free(cur); * } */ static inline void lxc_list_del(struct lxc_list *list) { struct lxc_list *next, *prev; next = list->next; prev = list->prev; next->prev = prev; prev->next = next; } /* Return length of the list. */ static inline size_t lxc_list_len(struct lxc_list *list) { size_t i = 0; struct lxc_list *iter; lxc_list_for_each(iter, list) { i++; } return i; } static inline struct lxc_list *lxc_list_new(void) { struct lxc_list *l; l = zalloc(sizeof(struct lxc_list)); if (l) lxc_list_init(l); return l; } #endif /* __LXC_LIST_H */ lxc-4.0.12/src/lxc/rexec.c0000644061062106075000000001061514176403775012165 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include "file_utils.h" #include "macro.h" #include "memory_utils.h" #include "process_utils.h" #include "rexec.h" #include "string_utils.h" #include "syscall_wrappers.h" #if IS_BIONIC #include "fexecve.h" #endif #define LXC_MEMFD_REXEC_SEALS \ (F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE) static int push_vargs(char *data, int data_length, char ***output) { int num = 0; char *cur = data; if (!data || *output) return -1; *output = must_realloc(NULL, sizeof(**output)); while (cur < data + data_length) { num++; *output = must_realloc(*output, (num + 1) * sizeof(**output)); (*output)[num - 1] = cur; cur += strlen(cur) + 1; } (*output)[num] = NULL; return num; } static int parse_argv(char ***argv) { __do_free char *cmdline = NULL; int ret; size_t cmdline_size; cmdline = file_to_buf("/proc/self/cmdline", &cmdline_size); if (!cmdline) return -1; ret = push_vargs(cmdline, cmdline_size, argv); if (ret <= 0) return -1; move_ptr(cmdline); return 0; } static int is_memfd(void) { __do_close int fd = -EBADF; int seals; fd = open("/proc/self/exe", O_RDONLY | O_CLOEXEC); if (fd < 0) return -ENOTRECOVERABLE; seals = fcntl(fd, F_GET_SEALS); if (seals < 0) { struct stat s = {0}; if (fstat(fd, &s) == 0) return (s.st_nlink == 0); return -EINVAL; } return seals == LXC_MEMFD_REXEC_SEALS; } static void lxc_rexec_as_memfd(char **argv, char **envp, const char *memfd_name) { __do_close int execfd = -EBADF, fd = -EBADF, memfd = -EBADF, tmpfd = -EBADF; int ret; ssize_t bytes_sent = 0; struct stat st = {0}; memfd = memfd_create(memfd_name, MFD_ALLOW_SEALING | MFD_CLOEXEC); if (memfd < 0) { char template[PATH_MAX]; ret = strnprintf(template, sizeof(template), P_tmpdir "/.%s_XXXXXX", memfd_name); if (ret < 0) return; tmpfd = lxc_make_tmpfile(template, true); if (tmpfd < 0) return; ret = fchmod(tmpfd, 0700); if (ret) return; } fd = open("/proc/self/exe", O_RDONLY | O_CLOEXEC); if (fd < 0) return; /* sendfile() handles up to 2GB. */ ret = fstat(fd, &st); if (ret) return; while (bytes_sent < st.st_size) { ssize_t sent; sent = lxc_sendfile_nointr(memfd >= 0 ? memfd : tmpfd, fd, NULL, st.st_size - bytes_sent); if (sent < 0) { /* * Fallback to shoveling data between kernel- and * userspace. */ if (lseek(fd, 0, SEEK_SET) == (off_t) -1) fprintf(stderr, "Failed to seek to beginning of file"); if (fd_to_fd(fd, memfd >= 0 ? memfd : tmpfd)) break; return; } bytes_sent += sent; } close_prot_errno_disarm(fd); if (memfd >= 0) { if (fcntl(memfd, F_ADD_SEALS, LXC_MEMFD_REXEC_SEALS)) return; execfd = move_fd(memfd); } else { char procfd[LXC_PROC_PID_FD_LEN]; ret = strnprintf(procfd, sizeof(procfd), "/proc/self/fd/%d", tmpfd); if (ret < 0) return; execfd = open(procfd, O_PATH | O_CLOEXEC); close_prot_errno_disarm(tmpfd); } if (execfd < 0) return; fexecve(execfd, argv, envp); } /* * Get cheap access to the environment. This must be declared by the user as * mandated by POSIX. The definition is located in unistd.h. */ extern char **environ; int lxc_rexec(const char *memfd_name) { __do_free_string_list char **argv = NULL; int ret; ret = is_memfd(); if (ret < 0 && ret == -ENOTRECOVERABLE) { fprintf(stderr, "%s - Failed to determine whether this is a memfd\n", strerror(errno)); return -1; } else if (ret > 0) { return 0; } ret = parse_argv(&argv); if (ret < 0) { fprintf(stderr, "%s - Failed to parse command line parameters\n", strerror(errno)); return -1; } lxc_rexec_as_memfd(argv, environ, memfd_name); fprintf(stderr, "%s - Failed to rexec as memfd\n", strerror(errno)); return -1; } /** * This function will copy any binary that calls liblxc into a memory file and * will use the memfd to rexecute the binary. This is done to prevent attacks * through the /proc/self/exe symlink to corrupt the host binary when host and * container are in the same user namespace or have set up an identity id * mapping: CVE-2019-5736. */ __attribute__((constructor)) static void liblxc_rexec(void) { if (getenv("LXC_MEMFD_REXEC") && lxc_rexec("liblxc")) { fprintf(stderr, "Failed to re-execute liblxc via memory file descriptor\n"); _exit(EXIT_FAILURE); } } lxc-4.0.12/src/lxc/lxcseccomp.h0000644061062106075000000001016114176403775013220 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_LXCSECCOMP_H #define __LXC_LXCSECCOMP_H #include "config.h" #include #ifdef HAVE_SECCOMP #include #include #endif #if HAVE_DECL_SECCOMP_NOTIFY_FD #include #include #endif #include "compiler.h" #include "conf.h" #include "memory_utils.h" struct lxc_conf; struct lxc_async_descr; struct lxc_handler; #ifndef SECCOMP_FILTER_FLAG_NEW_LISTENER #define SECCOMP_FILTER_FLAG_NEW_LISTENER (1UL << 3) #endif #ifdef HAVE_SECCOMP #if HAVE_DECL_SECCOMP_NOTIFY_FD #if !HAVE_STRUCT_SECCOMP_NOTIF_SIZES struct seccomp_notif_sizes { __u16 seccomp_notif; __u16 seccomp_notif_resp; __u16 seccomp_data; }; #endif struct seccomp_notify_proxy_msg { uint64_t __reserved; pid_t monitor_pid; pid_t init_pid; struct seccomp_notif_sizes sizes; uint64_t cookie_len; /* followed by: seccomp_notif, seccomp_notif_resp, cookie */ }; struct seccomp_notify { bool wants_supervision; int notify_fd; int proxy_fd; struct sockaddr_un proxy_addr; struct seccomp_notif_sizes sizes; struct seccomp_notif *req_buf; struct seccomp_notif_resp *rsp_buf; char *cookie; }; #endif /* HAVE_DECL_SECCOMP_NOTIFY_FD */ struct lxc_seccomp { char *seccomp; #if HAVE_SCMP_FILTER_CTX unsigned int allow_nesting; scmp_filter_ctx seccomp_ctx; #endif /* HAVE_SCMP_FILTER_CTX */ #if HAVE_DECL_SECCOMP_NOTIFY_FD struct seccomp_notify notifier; #endif /* HAVE_DECL_SECCOMP_NOTIFY_FD */ }; __hidden extern int lxc_seccomp_load(struct lxc_conf *conf); __hidden extern int lxc_read_seccomp_config(struct lxc_conf *conf); __hidden extern void lxc_seccomp_free(struct lxc_seccomp *seccomp); __hidden extern int seccomp_notify_cleanup_handler(int fd, void *data); __hidden extern int seccomp_notify_handler(int fd, uint32_t events, void *data, struct lxc_async_descr *descr); __hidden extern void seccomp_conf_init(struct lxc_conf *conf); __hidden extern int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp, struct lxc_async_descr *descr, struct lxc_handler *handler); __hidden extern int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd); __hidden extern int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd); __hidden extern int lxc_seccomp_add_notifier(const char *name, const char *lxcpath, struct lxc_seccomp *seccomp); static inline void lxc_seccomp_close_notifier_fd(struct lxc_seccomp *seccomp) { #if HAVE_DECL_SECCOMP_NOTIFY_FD if (seccomp->notifier.wants_supervision) close_prot_errno_disarm(seccomp->notifier.notify_fd); #endif } static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp) { #if HAVE_DECL_SECCOMP_NOTIFY_FD return seccomp->notifier.notify_fd; #else errno = ENOSYS; return -EBADF; #endif } #else /* HAVE_SECCOMP */ struct lxc_seccomp { char *seccomp; }; static inline int lxc_seccomp_load(struct lxc_conf *conf) { return 0; } static inline int lxc_read_seccomp_config(struct lxc_conf *conf) { return 0; } static inline void lxc_seccomp_free(struct lxc_seccomp *seccomp) { free_disarm(seccomp->seccomp); } static inline int seccomp_notify_handler(int fd, uint32_t events, void *data, struct lxc_async_descr *descr) { return ret_errno(ENOSYS); } static inline int seccomp_notify_cleanup_handler(void *data) { return ret_errno(ENOSYS); } static inline void seccomp_conf_init(struct lxc_conf *conf) { } static inline int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp, struct lxc_async_descr *descr, struct lxc_handler *handler) { return 0; } static inline int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd) { return 0; } static inline int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd) { return 0; } static inline int lxc_seccomp_add_notifier(const char *name, const char *lxcpath, struct lxc_seccomp *seccomp) { return 0; } static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp) { return -EBADF; } static inline void lxc_seccomp_close_notifier_fd(struct lxc_seccomp *seccomp) { } #endif /* HAVE_SECCOMP */ #endif /* __LXC_LXCSECCOMP_H */ lxc-4.0.12/src/lxc/utils.c0000644061062106075000000012167414176403775012227 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif #define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Needs to be after sys/mount.h header */ #include #include #include #include #include #include #include #include "config.h" #include "log.h" #include "lsm/lsm.h" #include "lxclock.h" #include "memory_utils.h" #include "namespace.h" #include "parse.h" #include "process_utils.h" #include "syscall_wrappers.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #if !HAVE_STRLCAT #include "strlcat.h" #endif #ifndef O_PATH #define O_PATH 010000000 #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 00400000 #endif lxc_log_define(utils, lxc); /* * if path is btrfs, tries to remove it and any subvolumes beneath it */ extern bool btrfs_try_remove_subvol(const char *path); static int _recursive_rmdir(const char *dirname, dev_t pdev, const char *exclude, int level, bool onedev) { __do_closedir DIR *dir = NULL; int failed = 0; bool hadexclude = false; int ret; struct dirent *direntp; char pathname[PATH_MAX]; dir = opendir(dirname); if (!dir) return log_error(-1, "Failed to open \"%s\"", dirname); while ((direntp = readdir(dir))) { int rc; struct stat mystat; if (strequal(direntp->d_name, ".") || strequal(direntp->d_name, "..")) continue; rc = strnprintf(pathname, sizeof(pathname), "%s/%s", dirname, direntp->d_name); if (rc < 0) { ERROR("The name of path is too long"); failed = 1; continue; } if (!level && exclude && strequal(direntp->d_name, exclude)) { ret = rmdir(pathname); if (ret < 0) { switch (errno) { case ENOTEMPTY: INFO("Not deleting snapshot \"%s\"", pathname); hadexclude = true; break; case ENOTDIR: ret = unlink(pathname); if (ret) INFO("Failed to remove \"%s\"", pathname); break; default: SYSERROR("Failed to rmdir \"%s\"", pathname); failed = 1; break; } } continue; } ret = lstat(pathname, &mystat); if (ret) { SYSERROR("Failed to stat \"%s\"", pathname); failed = 1; continue; } if (onedev && mystat.st_dev != pdev) { if (btrfs_try_remove_subvol(pathname)) INFO("Removed btrfs subvolume at \"%s\"", pathname); continue; } if (S_ISDIR(mystat.st_mode)) { if (_recursive_rmdir(pathname, pdev, exclude, level + 1, onedev) < 0) failed = 1; } else { ret = unlink(pathname); if (ret < 0) { __do_close int fd = -EBADF; fd = open(pathname, O_RDONLY | O_CLOEXEC | O_NONBLOCK); if (fd >= 0) { /* The file might be marked immutable. */ int attr = 0; ret = ioctl(fd, FS_IOC_GETFLAGS, &attr); if (ret < 0) SYSERROR("Failed to retrieve file flags"); attr &= ~FS_IMMUTABLE_FL; ret = ioctl(fd, FS_IOC_SETFLAGS, &attr); if (ret < 0) SYSERROR("Failed to set file flags"); } ret = unlink(pathname); if (ret < 0) { SYSERROR("Failed to delete \"%s\"", pathname); failed = 1; } } } } if (rmdir(dirname) < 0 && !btrfs_try_remove_subvol(dirname) && !hadexclude) { SYSERROR("Failed to delete \"%s\"", dirname); failed = 1; } return failed ? -1 : 0; } /* * In overlayfs, st_dev is unreliable. So on overlayfs we don't do the * lxc_rmdir_onedev(). */ static inline bool is_native_overlayfs(const char *path) { return has_fs_type(path, OVERLAY_SUPER_MAGIC) || has_fs_type(path, OVERLAYFS_SUPER_MAGIC); } /* returns 0 on success, -1 if there were any failures */ extern int lxc_rmdir_onedev(const char *path, const char *exclude) { struct stat mystat; bool onedev = true; if (is_native_overlayfs(path)) onedev = false; if (lstat(path, &mystat) < 0) { if (errno == ENOENT) return 0; return log_error_errno(-1, errno, "Failed to stat \"%s\"", path); } return _recursive_rmdir(path, mystat.st_dev, exclude, 0, onedev); } /* borrowed from iproute2 */ extern int get_u16(unsigned short *val, const char *arg, int base) { unsigned long res; char *ptr; if (!arg || !*arg) return ret_errno(EINVAL); errno = 0; res = strtoul(arg, &ptr, base); if (!ptr || ptr == arg || *ptr || res > 0xFFFF || errno != 0) return ret_errno(ERANGE); *val = res; return 0; } int mkdir_p(const char *dir, mode_t mode) { const char *tmp = dir; const char *orig = dir; do { __do_free char *makeme = NULL; int ret; dir = tmp + strspn(tmp, "/"); tmp = dir + strcspn(dir, "/"); makeme = strndup(orig, dir - orig); if (!makeme) return ret_set_errno(-1, ENOMEM); ret = mkdir(makeme, mode); if (ret < 0 && errno != EEXIST) return log_error_errno(-1, errno, "Failed to create directory \"%s\"", makeme); } while (tmp != dir); return 0; } char *get_rundir(void) { __do_free char *rundir = NULL; char *static_rundir; int ret; size_t len; const char *homedir; struct stat sb; if (stat(RUNTIME_PATH, &sb) < 0) return NULL; if (geteuid() == sb.st_uid || getegid() == sb.st_gid) return strdup(RUNTIME_PATH); static_rundir = getenv("XDG_RUNTIME_DIR"); if (static_rundir) return strdup(static_rundir); INFO("XDG_RUNTIME_DIR isn't set in the environment"); homedir = getenv("HOME"); if (!homedir) return log_error(NULL, "HOME isn't set in the environment"); len = strlen(homedir) + 17; rundir = malloc(sizeof(char) * len); if (!rundir) return NULL; ret = strnprintf(rundir, len, "%s/.cache/lxc/run/", homedir); if (ret < 0) return ret_set_errno(NULL, EIO); return move_ptr(rundir); } int wait_for_pid(pid_t pid) { int status, ret; again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; return -1; } if (ret != pid) goto again; if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) return -1; return 0; } int wait_for_pidfd(int pidfd) { int ret; siginfo_t info = { .si_signo = 0, }; do { ret = waitid(P_PIDFD, pidfd, &info, __WALL | WEXITED); } while (ret < 0 && errno == EINTR); return !ret && WIFEXITED(info.si_status) && WEXITSTATUS(info.si_status) == 0; } int lxc_wait_for_pid_status(pid_t pid) { int status, ret; again: ret = waitpid(pid, &status, 0); if (ret == -1) { if (errno == EINTR) goto again; return -1; } if (ret != pid) goto again; return status; } bool wait_exited(pid_t pid) { int status; status = lxc_wait_for_pid_status(pid); if (status < 0) return log_error(false, "Failed to reap on child process %d", pid); if (WIFSIGNALED(status)) return log_error(false, "Child process %d terminated by signal %d", pid, WTERMSIG(status)); if (!WIFEXITED(status)) return log_error(false, "Child did not termiate correctly"); if (WEXITSTATUS(status)) return log_error(false, "Child terminated with error %d", WEXITSTATUS(status)); TRACE("Reaped child process %d", pid); return true; } #ifdef HAVE_OPENSSL #include static int do_sha1_hash(const char *buf, int buflen, unsigned char *md_value, unsigned int *md_len) { EVP_MD_CTX *mdctx; const EVP_MD *md; md = EVP_get_digestbyname("sha1"); if (!md) return log_error(-1, "Unknown message digest: sha1\n"); mdctx = EVP_MD_CTX_create(); EVP_DigestInit_ex(mdctx, md, NULL); EVP_DigestUpdate(mdctx, buf, buflen); EVP_DigestFinal_ex(mdctx, md_value, md_len); EVP_MD_CTX_destroy(mdctx); return 0; } int sha1sum_file(char *fnam, unsigned char *digest, unsigned int *md_len) { __do_free char *buf = NULL; __do_fclose FILE *f = NULL; int ret; ssize_t flen; ssize_t nbytes; if (!fnam) return -1; f = fopen_cloexec(fnam, "r"); if (!f) return log_error_errno(-1, errno, "Failed to open template \"%s\"", fnam); if (fseek(f, 0, SEEK_END) < 0) return log_error_errno(-1, errno, "Failed to seek to end of template"); flen = ftell(f); if (flen < 0) return log_error_errno(-1, errno, "Failed to tell size of template"); if (fseek(f, 0, SEEK_SET) < 0) return log_error_errno(-1, errno, "Failed to seek to start of template"); buf = malloc(flen + 1); if (!buf) return log_error_errno(-1, ENOMEM, "Out of memory"); nbytes = fread(buf, 1, flen, f); if (nbytes < 0 || nbytes != flen) return log_error_errno(-1, errno, "Failed to read template"); buf[flen] = '\0'; ret = do_sha1_hash(buf, flen, (void *)digest, md_len); return ret; } #endif struct lxc_popen_FILE *lxc_popen(const char *command) { int ret; int pipe_fds[2]; pid_t child_pid; struct lxc_popen_FILE *fp = NULL; ret = pipe2(pipe_fds, O_CLOEXEC); if (ret < 0) return NULL; child_pid = fork(); if (child_pid < 0) goto on_error; if (!child_pid) { sigset_t mask; close(pipe_fds[0]); /* duplicate stdout */ if (pipe_fds[1] != STDOUT_FILENO) ret = dup2(pipe_fds[1], STDOUT_FILENO); else ret = fcntl(pipe_fds[1], F_SETFD, 0); if (ret < 0) { close(pipe_fds[1]); _exit(EXIT_FAILURE); } /* duplicate stderr */ if (pipe_fds[1] != STDERR_FILENO) ret = dup2(pipe_fds[1], STDERR_FILENO); else ret = fcntl(pipe_fds[1], F_SETFD, 0); close(pipe_fds[1]); if (ret < 0) _exit(EXIT_FAILURE); /* unblock all signals */ ret = sigfillset(&mask); if (ret < 0) _exit(EXIT_FAILURE); ret = pthread_sigmask(SIG_UNBLOCK, &mask, NULL); if (ret < 0) _exit(EXIT_FAILURE); /* check if /bin/sh exist, otherwise try Android location /system/bin/sh */ if (file_exists("/bin/sh")) execl("/bin/sh", "sh", "-c", command, (char *)NULL); else execl("/system/bin/sh", "sh", "-c", command, (char *)NULL); _exit(127); } close(pipe_fds[1]); pipe_fds[1] = -1; fp = malloc(sizeof(*fp)); if (!fp) goto on_error; memset(fp, 0, sizeof(*fp)); fp->child_pid = child_pid; fp->pipe = pipe_fds[0]; /* From now on, closing fp->f will also close fp->pipe. So only ever * call fclose(fp->f). */ fp->f = fdopen(pipe_fds[0], "r"); if (!fp->f) goto on_error; return fp; on_error: /* We can only close pipe_fds[0] if fdopen() didn't succeed or wasn't * called yet. Otherwise the fd belongs to the file opened by fdopen() * since it isn't dup()ed. */ if (fp && !fp->f && pipe_fds[0] >= 0) close(pipe_fds[0]); if (pipe_fds[1] >= 0) close(pipe_fds[1]); if (fp && fp->f) fclose(fp->f); if (fp) free(fp); return NULL; } int lxc_pclose(struct lxc_popen_FILE *fp) { pid_t wait_pid; int wstatus = 0; if (!fp) return -1; do { wait_pid = waitpid(fp->child_pid, &wstatus, 0); } while (wait_pid < 0 && errno == EINTR); fclose(fp->f); free(fp); if (wait_pid < 0) return -1; return wstatus; } int randseed(bool srand_it) { __do_fclose FILE *f = NULL; /* * srand pre-seed function based on /dev/urandom */ unsigned int seed = time(NULL) + getpid(); f = fopen("/dev/urandom", "re"); if (f) { int ret = fread(&seed, sizeof(seed), 1, f); if (ret != 1) SYSDEBUG("Unable to fread /dev/urandom, fallback to time+pid rand seed"); } if (srand_it) srand(seed); return seed; } uid_t get_ns_uid(uid_t orig) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; size_t sz = 0; uid_t nsid, hostid, range; f = fopen("/proc/self/uid_map", "re"); if (!f) return log_error_errno(0, errno, "Failed to open uid_map"); while (getline(&line, &sz, f) != -1) { if (sscanf(line, "%u %u %u", &nsid, &hostid, &range) != 3) continue; if (hostid <= orig && hostid + range > orig) return nsid += orig - hostid; } return LXC_INVALID_UID; } gid_t get_ns_gid(gid_t orig) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; size_t sz = 0; gid_t nsid, hostid, range; f = fopen("/proc/self/gid_map", "re"); if (!f) return log_error_errno(0, errno, "Failed to open gid_map"); while (getline(&line, &sz, f) != -1) { if (sscanf(line, "%u %u %u", &nsid, &hostid, &range) != 3) continue; if (hostid <= orig && hostid + range > orig) return nsid += orig - hostid; } return LXC_INVALID_GID; } bool dir_exists(const char *path) { return exists_dir_at(-1, path); } /* Note we don't use SHA-1 here as we don't want to depend on HAVE_GNUTLS. * FNV has good anti collision properties and we're not worried * about pre-image resistance or one-way-ness, we're just trying to make * the name unique in the 108 bytes of space we have. */ uint64_t fnv_64a_buf(void *buf, size_t len, uint64_t hval) { unsigned char *bp; for(bp = buf; bp < (unsigned char *)buf + len; bp++) { /* xor the bottom with the current octet */ hval ^= (uint64_t)*bp; /* gcc optimised: * multiply by the 64 bit FNV magic prime mod 2^64 */ hval += (hval << 1) + (hval << 4) + (hval << 5) + (hval << 7) + (hval << 8) + (hval << 40); } return hval; } bool is_shared_mountpoint(const char *path) { __do_fclose FILE *f = NULL; __do_free char *line = NULL; int i; size_t len = 0; f = fopen("/proc/self/mountinfo", "re"); if (!f) return 0; while (getline(&line, &len, f) > 0) { char *slider1, *slider2; for (slider1 = line, i = 0; slider1 && i < 4; i++) slider1 = strchr(slider1 + 1, ' '); if (!slider1) continue; slider2 = strchr(slider1 + 1, ' '); if (!slider2) continue; *slider2 = '\0'; if (strequal(slider1 + 1, path)) { /* This is the path. Is it shared? */ slider1 = strchr(slider2 + 1, ' '); if (slider1 && strstr(slider1, "shared:")) return true; } } return false; } /* * Detect whether / is mounted MS_SHARED. The only way I know of to * check that is through /proc/self/mountinfo. * I'm only checking for /. If the container rootfs or mount location * is MS_SHARED, but not '/', then you're out of luck - figuring that * out would be too much work to be worth it. */ int detect_shared_rootfs(void) { if (is_shared_mountpoint("/")) return 1; return 0; } bool switch_to_ns(pid_t pid, const char *ns) { __do_close int fd = -EBADF; int ret; char nspath[STRLITERALLEN("/proc//ns/") + INTTYPE_TO_STRLEN(pid_t) + LXC_NAMESPACE_NAME_MAX]; /* Switch to new ns */ ret = strnprintf(nspath, sizeof(nspath), "/proc/%d/ns/%s", pid, ns); if (ret < 0) return false; fd = open(nspath, O_RDONLY | O_CLOEXEC); if (fd < 0) return log_error_errno(false, errno, "Failed to open \"%s\"", nspath); ret = setns(fd, 0); if (ret) return log_error_errno(false, errno, "Failed to set process %d to \"%s\" of %d", pid, ns, fd); return true; } /* * looking at fs/proc_namespace.c, it appears we can * actually expect the rootfs entry to very specifically contain * " - rootfs rootfs " * IIUC, so long as we've chrooted so that rootfs is not our root, * the rootfs entry should always be skipped in mountinfo contents. */ bool detect_ramfs_rootfs(void) { __do_free char *line = NULL; __do_free void *fopen_cache = NULL; __do_fclose FILE *f = NULL; size_t len = 0; f = fopen_cached("/proc/self/mountinfo", "re", &fopen_cache); if (!f) return false; while (getline(&line, &len, f) != -1) { int i; char *p, *p2; for (p = line, i = 0; p && i < 4; i++) p = strchr(p + 1, ' '); if (!p) continue; p2 = strchr(p + 1, ' '); if (!p2) continue; *p2 = '\0'; if (strequal(p + 1, "/")) { /* This is '/'. Is it the ramfs? */ p = strchr(p2 + 1, '-'); if (p && strnequal(p, "- rootfs ", 9)) return true; } } return false; } char *on_path(const char *cmd, const char *rootfs) { __do_free char *path = NULL; char *entry = NULL; char cmdpath[PATH_MAX]; int ret; path = getenv("PATH"); if (!path) return NULL; path = strdup(path); if (!path) return NULL; lxc_iterate_parts(entry, path, ":") { if (rootfs) ret = strnprintf(cmdpath, sizeof(cmdpath), "%s/%s/%s", rootfs, entry, cmd); else ret = strnprintf(cmdpath, sizeof(cmdpath), "%s/%s", entry, cmd); if (ret < 0) continue; if (access(cmdpath, X_OK) == 0) return strdup(cmdpath); } return NULL; } /* historically lxc-init has been under /usr/lib/lxc and under * /usr/lib/$ARCH/lxc. It now lives as $prefix/sbin/init.lxc. */ char *choose_init(const char *rootfs) { char *retv = NULL; const char *empty = "", *tmp; int ret, env_set = 0; if (!getenv("PATH")) { if (setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", 0)) SYSERROR("Failed to setenv"); env_set = 1; } retv = on_path("init.lxc", rootfs); if (env_set) if (unsetenv("PATH")) SYSERROR("Failed to unsetenv"); if (retv) return retv; retv = malloc(PATH_MAX); if (!retv) return NULL; if (rootfs) tmp = rootfs; else tmp = empty; ret = strnprintf(retv, PATH_MAX, "%s/%s/%s", tmp, SBINDIR, "/init.lxc"); if (ret < 0) { ERROR("The name of path is too long"); goto out1; } if (access(retv, X_OK) == 0) return retv; ret = strnprintf(retv, PATH_MAX, "%s/%s/%s", tmp, LXCINITDIR, "/lxc/lxc-init"); if (ret < 0) { ERROR("The name of path is too long"); goto out1; } if (access(retv, X_OK) == 0) return retv; ret = strnprintf(retv, PATH_MAX, "%s/usr/lib/lxc/lxc-init", tmp); if (ret < 0) { ERROR("The name of path is too long"); goto out1; } if (access(retv, X_OK) == 0) return retv; ret = strnprintf(retv, PATH_MAX, "%s/sbin/lxc-init", tmp); if (ret < 0) { ERROR("The name of path is too long"); goto out1; } if (access(retv, X_OK) == 0) return retv; /* * Last resort, look for the statically compiled init.lxc which we * hopefully bind-mounted in. * If we are called during container setup, and we get to this point, * then the init.lxc.static from the host will need to be bind-mounted * in. So we return NULL here to indicate that. */ if (rootfs) goto out1; ret = strnprintf(retv, PATH_MAX, "/init.lxc.static"); if (ret < 0) { WARN("Nonsense - name /lxc.init.static too long"); goto out1; } if (access(retv, X_OK) == 0) return retv; out1: free(retv); return NULL; } /* * Given the '-t' template option to lxc-create, figure out what to * do. If the template is a full executable path, use that. If it * is something like 'sshd', then return $templatepath/lxc-sshd. * On success return the template, on error return NULL. */ char *get_template_path(const char *t) { int ret, len; char *tpath; if (t[0] == '/') { if (access(t, X_OK) == 0) { return strdup(t); } else { SYSERROR("Bad template pathname: %s", t); return NULL; } } len = strlen(LXCTEMPLATEDIR) + strlen(t) + strlen("/lxc-") + 1; tpath = malloc(len); if (!tpath) return NULL; ret = strnprintf(tpath, len, "%s/lxc-%s", LXCTEMPLATEDIR, t); if (ret < 0) { free(tpath); return NULL; } if (access(tpath, X_OK) < 0) { SYSERROR("bad template: %s", t); free(tpath); return NULL; } return tpath; } /* * @path: a pathname where / replaced with '\0'. * @offsetp: pointer to int showing which path segment was last seen. * Updated on return to reflect the next segment. * @fulllen: full original path length. * Returns a pointer to the next path segment, or NULL if done. */ static char *get_nextpath(char *path, int *offsetp, int fulllen) { int offset = *offsetp; if (offset >= fulllen) return NULL; while (offset < fulllen && path[offset] != '\0') offset++; while (offset < fulllen && path[offset] == '\0') offset++; *offsetp = offset; return (offset < fulllen) ? &path[offset] : NULL; } /* * Check that @subdir is a subdir of @dir. @len is the length of * @dir (to avoid having to recalculate it). */ static bool is_subdir(const char *subdir, const char *dir, size_t len) { size_t subdirlen = strlen(subdir); if (subdirlen < len) return false; if (!strnequal(subdir, dir, len)) return false; if (dir[len-1] == '/') return true; if (subdir[len] == '/' || subdirlen == len) return true; return false; } /* * Check if the open fd is a symlink. Return -ELOOP if it is. Return * -ENOENT if we couldn't fstat. Return 0 if the fd is ok. */ static int check_symlink(int fd) { struct stat sb; int ret; ret = fstat(fd, &sb); if (ret < 0) return -ENOENT; if (S_ISLNK(sb.st_mode)) return -ELOOP; return 0; } /* * Open a file or directory, provided that it contains no symlinks. * * CAVEAT: This function must not be used for other purposes than container * setup before executing the container's init */ static int open_if_safe(int dirfd, const char *nextpath) { int newfd = openat(dirfd, nextpath, O_RDONLY | O_NOFOLLOW); if (newfd >= 0) /* Was not a symlink, all good. */ return newfd; if (errno == ELOOP) return newfd; if (errno == EPERM || errno == EACCES) { /* We're not root (cause we got EPERM) so try opening with * O_PATH. */ newfd = openat(dirfd, nextpath, O_PATH | O_NOFOLLOW); if (newfd >= 0) { /* O_PATH will return an fd for symlinks. We know * nextpath wasn't a symlink at last openat, so if fd is * now a link, then something * fishy is going on. */ int ret = check_symlink(newfd); if (ret < 0) { close(newfd); newfd = ret; } } } return newfd; } /* * Open a path intending for mounting, ensuring that the final path * is inside the container's rootfs. * * CAVEAT: This function must not be used for other purposes than container * setup before executing the container's init * * @target: path to be opened * @prefix_skip: a part of @target in which to ignore symbolic links. This * would be the container's rootfs. * * Return an open fd for the path, or <0 on error. */ static int open_without_symlink(const char *target, const char *prefix_skip) { int curlen = 0, dirfd, fulllen, i; char *dup; fulllen = strlen(target); /* make sure prefix-skip makes sense */ if (prefix_skip && strlen(prefix_skip) > 0) { curlen = strlen(prefix_skip); if (!is_subdir(target, prefix_skip, curlen)) { ERROR("WHOA there - target \"%s\" didn't start with prefix \"%s\"", target, prefix_skip); return -EINVAL; } /* * get_nextpath() expects the curlen argument to be * on a (turned into \0) / or before it, so decrement * curlen to make sure that happens */ if (curlen) curlen--; } else { prefix_skip = "/"; curlen = 0; } /* Make a copy of target which we can hack up, and tokenize it */ if ((dup = strdup(target)) == NULL) { ERROR("Out of memory checking for symbolic link"); return -ENOMEM; } for (i = 0; i < fulllen; i++) { if (dup[i] == '/') dup[i] = '\0'; } dirfd = open(prefix_skip, O_RDONLY); if (dirfd < 0) { SYSERROR("Failed to open path \"%s\"", prefix_skip); goto out; } for (;;) { int newfd, saved_errno; char *nextpath; if ((nextpath = get_nextpath(dup, &curlen, fulllen)) == NULL) goto out; newfd = open_if_safe(dirfd, nextpath); saved_errno = errno; close(dirfd); dirfd = newfd; if (newfd < 0) { errno = saved_errno; if (errno == ELOOP) SYSERROR("%s in %s was a symbolic link!", nextpath, target); goto out; } } out: free(dup); return dirfd; } int __safe_mount_beneath_at(int beneath_fd, const char *src, const char *dst, const char *fstype, unsigned int flags, const void *data) { __do_close int source_fd = -EBADF, target_fd = -EBADF; struct lxc_open_how how = { .flags = PROTECT_OPATH_DIRECTORY, .resolve = PROTECT_LOOKUP_BENEATH_WITH_MAGICLINKS, }; int ret; char src_buf[LXC_PROC_PID_FD_LEN], tgt_buf[LXC_PROC_PID_FD_LEN]; if (beneath_fd < 0) return -EINVAL; if ((flags & MS_BIND) && src && src[0] != '/') { source_fd = openat2(beneath_fd, src, &how, sizeof(how)); if (source_fd < 0) return -errno; ret = strnprintf(src_buf, sizeof(src_buf), "/proc/self/fd/%d", source_fd); if (ret < 0) return -EIO; } else { src_buf[0] = '\0'; } target_fd = openat2(beneath_fd, dst, &how, sizeof(how)); if (target_fd < 0) return log_error_errno(-errno, errno, "Failed to open %d(%s)", beneath_fd, dst); ret = strnprintf(tgt_buf, sizeof(tgt_buf), "/proc/self/fd/%d", target_fd); if (ret < 0) return -EIO; if (!is_empty_string(src_buf)) ret = mount(src_buf, tgt_buf, fstype, flags, data); else ret = mount(src, tgt_buf, fstype, flags, data); return ret; } int safe_mount_beneath(const char *beneath, const char *src, const char *dst, const char *fstype, unsigned int flags, const void *data) { __do_close int beneath_fd = -EBADF; const char *path = beneath ? beneath : "/"; beneath_fd = openat(-1, path, PROTECT_OPATH_DIRECTORY); if (beneath_fd < 0) return log_error_errno(-errno, errno, "Failed to open %s", path); return __safe_mount_beneath_at(beneath_fd, src, dst, fstype, flags, data); } int safe_mount_beneath_at(int beneath_fd, const char *src, const char *dst, const char *fstype, unsigned int flags, const void *data) { return __safe_mount_beneath_at(beneath_fd, src, dst, fstype, flags, data); } /* * Safely mount a path into a container, ensuring that the mount target * is under the container's @rootfs. (If @rootfs is NULL, then the container * uses the host's /) * * CAVEAT: This function must not be used for other purposes than container * setup before executing the container's init */ int safe_mount(const char *src, const char *dest, const char *fstype, unsigned long flags, const void *data, const char *rootfs) { int destfd, ret, saved_errno; /* Only needs enough for /proc/self/fd/. */ char srcbuf[50], destbuf[50]; int srcfd = -1; const char *mntsrc = src; if (!rootfs) rootfs = ""; /* todo - allow symlinks for relative paths if 'allowsymlinks' option is passed */ if (flags & MS_BIND && src && src[0] != '/') { INFO("This is a relative bind mount"); srcfd = open_without_symlink(src, NULL); if (srcfd < 0) return srcfd; ret = strnprintf(srcbuf, sizeof(srcbuf), "/proc/self/fd/%d", srcfd); if (ret < 0) { close(srcfd); ERROR("Out of memory"); return -EINVAL; } mntsrc = srcbuf; } destfd = open_without_symlink(dest, rootfs); if (destfd < 0) { if (srcfd != -1) { saved_errno = errno; close(srcfd); errno = saved_errno; } return destfd; } ret = strnprintf(destbuf, sizeof(destbuf), "/proc/self/fd/%d", destfd); if (ret < 0) { if (srcfd != -1) close(srcfd); close(destfd); ERROR("Out of memory"); return -EINVAL; } ret = mount(mntsrc, destbuf, fstype, flags, data); saved_errno = errno; if (srcfd != -1) close(srcfd); close(destfd); if (ret < 0) { errno = saved_errno; SYSERROR("Failed to mount \"%s\" onto \"%s\"", src ? src : "(null)", dest); return ret; } return 0; } int open_devnull(void) { int fd = open("/dev/null", O_RDWR); if (fd < 0) SYSERROR("Can't open /dev/null"); return fd; } int set_stdfds(int fd) { int ret; if (fd < 0) return -1; ret = dup2(fd, STDIN_FILENO); if (ret < 0) return -1; ret = dup2(fd, STDOUT_FILENO); if (ret < 0) return -1; ret = dup2(fd, STDERR_FILENO); if (ret < 0) return -1; return 0; } int null_stdfds(void) { int ret = -1; int fd; fd = open_devnull(); if (fd >= 0) { ret = set_stdfds(fd); close(fd); } return ret; } /* Check whether a signal is blocked by a process. */ /* /proc/pid-to-str/status\0 = (5 + 21 + 7 + 1) */ #define __PROC_STATUS_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) bool task_blocks_signal(pid_t pid, int signal) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; int ret; char status[__PROC_STATUS_LEN] = {0}; uint64_t sigblk = 0, one = 1; size_t n = 0; bool bret = false; ret = strnprintf(status, sizeof(status), "/proc/%d/status", pid); if (ret < 0) return bret; f = fopen(status, "re"); if (!f) return false; while (getline(&line, &n, f) != -1) { char *numstr; if (!strnequal(line, "SigBlk:", 7)) continue; numstr = lxc_trim_whitespace_in_place(line + 7); ret = lxc_safe_uint64(numstr, &sigblk, 16); if (ret < 0) return false; break; } if (sigblk & (one << (signal - 1))) bret = true; return bret; } int lxc_preserve_ns(const int pid, const char *ns) { int ret; /* 5 /proc + 21 /int_as_str + 3 /ns + 20 /NS_NAME + 1 \0 */ #define __NS_PATH_LEN 50 char path[__NS_PATH_LEN]; /* This way we can use this function to also check whether namespaces * are supported by the kernel by passing in the NULL or the empty * string. */ ret = strnprintf(path, sizeof(path), "/proc/%d/ns%s%s", pid, !ns || strequal(ns, "") ? "" : "/", !ns || strequal(ns, "") ? "" : ns); if (ret < 0) return ret_errno(EIO); return open(path, O_RDONLY | O_CLOEXEC); } bool lxc_switch_uid_gid(uid_t uid, gid_t gid) { int ret = 0; if (gid != LXC_INVALID_GID) { ret = setresgid(gid, gid, gid); if (ret < 0) { SYSERROR("Failed to switch to gid %d", gid); return false; } NOTICE("Switched to gid %d", gid); } if (uid != LXC_INVALID_UID) { ret = setresuid(uid, uid, uid); if (ret < 0) { SYSERROR("Failed to switch to uid %d", uid); return false; } NOTICE("Switched to uid %d", uid); } return true; } /* Simple convenience function which enables uniform logging. */ bool lxc_drop_groups(void) { int ret; ret = setgroups(0, NULL); if (ret) return log_error_errno(false, errno, "Failed to drop supplimentary groups"); NOTICE("Dropped supplimentary groups"); return ret == 0; } bool lxc_setgroups(gid_t list[], size_t size) { int ret; ret = setgroups(size, list); if (ret) return log_error_errno(false, errno, "Failed to set supplimentary groups"); if (size > 0 && lxc_log_trace()) { for (size_t i = 0; i < size; i++) TRACE("Setting supplimentary group %d", list[i]); } NOTICE("Set supplimentary groups"); return true; } static int lxc_get_unused_loop_dev_legacy(char *loop_name) { struct dirent *dp; struct loop_info64 lo64; DIR *dir; int dfd = -1, fd = -1, ret = -1; dir = opendir("/dev"); if (!dir) { SYSERROR("Failed to open \"/dev\""); return -1; } while ((dp = readdir(dir))) { if (!strnequal(dp->d_name, "loop", 4)) continue; dfd = dirfd(dir); if (dfd < 0) continue; fd = openat(dfd, dp->d_name, O_RDWR); if (fd < 0) continue; ret = ioctl(fd, LOOP_GET_STATUS64, &lo64); if (ret < 0) { if (ioctl(fd, LOOP_GET_STATUS64, &lo64) == 0 || errno != ENXIO) { close(fd); fd = -1; continue; } } ret = strnprintf(loop_name, LO_NAME_SIZE, "/dev/%s", dp->d_name); if (ret < 0) { close(fd); fd = -1; continue; } break; } closedir(dir); if (fd < 0) return -1; return fd; } static int lxc_get_unused_loop_dev(char *name_loop) { int loop_nr, ret; int fd_ctl = -1, fd_tmp = -1; fd_ctl = open("/dev/loop-control", O_RDWR | O_CLOEXEC); if (fd_ctl < 0) { SYSERROR("Failed to open loop control"); return -ENODEV; } loop_nr = ioctl(fd_ctl, LOOP_CTL_GET_FREE); if (loop_nr < 0) { SYSERROR("Failed to get loop control"); goto on_error; } ret = strnprintf(name_loop, LO_NAME_SIZE, "/dev/loop%d", loop_nr); if (ret < 0) goto on_error; fd_tmp = open(name_loop, O_RDWR | O_CLOEXEC); if (fd_tmp < 0) { /* on Android loop devices are moved under /dev/block, give it a shot */ ret = strnprintf(name_loop, LO_NAME_SIZE, "/dev/block/loop%d", loop_nr); if (ret < 0) goto on_error; fd_tmp = open(name_loop, O_RDWR | O_CLOEXEC); if (fd_tmp < 0) SYSERROR("Failed to open loop \"%s\"", name_loop); } on_error: close(fd_ctl); return fd_tmp; } int lxc_prepare_loop_dev(const char *source, char *loop_dev, int flags) { int ret; struct loop_info64 lo64; int fd_img = -1, fret = -1, fd_loop = -1; fd_loop = lxc_get_unused_loop_dev(loop_dev); if (fd_loop < 0) { if (fd_loop != -ENODEV) goto on_error; fd_loop = lxc_get_unused_loop_dev_legacy(loop_dev); if (fd_loop < 0) goto on_error; } fd_img = open(source, O_RDWR | O_CLOEXEC); if (fd_img < 0) { SYSERROR("Failed to open source \"%s\"", source); goto on_error; } ret = ioctl(fd_loop, LOOP_SET_FD, fd_img); if (ret < 0) { SYSERROR("Failed to set loop fd"); goto on_error; } memset(&lo64, 0, sizeof(lo64)); lo64.lo_flags = flags; strlcpy((char *)lo64.lo_file_name, source, LO_NAME_SIZE); ret = ioctl(fd_loop, LOOP_SET_STATUS64, &lo64); if (ret < 0) { SYSERROR("Failed to set loop status64"); goto on_error; } fret = 0; on_error: if (fd_img >= 0) close(fd_img); if (fret < 0 && fd_loop >= 0) { close(fd_loop); fd_loop = -1; } return fd_loop; } int lxc_unstack_mountpoint(const char *path, bool lazy) { int ret; int umounts = 0; pop_stack: ret = umount2(path, lazy ? MNT_DETACH : 0); if (ret < 0) { /* We consider anything else than EINVAL deadly to prevent going * into an infinite loop. (The other alternative is constantly * parsing /proc/self/mountinfo which is yucky and probably * racy.) */ if (errno != EINVAL) return -errno; } else { /* Just stop counting when this happens. That'd just be so * stupid that we won't even bother trying to report back the * correct value anymore. */ if (umounts != INT_MAX) umounts++; /* We succeeded in umounting. Make sure that there's no other * mountpoint stacked underneath. */ goto pop_stack; } return umounts; } static int run_command_internal(char *buf, size_t buf_size, int (*child_fn)(void *), void *args, bool wait_status) { pid_t child; int ret, fret, pipefd[2]; ssize_t bytes; /* Make sure our callers do not receive uninitialized memory. */ if (buf_size > 0 && buf) buf[0] = '\0'; if (pipe(pipefd) < 0) { SYSERROR("Failed to create pipe"); return -1; } child = lxc_raw_clone(0, NULL); if (child < 0) { close(pipefd[0]); close(pipefd[1]); SYSERROR("Failed to create new process"); return -1; } if (child == 0) { /* Close the read-end of the pipe. */ close(pipefd[0]); /* Redirect std{err,out} to write-end of the * pipe. */ ret = dup2(pipefd[1], STDOUT_FILENO); if (ret >= 0) ret = dup2(pipefd[1], STDERR_FILENO); /* Close the write-end of the pipe. */ close(pipefd[1]); if (ret < 0) { SYSERROR("Failed to duplicate std{err,out} file descriptor"); _exit(EXIT_FAILURE); } /* Does not return. */ child_fn(args); ERROR("Failed to exec command"); _exit(EXIT_FAILURE); } /* close the write-end of the pipe */ close(pipefd[1]); if (buf && buf_size > 0) { bytes = lxc_read_nointr(pipefd[0], buf, buf_size - 1); if (bytes > 0) buf[bytes - 1] = '\0'; } if (wait_status) fret = lxc_wait_for_pid_status(child); else fret = wait_for_pid(child); /* close the read-end of the pipe */ close(pipefd[0]); return fret; } int run_command(char *buf, size_t buf_size, int (*child_fn)(void *), void *args) { return run_command_internal(buf, buf_size, child_fn, args, false); } int run_command_status(char *buf, size_t buf_size, int (*child_fn)(void *), void *args) { return run_command_internal(buf, buf_size, child_fn, args, true); } bool lxc_nic_exists(char *nic) { #define __LXC_SYS_CLASS_NET_LEN 15 + IFNAMSIZ + 1 char path[__LXC_SYS_CLASS_NET_LEN]; int ret; struct stat sb; if (strequal(nic, "none")) return true; ret = strnprintf(path, sizeof(path), "/sys/class/net/%s", nic); if (ret < 0) return false; ret = stat(path, &sb); if (ret < 0) return false; return true; } uint64_t lxc_find_next_power2(uint64_t n) { /* 0 is not valid input. We return 0 to the caller since 0 is not a * valid power of two. */ if (n == 0) return 0; if (!(n & (n - 1))) return n; while (n & (n - 1)) n = n & (n - 1); n = n << 1; return n; } static int process_dead(/* takes */ int status_fd) { __do_close int dupfd = -EBADF; __do_free char *line = NULL; __do_fclose FILE *f = NULL; int ret = 0; size_t n = 0; dupfd = dup(status_fd); if (dupfd < 0) return -1; if (fd_cloexec(dupfd, true) < 0) return -1; f = fdopen(dupfd, "re"); if (!f) return -1; /* Transfer ownership of fd. */ move_fd(dupfd); ret = 0; while (getline(&line, &n, f) != -1) { char *state; if (!strnequal(line, "State:", 6)) continue; state = lxc_trim_whitespace_in_place(line + 6); /* only check whether process is dead or zombie for now */ if (*state == 'X' || *state == 'Z') ret = 1; } return ret; } int lxc_set_death_signal(int signal, pid_t parent, int parent_status_fd) { int ret; pid_t ppid; ret = prctl(PR_SET_PDEATHSIG, prctl_arg(signal), prctl_arg(0), prctl_arg(0), prctl_arg(0)); /* verify that we haven't been orphaned in the meantime */ ppid = (pid_t)syscall(SYS_getppid); if (ppid == 0) { /* parent outside our pidns */ if (parent_status_fd < 0) return 0; if (process_dead(parent_status_fd) == 1) return raise(SIGKILL); } else if (ppid != parent) { return raise(SIGKILL); } if (ret < 0) return -1; return 0; } int lxc_rm_rf(const char *dirname) { __do_closedir DIR *dir = NULL; int fret = 0; int ret; struct dirent *direntp; dir = opendir(dirname); if (!dir) return log_error_errno(-1, errno, "Failed to open dir \"%s\"", dirname); while ((direntp = readdir(dir))) { __do_free char *pathname = NULL; struct stat mystat; if (strequal(direntp->d_name, ".") || strequal(direntp->d_name, "..")) continue; pathname = must_make_path(dirname, direntp->d_name, NULL); ret = lstat(pathname, &mystat); if (ret < 0) { if (!fret) SYSWARN("Failed to stat \"%s\"", pathname); fret = -1; continue; } if (!S_ISDIR(mystat.st_mode)) continue; ret = lxc_rm_rf(pathname); if (ret < 0) fret = -1; } ret = rmdir(dirname); if (ret < 0) return log_warn_errno(-1, errno, "Failed to delete \"%s\"", dirname); return fret; } bool lxc_can_use_pidfd(int pidfd) { int ret; if (pidfd < 0) return log_error(false, "Kernel does not support pidfds"); /* * We don't care whether or not children were in a waitable state. We * just care whether waitid() recognizes P_PIDFD. * * Btw, while I have your attention, the above waitid() code is an * excellent example of how _not_ to do flag-based kernel APIs. So if * you ever go into kernel development or are already and you add this * kind of flag potpourri even though you have read this comment shame * on you. May the gods of operating system development have mercy on * your soul because I won't. */ ret = waitid(P_PIDFD, pidfd, NULL, /* Type of children to wait for. */ __WALL | /* How to wait for them. */ WNOHANG | WNOWAIT | /* What state to wait for. */ WEXITED | WSTOPPED | WCONTINUED); if (ret < 0) return log_error_errno(false, errno, "Kernel does not support waiting on processes through pidfds"); ret = lxc_raw_pidfd_send_signal(pidfd, 0, NULL, 0); if (ret) return log_error_errno(false, errno, "Kernel does not support sending singals through pidfds"); return log_trace(true, "Kernel supports pidfds"); } int fix_stdio_permissions(uid_t uid) { __do_close int devnull_fd = -EBADF; int fret = 0; int std_fds[] = {STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO}; int ret; struct stat st, st_null; devnull_fd = open_devnull(); if (devnull_fd < 0) return log_trace_errno(-1, errno, "Failed to open \"/dev/null\""); ret = fstat(devnull_fd, &st_null); if (ret) return log_trace_errno(-errno, errno, "Failed to stat \"/dev/null\""); for (size_t i = 0; i < ARRAY_SIZE(std_fds); i++) { ret = fstat(std_fds[i], &st); if (ret) { SYSWARN("Failed to stat standard I/O file descriptor %d", std_fds[i]); fret = -1; continue; } if (st.st_rdev == st_null.st_rdev) continue; ret = fchown(std_fds[i], uid, st.st_gid); if (ret) { SYSTRACE("Failed to chown standard I/O file descriptor %d to uid %d and gid %d", std_fds[i], uid, st.st_gid); fret = -1; continue; } ret = fchmod(std_fds[i], 0700); if (ret) { SYSTRACE("Failed to chmod standard I/O file descriptor %d", std_fds[i]); fret = -1; } } return fret; } bool multiply_overflow(int64_t base, uint64_t mult, int64_t *res) { if (base > 0 && base > (int64_t)(INT64_MAX / mult)) return false; if (base < 0 && base < (int64_t)(INT64_MIN / mult)) return false; *res = (int64_t)(base * mult); return true; } int print_r(int fd, const char *path) { __do_close int dfd = -EBADF, dfd_dup = -EBADF; __do_closedir DIR *dir = NULL; int ret = 0; struct dirent *direntp; struct stat st; if (is_empty_string(path)) { char buf[LXC_PROC_SELF_FD_LEN]; ret = strnprintf(buf, sizeof(buf), "/proc/self/fd/%d", fd); if (ret < 0) return ret_errno(EIO); /* * O_PATH file descriptors can't be used so we need to re-open * just in case. */ dfd = openat(-EBADF, buf, O_CLOEXEC | O_DIRECTORY, 0); } else { dfd = openat(fd, path, O_CLOEXEC | O_DIRECTORY, 0); } if (dfd < 0) return -1; dfd_dup = dup_cloexec(dfd); if (dfd_dup < 0) return -1; dir = fdopendir(dfd); if (!dir) return -1; /* Transfer ownership to fdopendir(). */ move_fd(dfd); while ((direntp = readdir(dir))) { if (!strcmp(direntp->d_name, ".") || !strcmp(direntp->d_name, "..")) continue; ret = fstatat(dfd_dup, direntp->d_name, &st, AT_SYMLINK_NOFOLLOW); if (ret < 0 && errno != ENOENT) break; ret = 0; if (S_ISDIR(st.st_mode)) ret = print_r(dfd_dup, direntp->d_name); else INFO("mode(%o):uid(%d):gid(%d) -> %d/%s\n", (st.st_mode & ~S_IFMT), st.st_uid, st.st_gid, dfd_dup, direntp->d_name); if (ret < 0 && errno != ENOENT) break; } if (is_empty_string(path)) ret = fstatat(fd, "", &st, AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH); else ret = fstatat(fd, path, &st, AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW); if (ret) return -1; else INFO("mode(%o):uid(%d):gid(%d) -> %s", (st.st_mode & ~S_IFMT), st.st_uid, st.st_gid, maybe_empty(path)); return ret; } lxc-4.0.12/src/lxc/sync.c0000644061062106075000000001000014176403775012017 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include "log.h" #include "start.h" #include "sync.h" #include "utils.h" lxc_log_define(sync, lxc); bool sync_wait(int fd, int sequence) { int sync = -1; ssize_t ret; ret = lxc_read_nointr(fd, &sync, sizeof(sync)); if (ret < 0) return log_error_errno(false, errno, "Sync wait failure"); if (!ret) return true; if ((size_t)ret != sizeof(sync)) return log_error(false, "Unexpected sync size: %zu expected %zu", (size_t)ret, sizeof(sync)); if (sync == SYNC_ERROR) return log_error(false, "An error occurred in another process (expected sequence number %d)", sequence); if (sync != sequence) return log_error(false, "Invalid sequence number %d. Expected sequence number %d", sync, sequence); return true; } bool sync_wake(int fd, int sequence) { int sync = sequence; if (lxc_write_nointr(fd, &sync, sizeof(sync)) < 0) return log_error_errno(false, errno, "Sync wake failure"); return true; } static bool __sync_barrier(int fd, int sequence) { if (!sync_wake(fd, sequence)) return false; return sync_wait(fd, sequence + 1); } static inline const char *start_sync_to_string(int state) { switch (state) { case START_SYNC_STARTUP: return "startup"; case START_SYNC_CONFIGURE: return "configure"; case START_SYNC_POST_CONFIGURE: return "post-configure"; case START_SYNC_CGROUP_LIMITS: return "cgroup-limits"; case START_SYNC_IDMAPPED_MOUNTS: return "idmapped-mounts"; case START_SYNC_FDS: return "fds"; case START_SYNC_READY_START: return "ready-start"; case START_SYNC_RESTART: return "restart"; case START_SYNC_POST_RESTART: return "post-restart"; case SYNC_ERROR: return "error"; default: return "invalid sync state"; } } bool lxc_sync_barrier_parent(struct lxc_handler *handler, int sequence) { TRACE("Child waking parent with sequence %s and waiting for sequence %s", start_sync_to_string(sequence), start_sync_to_string(sequence + 1)); return __sync_barrier(handler->sync_sock[0], sequence); } bool lxc_sync_barrier_child(struct lxc_handler *handler, int sequence) { TRACE("Parent waking child with sequence %s and waiting with sequence %s", start_sync_to_string(sequence), start_sync_to_string(sequence + 1)); return __sync_barrier(handler->sync_sock[1], sequence); } bool lxc_sync_wake_parent(struct lxc_handler *handler, int sequence) { TRACE("Child waking parent with sequence %s", start_sync_to_string(sequence)); return sync_wake(handler->sync_sock[0], sequence); } bool lxc_sync_wait_parent(struct lxc_handler *handler, int sequence) { TRACE("Child waiting for parent with sequence %s", start_sync_to_string(sequence)); return sync_wait(handler->sync_sock[0], sequence); } bool lxc_sync_wait_child(struct lxc_handler *handler, int sequence) { TRACE("Parent waiting for child with sequence %s", start_sync_to_string(sequence)); return sync_wait(handler->sync_sock[1], sequence); } bool lxc_sync_wake_child(struct lxc_handler *handler, int sequence) { TRACE("Parent waking child with sequence %s", start_sync_to_string(sequence)); return sync_wake(handler->sync_sock[1], sequence); } bool lxc_sync_init(struct lxc_handler *handler) { int ret; ret = socketpair(AF_LOCAL, SOCK_STREAM, 0, handler->sync_sock); if (ret) return log_error_errno(false, errno, "failed to create synchronization socketpair"); /* Be sure we don't inherit this after the exec */ ret = fcntl(handler->sync_sock[0], F_SETFD, FD_CLOEXEC); if (ret < 0) return log_error_errno(false, errno, "Failed to make socket close-on-exec"); TRACE("Initialized synchronization infrastructure"); return true; } void lxc_sync_fini_child(struct lxc_handler *handler) { close_prot_errno_disarm(handler->sync_sock[0]); } void lxc_sync_fini_parent(struct lxc_handler *handler) { close_prot_errno_disarm(handler->sync_sock[1]); } void lxc_sync_fini(struct lxc_handler *handler) { lxc_sync_fini_child(handler); lxc_sync_fini_parent(handler); } lxc-4.0.12/src/lxc/terminal.c0000644061062106075000000010046514176403775012675 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "lxc.h" #include "af_unix.h" #include "caps.h" #include "commands.h" #include "conf.h" #include "log.h" #include "lxclock.h" #include "mainloop.h" #include "memory_utils.h" #include "start.h" #include "syscall_wrappers.h" #include "terminal.h" #include "utils.h" #if HAVE_OPENPTY #include #else #include "openpty.h" #endif #define LXC_TERMINAL_BUFFER_SIZE 1024 lxc_log_define(terminal, lxc); void lxc_terminal_winsz(int srcfd, int dstfd) { int ret; struct winsize wsz; if (!isatty(srcfd)) return; ret = ioctl(srcfd, TIOCGWINSZ, &wsz); if (ret < 0) { WARN("Failed to get window size"); return; } ret = ioctl(dstfd, TIOCSWINSZ, &wsz); if (ret < 0) WARN("Failed to set window size"); else DEBUG("Set window size to %d columns and %d rows", wsz.ws_col, wsz.ws_row); return; } static void lxc_terminal_winch(struct lxc_terminal_state *ts) { lxc_terminal_winsz(ts->stdinfd, ts->ptxfd); } int lxc_terminal_signalfd_cb(int fd, uint32_t events, void *cbdata, struct lxc_async_descr *descr) { ssize_t ret; struct signalfd_siginfo siginfo; struct lxc_terminal_state *ts = cbdata; ret = lxc_read_nointr(fd, &siginfo, sizeof(siginfo)); if (ret < 0 || (size_t)ret < sizeof(siginfo)) { ERROR("Failed to read signal info"); return LXC_MAINLOOP_ERROR; } if (siginfo.ssi_signo == SIGTERM) { DEBUG("Received SIGTERM. Detaching from the terminal"); return LXC_MAINLOOP_CLOSE; } if (siginfo.ssi_signo == SIGWINCH) lxc_terminal_winch(ts); return LXC_MAINLOOP_CONTINUE; } struct lxc_terminal_state *lxc_terminal_signal_init(int srcfd, int dstfd) { __do_close int signal_fd = -EBADF; __do_free struct lxc_terminal_state *ts = NULL; int ret; sigset_t mask; ts = malloc(sizeof(*ts)); if (!ts) return NULL; memset(ts, 0, sizeof(*ts)); ts->stdinfd = srcfd; ts->ptxfd = dstfd; ts->sigfd = -1; ret = sigemptyset(&mask); if (ret < 0) { SYSERROR("Failed to initialize an empty signal set"); return NULL; } if (isatty(srcfd)) { ret = sigaddset(&mask, SIGWINCH); if (ret < 0) SYSNOTICE("Failed to add SIGWINCH to signal set"); } else { INFO("fd %d does not refer to a tty device", srcfd); } /* Exit the mainloop cleanly on SIGTERM. */ ret = sigaddset(&mask, SIGTERM); if (ret < 0) { SYSERROR("Failed to add SIGWINCH to signal set"); return NULL; } ret = pthread_sigmask(SIG_BLOCK, &mask, &ts->oldmask); if (ret < 0) { WARN("Failed to block signals"); return NULL; } signal_fd = signalfd(-1, &mask, SFD_CLOEXEC); if (signal_fd < 0) { WARN("Failed to create signal fd"); (void)pthread_sigmask(SIG_SETMASK, &ts->oldmask, NULL); return NULL; } ts->sigfd = move_fd(signal_fd); TRACE("Created signal fd %d", ts->sigfd); return move_ptr(ts); } int lxc_terminal_signal_sigmask_safe_blocked(struct lxc_terminal *terminal) { struct lxc_terminal_state *state = terminal->tty_state; if (!state) return 0; return pthread_sigmask(SIG_SETMASK, &state->oldmask, NULL); } /** * lxc_terminal_signal_fini: uninstall signal handler * * @terminal: terminal instance * * Restore the saved signal handler that was in effect at the time * lxc_terminal_signal_init() was called. */ static void lxc_terminal_signal_fini(struct lxc_terminal *terminal) { struct lxc_terminal_state *state = terminal->tty_state; if (!terminal->tty_state) return; state = terminal->tty_state; if (state->sigfd >= 0) { close(state->sigfd); if (pthread_sigmask(SIG_SETMASK, &state->oldmask, NULL) < 0) SYSWARN("Failed to restore signal mask"); } free(terminal->tty_state); terminal->tty_state = NULL; } static int lxc_terminal_truncate_log_file(struct lxc_terminal *terminal) { /* be very certain things are kosher */ if (!terminal->log_path || terminal->log_fd < 0) return -EBADF; return lxc_unpriv(ftruncate(terminal->log_fd, 0)); } static int lxc_terminal_rotate_log_file(struct lxc_terminal *terminal) { __do_free char *tmp = NULL; int ret; size_t len; if (!terminal->log_path || terminal->log_rotate == 0) return -EOPNOTSUPP; /* be very certain things are kosher */ if (terminal->log_fd < 0) return -EBADF; len = strlen(terminal->log_path) + sizeof(".1"); tmp = must_realloc(NULL, len); ret = strnprintf(tmp, len, "%s.1", terminal->log_path); if (ret < 0) return -EFBIG; close(terminal->log_fd); terminal->log_fd = -1; ret = lxc_unpriv(rename(terminal->log_path, tmp)); if (ret < 0) return ret; return lxc_terminal_create_log_file(terminal); } static int lxc_terminal_write_log_file(struct lxc_terminal *terminal, char *buf, int bytes_read) { int ret; struct stat st; int64_t space_left = -1; if (terminal->log_fd < 0) return 0; /* A log size <= 0 means that there's no limit on the size of the log * file at which point we simply ignore whether the log is supposed to * be rotated or not. */ if (terminal->log_size <= 0) return lxc_write_nointr(terminal->log_fd, buf, bytes_read); /* Get current size of the log file. */ ret = fstat(terminal->log_fd, &st); if (ret < 0) { SYSERROR("Failed to stat the terminal log file descriptor"); return -1; } /* handle non-regular files */ if ((st.st_mode & S_IFMT) != S_IFREG) { /* This isn't a regular file. so rotating the file seems a * dangerous thing to do, size limits are also very * questionable. Let's not risk anything and tell the user that * they're requesting us to do weird stuff. */ if (terminal->log_rotate > 0 || terminal->log_size > 0) return -EINVAL; /* I mean, sure log wherever you want to. */ return lxc_write_nointr(terminal->log_fd, buf, bytes_read); } space_left = terminal->log_size - st.st_size; /* User doesn't want to rotate the log file and there's no more space * left so simply truncate it. */ if (space_left <= 0 && terminal->log_rotate <= 0) { ret = lxc_terminal_truncate_log_file(terminal); if (ret < 0) return ret; if ((uint64_t)bytes_read <= terminal->log_size) return lxc_write_nointr(terminal->log_fd, buf, bytes_read); /* Write as much as we can into the buffer and loose the rest. */ return lxc_write_nointr(terminal->log_fd, buf, terminal->log_size); } /* There's enough space left. */ if (bytes_read <= space_left) return lxc_write_nointr(terminal->log_fd, buf, bytes_read); /* There's not enough space left but at least write as much as we can * into the old log file. */ ret = lxc_write_nointr(terminal->log_fd, buf, space_left); if (ret < 0) return -1; /* Calculate how many bytes we still need to write. */ bytes_read -= space_left; /* There'd be more to write but we aren't instructed to rotate the log * file so simply return. There's no error on our side here. */ if (terminal->log_rotate > 0) ret = lxc_terminal_rotate_log_file(terminal); else ret = lxc_terminal_truncate_log_file(terminal); if (ret < 0) return ret; if (terminal->log_size < (uint64_t)bytes_read) { /* Well, this is unfortunate because it means that there is more * to write than the user has granted us space. There are * multiple ways to handle this but let's use the simplest one: * write as much as we can, tell the user that there was more * stuff to write and move on. * Note that this scenario shouldn't actually happen with the * standard pty-based terminal that LXC allocates since it will * be switched into raw mode. In raw mode only 1 byte at a time * should be read and written. */ WARN("Size of terminal log file is smaller than the bytes to write"); ret = lxc_write_nointr(terminal->log_fd, buf, terminal->log_size); if (ret < 0) return -1; bytes_read -= ret; return bytes_read; } /* Yay, we made it. */ ret = lxc_write_nointr(terminal->log_fd, buf, bytes_read); if (ret < 0) return -1; bytes_read -= ret; return bytes_read; } static int lxc_terminal_ptx_io(struct lxc_terminal *terminal) { char buf[LXC_TERMINAL_BUFFER_SIZE]; int r, w, w_log, w_rbuf; w = r = lxc_read_nointr(terminal->ptx, buf, sizeof(buf)); if (r <= 0) return -1; w_rbuf = w_log = 0; /* write to peer first */ if (terminal->peer >= 0) w = lxc_write_nointr(terminal->peer, buf, r); /* write to terminal ringbuffer */ if (terminal->buffer_size > 0) w_rbuf = lxc_ringbuf_write(&terminal->ringbuf, buf, r); /* write to terminal log */ if (terminal->log_fd >= 0) w_log = lxc_terminal_write_log_file(terminal, buf, r); if (w != r) WARN("Short write on terminal r:%d != w:%d", r, w); if (w_rbuf < 0) { errno = -w_rbuf; SYSTRACE("Failed to write %d bytes to terminal ringbuffer", r); } if (w_log < 0) TRACE("Failed to write %d bytes to terminal log", r); return 0; } static int lxc_terminal_peer_io(struct lxc_terminal *terminal) { char buf[LXC_TERMINAL_BUFFER_SIZE]; int r, w; w = r = lxc_read_nointr(terminal->peer, buf, sizeof(buf)); if (r <= 0) return -1; w = lxc_write_nointr(terminal->ptx, buf, r); if (w != r) WARN("Short write on terminal r:%d != w:%d", r, w); return 0; } static int lxc_terminal_ptx_io_handler(int fd, uint32_t events, void *data, struct lxc_async_descr *descr) { struct lxc_terminal *terminal = data; int ret; ret = lxc_terminal_ptx_io(data); if (ret < 0) return log_info(LXC_MAINLOOP_CLOSE, "Terminal client on fd %d has exited", terminal->ptx); return LXC_MAINLOOP_CONTINUE; } static int lxc_terminal_peer_io_handler(int fd, uint32_t events, void *data, struct lxc_async_descr *descr) { struct lxc_terminal *terminal = data; int ret; ret = lxc_terminal_peer_io(data); if (ret < 0) return log_info(LXC_MAINLOOP_CLOSE, "Terminal client on fd %d has exited", terminal->peer); return LXC_MAINLOOP_CONTINUE; } static int lxc_terminal_mainloop_add_peer(struct lxc_terminal *terminal) { int ret; if (terminal->peer >= 0) { ret = lxc_mainloop_add_handler(terminal->descr, terminal->peer, lxc_terminal_peer_io_handler, default_cleanup_handler, terminal, "lxc_terminal_peer_io_handler"); if (ret < 0) { WARN("Failed to add terminal peer handler to mainloop"); return -1; } } if (!terminal->tty_state || terminal->tty_state->sigfd < 0) return 0; ret = lxc_mainloop_add_handler(terminal->descr, terminal->tty_state->sigfd, lxc_terminal_signalfd_cb, default_cleanup_handler, terminal->tty_state, "lxc_terminal_signalfd_cb"); if (ret < 0) { WARN("Failed to add signal handler to mainloop"); return -1; } return 0; } int lxc_terminal_mainloop_add(struct lxc_async_descr *descr, struct lxc_terminal *terminal) { int ret; if (terminal->ptx < 0) { INFO("Terminal is not initialized"); return 0; } ret = lxc_mainloop_add_handler(descr, terminal->ptx, lxc_terminal_ptx_io_handler, default_cleanup_handler, terminal, "lxc_terminal_ptx_io_handler"); if (ret < 0) { ERROR("Failed to add handler for terminal ptx fd %d to mainloop", terminal->ptx); return -1; } /* We cache the descr so that we can add an fd to it when someone * does attach to it in lxc_terminal_allocate(). */ terminal->descr = descr; return lxc_terminal_mainloop_add_peer(terminal); } int lxc_setup_tios(int fd, struct termios *oldtios) { int ret; struct termios newtios; if (!isatty(fd)) { ERROR("File descriptor %d does not refer to a terminal", fd); return -1; } /* Get current termios. */ ret = tcgetattr(fd, oldtios); if (ret < 0) { SYSERROR("Failed to get current terminal settings"); return -1; } /* ensure we don't end up in an endless loop: * The kernel might fire SIGTTOU while an * ioctl() in tcsetattr() is executed. When the ioctl() * is resumed and retries, the signal handler interrupts it again. */ signal (SIGTTIN, SIG_IGN); signal (SIGTTOU, SIG_IGN); newtios = *oldtios; /* We use the same settings that ssh does. */ newtios.c_iflag |= IGNPAR; newtios.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); #ifdef IUCLC newtios.c_iflag &= ~IUCLC; #endif newtios.c_lflag &= ~(TOSTOP | ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); #ifdef IEXTEN newtios.c_lflag &= ~IEXTEN; #endif newtios.c_oflag |= ONLCR; newtios.c_oflag |= OPOST; newtios.c_cc[VMIN] = 1; newtios.c_cc[VTIME] = 0; /* Set new attributes. */ ret = tcsetattr(fd, TCSAFLUSH, &newtios); if (ret < 0) { ERROR("Failed to set new terminal settings"); return -1; } return 0; } static void lxc_terminal_peer_proxy_free(struct lxc_terminal *terminal) { lxc_terminal_signal_fini(terminal); close(terminal->proxy.ptx); terminal->proxy.ptx = -1; close(terminal->proxy.pty); terminal->proxy.pty = -1; terminal->proxy.busy = -1; terminal->proxy.name[0] = '\0'; terminal->peer = -1; } static int lxc_terminal_peer_proxy_alloc(struct lxc_terminal *terminal, int sockfd) { int ret; struct termios oldtermio; struct lxc_terminal_state *ts; if (terminal->ptx < 0) { ERROR("Terminal not set up"); return -1; } if (terminal->proxy.busy != -1 || terminal->peer != -1) { NOTICE("Terminal already in use"); return -1; } if (terminal->tty_state) { ERROR("Terminal has already been initialized"); return -1; } /* This is the proxy terminal that will be given to the client, and * that the real terminal ptx will send to / recv from. */ ret = openpty(&terminal->proxy.ptx, &terminal->proxy.pty, NULL, NULL, NULL); if (ret < 0) { SYSERROR("Failed to open proxy terminal"); return -1; } ret = ttyname_r(terminal->proxy.pty, terminal->proxy.name, sizeof(terminal->proxy.name)); if (ret < 0) { SYSERROR("Failed to retrieve name of proxy terminal pty"); goto on_error; } ret = fd_cloexec(terminal->proxy.ptx, true); if (ret < 0) { SYSERROR("Failed to set FD_CLOEXEC flag on proxy terminal ptx"); goto on_error; } ret = fd_cloexec(terminal->proxy.pty, true); if (ret < 0) { SYSERROR("Failed to set FD_CLOEXEC flag on proxy terminal pty"); goto on_error; } ret = lxc_setup_tios(terminal->proxy.pty, &oldtermio); if (ret < 0) goto on_error; ts = lxc_terminal_signal_init(terminal->proxy.ptx, terminal->ptx); if (!ts) goto on_error; terminal->tty_state = ts; terminal->peer = terminal->proxy.pty; terminal->proxy.busy = sockfd; ret = lxc_terminal_mainloop_add_peer(terminal); if (ret < 0) goto on_error; NOTICE("Opened proxy terminal with ptx fd %d and pty fd %d", terminal->proxy.ptx, terminal->proxy.pty); return 0; on_error: lxc_terminal_peer_proxy_free(terminal); return -1; } int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq) { size_t ttynum; int ptxfd = -1; struct lxc_tty_info *ttys = &conf->ttys; struct lxc_terminal *terminal = &conf->console; if (*ttyreq == 0) { int ret; ret = lxc_terminal_peer_proxy_alloc(terminal, sockfd); if (ret < 0) goto out; ptxfd = terminal->proxy.ptx; goto out; } if (*ttyreq > 0) { if ((size_t)*ttyreq > ttys->max) goto out; if (ttys->tty[*ttyreq - 1].busy >= 0) goto out; /* The requested tty is available. */ ttynum = *ttyreq; goto out_tty; } /* Search for next available tty, fixup index tty1 => [0]. */ for (ttynum = 1; ttynum <= ttys->max && ttys->tty[ttynum - 1].busy >= 0; ttynum++) { ; } /* We didn't find any available slot for tty. */ if (ttynum > ttys->max) goto out; *ttyreq = (int)ttynum; out_tty: ttys->tty[ttynum - 1].busy = sockfd; ptxfd = ttys->tty[ttynum - 1].ptx; out: return ptxfd; } void lxc_terminal_free(struct lxc_conf *conf, int fd) { struct lxc_tty_info *ttys = &conf->ttys; struct lxc_terminal *terminal = &conf->console; for (size_t i = 0; i < ttys->max; i++) if (ttys->tty[i].busy == fd) ttys->tty[i].busy = -1; if (terminal->proxy.busy != fd) return; lxc_mainloop_del_handler(terminal->descr, terminal->proxy.pty); lxc_terminal_peer_proxy_free(terminal); } static int lxc_terminal_peer_default(struct lxc_terminal *terminal) { struct lxc_terminal_state *ts; const char *path; int ret = 0; if (terminal->path) path = terminal->path; else path = "/dev/tty"; terminal->peer = lxc_unpriv(open(path, O_RDWR | O_CLOEXEC)); if (terminal->peer < 0) { if (!terminal->path) { errno = ENODEV; SYSDEBUG("The process does not have a controlling terminal"); goto on_succes; } SYSERROR("Failed to open proxy terminal \"%s\"", path); return -ENOTTY; } DEBUG("Using terminal \"%s\" as proxy", path); if (!isatty(terminal->peer)) { ERROR("File descriptor for \"%s\" does not refer to a terminal", path); goto on_error_free_tios; } ts = lxc_terminal_signal_init(terminal->peer, terminal->ptx); terminal->tty_state = ts; if (!ts) { WARN("Failed to install signal handler"); goto on_error_free_tios; } lxc_terminal_winsz(terminal->peer, terminal->ptx); terminal->tios = malloc(sizeof(*terminal->tios)); if (!terminal->tios) goto on_error_free_tios; ret = lxc_setup_tios(terminal->peer, terminal->tios); if (ret < 0) goto on_error_close_peer; else goto on_succes; on_error_free_tios: free(terminal->tios); terminal->tios = NULL; on_error_close_peer: close(terminal->peer); terminal->peer = -1; ret = -ENOTTY; on_succes: return ret; } int lxc_terminal_write_ringbuffer(struct lxc_terminal *terminal) { char *r_addr; ssize_t ret; uint64_t used; struct lxc_ringbuf *buf = &terminal->ringbuf; /* There's not log file where we can dump the ringbuffer to. */ if (terminal->log_fd < 0) return 0; used = lxc_ringbuf_used(buf); if (used == 0) return 0; ret = lxc_terminal_truncate_log_file(terminal); if (ret < 0) return ret; /* Write as much as we can without exceeding the limit. */ if (terminal->log_size < used) used = terminal->log_size; r_addr = lxc_ringbuf_get_read_addr(buf); ret = lxc_write_nointr(terminal->log_fd, r_addr, used); if (ret < 0) return -EIO; return 0; } void lxc_terminal_delete(struct lxc_terminal *terminal) { int ret; ret = lxc_terminal_write_ringbuffer(terminal); if (ret < 0) WARN("Failed to write terminal log to disk"); if (terminal->tios && terminal->peer >= 0) { ret = tcsetattr(terminal->peer, TCSAFLUSH, terminal->tios); if (ret < 0) SYSWARN("Failed to set old terminal settings"); } free(terminal->tios); terminal->tios = NULL; if (terminal->peer >= 0) close(terminal->peer); terminal->peer = -1; if (terminal->ptx >= 0) close(terminal->ptx); terminal->ptx = -1; if (terminal->pty >= 0) close(terminal->pty); terminal->pty = -1; terminal->pty_nr = -1; if (terminal->log_fd >= 0) close(terminal->log_fd); terminal->log_fd = -1; } /** * Note that this function needs to run before the mainloop starts. Since we * register a handler for the terminal's ptxfd when we create the mainloop * the terminal handler needs to see an allocated ringbuffer. */ static int lxc_terminal_create_ringbuf(struct lxc_terminal *terminal) { int ret; struct lxc_ringbuf *buf = &terminal->ringbuf; uint64_t size = terminal->buffer_size; /* no ringbuffer previously allocated and no ringbuffer requested */ if (!buf->addr && size <= 0) return 0; /* ringbuffer allocated but no new ringbuffer requested */ if (buf->addr && size <= 0) { lxc_ringbuf_release(buf); buf->addr = NULL; buf->r_off = 0; buf->w_off = 0; buf->size = 0; TRACE("Deallocated terminal ringbuffer"); return 0; } if (size <= 0) return 0; /* check wether the requested size for the ringbuffer has changed */ if (buf->addr && buf->size != size) { TRACE("Terminal ringbuffer size changed from %" PRIu64 " to %" PRIu64 " bytes. Deallocating terminal ringbuffer", buf->size, size); lxc_ringbuf_release(buf); } ret = lxc_ringbuf_create(buf, size); if (ret < 0) { ERROR("Failed to setup %" PRIu64 " byte terminal ringbuffer", size); return -1; } TRACE("Allocated %" PRIu64 " byte terminal ringbuffer", size); return 0; } /** * This is the terminal log file. Please note that the terminal log file is * (implementation wise not content wise) independent of the terminal ringbuffer. */ int lxc_terminal_create_log_file(struct lxc_terminal *terminal) { if (!terminal->log_path) return 0; terminal->log_fd = lxc_unpriv(open(terminal->log_path, O_CLOEXEC | O_RDWR | O_CREAT | O_APPEND, 0600)); if (terminal->log_fd < 0) { SYSERROR("Failed to open terminal log file \"%s\"", terminal->log_path); return -1; } DEBUG("Using \"%s\" as terminal log file", terminal->log_path); return 0; } static int lxc_terminal_map_ids(struct lxc_conf *c, struct lxc_terminal *terminal) { int ret; if (list_empty(&c->id_map)) return 0; if (is_empty_string(terminal->name) && terminal->pty < 0) return 0; if (terminal->pty >= 0) ret = userns_exec_mapped_root(NULL, terminal->pty, c); else ret = userns_exec_mapped_root(terminal->name, -EBADF, c); if (ret < 0) return log_error(-1, "Failed to chown terminal %d(%s)", terminal->pty, !is_empty_string(terminal->name) ? terminal->name : "(null)"); TRACE("Chowned terminal %d(%s)", terminal->pty, !is_empty_string(terminal->name) ? terminal->name : "(null)"); return 0; } static int lxc_terminal_create_foreign(struct lxc_conf *conf, struct lxc_terminal *terminal) { int ret; ret = openpty(&terminal->ptx, &terminal->pty, NULL, NULL, NULL); if (ret < 0) { SYSERROR("Failed to open terminal"); return -1; } ret = lxc_terminal_map_ids(conf, terminal); if (ret < 0) { SYSERROR("Failed to change ownership of terminal multiplexer device"); goto err; } ret = ttyname_r(terminal->pty, terminal->name, sizeof(terminal->name)); if (ret < 0) { SYSERROR("Failed to retrieve name of terminal pty"); goto err; } ret = fd_cloexec(terminal->ptx, true); if (ret < 0) { SYSERROR("Failed to set FD_CLOEXEC flag on terminal ptx"); goto err; } ret = fd_cloexec(terminal->pty, true); if (ret < 0) { SYSERROR("Failed to set FD_CLOEXEC flag on terminal pty"); goto err; } ret = lxc_terminal_peer_default(terminal); if (ret < 0) { ERROR("Failed to allocate proxy terminal"); goto err; } return 0; err: lxc_terminal_delete(terminal); return -ENODEV; } int lxc_devpts_terminal(int devpts_fd, int *ret_ptx, int *ret_pty, int *ret_pty_nr, bool require_tiocgptpeer) { __do_close int fd_devpts = -EBADF, fd_ptx = -EBADF, fd_opath_pty = -EBADF, fd_pty = -EBADF; int pty_nr = -1; int ret; /* * When we aren't told what devpts instance to allocate from we assume * it is the one in the caller's mount namespace. * This poses a slight complication, a lot of distros will change * permissions on /dev/ptmx so it can be opened by unprivileged users * but will not change permissions on /dev/pts/ptmx itself. In * addition, /dev/ptmx can either be a symlink, a bind-mount, or a * separate device node. So we need to allow for fairly lax lookup. */ if (devpts_fd < 0) fd_ptx = open_at(-EBADF, "/dev/ptmx", PROTECT_OPEN_RW & ~O_NOFOLLOW, PROTECT_LOOKUP_ABSOLUTE_XDEV_SYMLINKS, 0); else fd_ptx = open_beneath(devpts_fd, "ptmx", O_RDWR | O_NOCTTY | O_CLOEXEC); if (fd_ptx < 0) { if (errno == ENOSPC) return systrace("Exceeded number of allocatable terminals"); return syswarn("Failed to open terminal multiplexer device"); } if (devpts_fd < 0) { fd_devpts = open_at(-EBADF, "/dev/pts", PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (fd_devpts < 0) return syswarn("Failed to open devpts instance"); if (!same_device(fd_devpts, "ptmx", fd_ptx, "")) return syswarn("The acquired ptmx devices don't match"); devpts_fd = fd_devpts; } ret = unlockpt(fd_ptx); if (ret < 0) return syswarn_set(-ENODEV, "Failed to unlock multiplexer device device"); fd_pty = ioctl(fd_ptx, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC); if (fd_pty < 0) { switch (errno) { case ENOTTY: SYSTRACE("Pure fd-based terminal allocation not possible"); break; case ENOSPC: SYSTRACE("Exceeded number of allocatable terminals"); break; default: SYSWARN("Failed to allocate new pty device"); return -errno; } /* The caller tells us that they trust the devpts instance. */ if (require_tiocgptpeer) return ret_errno(ENODEV); } ret = ioctl(fd_ptx, TIOCGPTN, &pty_nr); if (ret) return syswarn_set(-ENODEV, "Failed to retrieve name of terminal pty"); if (fd_pty < 0) { /* * If we end up it means that TIOCGPTPEER isn't supported but * the caller told us they trust the devpts instance so we use * the pty nr to open the pty side. */ fd_pty = open_at(devpts_fd, fdstr(pty_nr), PROTECT_OPEN_RW, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (fd_pty < 0) return syswarn_set(-ENODEV, "Failed to open terminal pty fd by path %d/%d", devpts_fd, pty_nr); } else { fd_opath_pty = open_at(devpts_fd, fdstr(pty_nr), PROTECT_OPATH_FILE, PROTECT_LOOKUP_ABSOLUTE_XDEV, 0); if (fd_opath_pty < 0) return syswarn_set(-ENODEV, "Failed to open terminal pty fd by path %d/%d", devpts_fd, pty_nr); if (!same_file_lax(fd_pty, fd_opath_pty)) return syswarn_set(-ENODEV, "Terminal file descriptor changed"); } *ret_ptx = move_fd(fd_ptx); *ret_pty = move_fd(fd_pty); *ret_pty_nr = pty_nr; return 0; } int lxc_terminal_parent(struct lxc_conf *conf) { struct lxc_terminal *console = &conf->console; int ret; if (!wants_console(&conf->console)) return 0; /* Allocate console from the container's devpts. */ if (conf->pty_max > 1) return 0; /* Allocate console for the container from the host's devpts. */ ret = lxc_devpts_terminal(-EBADF, &console->ptx, &console->pty, &console->pty_nr, false); if (ret < 0) return syserror("Failed to allocate console"); ret = strnprintf(console->name, sizeof(console->name), "/dev/pts/%d", console->pty_nr); if (ret < 0) return syserror("Failed to create console path"); return lxc_terminal_map_ids(conf, &conf->console); } static int lxc_terminal_create_native(const char *name, const char *lxcpath, struct lxc_terminal *terminal) { __do_close int devpts_fd = -EBADF; int ret; devpts_fd = lxc_cmd_get_devpts_fd(name, lxcpath); if (devpts_fd < 0) return sysinfo("Failed to receive devpts fd"); ret = lxc_devpts_terminal(devpts_fd, &terminal->ptx, &terminal->pty, &terminal->pty_nr, true); if (ret < 0) return ret; ret = strnprintf(terminal->name, sizeof(terminal->name), "/dev/pts/%d", terminal->pty_nr); if (ret < 0) return syserror("Failed to create path"); ret = lxc_terminal_peer_default(terminal); if (ret < 0) { lxc_terminal_delete(terminal); return syswarn_set(-ENODEV, "Failed to allocate proxy terminal"); } return 0; } int lxc_terminal_create(const char *name, const char *lxcpath, struct lxc_conf *conf, struct lxc_terminal *terminal) { if (!lxc_terminal_create_native(name, lxcpath, terminal)) return 0; return lxc_terminal_create_foreign(conf, terminal); } int lxc_terminal_setup(struct lxc_conf *conf) { int ret; struct lxc_terminal *terminal = &conf->console; if (terminal->path && strequal(terminal->path, "none")) return log_info(0, "No terminal requested"); ret = lxc_terminal_peer_default(terminal); if (ret < 0) goto err; ret = lxc_terminal_create_log_file(terminal); if (ret < 0) goto err; ret = lxc_terminal_create_ringbuf(terminal); if (ret < 0) goto err; return 0; err: lxc_terminal_delete(terminal); return -ENODEV; } static bool __terminal_dup2(int duplicate, int original) { int ret; if (!isatty(original)) return true; ret = dup2(duplicate, original); if (ret < 0) { SYSERROR("Failed to dup2(%d, %d)", duplicate, original); return false; } return true; } int lxc_terminal_set_stdfds(int fd) { int i; if (fd < 0) return 0; for (i = 0; i < 3; i++) if (!__terminal_dup2(fd, (int[]){STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO}[i])) return -1; return 0; } int lxc_terminal_stdin_cb(int fd, uint32_t events, void *cbdata, struct lxc_async_descr *descr) { int ret; char c; struct lxc_terminal_state *ts = cbdata; if (fd != ts->stdinfd) return LXC_MAINLOOP_CLOSE; ret = lxc_read_nointr(ts->stdinfd, &c, 1); if (ret <= 0) return LXC_MAINLOOP_CLOSE; if (ts->escape >= 1) { /* we want to exit the terminal with Ctrl+a q */ if (c == ts->escape && !ts->saw_escape) { ts->saw_escape = 1; return LXC_MAINLOOP_CONTINUE; } if (c == 'q' && ts->saw_escape) return LXC_MAINLOOP_CLOSE; ts->saw_escape = 0; } ret = lxc_write_nointr(ts->ptxfd, &c, 1); if (ret <= 0) return LXC_MAINLOOP_CLOSE; return LXC_MAINLOOP_CONTINUE; } int lxc_terminal_ptx_cb(int fd, uint32_t events, void *cbdata, struct lxc_async_descr *descr) { int r, w; char buf[LXC_TERMINAL_BUFFER_SIZE]; struct lxc_terminal_state *ts = cbdata; if (fd != ts->ptxfd) return LXC_MAINLOOP_CLOSE; r = lxc_read_nointr(fd, buf, sizeof(buf)); if (r <= 0) return LXC_MAINLOOP_CLOSE; w = lxc_write_nointr(ts->stdoutfd, buf, r); if (w <= 0 || w != r) return LXC_MAINLOOP_CLOSE; return LXC_MAINLOOP_CONTINUE; } int lxc_terminal_getfd(struct lxc_container *c, int *ttynum, int *ptxfd) { return lxc_cmd_get_tty_fd(c->name, ttynum, ptxfd, c->config_path); } int lxc_console(struct lxc_container *c, int ttynum, int stdinfd, int stdoutfd, int stderrfd, int escape) { int ptxfd, ret, ttyfd; struct lxc_async_descr descr; struct termios oldtios; struct lxc_terminal_state *ts; struct lxc_terminal terminal = { .tty_state = NULL, }; int istty = 0; ttyfd = lxc_cmd_get_tty_fd(c->name, &ttynum, &ptxfd, c->config_path); if (ttyfd < 0) return -1; ret = setsid(); if (ret < 0) TRACE("Process is already group leader"); ts = lxc_terminal_signal_init(stdinfd, ptxfd); if (!ts) { ret = -1; goto close_fds; } terminal.tty_state = ts; ts->escape = escape; ts->stdoutfd = stdoutfd; istty = isatty(stdinfd); if (istty) { lxc_terminal_winsz(stdinfd, ptxfd); lxc_terminal_winsz(ts->stdinfd, ts->ptxfd); } else { INFO("File descriptor %d does not refer to a terminal", stdinfd); } ret = lxc_mainloop_open(&descr); if (ret) { ERROR("Failed to create mainloop"); goto sigwinch_fini; } if (ts->sigfd != -1) { ret = lxc_mainloop_add_handler(&descr, ts->sigfd, lxc_terminal_signalfd_cb, default_cleanup_handler, ts, "lxc_terminal_signalfd_cb"); if (ret < 0) { ERROR("Failed to add signal handler to mainloop"); goto close_mainloop; } } ret = lxc_mainloop_add_handler(&descr, ts->stdinfd, lxc_terminal_stdin_cb, default_cleanup_handler, ts, "lxc_terminal_stdin_cb"); if (ret < 0) { ERROR("Failed to add stdin handler"); goto close_mainloop; } ret = lxc_mainloop_add_handler(&descr, ts->ptxfd, lxc_terminal_ptx_cb, default_cleanup_handler, ts, "lxc_terminal_ptx_cb"); if (ret < 0) { ERROR("Failed to add ptx handler"); goto close_mainloop; } if (ts->escape >= 1) { fprintf(stderr, "\n" "Connected to tty %1$d\n" "Type to exit the console, " " to enter Ctrl+%2$c itself\n", ttynum, 'a' + escape - 1); } if (istty) { ret = lxc_setup_tios(stdinfd, &oldtios); if (ret < 0) goto close_mainloop; } ret = lxc_mainloop(&descr, -1); if (ret < 0) { ERROR("The mainloop returned an error"); goto restore_tios; } ret = 0; restore_tios: if (istty) { istty = tcsetattr(stdinfd, TCSAFLUSH, &oldtios); if (istty < 0) SYSWARN("Failed to restore terminal properties"); } close_mainloop: lxc_mainloop_close(&descr); sigwinch_fini: lxc_terminal_signal_fini(&terminal); close_fds: close(ptxfd); close(ttyfd); return ret; } int lxc_make_controlling_terminal(int fd) { int ret; setsid(); ret = ioctl(fd, TIOCSCTTY, (char *)NULL); if (ret < 0) return -1; return 0; } int lxc_terminal_prepare_login(int fd) { int ret; ret = lxc_make_controlling_terminal(fd); if (ret < 0) return -1; ret = lxc_terminal_set_stdfds(fd); if (ret < 0) return -1; if (fd > STDERR_FILENO) close(fd); return 0; } void lxc_terminal_info_init(struct lxc_terminal_info *terminal) { terminal->name[0] = '\0'; terminal->ptx = -EBADF; terminal->pty = -EBADF; terminal->busy = -1; } void lxc_terminal_init(struct lxc_terminal *terminal) { memset(terminal, 0, sizeof(*terminal)); terminal->pty_nr = -1; terminal->pty = -EBADF; terminal->ptx = -EBADF; terminal->peer = -EBADF; terminal->log_fd = -EBADF; lxc_terminal_info_init(&terminal->proxy); } void lxc_terminal_conf_free(struct lxc_terminal *terminal) { free(terminal->log_path); free(terminal->path); if (terminal->buffer_size > 0 && terminal->ringbuf.addr) lxc_ringbuf_release(&terminal->ringbuf); lxc_terminal_signal_fini(terminal); } lxc-4.0.12/src/lxc/file_utils.c0000644061062106075000000003471214176403775013222 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include "file_utils.h" #include "macro.h" #include "memory_utils.h" #include "string_utils.h" #include "syscall_wrappers.h" #include "utils.h" int lxc_open_dirfd(const char *dir) { return open_at(-EBADF, dir, PROTECT_OPATH_DIRECTORY, PROTECT_LOOKUP_ABSOLUTE & ~RESOLVE_NO_XDEV, 0); } int lxc_readat(int dirfd, const char *filename, void *buf, size_t count) { __do_close int fd = -EBADF; ssize_t ret; fd = open_at(dirfd, filename, PROTECT_OPEN, PROTECT_LOOKUP_BENEATH, 0); if (fd < 0) return -errno; ret = lxc_read_nointr(fd, buf, count); if (ret < 0) return -errno; return ret; } int lxc_writeat(int dirfd, const char *filename, const void *buf, size_t count) { __do_close int fd = -EBADF; ssize_t ret; fd = open_at(dirfd, filename, PROTECT_OPEN_W_WITH_TRAILING_SYMLINKS, PROTECT_LOOKUP_BENEATH, 0); if (fd < 0) return -1; ret = lxc_write_nointr(fd, buf, count); if (ret < 0 || (size_t)ret != count) return -1; return 0; } int lxc_write_openat(const char *dir, const char *filename, const void *buf, size_t count) { __do_close int dirfd = -EBADF; dirfd = open(dir, PROTECT_OPEN); if (dirfd < 0) return -errno; return lxc_writeat(dirfd, filename, buf, count); } int lxc_write_to_file(const char *filename, const void *buf, size_t count, bool add_newline, mode_t mode) { __do_close int fd = -EBADF; ssize_t ret; fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, mode); if (fd < 0) return -1; ret = lxc_write_nointr(fd, buf, count); if (ret < 0) return -1; if ((size_t)ret != count) return -1; if (add_newline) { ret = lxc_write_nointr(fd, "\n", 1); if (ret != 1) return -1; } return 0; } int lxc_read_from_file(const char *filename, void *buf, size_t count) { __do_close int fd = -EBADF; ssize_t ret; fd = open(filename, O_RDONLY | O_CLOEXEC); if (fd < 0) return -1; if (!buf || !count) { char buf2[100]; size_t count2 = 0; while ((ret = lxc_read_nointr(fd, buf2, 100)) > 0) count2 += ret; if (ret >= 0) ret = count2; } else { memset(buf, 0, count); ret = lxc_read_nointr(fd, buf, count); } return ret; } ssize_t lxc_read_try_buf_at(int dfd, const char *path, void *buf, size_t count) { __do_close int fd = -EBADF; ssize_t ret; fd = open_at(dfd, path, PROTECT_OPEN, PROTECT_LOOKUP_BENEATH, 0); if (fd < 0) return -errno; if (!buf || !count) { char buf2[100]; size_t count2 = 0; while ((ret = lxc_read_nointr(fd, buf2, 100)) > 0) count2 += ret; if (ret >= 0) ret = count2; } else { memset(buf, 0, count); ret = lxc_read_nointr(fd, buf, count); } return ret; } ssize_t lxc_write_nointr(int fd, const void *buf, size_t count) { ssize_t ret; do { ret = write(fd, buf, count); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_pwrite_nointr(int fd, const void *buf, size_t count, off_t offset) { ssize_t ret; do { ret = pwrite(fd, buf, count, offset); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_send_nointr(int sockfd, void *buf, size_t len, int flags) { ssize_t ret; do { ret = send(sockfd, buf, len, flags); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_read_nointr(int fd, void *buf, size_t count) { ssize_t ret; do { ret = read(fd, buf, count); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_recv_nointr(int sockfd, void *buf, size_t len, int flags) { ssize_t ret; do { ret = recv(sockfd, buf, len, flags); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_recvmsg_nointr_iov(int sockfd, struct iovec *iov, size_t iovlen, int flags) { ssize_t ret; struct msghdr msg = { .msg_iov = iov, .msg_iovlen = iovlen, }; do { ret = recvmsg(sockfd, &msg, flags); } while (ret < 0 && errno == EINTR); return ret; } ssize_t lxc_read_nointr_expect(int fd, void *buf, size_t count, const void *expected_buf) { ssize_t ret; ret = lxc_read_nointr(fd, buf, count); if (ret < 0) return ret; if ((size_t)ret != count) return -1; if (expected_buf && memcmp(buf, expected_buf, count) != 0) return ret_set_errno(-1, EINVAL); return 0; } ssize_t lxc_read_file_expect(const char *path, void *buf, size_t count, const void *expected_buf) { __do_close int fd = -EBADF; fd = open(path, O_RDONLY | O_CLOEXEC); if (fd < 0) return -1; return lxc_read_nointr_expect(fd, buf, count, expected_buf); } bool file_exists(const char *f) { struct stat statbuf; return stat(f, &statbuf) == 0; } int print_to_file(const char *file, const char *content) { __do_fclose FILE *f = NULL; int ret; size_t len; f = fopen(file, "we"); if (!f) return -1; len = strlen(content); ret = fprintf(f, "%s", content); if (ret < 0 || (size_t)ret != len) ret = -1; else ret = 0; return ret; } int is_dir(const char *path) { int ret; struct stat statbuf; ret = stat(path, &statbuf); if (ret == 0 && S_ISDIR(statbuf.st_mode)) return 1; return 0; } /* * Return the number of lines in file @fn, or -1 on error */ int lxc_count_file_lines(const char *fn) { __do_free char *line = NULL; __do_fclose FILE *f = NULL; size_t sz = 0; int n = 0; f = fopen_cloexec(fn, "r"); if (!f) return -1; while (getline(&line, &sz, f) != -1) n++; return n; } int lxc_make_tmpfile(char *template, bool rm) { __do_close int fd = -EBADF; int ret; mode_t msk; msk = umask(0022); fd = mkstemp(template); umask(msk); if (fd < 0) return -1; if (lxc_set_cloexec(fd)) return -1; if (!rm) return move_fd(fd); ret = unlink(template); if (ret < 0) return -1; return move_fd(fd); } bool is_fs_type(const struct statfs *fs, fs_type_magic magic_val) { return (fs->f_type == (fs_type_magic)magic_val); } bool has_fs_type(const char *path, fs_type_magic magic_val) { int ret; struct statfs sb; ret = statfs(path, &sb); if (ret < 0) return false; return is_fs_type(&sb, magic_val); } bool fhas_fs_type(int fd, fs_type_magic magic_val) { int ret; struct statfs sb; ret = fstatfs(fd, &sb); if (ret < 0) return false; return is_fs_type(&sb, magic_val); } FILE *fopen_cloexec(const char *path, const char *mode) { __do_close int fd = -EBADF; int open_mode = 0, step = 0; FILE *f; if (strnequal(mode, "r+", 2)) { open_mode = O_RDWR; step = 2; } else if (strnequal(mode, "r", 1)) { open_mode = O_RDONLY; step = 1; } else if (strnequal(mode, "w+", 2)) { open_mode = O_RDWR | O_TRUNC | O_CREAT; step = 2; } else if (strnequal(mode, "w", 1)) { open_mode = O_WRONLY | O_TRUNC | O_CREAT; step = 1; } else if (strnequal(mode, "a+", 2)) { open_mode = O_RDWR | O_CREAT | O_APPEND; step = 2; } else if (strnequal(mode, "a", 1)) { open_mode = O_WRONLY | O_CREAT | O_APPEND; step = 1; } for (; mode[step]; step++) if (mode[step] == 'x') open_mode |= O_EXCL; fd = open(path, open_mode | O_CLOEXEC, 0660); if (fd < 0) return NULL; f = fdopen(fd, mode); if (f) move_fd(fd); return f; } ssize_t lxc_sendfile_nointr(int out_fd, int in_fd, off_t *offset, size_t count) { ssize_t ret; do { ret = sendfile(out_fd, in_fd, offset, count); } while (ret < 0 && errno == EINTR); return ret; } ssize_t __fd_to_fd(int from, int to) { ssize_t total_bytes = 0; for (;;) { uint8_t buf[PATH_MAX]; uint8_t *p = buf; ssize_t bytes_to_write; ssize_t bytes_read; bytes_read = lxc_read_nointr(from, buf, sizeof buf); if (bytes_read < 0) return -1; if (bytes_read == 0) break; bytes_to_write = (size_t)bytes_read; total_bytes += bytes_read; do { ssize_t bytes_written; bytes_written = lxc_write_nointr(to, p, bytes_to_write); if (bytes_written < 0) return -1; bytes_to_write -= bytes_written; p += bytes_written; } while (bytes_to_write > 0); } return total_bytes; } int fd_to_buf(int fd, char **buf, size_t *length) { __do_free char *copy = NULL; if (!length) return 0; *length = 0; for (;;) { ssize_t bytes_read; char chunk[4096]; char *old = copy; bytes_read = lxc_read_nointr(fd, chunk, sizeof(chunk)); if (bytes_read < 0) return -errno; if (!bytes_read) break; copy = realloc(old, (*length + bytes_read) * sizeof(*old)); if (!copy) return ret_errno(ENOMEM); memcpy(copy + *length, chunk, bytes_read); *length += bytes_read; } *buf = move_ptr(copy); return 0; } char *file_to_buf(const char *path, size_t *length) { __do_close int fd = -EBADF; char *buf = NULL; if (!length) return NULL; fd = open(path, O_RDONLY | O_CLOEXEC); if (fd < 0) return NULL; if (fd_to_buf(fd, &buf, length) < 0) return NULL; return buf; } FILE *fopen_cached(const char *path, const char *mode, void **caller_freed_buffer) { #ifdef HAVE_FMEMOPEN __do_free char *buf = NULL; size_t len = 0; FILE *f; buf = file_to_buf(path, &len); if (!buf) return NULL; f = fmemopen(buf, len, mode); if (!f) return NULL; *caller_freed_buffer = move_ptr(buf); return f; #else return fopen(path, mode); #endif } FILE *fdopen_cached(int fd, const char *mode, void **caller_freed_buffer) { FILE *f; #ifdef HAVE_FMEMOPEN __do_free char *buf = NULL; size_t len = 0; if (fd_to_buf(fd, &buf, &len) < 0) return NULL; f = fmemopen(buf, len, mode); if (!f) return NULL; *caller_freed_buffer = move_ptr(buf); #else __do_close int dupfd = -EBADF; dupfd = dup(fd); if (dupfd < 0) return NULL; f = fdopen(dupfd, "re"); if (!f) return NULL; /* Transfer ownership of fd. */ move_fd(dupfd); #endif return f; } int fd_cloexec(int fd, bool cloexec) { int oflags, nflags; oflags = fcntl(fd, F_GETFD, 0); if (oflags < 0) return -errno; if (cloexec) nflags = oflags | FD_CLOEXEC; else nflags = oflags & ~FD_CLOEXEC; if (nflags == oflags) return 0; if (fcntl(fd, F_SETFD, nflags) < 0) return -errno; return 0; } FILE *fdopen_at(int dfd, const char *path, const char *mode, unsigned int o_flags, unsigned int resolve_flags) { __do_close int fd = -EBADF; __do_fclose FILE *f = NULL; if (is_empty_string(path)) fd = dup_cloexec(dfd); else fd = open_at(dfd, path, o_flags, resolve_flags, 0); if (fd < 0) return NULL; f = fdopen(fd, "re"); if (!f) return NULL; /* Transfer ownership of fd. */ move_fd(fd); return move_ptr(f); } int timens_offset_write(clockid_t clk_id, int64_t s_offset, int64_t ns_offset) { __do_close int fd = -EBADF; ssize_t len, ret; char buf[INTTYPE_TO_STRLEN(int) + STRLITERALLEN(" ") + INTTYPE_TO_STRLEN(int64_t) + STRLITERALLEN(" ") + INTTYPE_TO_STRLEN(int64_t) + 1]; if (clk_id == CLOCK_MONOTONIC_COARSE || clk_id == CLOCK_MONOTONIC_RAW) clk_id = CLOCK_MONOTONIC; fd = open("/proc/self/timens_offsets", O_WRONLY | O_CLOEXEC); if (fd < 0) return -errno; len = strnprintf(buf, sizeof(buf), "%d %" PRId64 " %" PRId64, clk_id, s_offset, ns_offset); if (len < 0) return ret_errno(EFBIG); ret = lxc_write_nointr(fd, buf, len); if (ret < 0 || ret != len) return -EIO; return 0; } bool exists_dir_at(int dir_fd, const char *path) { int ret; struct stat sb; ret = fstatat(dir_fd, path, &sb, 0); if (ret < 0) return false; ret = S_ISDIR(sb.st_mode); if (ret) errno = EEXIST; else errno = ENOTDIR; return ret; } bool exists_file_at(int dir_fd, const char *path) { int ret; struct stat sb; ret = fstatat(dir_fd, path, &sb, 0); if (ret == 0) errno = EEXIST; return ret == 0; } int open_at(int dfd, const char *path, unsigned int o_flags, unsigned int resolve_flags, mode_t mode) { __do_close int fd = -EBADF; struct lxc_open_how how = { .flags = o_flags, .mode = mode, .resolve = resolve_flags, }; fd = openat2(dfd, path, &how, sizeof(how)); if (fd >= 0) return move_fd(fd); if (errno != ENOSYS) return -errno; fd = openat(dfd, path, o_flags, mode); if (fd < 0) return -errno; return move_fd(fd); } int open_at_same(int fd_same, int dfd, const char *path, unsigned int o_flags, unsigned int resolve_flags, mode_t mode) { __do_close int fd = -EBADF; fd = open_at(dfd, path, o_flags, resolve_flags, mode); if (fd < 0) return -errno; if (!same_file_lax(fd_same, fd)) return ret_errno(EINVAL); return move_fd(fd); } int fd_make_nonblocking(int fd) { int flags; flags = fcntl(fd, F_GETFL); if (flags < 0) return -1; flags &= ~O_NONBLOCK; return fcntl(fd, F_SETFL, flags); } #define BATCH_SIZE 50 static void batch_realloc(char **mem, size_t oldlen, size_t newlen) { int newbatches = (newlen / BATCH_SIZE) + 1; int oldbatches = (oldlen / BATCH_SIZE) + 1; if (!*mem || newbatches > oldbatches) *mem = must_realloc(*mem, newbatches * BATCH_SIZE); } static void append_line(char **dest, size_t oldlen, char *new, size_t newlen) { size_t full = oldlen + newlen; batch_realloc(dest, oldlen, full + 1); memcpy(*dest + oldlen, new, newlen + 1); } /* Slurp in a whole file */ char *read_file_at(int dfd, const char *fnam, unsigned int o_flags, unsigned resolve_flags) { __do_close int fd = -EBADF; __do_free char *buf = NULL, *line = NULL; __do_fclose FILE *f = NULL; size_t len = 0, fulllen = 0; int linelen; fd = open_at(dfd, fnam, o_flags, resolve_flags, 0); if (fd < 0) return NULL; f = fdopen(fd, "re"); if (!f) return NULL; /* Transfer ownership to fdopen(). */ move_fd(fd); while ((linelen = getline(&line, &len, f)) != -1) { append_line(&buf, fulllen, line, linelen); fulllen += linelen; } return move_ptr(buf); } bool same_file_lax(int fda, int fdb) { struct stat st_fda, st_fdb; if (fda == fdb) return true; if (fstat(fda, &st_fda) < 0) return false; if (fstat(fdb, &st_fdb) < 0) return false; errno = EINVAL; if ((st_fda.st_mode & S_IFMT) != (st_fdb.st_mode & S_IFMT)) return false; errno = EINVAL; return (st_fda.st_dev == st_fdb.st_dev) && (st_fda.st_ino == st_fdb.st_ino); } bool same_device(int fda, const char *patha, int fdb, const char *pathb) { int ret; mode_t modea, modeb; struct stat st_fda, st_fdb; if (fda == fdb) return true; if (is_empty_string(patha)) ret = fstat(fda, &st_fda); else ret = fstatat(fda, patha, &st_fda, 0); if (ret) return false; if (is_empty_string(pathb)) ret = fstat(fdb, &st_fdb); else ret = fstatat(fdb, pathb, &st_fdb, 0); if (ret) return false; errno = EINVAL; modea = (st_fda.st_mode & S_IFMT); modeb = (st_fdb.st_mode & S_IFMT); if (modea != modeb || !IN_SET(modea, S_IFCHR, S_IFBLK)) return false; return (st_fda.st_rdev == st_fdb.st_rdev); } lxc-4.0.12/src/lxc/start.h0000644061062106075000000001266214176403775012225 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_START_H #define __LXC_START_H #include "config.h" #include #include #include #include #include #include #include #include "compiler.h" #include "conf.h" #include "macro.h" #include "namespace.h" #include "state.h" struct lxc_handler { /* Record the clone for namespaces flags that the container requested. * * @ns_clone_flags * - All clone flags that were requested. * * @ns_on_clone_flags * - The clone flags for namespaces to actually use when calling * lxc_clone(): After the container has started ns_on_clone_flags will * list the clone flags that were unshare()ed rather then clone()ed * because of ordering requirements (e.g. e.g. CLONE_NEWNET and * CLONE_NEWUSER) or implementation details. * * @ns_unshare_flags * - Flags for namespaces that were unshared, not cloned. * * @clone_flags * - ns_on_clone flags | other flags used to create container. */ struct /* lxc_ns */ { unsigned int ns_clone_flags; unsigned int ns_on_clone_flags; unsigned int ns_unshare_flags; __aligned_u64 clone_flags; }; /* Signal file descriptor. */ int sigfd; /* List of file descriptors referring to the namespaces of the * container. Note that these are not necessarily identical to * the "clone_flags" handler field in case namespace inheritance is * requested. */ int nsfd[LXC_NS_MAX]; /* Abstract unix domain SOCK_DGRAM socketpair to pass arbitrary data * between child and parent. */ int data_sock[2]; /* The socketpair() fds used to wait on successful daemonized startup. */ int state_socket_pair[2]; /* Socketpair to synchronize processes during container creation. */ int sync_sock[2]; /* Pointer to the name of the container. Do not free! */ const char *name; /* Pointer to the path the container. Do not free! */ const char *lxcpath; /* Whether the container's startup process euid is 0. */ bool am_root; /* Indicates whether should we close std{in,out,err} on start. */ bool daemonize; /* The child's pid. */ pid_t pid; /* The child's pidfd. */ int pidfd; /* The grandfather's pid when double-forking. */ pid_t transient_pid; /* The monitor's pid. */ pid_t monitor_pid; int monitor_status_fd; /* Whether the child has already exited. */ bool init_died; /* The signal mask prior to setting up the signal file descriptor. */ sigset_t oldmask; /* The container's in-memory configuration. */ struct lxc_conf *conf; /* A set of operations to be performed at various stages of the * container's life. */ struct lxc_operations *ops; /* This holds the cgroup information. Note that the data here is * specific to the cgroup driver used. */ void *cgroup_data; /* Data to be passed to handler ops. */ void *data; /* Current state of the container. */ lxc_state_t state; /* The exit status of the container; not defined unless ->init_died == * true. */ int exit_status; struct cgroup_ops *cgroup_ops; /* Internal fds that always need to stay open. */ int keep_fds[3]; /* Static memory, don't free. */ struct lsm_ops *lsm_ops; /* The namespace idx is guaranteed to match the stashed namespace path. */ char nsfd_paths[LXC_NS_MAX + 1][LXC_EXPOSE_NAMESPACE_LEN]; /* The namesace idx is _not_ guaranteed to match the stashed namespace path. */ lxc_namespace_t hook_argc; char *hook_argv[LXC_NS_MAX + 1]; }; struct execute_args { char *const *argv; int quiet; }; struct lxc_operations { int (*start)(struct lxc_handler *, void *); int (*post_start)(struct lxc_handler *, void *); }; __hidden extern int lxc_poll(const char *name, struct lxc_handler *handler); __hidden extern int lxc_set_state(const char *name, struct lxc_handler *handler, lxc_state_t state); __hidden extern int lxc_serve_state_clients(const char *name, struct lxc_handler *handler, lxc_state_t state); __hidden extern void lxc_abort(struct lxc_handler *handler); __hidden extern struct lxc_handler *lxc_init_handler(struct lxc_handler *old, const char *name, struct lxc_conf *conf, const char *lxcpath, bool daemonize); __hidden extern void lxc_put_handler(struct lxc_handler *handler); __hidden extern int lxc_init(const char *name, struct lxc_handler *handler); __hidden extern void lxc_end(struct lxc_handler *handler); /* lxc_check_inherited: Check for any open file descriptors and close them if * requested. * @param[in] conf The container's configuration. * @param[in] closeall Whether we should close all open file descriptors. * @param[in] fds_to_ignore Array of file descriptors to ignore. * @param[in] len_fds Length of fds_to_ignore array. */ __hidden extern int lxc_check_inherited(struct lxc_conf *conf, bool closeall, int *fds_to_ignore, size_t len_fds); static inline int inherit_fds(struct lxc_handler *handler, bool closeall) { return lxc_check_inherited(handler->conf, closeall, handler->keep_fds, ARRAY_SIZE(handler->keep_fds)); } __hidden extern int __lxc_start(struct lxc_handler *, struct lxc_operations *, void *, const char *, bool, int *); __hidden extern int resolve_clone_flags(struct lxc_handler *handler); __hidden extern void lxc_expose_namespace_environment(const struct lxc_handler *handler); static inline bool container_uses_namespace(const struct lxc_handler *handler, unsigned int ns_flag) { return (handler->ns_clone_flags & ns_flag); } #endif lxc-4.0.12/src/lxc/Makefile.am0000644061062106075000000022043014176403775012745 00000000000000# SPDX-License-Identifier: LGPL-2.1+ pkginclude_HEADERS = attach_options.h \ lxccontainer.h \ version.h noinst_HEADERS = api_extensions.h \ attach.h \ ../include/bpf.h \ ../include/bpf_common.h \ caps.h \ cgroups/cgroup.h \ cgroups/cgroup_utils.h \ cgroups/cgroup2_devices.h \ compiler.h \ conf.h \ confile.h \ confile_utils.h \ criu.h \ error.h \ error_utils.h \ file_utils.h \ hlist.h \ ../include/strchrnul.h \ ../include/strlcat.h \ ../include/strlcpy.h \ ../include/netns_ifaddrs.h \ initutils.h \ list.h \ log.h \ lxc.h \ lxclock.h \ macro.h \ memory_utils.h \ monitor.h \ mount_utils.h \ namespace.h \ process_utils.h \ rexec.h \ start.h \ state.h \ storage/btrfs.h \ storage/dir.h \ storage/loop.h \ storage/lvm.h \ storage/nbd.h \ storage/overlay.h \ storage/rbd.h \ storage/rsync.h \ storage/storage.h \ storage/storage_utils.h \ storage/zfs.h \ string_utils.h \ syscall_numbers.h \ syscall_wrappers.h \ terminal.h \ ../tests/lxctest.h \ tools/arguments.h \ utils.h \ uuid.h if IS_BIONIC noinst_HEADERS += ../include/fexecve.h \ ../include/lxcmntent.h endif if !HAVE_OPENPTY noinst_HEADERS += ../include/openpty.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 noinst_HEADERS += ../include/prlimit.h endif endif if !HAVE_GETLINE if HAVE_FGETLN noinst_HEADERS += ../include/getline.h endif endif if !HAVE_GETSUBOPT noinst_HEADERS += tools/include/getsubopt.h endif if !HAVE_GETGRGID_R noinst_HEADERS += ../include/getgrgid_r.h endif sodir=$(libdir) LSM_SOURCES = lsm/lsm.c \ lsm/lsm.h \ lsm/nop.c if ENABLE_APPARMOR LSM_SOURCES += lsm/apparmor.c endif if ENABLE_SELINUX LSM_SOURCES += lsm/selinux.c endif lib_LTLIBRARIES = liblxc.la liblxc_la_SOURCES = af_unix.c af_unix.h \ api_extensions.h \ attach.c attach.h \ ../include/bpf.h \ ../include/bpf_common.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ compiler.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ criu.c criu.h \ error.c error.h \ execute.c \ error_utils.h \ freezer.c \ file_utils.c file_utils.h \ hlist.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ list.h \ log.c log.h \ lxc.h \ lxccontainer.c lxccontainer.h \ lxclock.c lxclock.h \ lxcseccomp.h \ macro.h \ memory_utils.h \ mainloop.c mainloop.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ monitor.c monitor.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ rtnl.c rtnl.h \ state.c state.h \ start.c start.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ syscall_numbers.h \ syscall_wrappers.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ version.h \ $(LSM_SOURCES) if IS_BIONIC liblxc_la_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_OPENPTY liblxc_la_SOURCES += ../include/openpty.c ../include/openpty.h endif if !HAVE_GETGRGID_R liblxc_la_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_GETLINE if HAVE_FGETLN liblxc_la_SOURCES += ../include/getline.c ../include/getline.h endif endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 liblxc_la_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif if ENABLE_SECCOMP liblxc_la_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRLCPY liblxc_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT liblxc_la_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_STRCHRNUL liblxc_la_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if ENFORCE_MEMFD_REXEC liblxc_la_SOURCES += rexec.c rexec.h endif AM_CFLAGS += -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ -DLXCPATH=\"$(LXCPATH)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \ -DLXCINITDIR=\"$(LXCINITDIR)\" \ -DLIBEXECDIR=\"$(LIBEXECDIR)\" \ -DLXCTEMPLATEDIR=\"$(LXCTEMPLATEDIR)\" \ -DLXCTEMPLATECONFIG=\"$(LXCTEMPLATECONFIG)\" \ -DLOGPATH=\"$(LOGPATH)\" \ -DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \ -DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \ -DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \ -DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\" \ -DRUNTIME_PATH=\"$(RUNTIME_PATH)\" \ -DSBINDIR=\"$(SBINDIR)\" \ -DAPPARMOR_CACHE_DIR=\"$(APPARMOR_CACHE_DIR)\" \ -I $(top_srcdir)/src \ -I $(top_srcdir)/src/include \ -I $(top_srcdir)/src/lxc \ -I $(top_srcdir)/src/lxc/storage \ -I $(top_srcdir)/src/lxc/cgroups if ENABLE_APPARMOR AM_CFLAGS += -DHAVE_APPARMOR endif if ENABLE_OPENSSL AM_CFLAGS += -DHAVE_OPENSSL endif if ENABLE_SECCOMP AM_CFLAGS += -DHAVE_SECCOMP \ $(SECCOMP_CFLAGS) endif if ENABLE_SELINUX AM_CFLAGS += -DHAVE_SELINUX endif if ENABLE_DLOG AM_CFLAGS += -DHAVE_DLOG \ $(DLOG_CFLAGS) endif if USE_CONFIGPATH_LOGS AM_CFLAGS += -DUSE_CONFIGPATH_LOGS endif # build the shared library liblxc_la_CFLAGS = -fPIC \ -DPIC \ $(AM_CFLAGS) \ $(LIBLXC_SANITIZER) \ -pthread liblxc_la_LDFLAGS = -pthread \ -Wl,-soname,liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) \ -version-info @LXC_ABI_MAJOR@ if ENABLE_NO_UNDEFINED liblxc_la_LDFLAGS += -Wl,-no-undefined endif liblxc_la_LIBADD = $(CAP_LIBS) \ $(OPENSSL_LIBS) \ $(SELINUX_LIBS) \ $(SECCOMP_LIBS) \ $(DLOG_LIBS) \ $(LIBURING_LIBS) bin_SCRIPTS= if ENABLE_COMMANDS bin_SCRIPTS += cmd/lxc-checkconfig \ cmd/lxc-update-config endif if ENABLE_TOOLS bin_PROGRAMS = lxc-attach \ lxc-autostart \ lxc-cgroup \ lxc-checkpoint \ lxc-copy \ lxc-config \ lxc-console \ lxc-create \ lxc-destroy \ lxc-device \ lxc-execute \ lxc-freeze \ lxc-info \ lxc-ls \ lxc-monitor \ lxc-snapshot \ lxc-start \ lxc-stop \ lxc-top \ lxc-unfreeze \ lxc-unshare \ lxc-wait endif if ENABLE_COMMANDS if ENABLE_TOOLS bin_PROGRAMS += lxc-usernsexec else bin_PROGRAMS = lxc-usernsexec endif sbin_PROGRAMS = init.lxc pkglibexec_PROGRAMS = lxc-monitord \ lxc-user-nic endif AM_LDFLAGS += -Wl,-E if ENABLE_RPATH AM_LDFLAGS += -Wl,-rpath -Wl,$(libdir) endif LDADD = liblxc.la \ @CAP_LIBS@ \ @OPENSSL_LIBS@ \ @SECCOMP_LIBS@ \ @SELINUX_LIBS@ \ @DLOG_LIBS@ \ @LIBURING_LIBS@ if ENABLE_TOOLS lxc_attach_SOURCES = tools/lxc_attach.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_attach_SOURCES += $(liblxc_la_SOURCES) lxc_attach_LDFLAGS = -all-static -pthread else lxc_attach_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ rexec.c rexec.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_attach_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_attach_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_attach_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_attach_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_attach_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_attach_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_attach_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_attach_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_autostart_SOURCES = tools/lxc_autostart.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_autostart_SOURCES += $(liblxc_la_SOURCES) lxc_autostart_LDFLAGS = -all-static -pthread else lxc_autostart_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_autostart_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_autostart_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_autostart_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_autostart_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_autostart_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_autostart_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_autostart_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_autostart_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_cgroup_SOURCES += $(liblxc_la_SOURCES) lxc_cgroup_LDFLAGS = -all-static -pthread else lxc_cgroup_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_cgroup_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_cgroup_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_cgroup_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_cgroup_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_cgroup_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_cgroup_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_cgroup_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_cgroup_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_config_SOURCES = tools/lxc_config.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_config_SOURCES += $(liblxc_la_SOURCES) lxc_config_LDFLAGS = -all-static -pthread else lxc_config_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_config_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_config_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_config_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_config_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_config_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_config_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_config_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_config_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_console_SOURCES = tools/lxc_console.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_console_SOURCES += $(liblxc_la_SOURCES) lxc_console_LDFLAGS = -all-static -pthread else lxc_console_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_console_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_console_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_console_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_console_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_console_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_console_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_console_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_console_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_destroy_SOURCES = tools/lxc_destroy.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_destroy_SOURCES += $(liblxc_la_SOURCES) lxc_destroy_LDFLAGS = -all-static -pthread else lxc_destroy_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_destroy_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_destroy_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_destroy_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_destroy_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_destroy_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_destroy_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_destroy_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_destroy_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_device_SOURCES = tools/lxc_device.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_device_SOURCES += $(liblxc_la_SOURCES) lxc_device_LDFLAGS = -all-static -pthread else lxc_device_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_device_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_device_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_device_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_device_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_device_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_device_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_device_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_device_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_execute_SOURCES = tools/lxc_execute.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_execute_SOURCES += $(liblxc_la_SOURCES) lxc_execute_LDFLAGS = -all-static -pthread else lxc_execute_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_execute_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_execute_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_execute_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_execute_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_execute_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_execute_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_execute_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_execute_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_freeze_SOURCES = tools/lxc_freeze.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_freeze_SOURCES += $(liblxc_la_SOURCES) lxc_freeze_LDFLAGS = -all-static -pthread else lxc_freeze_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_freeze_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_freeze_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_freeze_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_freeze_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_freeze_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_freeze_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_freeze_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_freeze_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_info_SOURCES = tools/lxc_info.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_info_SOURCES += $(liblxc_la_SOURCES) lxc_info_LDFLAGS = -all-static -pthread else lxc_info_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_info_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_info_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_info_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_info_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_info_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_info_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_info_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_info_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_monitor_SOURCES = tools/lxc_monitor.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_monitor_SOURCES += $(liblxc_la_SOURCES) lxc_monitor_LDFLAGS = -all-static -pthread else lxc_monitor_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ macro.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_monitor_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_monitor_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_monitor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_monitor_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_monitor_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_monitor_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_monitor_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_monitor_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_ls_SOURCES = tools/lxc_ls.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_ls_SOURCES += $(liblxc_la_SOURCES) lxc_ls_LDFLAGS = -all-static -pthread else lxc_ls_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ memory_utils.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_ls_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_ls_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_ls_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_ls_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_ls_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_ls_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_ls_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_ls_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_copy_SOURCES = tools/lxc_copy.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_copy_SOURCES += $(liblxc_la_SOURCES) lxc_copy_LDFLAGS = -all-static -pthread else lxc_copy_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_copy_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_copy_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_copy_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_copy_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_copy_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_copy_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_copy_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_copy_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_start_SOURCES = tools/lxc_start.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_start_SOURCES += $(liblxc_la_SOURCES) lxc_start_LDFLAGS = -all-static -pthread else lxc_start_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_start_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_start_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_start_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_start_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_start_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_start_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_start_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_start_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_stop_SOURCES = tools/lxc_stop.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_stop_SOURCES += $(liblxc_la_SOURCES) lxc_stop_LDFLAGS = -all-static -pthread else lxc_stop_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_stop_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_stop_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_stop_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_stop_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_stop_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_stop_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_stop_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_stop_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_top_SOURCES = tools/lxc_top.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_top_SOURCES += $(liblxc_la_SOURCES) lxc_top_LDFLAGS = -all-static -pthread else lxc_top_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_top_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_top_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_top_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_top_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_top_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_top_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_top_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_top_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_unfreeze_SOURCES += $(liblxc_la_SOURCES) lxc_unfreeze_LDFLAGS = -all-static -pthread else lxc_unfreeze_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_unfreeze_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_unfreeze_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_unfreeze_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_unfreeze_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_unfreeze_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_unfreeze_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_unfreeze_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_unfreeze_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_unshare_SOURCES = tools/lxc_unshare.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_unshare_SOURCES += $(liblxc_la_SOURCES) lxc_unshare_LDFLAGS = -all-static -pthread else lxc_unshare_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ syscall_numbers.h \ syscall_wrappers.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_unshare_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_unshare_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_unshare_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_unshare_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_unshare_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_unshare_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_unshare_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_unshare_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_wait_SOURCES = tools/lxc_wait.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_wait_SOURCES += $(liblxc_la_SOURCES) lxc_wait_LDFLAGS = -all-static -pthread else lxc_wait_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_wait_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_wait_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_wait_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_wait_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_wait_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_wait_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_wait_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_wait_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_create_SOURCES = tools/lxc_create.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_create_SOURCES += $(liblxc_la_SOURCES) lxc_create_LDFLAGS = -all-static -pthread else lxc_create_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_create_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_create_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_create_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_create_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_create_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_create_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_create_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_create_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_snapshot_SOURCES += $(liblxc_la_SOURCES) lxc_snapshot_LDFLAGS = -all-static -pthread else lxc_snapshot_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_snapshot_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_snapshot_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_snapshot_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_snapshot_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_snapshot_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_snapshot_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_snapshot_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_snapshot_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ tools/arguments.c tools/arguments.h if ENABLE_STATIC_BINARIES lxc_checkpoint_SOURCES += $(liblxc_la_SOURCES) lxc_checkpoint_LDFLAGS = -all-static -pthread else lxc_checkpoint_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_checkpoint_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_checkpoint_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_checkpoint_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_checkpoint_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_checkpoint_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_checkpoint_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_checkpoint_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_checkpoint_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif endif if ENABLE_COMMANDS # Binaries shipping with liblxc init_lxc_SOURCES = cmd/lxc_init.c \ af_unix.c af_unix.h \ caps.c caps.h \ error.c error.h \ file_utils.c file_utils.h \ initutils.c initutils.h \ log.c log.h \ macro.h \ memory_utils.h \ namespace.c namespace.h \ string_utils.c string_utils.h if !HAVE_STRLCPY init_lxc_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT init_lxc_SOURCES += ../include/strlcat.c ../include/strlcat.h endif init_lxc_LDFLAGS = -pthread lxc_monitord_SOURCES = cmd/lxc_monitord.c if ENABLE_STATIC_BINARIES lxc_monitord_SOURCES += $(liblxc_la_SOURCES) lxc_monitord_LDFLAGS = -all-static -pthread else lxc_monitord_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ syscall_numbers.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_monitord_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_monitord_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_monitord_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_monitord_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_monitord_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_monitord_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_monitord_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_monitord_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_user_nic_SOURCES = cmd/lxc_user_nic.c if ENABLE_STATIC_BINARIES lxc_user_nic_SOURCES += $(liblxc_la_SOURCES) lxc_user_nic_LDFLAGS = -all-static -pthread else lxc_user_nic_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ log.c log.h \ lxclock.c lxclock.h \ mainloop.c mainloop.h \ memory_utils.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ syscall_numbers.h \ syscall_wrappers.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_user_nic_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_user_nic_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_user_nic_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_user_nic_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_user_nic_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_user_nic_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_user_nic_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_user_nic_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c if ENABLE_STATIC_BINARIES lxc_usernsexec_SOURCES += $(liblxc_la_SOURCES) lxc_usernsexec_LDFLAGS = -all-static -pthread else lxc_usernsexec_SOURCES += af_unix.c af_unix.h \ caps.c caps.h \ cgroups/cgfsng.c \ cgroups/cgroup.c cgroups/cgroup.h \ cgroups/cgroup2_devices.c cgroups/cgroup2_devices.h \ cgroups/cgroup_utils.c cgroups/cgroup_utils.h \ commands.c commands.h \ commands_utils.c commands_utils.h \ conf.c conf.h \ confile.c confile.h \ confile_utils.c confile_utils.h \ error.c error.h \ file_utils.c file_utils.h \ hlist.h \ ../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \ initutils.c initutils.h \ list.h \ log.c log.h \ lxclock.c lxclock.h \ macro.h \ mainloop.c mainloop.h \ memory_utils.h \ monitor.c monitor.h \ mount_utils.c mount_utils.h \ namespace.c namespace.h \ network.c network.h \ nl.c nl.h \ parse.c parse.h \ process_utils.c process_utils.h \ ringbuf.c ringbuf.h \ start.c start.h \ state.c state.h \ storage/btrfs.c storage/btrfs.h \ storage/dir.c storage/dir.h \ storage/loop.c storage/loop.h \ storage/lvm.c storage/lvm.h \ storage/nbd.c storage/nbd.h \ storage/overlay.c storage/overlay.h \ storage/rbd.c storage/rbd.h \ storage/rsync.c storage/rsync.h \ storage/storage.c storage/storage.h \ storage/storage_utils.c storage/storage_utils.h \ storage/zfs.c storage/zfs.h \ string_utils.c string_utils.h \ sync.c sync.h \ syscall_wrappers.h \ terminal.c terminal.h \ utils.c utils.h \ uuid.c uuid.h \ $(LSM_SOURCES) if ENABLE_SECCOMP lxc_usernsexec_SOURCES += seccomp.c lxcseccomp.h endif if !HAVE_STRCHRNUL lxc_usernsexec_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif if !HAVE_STRLCPY lxc_usernsexec_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT lxc_usernsexec_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_OPENPTY lxc_usernsexec_SOURCES += ../include/openpty.c ../include/openpty.h endif if IS_BIONIC lxc_usernsexec_SOURCES += ../include/fexecve.c ../include/fexecve.h \ ../include/lxcmntent.c ../include/lxcmntent.h endif if !HAVE_GETGRGID_R lxc_usernsexec_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h endif if !HAVE_PRLIMIT if HAVE_PRLIMIT64 lxc_usernsexec_SOURCES += ../include/prlimit.c ../include/prlimit.h endif endif endif endif if ENABLE_TOOLS if !HAVE_GETSUBOPT lxc_copy_SOURCES += tools/include/getsubopt.c tools/include/getsubopt.h endif endif if ENABLE_COMMANDS if HAVE_STATIC_LIBCAP sbin_PROGRAMS += init.lxc.static init_lxc_static_SOURCES = cmd/lxc_init.c \ af_unix.c af_unix.h \ caps.c caps.h \ error.c error.h \ file_utils.c file_utils.h \ initutils.c initutils.h \ log.c log.h \ macro.h \ memory_utils.h \ namespace.c namespace.h \ string_utils.c string_utils.h if !HAVE_GETLINE if HAVE_FGETLN init_lxc_static_SOURCES += ../include/getline.c ../include/getline.h endif endif if !HAVE_STRLCPY init_lxc_static_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif if !HAVE_STRLCAT init_lxc_static_SOURCES += ../include/strlcat.c ../include/strlcat.h endif init_lxc_static_LDFLAGS = -all-static -pthread init_lxc_static_LDADD = @CAP_LIBS@ init_lxc_static_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF if ENABLE_SANITIZERS init_lxc_static_CFLAGS += -fno-sanitize=address,undefined endif if ENABLE_FUZZERS init_lxc_static_CFLAGS += -fno-sanitize=fuzzer-no-link endif endif endif if ENABLE_PAM if HAVE_PAM exec_pam_LTLIBRARIES = pam_cgfs.la pam_cgfs_la_SOURCES = pam/pam_cgfs.c \ file_utils.c file_utils.h \ macro.h \ memory_utils.h \ string_utils.c string_utils.h if !HAVE_STRLCAT pam_cgfs_la_SOURCES += ../include/strlcat.c ../include/strlcat.h endif if !HAVE_STRLCPY pam_cgfs_la_SOURCES += ../include/strlcpy.c ../include/strlcpy.h endif pam_cgfs_la_CFLAGS = $(AM_CFLAGS) -DNO_LXC_CONF pam_cgfs_la_LIBADD = $(AM_LIBS) \ $(PAM_LIBS) \ $(DLOG_LIBS) \ -L$(top_srcdir) pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) \ -avoid-version \ -module \ -shared endif endif install-exec-hook: mkdir -p $(DESTDIR)$(datadir)/lxc install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@ rm -f $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.1 cd $(DESTDIR)$(libdir); \ ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \ ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so if ENABLE_PAM if HAVE_PAM $(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.la" $(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.a" endif endif if ENABLE_COMMANDS chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic if ENABLE_BASH install-data-local: cd $(DESTDIR)$(bashcompdir); \ for bin in $(bin_PROGRAMS) ; do \ ln -sf lxc $$bin ; \ done endif endif uninstall-local: $(RM) $(DESTDIR)$(libdir)/liblxc.so* $(RM) $(DESTDIR)$(libdir)/liblxc.a if ENABLE_BASH for bin in $(bin_PROGRAMS) ; do \ $(RM) $(DESTDIR)$(bashcompdir)/$$bin ; \ done endif if ENABLE_PAM if HAVE_PAM $(RM) $(DESTDIR)$(exec_pamdir)/pam_cgfs.so* endif endif lxc-4.0.12/src/lxc/state.c0000644061062106075000000000432014176403775012173 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "cgroup.h" #include "commands.h" #include "commands_utils.h" #include "log.h" #include "lxc.h" #include "monitor.h" #include "start.h" #include "utils.h" lxc_log_define(state, lxc); static const char *const strstate[] = { "STOPPED", "STARTING", "RUNNING", "STOPPING", "ABORTING", "FREEZING", "FROZEN", "THAWED", }; const char *lxc_state2str(lxc_state_t state) { if (state < STOPPED || state > MAX_STATE - 1) return "INVALID STATE"; return strstate[state]; } lxc_state_t lxc_str2state(const char *state) { size_t len; len = sizeof(strstate) / sizeof(strstate[0]); for (lxc_state_t i = 0; i < len; i++) { if (strequal(strstate[i], state)) return i; } ERROR("invalid state '%s'", state); return -1; } lxc_state_t lxc_getstate(const char *name, const char *lxcpath) { return lxc_cmd_get_state(name, lxcpath); } static int fillwaitedstates(const char *strstates, lxc_state_t *states) { char *token; char *strstates_dup; int state; strstates_dup = strdup(strstates); if (!strstates_dup) return -1; lxc_iterate_parts(token, strstates_dup, "|") { state = lxc_str2state(token); if (state < 0) { free(strstates_dup); return -1; } states[state] = 1; } free(strstates_dup); return 0; } int lxc_wait(const char *lxcname, const char *states, int timeout, const char *lxcpath) { int state = -1; lxc_state_t s[MAX_STATE] = {0}; if (fillwaitedstates(states, s)) return -1; for (;;) { struct timespec onesec = { .tv_sec = 1, .tv_nsec = 0, }; state = lxc_cmd_sock_get_state(lxcname, lxcpath, s, timeout); if (state >= 0) break; if (errno != ECONNREFUSED) return log_error_errno(-1, errno, "Failed to receive state from monitor"); if (timeout > 0) timeout--; if (timeout == 0) return -1; (void)nanosleep(&onesec, NULL); } TRACE("Retrieved state of container %s", lxc_state2str(state)); if (!s[state]) return -1; return 0; } lxc-4.0.12/src/lxc/log.c0000644061062106075000000005207714176403775011650 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lxc.h" #include "caps.h" #include "file_utils.h" #include "log.h" #include "memory_utils.h" #include "utils.h" #if !HAVE_STRLCPY #include "strlcpy.h" #endif #if HAVE_DLOG #include #undef LOG_TAG #define LOG_TAG "LXC" #endif /* We're logging in seconds and nanoseconds. Assuming that the underlying * datatype is currently at maximum a 64bit integer, we have a date string that * is of maximum length (2^64 - 1) * 2 = (21 + 21) = 42. */ #define LXC_LOG_TIME_SIZE ((INTTYPE_TO_STRLEN(uint64_t)) * 2) int lxc_log_fd = -EBADF; static bool wants_syslog = false; static int lxc_quiet_specified; bool lxc_log_use_global_fd = false; static int lxc_loglevel_specified; static char log_prefix[LXC_LOG_PREFIX_SIZE] = "lxc"; static char *log_fname = NULL; static char *log_vmname = NULL; lxc_log_define(log, lxc); static int lxc_log_priority_to_syslog(int priority) { switch (priority) { case LXC_LOG_LEVEL_FATAL: return LOG_EMERG; case LXC_LOG_LEVEL_ALERT: return LOG_ALERT; case LXC_LOG_LEVEL_CRIT: return LOG_CRIT; case LXC_LOG_LEVEL_ERROR: return LOG_ERR; case LXC_LOG_LEVEL_WARN: return LOG_WARNING; case LXC_LOG_LEVEL_NOTICE: case LXC_LOG_LEVEL_NOTSET: return LOG_NOTICE; case LXC_LOG_LEVEL_INFO: return LOG_INFO; case LXC_LOG_LEVEL_TRACE: case LXC_LOG_LEVEL_DEBUG: return LOG_DEBUG; } /* Not reached */ return LOG_NOTICE; } static const char *lxc_log_get_container_name(void) { #ifndef NO_LXC_CONF if (current_config && !log_vmname) return current_config->name; #endif return log_vmname; } int lxc_log_get_fd(void) { int fd_log = -EBADF; #ifndef NO_LXC_CONF if (current_config && !lxc_log_use_global_fd) fd_log = current_config->logfd; #endif if (fd_log < 0) fd_log = lxc_log_fd; return fd_log; } static char *lxc_log_get_va_msg(struct lxc_log_event *event) { __do_free char *msg = NULL; int rc, len; va_list args; if (!event) return ret_set_errno(NULL, EINVAL); va_copy(args, *event->vap); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" len = vsnprintf(NULL, 0, event->fmt, args) + 1; #pragma GCC diagnostic pop va_end(args); msg = malloc(len * sizeof(char)); if (!msg) return ret_set_errno(NULL, ENOMEM); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" rc = vsnprintf(msg, len, event->fmt, *event->vap); #pragma GCC diagnostic pop if (rc < 0 || rc >= len) return ret_set_errno(NULL, EIO); return move_ptr(msg); } static int log_append_syslog(const struct lxc_log_appender *appender, struct lxc_log_event *event) { __do_free char *msg = NULL; const char *log_container_name; if (!wants_syslog) return 0; log_container_name = lxc_log_get_container_name(); msg = lxc_log_get_va_msg(event); if (!msg) return 0; syslog(lxc_log_priority_to_syslog(event->priority), "%s%s %s - %s:%s:%d - %s" , log_container_name ? log_container_name : "", log_container_name ? ":" : "", event->category, event->locinfo->file, event->locinfo->func, event->locinfo->line, msg); return 0; } static int log_append_stderr(const struct lxc_log_appender *appender, struct lxc_log_event *event) { const char *log_container_name; if (event->priority < LXC_LOG_LEVEL_ERROR) return 0; log_container_name = lxc_log_get_container_name(); fprintf(stderr, "%s: %s%s", log_prefix, log_container_name ? log_container_name : "", log_container_name ? ": " : ""); fprintf(stderr, "%s: %s: %d ", event->locinfo->file, event->locinfo->func, event->locinfo->line); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" vfprintf(stderr, event->fmt, *event->vap); #pragma GCC diagnostic pop fprintf(stderr, "\n"); return 0; } static int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time) { int64_t epoch_to_days, z, era, doe, yoe, year, doy, mp, day, month, d_in_s, hours, h_in_s, minutes, seconds; char nanosec[INTTYPE_TO_STRLEN(int64_t)]; int ret; /* * See https://howardhinnant.github.io/date_algorithms.html for an * explanation of the algorithm used here. */ /* Convert Epoch in seconds to number of days. */ epoch_to_days = time->tv_sec / 86400; /* Shift the Epoch from 1970-01-01 to 0000-03-01. */ z = epoch_to_days + 719468; /* * Compute the era from the serial date by simply dividing by the number * of days in an era (146097). */ era = (z >= 0 ? z : z - 146096) / 146097; /* * The day-of-era (doe) can then be found by subtracting the era number * times the number of days per era, from the serial date. */ doe = (z - era * 146097); /* * From the day-of-era (doe), the year-of-era (yoe, range [0, 399]) can * be computed. */ yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; /* Given year-of-era, and era, one can now compute the year. */ year = yoe + era * 400; /* * Also the day-of-year, again with the year beginning on Mar. 1, can be * computed from the day-of-era and year-of-era. */ doy = doe - (365 * yoe + yoe / 4 - yoe / 100); /* Given day-of-year, find the month number. */ mp = (5 * doy + 2) / 153; /* * From day-of-year and month-of-year we can now easily compute * day-of-month. */ day = doy - (153 * mp + 2) / 5 + 1; /* * Transform the month number from the [0, 11] / [Mar, Feb] system to * the civil system: [1, 12] to find the correct month. */ month = mp + (mp < 10 ? 3 : -9); /* * The algorithm assumes that a year begins on 1 March, so add 1 before * that. */ if (month < 3) year++; /* Transform days in the epoch to seconds. */ d_in_s = epoch_to_days * 86400; /* * To find the current hour simply substract the Epoch_to_days from the * total Epoch and divide by the number of seconds in an hour. */ hours = (time->tv_sec - d_in_s) / 3600; /* Transform hours to seconds. */ h_in_s = hours * 3600; /* * Calculate minutes by subtracting the seconds for all days in the * epoch and for all hours in the epoch and divide by the number of * minutes in an hour. */ minutes = (time->tv_sec - d_in_s - h_in_s) / 60; /* * Calculate the seconds by subtracting the seconds for all days in the * epoch, hours in the epoch and minutes in the epoch. */ seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60)); /* Make string from nanoseconds. */ ret = strnprintf(nanosec, sizeof(nanosec), "%"PRId64, (int64_t)time->tv_nsec); if (ret < 0) return ret_errno(EIO); /* * Create final timestamp for the log and shorten nanoseconds to 3 * digit precision. */ ret = strnprintf(buf, bufsize, "%" PRId64 "%02" PRId64 "%02" PRId64 "%02" PRId64 "%02" PRId64 "%02" PRId64 ".%.3s", year, month, day, hours, minutes, seconds, nanosec); if (ret < 0) return ret_errno(EIO); return 0; } /* * This function needs to make extra sure that it is 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. */ static int log_append_logfile(const struct lxc_log_appender *appender, struct lxc_log_event *event) { int fd_to_use = -EBADF; char buffer[LXC_LOG_BUFFER_SIZE]; char date_time[LXC_LOG_TIME_SIZE]; int n; ssize_t ret; const char *log_container_name; #ifndef NO_LXC_CONF if (current_config && !lxc_log_use_global_fd) fd_to_use = current_config->logfd; #endif log_container_name = lxc_log_get_container_name(); if (fd_to_use < 0) fd_to_use = lxc_log_fd; if (fd_to_use < 0) return 0; ret = lxc_unix_epoch_to_utc(date_time, LXC_LOG_TIME_SIZE, &event->timestamp); if (ret) return ret; /* * We allow truncation here which is why we use snprintf() directly * instead of strnprintf(). */ n = snprintf(buffer, sizeof(buffer), "%s%s%s %s %-8s %s - %s:%s:%d - ", log_prefix, log_container_name ? " " : "", log_container_name ? log_container_name : "", date_time, lxc_log_priority_to_string(event->priority), event->category, event->locinfo->file, event->locinfo->func, event->locinfo->line); if (n < 0) return ret_errno(EIO); if ((size_t)n < STRARRAYLEN(buffer)) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" ret = vsnprintf(buffer + n, sizeof(buffer) - n, event->fmt, *event->vap); #pragma GCC diagnostic pop if (ret < 0) return 0; n += ret; } if ((size_t)n >= sizeof(buffer)) n = STRARRAYLEN(buffer); buffer[n] = '\n'; return lxc_write_nointr(fd_to_use, buffer, n + 1); } #if HAVE_DLOG static int log_append_dlog(const struct lxc_log_appender *appender, struct lxc_log_event *event) { __do_free char *msg = NULL; const char *log_container_name; log_container_name = lxc_log_get_container_name(); msg = lxc_log_get_va_msg(event); switch (event->priority) { case LXC_LOG_LEVEL_TRACE: case LXC_LOG_LEVEL_DEBUG: print_log(DLOG_DEBUG, LOG_TAG, "%s: %s(%d) > [%s] %s", event->locinfo->file, event->locinfo->func, event->locinfo->line, log_container_name ? log_container_name : "-", msg ? msg : "-"); break; case LXC_LOG_LEVEL_INFO: print_log(DLOG_INFO, LOG_TAG, "%s: %s(%d) > [%s] %s", event->locinfo->file, event->locinfo->func, event->locinfo->line, log_container_name ? log_container_name : "-", msg ? msg : "-"); break; case LXC_LOG_LEVEL_NOTICE: case LXC_LOG_LEVEL_WARN: print_log(DLOG_WARN, LOG_TAG, "%s: %s(%d) > [%s] %s", event->locinfo->file, event->locinfo->func, event->locinfo->line, log_container_name ? log_container_name : "-", msg ? msg : "-"); break; case LXC_LOG_LEVEL_ERROR: print_log(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > [%s] %s", event->locinfo->file, event->locinfo->func, event->locinfo->line, log_container_name ? log_container_name : "-", msg ? msg : "-"); break; case LXC_LOG_LEVEL_CRIT: case LXC_LOG_LEVEL_ALERT: case LXC_LOG_LEVEL_FATAL: print_log(DLOG_FATAL, LOG_TAG, "%s: %s(%d) > [%s] %s", event->locinfo->file, event->locinfo->func, event->locinfo->line, log_container_name ? log_container_name : "-", msg ? msg : "-"); break; default: break; } return 0; } #endif static struct lxc_log_appender log_appender_syslog = { .name = "syslog", .append = log_append_syslog, .next = NULL, }; static struct lxc_log_appender log_appender_stderr = { .name = "stderr", .append = log_append_stderr, .next = NULL, }; static struct lxc_log_appender log_appender_logfile = { .name = "logfile", .append = log_append_logfile, .next = NULL, }; #if HAVE_DLOG static struct lxc_log_appender log_appender_dlog = { .name = "dlog", .append = log_append_dlog, .next = NULL, }; #endif static struct lxc_log_category log_root = { .name = "root", .priority = LXC_LOG_LEVEL_ERROR, .appender = NULL, .parent = NULL, }; #if HAVE_DLOG struct lxc_log_category lxc_log_category_lxc = { .name = "lxc", .priority = LXC_LOG_LEVEL_TRACE, .appender = &log_appender_dlog, .parent = &log_root }; #else struct lxc_log_category lxc_log_category_lxc = { .name = "lxc", .priority = LXC_LOG_LEVEL_ERROR, .appender = &log_appender_logfile, .parent = &log_root }; #endif static int build_dir(const char *name) { __do_free char *n = NULL; char *e, *p; if (is_empty_string(name)) return ret_errno(EINVAL); /* Make copy of the string since we'll be modifying it. */ n = strdup(name); if (!n) return ret_errno(ENOMEM); e = &n[strlen(n)]; for (p = n + 1; p < e; p++) { int ret; if (*p != '/') continue; *p = '\0'; #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION ret = lxc_unpriv(mkdir(n, 0755)); #else if (RUN_ON_OSS_FUZZ || is_in_comm("fuzz-lxc-") > 0) ret = errno = EEXIST; else ret = lxc_unpriv(mkdir(n, 0755)); #endif /*!FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */ *p = '/'; if (ret && errno != EEXIST) return log_error_errno(-errno, errno, "Failed to create directory \"%s\"", n); } return 0; } static int log_open(const char *name) { int newfd = -EBADF; __do_close int fd = -EBADF; #ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION fd = lxc_unpriv(open(name, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0660)); #else if (!RUN_ON_OSS_FUZZ && is_in_comm("fuzz-lxc-") <= 0) fd = lxc_unpriv(open(name, O_CREAT | O_WRONLY | O_APPEND | O_CLOEXEC, 0660)); #endif /* !FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */ if (fd < 0) return log_error_errno(-errno, errno, "Failed to open log file \"%s\"", name); if (fd > 2) return move_fd(fd); newfd = fcntl(fd, F_DUPFD_CLOEXEC, STDERR_FILENO); if (newfd < 0) return log_error_errno(-errno, errno, "Failed to dup log fd %d", fd); return newfd; } /* * Build the path to the log file * @name : the name of the container * @lxcpath : the lxcpath to use as a basename or NULL to use LOGPATH * Returns malloced path on success, or NULL on failure */ static char *build_log_path(const char *name, const char *lxcpath) { __do_free char *p = NULL; int ret; size_t len; bool use_dir; if (!name) return ret_set_errno(NULL, EINVAL); #if USE_CONFIGPATH_LOGS use_dir = true; #else use_dir = false; #endif /* * If USE_CONFIGPATH_LOGS is true or lxcpath is given, the resulting * path will be: * '$logpath' + '/' + '$name' + '/' + '$name' + '.log' + '\0' * * If USE_CONFIGPATH_LOGS is false the resulting path will be: * '$logpath' + '/' + '$name' + '.log' + '\0' */ len = strlen(name) + 6; /* 6 == '/' + '.log' + '\0' */ if (lxcpath) use_dir = true; else lxcpath = LOGPATH; if (use_dir) len += strlen(lxcpath) + 1 + strlen(name) + 1; /* add "/$container_name/" */ else len += strlen(lxcpath) + 1; p = malloc(len); if (!p) return ret_set_errno(NULL, ENOMEM); if (use_dir) ret = strnprintf(p, len, "%s/%s/%s.log", lxcpath, name, name); else ret = strnprintf(p, len, "%s/%s.log", lxcpath, name); if (ret < 0) return ret_set_errno(NULL, EIO); return move_ptr(p); } /* * This can be called: * 1. when a program calls lxc_log_init with no logfile parameter (in which * case the default is used). In this case lxc.loge can override this. * 2. when a program calls lxc_log_init with a logfile parameter. In this * case we don't want lxc.log to override this. * 3. When a lxc.log entry is found in config file. */ static int __lxc_log_set_file(const char *fname, int create_dirs) { /* we are overriding the default. */ if (lxc_log_fd >= 0) lxc_log_close(); if (is_empty_string(fname)) return ret_errno(EINVAL); if (strlen(fname) == 0) { log_fname = NULL; return ret_errno(EINVAL); } #if USE_CONFIGPATH_LOGS /* We don't build_dir for the default if the default is i.e. * /var/lib/lxc/$container/$container.log. */ if (create_dirs) #endif if (build_dir(fname)) return log_error_errno(-errno, errno, "Failed to create dir for log file \"%s\"", fname); lxc_log_fd = log_open(fname); if (lxc_log_fd < 0) return lxc_log_fd; log_fname = strdup(fname); return 0; } static int _lxc_log_set_file(const char *name, const char *lxcpath, int create_dirs) { __do_free char *logfile = NULL; logfile = build_log_path(name, lxcpath); if (!logfile) return log_error_errno(-errno, errno, "Could not build log path"); return __lxc_log_set_file(logfile, create_dirs); } /* * lxc_log_init: * Called from lxc front-end programs (like lxc-create, lxc-start) to * initialize the log defaults. */ int lxc_log_init(struct lxc_log *log) { int ret; int lxc_priority = LXC_LOG_LEVEL_ERROR; if (!log) return ret_errno(EINVAL); if (lxc_log_fd >= 0) return log_warn_errno(0, EOPNOTSUPP, "Log already initialized"); if (log->level) lxc_priority = lxc_log_priority_to_int(log->level); if (!lxc_loglevel_specified) { lxc_log_category_lxc.priority = lxc_priority; lxc_loglevel_specified = 1; } if (!lxc_quiet_specified) if (!log->quiet) lxc_log_category_lxc.appender->next = &log_appender_stderr; if (log->prefix) lxc_log_set_prefix(log->prefix); if (log->name) log_vmname = strdup(log->name); if (log->file) { if (strequal(log->file, "none")) return 0; ret = __lxc_log_set_file(log->file, 1); if (ret < 0) return log_error_errno(-1, errno, "Failed to enable logfile"); lxc_log_use_global_fd = true; } else { /* if no name was specified, there nothing to do */ if (!log->name) return 0; ret = -1; if (!log->lxcpath) log->lxcpath = LOGPATH; /* try LOGPATH if lxcpath is the default for the privileged containers */ if (!geteuid() && strequal(LXCPATH, log->lxcpath)) ret = _lxc_log_set_file(log->name, NULL, 0); /* try in lxcpath */ if (ret < 0) ret = _lxc_log_set_file(log->name, log->lxcpath, 1); /* try LOGPATH in case its writable by the caller */ if (ret < 0) ret = _lxc_log_set_file(log->name, NULL, 0); } /* * If !file, that is, if the user did not request this logpath, then * ignore failures and continue logging to console */ if (!log->file && ret != 0) { INFO("Ignoring failure to open default logfile"); ret = 0; } if (lxc_log_fd >= 0) { lxc_log_category_lxc.appender = &log_appender_logfile; lxc_log_category_lxc.appender->next = &log_appender_stderr; } return ret; } void lxc_log_close(void) { closelog(); free_disarm(log_vmname); close_prot_errno_disarm(lxc_log_fd); free_disarm(log_fname); } int lxc_log_syslog(int facility) { struct lxc_log_appender *appender; openlog(log_prefix, LOG_PID, facility); if (!lxc_log_category_lxc.appender) { lxc_log_category_lxc.appender = &log_appender_syslog; return 0; } appender = lxc_log_category_lxc.appender; /* Check if syslog was already added, to avoid creating a loop */ while (appender) { /* not an error: openlog re-opened the connection */ if (appender == &log_appender_syslog) return 0; appender = appender->next; } appender = lxc_log_category_lxc.appender; while (appender->next != NULL) appender = appender->next; appender->next = &log_appender_syslog; return 0; } void lxc_log_syslog_enable(void) { wants_syslog = true; } void lxc_log_syslog_disable(void) { wants_syslog = false; } /* * This is called when we read a lxc.log.level entry in a lxc.conf file. This * happens after processing command line arguments, which override the .conf * settings. So only set the level if previously unset. */ int lxc_log_set_level(int *dest, int level) { if (level < 0 || level >= LXC_LOG_LEVEL_NOTSET) return log_error_errno(-EINVAL, EINVAL, "Invalid log priority %d", level); *dest = level; return 0; } int lxc_log_get_level(void) { int level = LXC_LOG_LEVEL_NOTSET; #ifndef NO_LXC_CONF if (current_config) level = current_config->loglevel; #endif if (level == LXC_LOG_LEVEL_NOTSET) level = lxc_log_category_lxc.priority; return level; } bool lxc_log_has_valid_level(void) { int log_level; log_level = lxc_log_get_level(); if (log_level < 0 || log_level >= LXC_LOG_LEVEL_NOTSET) return ret_set_errno(false, EINVAL); return true; } /* * This is called when we read a lxc.logfile entry in a lxc.conf file. This * happens after processing command line arguments, which override the .conf * settings. So only set the file if previously unset. */ int lxc_log_set_file(int *fd, const char *fname) { if (*fd >= 0) close_prot_errno_disarm(*fd); if (is_empty_string(fname)) return ret_errno(EINVAL); if (build_dir(fname)) return -errno; *fd = log_open(fname); if (*fd < 0) return -errno; return 0; } inline const char *lxc_log_get_file(void) { return log_fname; } inline void lxc_log_set_prefix(const char *prefix) { /* We don't care if the prefix is truncated. */ (void)strlcpy(log_prefix, prefix, sizeof(log_prefix)); } inline const char *lxc_log_get_prefix(void) { return log_prefix; } inline void lxc_log_options_no_override(void) { lxc_quiet_specified = 1; lxc_loglevel_specified = 1; } lxc-4.0.12/src/lxc/mount_utils.c0000644061062106075000000004025114176403775013440 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include "conf.h" #include "file_utils.h" #include "log.h" #include "macro.h" #include "memory_utils.h" #include "mount_utils.h" #include "syscall_numbers.h" #include "syscall_wrappers.h" #ifdef HAVE_STATVFS #include #endif lxc_log_define(mount_utils, lxc); /* * Since the MOUNT_ATTR_ values are an enum, not a bitmap, users wanting * to transition to a different atime setting cannot simply specify the atime * setting in @attr_set, but must also specify MOUNT_ATTR__ATIME in the * @attr_clr field. */ static inline void set_atime(struct lxc_mount_attr *attr) { switch (attr->attr_set & MOUNT_ATTR__ATIME) { case MOUNT_ATTR_RELATIME: __fallthrough; case MOUNT_ATTR_NOATIME: __fallthrough; case MOUNT_ATTR_STRICTATIME: attr->attr_clr = MOUNT_ATTR__ATIME; break; } } int mnt_attributes_new(unsigned int old_flags, unsigned int *new_flags) { unsigned int flags = 0; if (old_flags & MS_RDONLY) { flags |= MOUNT_ATTR_RDONLY; old_flags &= ~MS_RDONLY; } if (old_flags & MS_NOSUID) { flags |= MOUNT_ATTR_NOSUID; old_flags &= ~MS_NOSUID; } if (old_flags & MS_NODEV) { flags |= MOUNT_ATTR_NODEV; old_flags &= ~MS_NODEV; } if (old_flags & MS_NOEXEC) { flags |= MOUNT_ATTR_NOEXEC; old_flags &= ~MS_NOEXEC; } if (old_flags & MS_RELATIME) { flags |= MOUNT_ATTR_RELATIME; old_flags &= ~MS_RELATIME; } if (old_flags & MS_NOATIME) { flags |= MOUNT_ATTR_NOATIME; old_flags &= ~MS_NOATIME; } if (old_flags & MS_STRICTATIME) { flags |= MOUNT_ATTR_STRICTATIME; old_flags &= ~MS_STRICTATIME; } if (old_flags & MS_NODIRATIME) { flags |= MOUNT_ATTR_NODIRATIME; old_flags &= ~MS_NODIRATIME; } *new_flags |= flags; return old_flags; } int mnt_attributes_old(unsigned int new_flags, unsigned int *old_flags) { unsigned int flags = 0; if (new_flags & MOUNT_ATTR_RDONLY) { flags |= MS_RDONLY; new_flags &= ~MOUNT_ATTR_RDONLY; } if (new_flags & MOUNT_ATTR_NOSUID) { flags |= MS_NOSUID; new_flags &= ~MOUNT_ATTR_NOSUID; } if (new_flags & MS_NODEV) { flags |= MOUNT_ATTR_NODEV; new_flags &= ~MS_NODEV; } if (new_flags & MOUNT_ATTR_NOEXEC) { flags |= MS_NOEXEC; new_flags &= ~MOUNT_ATTR_NOEXEC; } if (new_flags & MS_RELATIME) { flags |= MS_RELATIME; new_flags &= ~MOUNT_ATTR_RELATIME; } if (new_flags & MS_NOATIME) { flags |= MS_NOATIME; new_flags &= ~MOUNT_ATTR_NOATIME; } if (new_flags & MS_STRICTATIME) { flags |= MS_STRICTATIME; new_flags &= ~MOUNT_ATTR_STRICTATIME; } if (new_flags & MS_NODIRATIME) { flags |= MS_NODIRATIME; new_flags &= ~MOUNT_ATTR_NODIRATIME; } *old_flags |= flags; return new_flags; } static int __fs_prepare(const char *fs_name, int fd_from) { __do_close int fd_fs = -EBADF; char source[LXC_PROC_PID_FD_LEN]; int ret; /* This helper is only concerned with filesystems. */ if (is_empty_string(fs_name)) return ret_errno(EINVAL); /* * So here is where I'm a bit disappointed. The new mount api doesn't * let you specify the block device source through an fd. You need to * pass a path which is obviously crap and runs afoul of the mission to * only use fds for mount. */ if (fd_from >= 0) { ret = strnprintf(source, sizeof(source), "/proc/self/fd/%d", fd_from); if (ret < 0) return log_error_errno(-EIO, EIO, "Failed to create /proc/self/fd/%d", fd_from); } fd_fs = fsopen(fs_name, FSOPEN_CLOEXEC); if (fd_fs < 0) return log_error_errno(-errno, errno, "Failed to create new open new %s filesystem context", fs_name); if (fd_from >= 0) { ret = fsconfig(fd_fs, FSCONFIG_SET_STRING, "source", source, 0); if (ret) return log_error_errno(-errno, errno, "Failed to set %s filesystem source to %s", fs_name, source); TRACE("Set %s filesystem source property to %s", fs_name, source); } TRACE("Finished initializing new %s filesystem context %d", fs_name, fd_fs); return move_fd(fd_fs); } int fs_prepare(const char *fs_name, int dfd_from, const char *path_from, __u64 o_flags_from, __u64 resolve_flags_from) { __do_close int __fd_from = -EBADF; int fd_from; if (!is_empty_string(path_from)) { struct lxc_open_how how = { .flags = o_flags_from, .resolve = resolve_flags_from, }; __fd_from = openat2(dfd_from, path_from, &how, sizeof(how)); if (__fd_from < 0) return -errno; fd_from = __fd_from; } else { fd_from = dfd_from; } return __fs_prepare(fs_name, fd_from); } int fs_set_property(int fd_fs, const char *key, const char *val) { int ret; ret = fsconfig(fd_fs, FSCONFIG_SET_STRING, key, val, 0); if (ret < 0) return log_error_errno(-errno, errno, "Failed to set \"%s\" to \"%s\" on filesystem context %d", key, val, fd_fs); TRACE("Set \"%s\" to \"%s\" on filesystem context %d", key, val, fd_fs); return 0; } int fs_set_flag(int fd_fs, const char *key) { int ret; ret = fsconfig(fd_fs, FSCONFIG_SET_FLAG, key, NULL, 0); if (ret < 0) return syserror("Failed to set \"%s\" flag on filesystem context %d", key, fd_fs); TRACE("Set \"%s\" flag on filesystem context %d", key, fd_fs); return 0; } int fs_attach(int fd_fs, int dfd_to, const char *path_to, __u64 o_flags_to, __u64 resolve_flags_to, unsigned int attr_flags) { __do_close int __fd_to = -EBADF, fd_fsmnt = -EBADF; int fd_to, ret; if (!is_empty_string(path_to)) { struct lxc_open_how how = { .flags = o_flags_to, .resolve = resolve_flags_to, }; __fd_to = openat2(dfd_to, path_to, &how, sizeof(how)); if (__fd_to < 0) return -errno; fd_to = __fd_to; } else { fd_to = dfd_to; } ret = fsconfig(fd_fs, FSCONFIG_CMD_CREATE, NULL, NULL, 0); if (ret < 0) return log_error_errno(-errno, errno, "Failed to finalize filesystem context %d", fd_fs); fd_fsmnt = fsmount(fd_fs, FSMOUNT_CLOEXEC, attr_flags); if (fd_fsmnt < 0) return log_error_errno(-errno, errno, "Failed to create new mount for filesystem context %d", fd_fs); ret = move_mount(fd_fsmnt, "", fd_to, "", MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH); if (ret) return log_error_errno(-errno, errno, "Failed to mount %d onto %d", fd_fsmnt, fd_to); TRACE("Mounted %d onto %d", fd_fsmnt, fd_to); return 0; } int create_detached_idmapped_mount(const char *path, int userns_fd, bool recursive, __u64 attr_set, __u64 attr_clr) { __do_close int fd_tree_from = -EBADF; unsigned int open_tree_flags = OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC; struct lxc_mount_attr attr = { .attr_set = MOUNT_ATTR_IDMAP | attr_set, .attr_clr = attr_clr, .userns_fd = userns_fd, .propagation = MS_SLAVE, }; int ret; set_atime(&attr); TRACE("Idmapped mount \"%s\" requested with user namespace fd %d", path, userns_fd); if (recursive) open_tree_flags |= AT_RECURSIVE; fd_tree_from = open_tree(-EBADF, path, open_tree_flags); if (fd_tree_from < 0) return syserror("Failed to create detached mount"); ret = mount_setattr(fd_tree_from, "", AT_EMPTY_PATH | (recursive ? AT_RECURSIVE : 0), &attr, sizeof(attr)); if (ret < 0) return syserror("Failed to change mount attributes"); return move_fd(fd_tree_from); } int move_detached_mount(int dfd_from, int dfd_to, const char *path_to, __u64 o_flags_to, __u64 resolve_flags_to) { __do_close int __fd_to = -EBADF; int fd_to, ret; if (!is_empty_string(path_to)) { struct lxc_open_how how = { .flags = o_flags_to, .resolve = resolve_flags_to, }; __fd_to = openat2(dfd_to, path_to, &how, sizeof(how)); if (__fd_to < 0) return -errno; fd_to = __fd_to; } else { fd_to = dfd_to; } ret = move_mount(dfd_from, "", fd_to, "", MOVE_MOUNT_F_EMPTY_PATH | MOVE_MOUNT_T_EMPTY_PATH); if (ret) return syserror("Failed to attach detached mount %d to filesystem at %d", dfd_from, fd_to); TRACE("Attach detached mount %d to filesystem at %d", dfd_from, fd_to); return 0; } int __fd_bind_mount(int dfd_from, const char *path_from, __u64 o_flags_from, __u64 resolve_flags_from, int dfd_to, const char *path_to, __u64 o_flags_to, __u64 resolve_flags_to, __u64 attr_set, __u64 attr_clr, __u64 propagation, int userns_fd, bool recursive) { struct lxc_mount_attr attr = { .attr_set = attr_set, .attr_clr = attr_clr, .propagation = propagation, }; __do_close int __fd_from = -EBADF; __do_close int fd_tree_from = -EBADF; unsigned int open_tree_flags = AT_EMPTY_PATH | OPEN_TREE_CLONE | OPEN_TREE_CLOEXEC; int fd_from, ret; set_atime(&attr); if (!is_empty_string(path_from)) { struct lxc_open_how how = { .flags = o_flags_from, .resolve = resolve_flags_from, }; __fd_from = openat2(dfd_from, path_from, &how, sizeof(how)); if (__fd_from < 0) return -errno; fd_from = __fd_from; } else { fd_from = dfd_from; } if (recursive) open_tree_flags |= AT_RECURSIVE; fd_tree_from = open_tree(fd_from, "", open_tree_flags); if (fd_tree_from < 0) return syserror("Failed to create detached mount"); if (userns_fd >= 0) { attr.attr_set |= MOUNT_ATTR_IDMAP; attr.userns_fd = userns_fd; TRACE("Idmapped mount requested with user namespace fd %d", userns_fd); } if (attr.attr_set) { ret = mount_setattr(fd_tree_from, "", AT_EMPTY_PATH | (recursive ? AT_RECURSIVE : 0), &attr, sizeof(attr)); if (ret < 0) return syserror("Failed to change mount attributes"); } return move_detached_mount(fd_tree_from, dfd_to, path_to, o_flags_to, resolve_flags_to); } int calc_remount_flags_new(int dfd_from, const char *path_from, __u64 o_flags_from, __u64 resolve_flags_from, bool remount, unsigned long cur_flags, unsigned int *new_flags) { #ifdef HAVE_STATVFS __do_close int fd_from = -EBADF; unsigned int new_required_flags = 0; int ret; struct statvfs sb; fd_from = open_at(dfd_from, path_from, o_flags_from, resolve_flags_from, 0); if (fd_from < 0) return log_error_errno(-errno, errno, "Failed to open %d(%s)", dfd_from, maybe_empty(path_from)); ret = fstatvfs(dfd_from, &sb); if (ret < 0) return log_error_errno(-errno, errno, "Failed to retrieve mount information from %d(%s)", fd_from, maybe_empty(path_from)); if (remount) { if (sb.f_flag & MS_NOSUID) new_required_flags |= MOUNT_ATTR_NOSUID; if (sb.f_flag & MS_NODEV) new_required_flags |= MOUNT_ATTR_NODEV; if (sb.f_flag & MS_RDONLY) new_required_flags |= MOUNT_ATTR_RDONLY; if (sb.f_flag & MS_NOEXEC) new_required_flags |= MOUNT_ATTR_NOEXEC; } if (sb.f_flag & MS_NOATIME) new_required_flags |= MOUNT_ATTR_NOATIME; if (sb.f_flag & MS_NODIRATIME) new_required_flags |= MOUNT_ATTR_NODIRATIME; if (sb.f_flag & MS_RELATIME) new_required_flags |= MOUNT_ATTR_RELATIME; if (sb.f_flag & MS_STRICTATIME) new_required_flags |= MOUNT_ATTR_STRICTATIME; *new_flags = (cur_flags | new_required_flags); #endif return 0; } int calc_remount_flags_old(int dfd_from, const char *path_from, __u64 o_flags_from, __u64 resolve_flags_from, bool remount, unsigned long cur_flags, unsigned int *old_flags) { #ifdef HAVE_STATVFS __do_close int fd_from = -EBADF; unsigned int old_required_flags = 0; int ret; struct statvfs sb; fd_from = open_at(dfd_from, path_from, o_flags_from, resolve_flags_from, 0); if (fd_from < 0) return log_error_errno(-errno, errno, "Failed to open %d(%s)", dfd_from, maybe_empty(path_from)); ret = fstatvfs(dfd_from, &sb); if (ret < 0) return log_error_errno(-errno, errno, "Failed to retrieve mount information from %d(%s)", fd_from, maybe_empty(path_from)); if (remount) { if (sb.f_flag & MS_NOSUID) old_required_flags |= MS_NOSUID; if (sb.f_flag & MS_NODEV) old_required_flags |= MS_NODEV; if (sb.f_flag & MS_RDONLY) old_required_flags |= MS_RDONLY; if (sb.f_flag & MS_NOEXEC) old_required_flags |= MS_NOEXEC; } if (sb.f_flag & MS_NOATIME) old_required_flags |= MS_NOATIME; if (sb.f_flag & MS_NODIRATIME) old_required_flags |= MS_NODIRATIME; if (sb.f_flag & MS_RELATIME) old_required_flags |= MS_RELATIME; if (sb.f_flag & MS_STRICTATIME) old_required_flags |= MS_STRICTATIME; *old_flags = (cur_flags | old_required_flags); #endif return 0; } /* If we are asking to remount something, make sure that any NOEXEC etc are * honored. */ unsigned long add_required_remount_flags(const char *s, const char *d, unsigned long flags) { #ifdef HAVE_STATVFS int ret; struct statvfs sb; unsigned long required_flags = 0; if (!s) s = d; if (!s) return flags; ret = statvfs(s, &sb); if (ret < 0) return flags; if (flags & MS_REMOUNT) { if (sb.f_flag & MS_NOSUID) required_flags |= MS_NOSUID; if (sb.f_flag & MS_NODEV) required_flags |= MS_NODEV; if (sb.f_flag & MS_RDONLY) required_flags |= MS_RDONLY; if (sb.f_flag & MS_NOEXEC) required_flags |= MS_NOEXEC; } if (sb.f_flag & MS_NOATIME) required_flags |= MS_NOATIME; if (sb.f_flag & MS_NODIRATIME) required_flags |= MS_NODIRATIME; if (sb.f_flag & MS_LAZYTIME) required_flags |= MS_LAZYTIME; if (sb.f_flag & MS_RELATIME) required_flags |= MS_RELATIME; if (sb.f_flag & MS_STRICTATIME) required_flags |= MS_STRICTATIME; return flags | required_flags; #else return flags; #endif } bool can_use_mount_api(void) { static int supported = -1; if (supported == -1) { __do_close int fd = -EBADF; fd = openat2(-EBADF, "", NULL, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } fd = fsmount(-EBADF, 0, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } fd = fsconfig(-EBADF, -EINVAL, NULL, NULL, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } fd = fsopen(NULL, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } fd = move_mount(-EBADF, NULL, -EBADF, NULL, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } fd = open_tree(-EBADF, NULL, 0); if (fd > 0 || errno == ENOSYS) { supported = 0; return false; } supported = 1; TRACE("Kernel supports mount api"); } return supported == 1; } bool can_use_bind_mounts(void) { static int supported = -1; if (supported == -1) { int ret; if (!can_use_mount_api()) { supported = 0; return false; } ret = mount_setattr(-EBADF, NULL, 0, NULL, 0); if (!ret || errno == ENOSYS) { supported = 0; return false; } supported = 1; TRACE("Kernel supports bind mounts in the new mount api"); } return supported == 1; } int mount_at(int dfd_from, const char *path_from, __u64 resolve_flags_from, int dfd_to, const char *path_to, __u64 resolve_flags_to, const char *fs_name, unsigned int flags, const void *data) { __do_close int __fd_from = -EBADF, __fd_to = -EBADF; char *from = NULL, *to = NULL; int fd_from, fd_to, ret; char buf_from[LXC_PROC_SELF_FD_LEN], buf_to[LXC_PROC_SELF_FD_LEN]; if (dfd_from < 0 && !abspath(path_from)) return ret_errno(EINVAL); if (dfd_to < 0 && !abspath(path_to)) return ret_errno(EINVAL); if (!is_empty_string(path_from)) { __fd_from = open_at(dfd_from, path_from, PROTECT_OPATH_FILE, resolve_flags_from, 0); if (__fd_from < 0) return -errno; fd_from = __fd_from; } else { fd_from = dfd_from; } if (fd_from >= 0) { ret = strnprintf(buf_from, sizeof(buf_from), "/proc/self/fd/%d", fd_from); if (ret < 0) return syserror("Failed to create path"); from = buf_from; } if (!is_empty_string(path_to)) { __fd_to = open_at(dfd_to, path_to, PROTECT_OPATH_FILE, resolve_flags_to, 0); if (__fd_to < 0) return -errno; fd_to = __fd_to; } else { fd_to = dfd_to; } if (fd_to >= 0) { ret = strnprintf(buf_to, sizeof(buf_to), "/proc/self/fd/%d", fd_to); if (ret < 0) return syserror("Failed to create path"); to = buf_to; } ret = mount(from ?: fs_name, to, fs_name, flags, data); if (ret < 0) return syserror("Failed to mount \"%s\" to \"%s\"", maybe_empty(from), maybe_empty(to)); TRACE("Mounted \"%s\" to \"%s\"", maybe_empty(from), maybe_empty(to)); return 0; } lxc-4.0.12/src/lxc/syscall_wrappers.h0000644061062106075000000002424214176403775014462 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_SYSCALL_WRAPPER_H #define __LXC_SYSCALL_WRAPPER_H #include "config.h" #include #include #include #include #include #include #include #include #include #include "macro.h" #include "syscall_numbers.h" #ifdef HAVE_LINUX_MEMFD_H #include #endif #ifdef HAVE_SYS_SIGNALFD_H #include #endif #if HAVE_SYS_PERSONALITY_H #include #endif typedef int32_t key_serial_t; #if !HAVE_KEYCTL static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5) { return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5); } #define keyctl __keyctl #endif #ifndef F_LINUX_SPECIFIC_BASE #define F_LINUX_SPECIFIC_BASE 1024 #endif #ifndef F_ADD_SEALS #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) #endif #ifndef F_SEAL_SEAL #define F_SEAL_SEAL 0x0001 #define F_SEAL_SHRINK 0x0002 #define F_SEAL_GROW 0x0004 #define F_SEAL_WRITE 0x0008 #endif #if !HAVE_MEMFD_CREATE static inline int memfd_create_lxc(const char *name, unsigned int flags) { return syscall(__NR_memfd_create, name, flags); } #define memfd_create memfd_create_lxc #else extern int memfd_create(const char *name, unsigned int flags); #endif #if !HAVE_PIVOT_ROOT static inline int pivot_root(const char *new_root, const char *put_old) { return syscall(__NR_pivot_root, new_root, put_old); } #else extern int pivot_root(const char *new_root, const char *put_old); #endif /* Define sethostname() if missing from the C library */ #if !HAVE_SETHOSTNAME static inline int sethostname(const char *name, size_t len) { return syscall(__NR_sethostname, name, len); } #endif /* Define setns() if missing from the C library */ #if !HAVE_SETNS static inline int setns(int fd, int nstype) { return syscall(__NR_setns, fd, nstype); } #endif #if !HAVE_SYS_SIGNALFD_H struct signalfd_siginfo { uint32_t ssi_signo; int32_t ssi_errno; int32_t ssi_code; uint32_t ssi_pid; uint32_t ssi_uid; int32_t ssi_fd; uint32_t ssi_tid; uint32_t ssi_band; uint32_t ssi_overrun; uint32_t ssi_trapno; int32_t ssi_status; int32_t ssi_int; uint64_t ssi_ptr; uint64_t ssi_utime; uint64_t ssi_stime; uint64_t ssi_addr; uint8_t __pad[48]; }; static inline int signalfd(int fd, const sigset_t *mask, int flags) { int retval; retval = syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags); #ifdef __NR_signalfd if (errno == ENOSYS && flags == 0) retval = syscall(__NR_signalfd, fd, mask, _NSIG / 8); #endif return retval; } #endif /* Define unshare() if missing from the C library */ #if !HAVE_UNSHARE static inline int unshare(int flags) { return syscall(__NR_unshare, flags); } #else extern int unshare(int); #endif /* Define faccessat() if missing from the C library */ #if !HAVE_FACCESSAT static int faccessat(int __fd, const char *__file, int __type, int __flag) { return syscall(__NR_faccessat, __fd, __file, __type, __flag); } #endif #if !HAVE_MOVE_MOUNT static inline int move_mount_lxc(int from_dfd, const char *from_pathname, int to_dfd, const char *to_pathname, unsigned int flags) { return syscall(__NR_move_mount, from_dfd, from_pathname, to_dfd, to_pathname, flags); } #define move_mount move_mount_lxc #else extern int move_mount(int from_dfd, const char *from_pathname, int to_dfd, const char *to_pathname, unsigned int flags); #endif #if !HAVE_OPEN_TREE static inline int open_tree_lxc(int dfd, const char *filename, unsigned int flags) { return syscall(__NR_open_tree, dfd, filename, flags); } #define open_tree open_tree_lxc #else extern int open_tree(int dfd, const char *filename, unsigned int flags); #endif #if !HAVE_FSOPEN static inline int fsopen_lxc(const char *fs_name, unsigned int flags) { return syscall(__NR_fsopen, fs_name, flags); } #define fsopen fsopen_lxc #else extern int fsopen(const char *fs_name, unsigned int flags); #endif #if !HAVE_FSPICK static inline int fspick_lxc(int dfd, const char *path, unsigned int flags) { return syscall(__NR_fspick, dfd, path, flags); } #define fspick fspick_lxc #else extern int fspick(int dfd, const char *path, unsigned int flags); #endif #if !HAVE_FSCONFIG static inline int fsconfig_lxc(int fd, unsigned int cmd, const char *key, const void *value, int aux) { return syscall(__NR_fsconfig, fd, cmd, key, value, aux); } #define fsconfig fsconfig_lxc #else extern int fsconfig(int fd, unsigned int cmd, const char *key, const void *value, int aux); #endif #if !HAVE_FSMOUNT static inline int fsmount_lxc(int fs_fd, unsigned int flags, unsigned int attr_flags) { return syscall(__NR_fsmount, fs_fd, flags, attr_flags); } #define fsmount fsmount_lxc #else extern int fsmount(int fs_fd, unsigned int flags, unsigned int attr_flags); #endif /* * mount_setattr() */ struct lxc_mount_attr { __u64 attr_set; __u64 attr_clr; __u64 propagation; __u64 userns_fd; }; #if !HAVE_MOUNT_SETATTR static inline int mount_setattr(int dfd, const char *path, unsigned int flags, struct lxc_mount_attr *attr, size_t size) { return syscall(__NR_mount_setattr, dfd, path, flags, attr, size); } #endif /* * Arguments for how openat2(2) should open the target path. If only @flags and * @mode are non-zero, then openat2(2) operates very similarly to openat(2). * * However, unlike openat(2), unknown or invalid bits in @flags result in * -EINVAL rather than being silently ignored. @mode must be zero unless one of * {O_CREAT, O_TMPFILE} are set. * * @flags: O_* flags. * @mode: O_CREAT/O_TMPFILE file mode. * @resolve: RESOLVE_* flags. */ struct lxc_open_how { __u64 flags; __u64 mode; __u64 resolve; }; /* how->resolve flags for openat2(2). */ #ifndef RESOLVE_NO_XDEV #define RESOLVE_NO_XDEV 0x01 /* Block mount-point crossings (includes bind-mounts). */ #endif #ifndef RESOLVE_NO_MAGICLINKS #define RESOLVE_NO_MAGICLINKS 0x02 /* Block traversal through procfs-style "magic-links". */ #endif #ifndef RESOLVE_NO_SYMLINKS #define RESOLVE_NO_SYMLINKS 0x04 /* Block traversal through all symlinks (implies OEXT_NO_MAGICLINKS) */ #endif #ifndef RESOLVE_BENEATH #define RESOLVE_BENEATH 0x08 /* Block "lexical" trickery like "..", symlinks, and absolute paths which escape the dirfd. */ #endif #ifndef RESOLVE_IN_ROOT #define RESOLVE_IN_ROOT 0x10 /* Make all jumps to "/" and ".." be scoped inside the dirfd (similar to chroot(2)). */ #endif #define PROTECT_LOOKUP_BENEATH (RESOLVE_BENEATH | RESOLVE_NO_XDEV | RESOLVE_NO_MAGICLINKS | RESOLVE_NO_SYMLINKS) #define PROTECT_LOOKUP_BENEATH_WITH_SYMLINKS (PROTECT_LOOKUP_BENEATH & ~RESOLVE_NO_SYMLINKS) #define PROTECT_LOOKUP_BENEATH_WITH_MAGICLINKS (PROTECT_LOOKUP_BENEATH & ~(RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS)) #define PROTECT_LOOKUP_BENEATH_XDEV (PROTECT_LOOKUP_BENEATH & ~RESOLVE_NO_XDEV) #define PROTECT_LOOKUP_ABSOLUTE (PROTECT_LOOKUP_BENEATH & ~RESOLVE_BENEATH) #define PROTECT_LOOKUP_ABSOLUTE_WITH_SYMLINKS (PROTECT_LOOKUP_ABSOLUTE & ~RESOLVE_NO_SYMLINKS) #define PROTECT_LOOKUP_ABSOLUTE_WITH_MAGICLINKS (PROTECT_LOOKUP_ABSOLUTE & ~(RESOLVE_NO_SYMLINKS | RESOLVE_NO_MAGICLINKS)) #define PROTECT_LOOKUP_ABSOLUTE_XDEV (PROTECT_LOOKUP_ABSOLUTE & ~RESOLVE_NO_XDEV) #define PROTECT_LOOKUP_ABSOLUTE_XDEV_SYMLINKS (PROTECT_LOOKUP_ABSOLUTE_WITH_SYMLINKS & ~RESOLVE_NO_XDEV) #define PROTECT_OPATH_FILE (O_NOFOLLOW | O_PATH | O_CLOEXEC) #define PROTECT_OPATH_DIRECTORY (PROTECT_OPATH_FILE | O_DIRECTORY) #define PROTECT_OPEN_WITH_TRAILING_SYMLINKS (O_CLOEXEC | O_NOCTTY | O_RDONLY) #define PROTECT_OPEN (PROTECT_OPEN_WITH_TRAILING_SYMLINKS | O_NOFOLLOW) #define PROTECT_OPEN_W_WITH_TRAILING_SYMLINKS (O_CLOEXEC | O_NOCTTY | O_WRONLY) #define PROTECT_OPEN_W (PROTECT_OPEN_W_WITH_TRAILING_SYMLINKS | O_NOFOLLOW) #define PROTECT_OPEN_RW (O_CLOEXEC | O_NOCTTY | O_RDWR | O_NOFOLLOW) #if !HAVE_OPENAT2 static inline int openat2(int dfd, const char *filename, struct lxc_open_how *how, size_t size) { return syscall(__NR_openat2, dfd, filename, how, size); } #endif /* HAVE_OPENAT2 */ #ifndef CLOSE_RANGE_UNSHARE #define CLOSE_RANGE_UNSHARE (1U << 1) #endif #ifndef CLOSE_RANGE_CLOEXEC #define CLOSE_RANGE_CLOEXEC (1U << 2) #endif #if !HAVE_CLOSE_RANGE static inline int close_range(unsigned int fd, unsigned int max_fd, unsigned int flags) { return syscall(__NR_close_range, fd, max_fd, flags); } #endif #if !HAVE_SYS_PERSONALITY_H static inline int personality(unsigned long persona) { return syscall(__NR_personality, persona); } #endif /* arg1 of prctl() */ #ifndef PR_SCHED_CORE #define PR_SCHED_CORE 62 #endif /* arg2 of prctl() */ #ifndef PR_SCHED_CORE_GET #define PR_SCHED_CORE_GET 0 #endif #ifndef PR_SCHED_CORE_CREATE #define PR_SCHED_CORE_CREATE 1 /* create unique core_sched cookie */ #endif #ifndef PR_SCHED_CORE_SHARE_TO #define PR_SCHED_CORE_SHARE_TO 2 /* push core_sched cookie to pid */ #endif #ifndef PR_SCHED_CORE_SHARE_FROM #define PR_SCHED_CORE_SHARE_FROM 3 /* pull core_sched cookie to pid */ #endif #ifndef PR_SCHED_CORE_MAX #define PR_SCHED_CORE_MAX 4 #endif /* arg3 of prctl() */ #ifndef PR_SCHED_CORE_SCOPE_THREAD #define PR_SCHED_CORE_SCOPE_THREAD 0 #endif #ifndef PR_SCHED_CORE_SCOPE_THREAD_GROUP #define PR_SCHED_CORE_SCOPE_THREAD_GROUP 1 #endif #ifndef PR_SCHED_CORE_SCOPE_PROCESS_GROUP #define PR_SCHED_CORE_SCOPE_PROCESS_GROUP 2 #endif #define INVALID_SCHED_CORE_COOKIE ((__u64)-1) static inline bool core_scheduling_cookie_valid(__u64 cookie) { return (cookie > 0) && (cookie != INVALID_SCHED_CORE_COOKIE); } static inline int core_scheduling_cookie_get(pid_t pid, __u64 *cookie) { int ret; if (!cookie) return ret_errno(EINVAL); ret = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, pid, PR_SCHED_CORE_SCOPE_THREAD, (unsigned long)cookie); if (ret) { *cookie = INVALID_SCHED_CORE_COOKIE; return -errno; } return 0; } static inline int core_scheduling_cookie_create_threadgroup(pid_t pid) { int ret; ret = prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, pid, PR_SCHED_CORE_SCOPE_THREAD_GROUP, 0); if (ret) return -errno; return 0; } static inline int core_scheduling_cookie_share_with(pid_t pid) { return prctl(PR_SCHED_CORE, PR_SCHED_CORE_SHARE_FROM, pid, PR_SCHED_CORE_SCOPE_THREAD, 0); } #endif /* __LXC_SYSCALL_WRAPPER_H */ lxc-4.0.12/src/lxc/ringbuf.c0000644061062106075000000000552614176403775012520 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include "ringbuf.h" #include "syscall_wrappers.h" #include "utils.h" int lxc_ringbuf_create(struct lxc_ringbuf *buf, size_t size) { __do_close int memfd = -EBADF; char *tmp; int ret; buf->size = size; buf->r_off = 0; buf->w_off = 0; /* verify that we are at least given the multiple of a page size */ if (buf->size % lxc_getpagesize()) return -EINVAL; buf->addr = mmap(NULL, buf->size * 2, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (buf->addr == MAP_FAILED) return -EINVAL; memfd = memfd_create(".lxc_ringbuf", MFD_CLOEXEC); if (memfd < 0) { char template[] = P_tmpdir "/.lxc_ringbuf_XXXXXX"; if (errno != ENOSYS) goto on_error; memfd = lxc_make_tmpfile(template, true); } if (memfd < 0) goto on_error; ret = ftruncate(memfd, buf->size); if (ret < 0) goto on_error; tmp = mmap(buf->addr, buf->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, memfd, 0); if (tmp == MAP_FAILED || tmp != buf->addr) goto on_error; tmp = mmap(buf->addr + buf->size, buf->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, memfd, 0); if (tmp == MAP_FAILED || tmp != (buf->addr + buf->size)) goto on_error; return 0; on_error: lxc_ringbuf_release(buf); return -1; } void lxc_ringbuf_move_read_addr(struct lxc_ringbuf *buf, size_t len) { buf->r_off += len; if (buf->r_off < buf->size) return; /* wrap around */ buf->r_off -= buf->size; buf->w_off -= buf->size; } /** * lxc_ringbuf_write - write a message to the ringbuffer * - The size of the message should never be greater than the size of the whole * ringbuffer. * - The write method will always succeed i.e. it will always advance the r_off * if it detects that there's not enough space available to write the * message. */ int lxc_ringbuf_write(struct lxc_ringbuf *buf, const char *msg, size_t len) { char *w_addr; uint64_t free; /* consistency check: a write should never exceed the ringbuffer's total size */ if (len > buf->size) return -EFBIG; free = lxc_ringbuf_free(buf); /* not enough space left so advance read address */ if (len > free) lxc_ringbuf_move_read_addr(buf, len); w_addr = lxc_ringbuf_get_write_addr(buf); memcpy(w_addr, msg, len); lxc_ringbuf_move_write_addr(buf, len); return 0; } int lxc_ringbuf_read(struct lxc_ringbuf *buf, char *out, size_t *len) { uint64_t used; /* there's nothing to read */ if (buf->r_off == buf->w_off) return -ENODATA; /* read maximum amount available */ used = lxc_ringbuf_used(buf); if (used < *len) *len = used; /* copy data to reader but don't advance addr */ memcpy(out, lxc_ringbuf_get_read_addr(buf), *len); out[*len - 1] = '\0'; return 0; } lxc-4.0.12/src/lxc/syscall_numbers.h0000644061062106075000000004332014176403775014270 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_SYSCALL_NUMBERS_H #define __LXC_SYSCALL_NUMBERS_H #include "config.h" #include #include #include #include #include #include #include #include #ifdef HAVE_LINUX_MEMFD_H #include #endif #ifdef HAVE_SYS_SIGNALFD_H #include #endif #ifndef __NR_keyctl #if defined __i386__ #define __NR_keyctl 288 #elif defined __x86_64__ #define __NR_keyctl 250 #elif defined __arm__ #define __NR_keyctl 311 #elif defined __aarch64__ #define __NR_keyctl 311 #elif defined __s390__ #define __NR_keyctl 280 #elif defined __powerpc__ #define __NR_keyctl 271 #elif defined __riscv #define __NR_keyctl 219 #elif defined __sparc__ #define __NR_keyctl 283 #elif defined __ia64__ #define __NR_keyctl (249 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_keyctl 4282 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_keyctl 6245 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_keyctl 5241 #endif #else #define -1 #warning "__NR_keyctl not defined for your architecture" #endif #endif #ifndef __NR_memfd_create #if defined __i386__ #define __NR_memfd_create 356 #elif defined __x86_64__ #define __NR_memfd_create 319 #elif defined __arm__ #define __NR_memfd_create 385 #elif defined __aarch64__ #define __NR_memfd_create 279 #elif defined __s390__ #define __NR_memfd_create 350 #elif defined __powerpc__ #define __NR_memfd_create 360 #elif defined __riscv #define __NR_memfd_create 279 #elif defined __sparc__ #define __NR_memfd_create 348 #elif defined __blackfin__ #define __NR_memfd_create 390 #elif defined __ia64__ #define __NR_memfd_create 1340 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 #define __NR_memfd_create 4354 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 #define __NR_memfd_create 6318 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 #define __NR_memfd_create 5314 #endif #else #define -1 #warning "__NR_memfd_create not defined for your architecture" #endif #endif #ifndef __NR_pivot_root #if defined __i386__ #define __NR_pivot_root 217 #elif defined __x86_64__ #define __NR_pivot_root 155 #elif defined __arm__ #define __NR_pivot_root 218 #elif defined __aarch64__ #define __NR_pivot_root 218 #elif defined __s390__ #define __NR_pivot_root 217 #elif defined __powerpc__ #define __NR_pivot_root 203 #elif defined __riscv #define __NR_pivot_root 41 #elif defined __sparc__ #define __NR_pivot_root 146 #elif defined __ia64__ #define __NR_pivot_root (183 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_pivot_root 4216 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_pivot_root 6151 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_pivot_root 5151 #endif #else #define -1 #warning "__NR_pivot_root not defined for your architecture" #endif #endif #ifndef __NR_setns #if defined __i386__ #define __NR_setns 346 #elif defined __x86_64__ #define __NR_setns 308 #elif defined __arm__ #define __NR_setns 375 #elif defined __aarch64__ #define __NR_setns 375 #elif defined __s390__ #define __NR_setns 339 #elif defined __powerpc__ #define __NR_setns 350 #elif defined __riscv #define __NR_setns 268 #elif defined __sparc__ #define __NR_setns 337 #elif defined __ia64__ #define __NR_setns (306 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_setns 4344 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_setns 6308 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_setns 5303 #endif #else #define -1 #warning "__NR_setns not defined for your architecture" #endif #endif #ifndef __NR_sethostname #if defined __i386__ #define __NR_sethostname 74 #elif defined __x86_64__ #define __NR_sethostname 170 #elif defined __arm__ #define __NR_sethostname 74 #elif defined __aarch64__ #define __NR_sethostname 74 #elif defined __s390__ #define __NR_sethostname 74 #elif defined __powerpc__ #define __NR_sethostname 74 #elif defined __riscv #define __NR_sethostname 161 #elif defined __sparc__ #define __NR_sethostname 88 #elif defined __ia64__ #define __NR_sethostname (59 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_sethostname 474 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_sethostname 6165 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_sethostname 5165 #endif #else #define -1 #warning "__NR_sethostname not defined for your architecture" #endif #endif #ifndef __NR_signalfd #if defined __i386__ #define __NR_signalfd 321 #elif defined __x86_64__ #define __NR_signalfd 282 #elif defined __arm__ #define __NR_signalfd 349 #elif defined __aarch64__ #define __NR_signalfd 349 #elif defined __s390__ #define __NR_signalfd 316 #elif defined __powerpc__ #define __NR_signalfd 305 #elif defined __riscv #define __NR_signalfd 74 #elif defined __sparc__ #define __NR_signalfd 311 #elif defined __ia64__ #define __NR_signalfd (283 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_signalfd 4317 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_signalfd 6280 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_signalfd 5276 #endif #endif #endif #ifndef __NR_signalfd4 #if defined __i386__ #define __NR_signalfd4 327 #elif defined __x86_64__ #define __NR_signalfd4 289 #elif defined __arm__ #define __NR_signalfd4 355 #elif defined __aarch64__ #define __NR_signalfd4 355 #elif defined __s390__ #define __NR_signalfd4 322 #elif defined __powerpc__ #define __NR_signalfd4 313 #elif defined __riscv #define __NR_signalfd4 74 #elif defined __sparc__ #define __NR_signalfd4 317 #elif defined __ia64__ #define __NR_signalfd4 (289 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_signalfd4 4324 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_signalfd4 6287 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_signalfd4 5283 #endif #else #define -1 #warning "__NR_signalfd4 not defined for your architecture" #endif #endif #ifndef __NR_unshare #if defined __i386__ #define __NR_unshare 310 #elif defined __x86_64__ #define __NR_unshare 272 #elif defined __arm__ #define __NR_unshare 337 #elif defined __aarch64__ #define __NR_unshare 337 #elif defined __s390__ #define __NR_unshare 303 #elif defined __powerpc__ #define __NR_unshare 282 #elif defined __riscv #define __NR_unshare 97 #elif defined __sparc__ #define __NR_unshare 299 #elif defined __ia64__ #define __NR_unshare (272 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_unshare 4303 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_unshare 6266 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_unshare 5262 #endif #else #define -1 #warning "__NR_unshare not defined for your architecture" #endif #endif #ifndef __NR_bpf #if defined __i386__ #define __NR_bpf 357 #elif defined __x86_64__ #define __NR_bpf 321 #elif defined __arm__ #define __NR_bpf 386 #elif defined __aarch64__ #define __NR_bpf 386 #elif defined __s390__ #define __NR_bpf 351 #elif defined __powerpc__ #define __NR_bpf 361 #elif defined __riscv #define __NR_bpf 280 #elif defined __sparc__ #define __NR_bpf 349 #elif defined __ia64__ #define __NR_bpf (317 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_bpf 4355 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_bpf 6319 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_bpf 5315 #endif #else #define -1 #warning "__NR_bpf not defined for your architecture" #endif #endif #ifndef __NR_faccessat #if defined __i386__ #define __NR_faccessat 307 #elif defined __x86_64__ #define __NR_faccessat 269 #elif defined __arm__ #define __NR_faccessat 334 #elif defined __aarch64__ #define __NR_faccessat 334 #elif defined __s390__ #define __NR_faccessat 300 #elif defined __powerpc__ #define __NR_faccessat 298 #elif defined __riscv #define __NR_faccessat 48 #elif defined __sparc__ #define __NR_faccessat 296 #elif defined __ia64__ #define __NR_faccessat (269 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_faccessat 4300 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_faccessat 6263 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_faccessat 5259 #endif #else #define -1 #warning "__NR_faccessat not defined for your architecture" #endif #endif #ifndef __NR_pidfd_send_signal #if defined __alpha__ #define __NR_pidfd_send_signal 534 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_pidfd_send_signal 4424 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_pidfd_send_signal 6424 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_pidfd_send_signal 5424 #endif #elif defined __ia64__ #define __NR_pidfd_send_signal (424 + 1024) #else #define __NR_pidfd_send_signal 424 #endif #endif #ifndef __NR_seccomp #if defined __i386__ #define __NR_seccomp 354 #elif defined __x86_64__ #define __NR_seccomp 317 #elif defined __arm__ #define __NR_seccomp 383 #elif defined __aarch64__ #define __NR_seccomp 383 #elif defined __s390__ #define __NR_seccomp 348 #elif defined __powerpc__ #define __NR_seccomp 358 #elif defined __riscv #define __NR_seccomp 277 #elif defined __sparc__ #define __NR_seccomp 346 #elif defined __ia64__ #define __NR_seccomp (329 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_seccomp 4352 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_seccomp 6316 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_seccomp 5312 #endif #else #define -1 #warning "__NR_seccomp not defined for your architecture" #endif #endif #ifndef __NR_gettid #if defined __i386__ #define __NR_gettid 224 #elif defined __x86_64__ #define __NR_gettid 186 #elif defined __arm__ #define __NR_gettid 224 #elif defined __aarch64__ #define __NR_gettid 224 #elif defined __s390__ #define __NR_gettid 236 #elif defined __powerpc__ #define __NR_gettid 207 #elif defined __riscv #define __NR_gettid 178 #elif defined __sparc__ #define __NR_gettid 143 #elif defined __ia64__ #define __NR_gettid (81 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_gettid 4222 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_gettid 6178 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_gettid 5178 #endif #else #define -1 #warning "__NR_gettid not defined for your architecture" #endif #endif #ifndef __NR_execveat #if defined __i386__ #define __NR_execveat 358 #elif defined __x86_64__ #ifdef __ILP32__ /* x32 */ #define __NR_execveat 545 #else #define __NR_execveat 322 #endif #elif defined __arm__ #define __NR_execveat 387 #elif defined __aarch64__ #define __NR_execveat 387 #elif defined __s390__ #define __NR_execveat 354 #elif defined __powerpc__ #define __NR_execveat 362 #elif defined __riscv #define __NR_execveat 281 #elif defined __sparc__ #define __NR_execveat 350 #elif defined __ia64__ #define __NR_execveat (318 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_execveat 4356 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_execveat 6320 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_execveat 5316 #endif #else #define -1 #warning "__NR_execveat not defined for your architecture" #endif #endif #ifndef __NR_move_mount #if defined __alpha__ #define __NR_move_mount 539 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_move_mount 4429 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_move_mount 6429 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_move_mount 5429 #endif #elif defined __ia64__ #define __NR_move_mount (428 + 1024) #else #define __NR_move_mount 429 #endif #endif #ifndef __NR_open_tree #if defined __alpha__ #define __NR_open_tree 538 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_open_tree 4428 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_open_tree 6428 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_open_tree 5428 #endif #elif defined __ia64__ #define __NR_open_tree (428 + 1024) #else #define __NR_open_tree 428 #endif #endif #ifndef __NR_clone3 #if defined __alpha__ #define __NR_clone3 545 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_clone3 4435 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_clone3 6435 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_clone3 5435 #endif #elif defined __ia64__ #define __NR_clone3 (435 + 1024) #else #define __NR_clone3 435 #endif #endif #ifndef __NR_fsopen #if defined __alpha__ #define __NR_fsopen 540 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_fsopen 4430 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_fsopen 6430 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_fsopen 5430 #endif #elif defined __ia64__ #define __NR_fsopen (430 + 1024) #else #define __NR_fsopen 430 #endif #endif #ifndef __NR_fspick #if defined __alpha__ #define __NR_fspick 543 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_fspick 4433 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_fspick 6433 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_fspick 5433 #endif #elif defined __ia64__ #define __NR_fspick (433 + 1024) #else #define __NR_fspick 433 #endif #endif #ifndef __NR_fsconfig #if defined __alpha__ #define __NR_fsconfig 541 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_fsconfig 4431 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_fsconfig 6431 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_fsconfig 5431 #endif #elif defined __ia64__ #define __NR_fsconfig (431 + 1024) #else #define __NR_fsconfig 431 #endif #endif #ifndef __NR_fsmount #if defined __alpha__ #define __NR_fsmount 542 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_fsmount 4432 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_fsmount 6432 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_fsmount 5432 #endif #elif defined __ia64__ #define __NR_fsmount (432 + 1024) #else #define __NR_fsmount 432 #endif #endif #ifndef __NR_openat2 #if defined __alpha__ #define __NR_openat2 547 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_openat2 4437 #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_openat2 6437 #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_openat2 5437 #endif #elif defined __ia64__ #define __NR_openat2 (437 + 1024) #else #define __NR_openat2 437 #endif #endif #ifndef __NR_close_range #if defined __alpha__ #define __NR_close_range 546 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_close_range (436 + 4000) #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_close_range (436 + 6000) #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_close_range (436 + 5000) #endif #elif defined __ia64__ #define __NR_close_range (436 + 1024) #else #define __NR_close_range 436 #endif #endif #ifndef __NR_mount_setattr #if defined __alpha__ #define __NR_mount_setattr 552 #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_mount_setattr (442 + 4000) #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_mount_setattr (442 + 6000) #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_mount_setattr (442 + 5000) #endif #elif defined __ia64__ #define __NR_mount_setattr (442 + 1024) #else #define __NR_mount_setattr 442 #endif #endif #ifndef __NR_personality #if defined __alpha__ #define __NR_personality 324 #elif defined __m68k__ #define __NR_personality 136 #elif defined __i386__ #define __NR_personality 136 #elif defined __x86_64__ #define __NR_personality 135 #elif defined __arm__ #define __NR_personality 136 #elif defined __aarch64__ #define __NR_personality 92 #elif defined __s390__ #define __NR_personality 136 #elif defined __powerpc__ #define __NR_personality 136 #elif defined __riscv #define __NR_personality -1 #elif defined __sparc__ #define __NR_personality 191 #elif defined __ia64__ #define __NR_personality (116 + 1024) #elif defined _MIPS_SIM #if _MIPS_SIM == _MIPS_SIM_ABI32 /* o32 */ #define __NR_personality (136 + 4000) #endif #if _MIPS_SIM == _MIPS_SIM_NABI32 /* n32 */ #define __NR_personality (132 + 6000) #endif #if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */ #define __NR_personality (132 + 5000) #endif #else #define -1 #warning "__NR_personality not defined for your architecture" #endif #endif #endif /* __LXC_SYSCALL_NUMBERS_H */ lxc-4.0.12/src/lxc/caps.h0000644061062106075000000000500114176403775012003 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #ifndef __LXC_CAPS_H #define __LXC_CAPS_H #include "config.h" #include #include "compiler.h" #if HAVE_LIBCAP #include /* workaround for libcap < 2.17 bug */ #include __hidden extern int lxc_caps_down(void); __hidden extern int lxc_caps_up(void); __hidden extern int lxc_ambient_caps_up(void); __hidden extern int lxc_ambient_caps_down(void); __hidden extern int lxc_caps_init(void); __hidden extern int lxc_caps_last_cap(__u32 *cap); __hidden extern bool lxc_proc_cap_is_set(cap_value_t cap, cap_flag_t flag); __hidden extern bool lxc_file_cap_is_set(const char *path, cap_value_t cap, cap_flag_t flag); #else static inline int lxc_caps_down(void) { return 0; } static inline int lxc_caps_up(void) { return 0; } static inline int lxc_ambient_caps_up(void) { return 0; } static inline int lxc_ambient_caps_down(void) { return 0; } static inline int lxc_caps_init(void) { return 0; } static inline int lxc_caps_last_cap(__u32 *cap) { return 0; } typedef int cap_value_t; typedef int cap_flag_t; static inline bool lxc_proc_cap_is_set(cap_value_t cap, cap_flag_t flag) { return false; } static inline bool lxc_file_cap_is_set(const char *path, cap_value_t cap, cap_flag_t flag) { return false; } #endif #define lxc_priv(__lxc_function) \ ({ \ __label__ out; \ int __ret, __ret2, ___errno = 0; \ __ret = lxc_caps_up(); \ if (__ret) \ goto out; \ __ret = __lxc_function; \ if (__ret) \ ___errno = errno; \ __ret2 = lxc_caps_down(); \ out: \ __ret ? errno = ___errno, __ret : __ret2; \ }) #define lxc_unpriv(__lxc_function) \ ({ \ __label__ out; \ int __ret, __ret2, ___errno = 0; \ __ret = lxc_caps_down(); \ if (__ret) \ goto out; \ __ret = __lxc_function; \ if (__ret) \ ___errno = errno; \ __ret2 = lxc_caps_up(); \ out: \ __ret ? errno = ___errno, __ret : __ret2; \ }) #endif lxc-4.0.12/src/lxc/lxccontainer.c0000644061062106075000000040037614176403775013557 00000000000000/* SPDX-License-Identifier: LGPL-2.1+ */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "lxc.h" #include "netns_ifaddrs.h" #include "af_unix.h" #include "api_extensions.h" #include "attach.h" #include "cgroup.h" #include "macro.h" #include "commands.h" #include "commands_utils.h" #include "conf.h" #include "confile.h" #include "confile_utils.h" #include "criu.h" #include "error.h" #include "initutils.h" #include "log.h" #include "lxc.h" #include "lxclock.h" #include "memory_utils.h" #include "monitor.h" #include "namespace.h" #include "network.h" #include "parse.h" #include "process_utils.h" #include "start.h" #include "state.h" #include "storage.h" #include "storage/btrfs.h" #include "storage/overlay.h" #include "storage_utils.h" #include "sync.h" #include "syscall_wrappers.h" #include "terminal.h" #include "utils.h" #include "version.h" #if HAVE_OPENSSL #include #endif /* major()/minor() */ #ifdef MAJOR_IN_MKDEV #include #endif #if IS_BIONIC #include <../include/lxcmntent.h> #else #include #endif #if !HAVE_STRLCPY #include "include/strlcpy.h" #endif lxc_log_define(lxccontainer, lxc); static bool do_lxcapi_destroy(struct lxc_container *c); static const char *lxcapi_get_config_path(struct lxc_container *c); #define do_lxcapi_get_config_path(c) lxcapi_get_config_path(c) static bool do_lxcapi_set_config_item(struct lxc_container *c, const char *key, const char *v); static bool container_destroy(struct lxc_container *c, struct lxc_storage *storage); static bool get_snappath_dir(struct lxc_container *c, char *snappath); static bool lxcapi_snapshot_destroy_all(struct lxc_container *c); static bool do_lxcapi_save_config(struct lxc_container *c, const char *alt_file); static bool config_file_exists(const char *lxcpath, const char *cname) { __do_free char *fname = NULL; int ret; size_t len; /* $lxcpath + '/' + $cname + '/config' + \0 */ len = strlen(lxcpath) + 1 + strlen(cname) + 1 + strlen(LXC_CONFIG_FNAME) + 1; fname = must_realloc(NULL, len); ret = strnprintf(fname, len, "%s/%s/%s", lxcpath, cname, LXC_CONFIG_FNAME); if (ret < 0) return false; return file_exists(fname); } /* * A few functions to help detect when a container creation failed. If a * container creation was killed partway through, then trying to actually start * that container could harm the host. We detect this by creating a 'partial' * file under the container directory, and keeping an advisory lock. When * container creation completes, we remove that file. When we load or try to * start a container, if we find that file, without a flock, we remove the * container. */ enum { LXC_CREATE_FAILED = -1, LXC_CREATE_SUCCESS = 0, LXC_CREATE_ONGOING = 1, LXC_CREATE_INCOMPLETE = 2, }; static int ongoing_create(struct lxc_container *c) { __do_close int fd = -EBADF; __do_free char *path = NULL; struct flock lk = {0}; int ret; size_t len; len = strlen(c->config_path) + 1 + strlen(c->name) + 1 + strlen(LXC_PARTIAL_FNAME) + 1; path = must_realloc(NULL, len); ret = strnprintf(path, len, "%s/%s/%s", c->config_path, c->name, LXC_PARTIAL_FNAME); if (ret < 0) return LXC_CREATE_FAILED; fd = open(path, O_RDWR | O_CLOEXEC); if (fd < 0) { if (errno != ENOENT) return LXC_CREATE_FAILED; return LXC_CREATE_SUCCESS; } lk.l_type = F_WRLCK; lk.l_whence = SEEK_SET; /* * F_OFD_GETLK requires that l_pid be set to 0 otherwise the kernel * will EINVAL us. */ lk.l_pid = 0; ret = fcntl(fd, F_OFD_GETLK, &lk); if (ret < 0 && errno == EINVAL) { ret = flock(fd, LOCK_EX | LOCK_NB); if (ret < 0 && errno == EWOULDBLOCK) ret = 0; } /* F_OFD_GETLK will not send us back a pid so don't check it. */ if (ret == 0) /* Create is still ongoing. */ return LXC_CREATE_ONGOING; /* Create completed but partial is still there. */ return LXC_CREATE_INCOMPLETE; } static int create_partial(int fd_rootfs, struct lxc_container *c) { __do_close int fd_partial = -EBADF; int ret; struct flock lk = {0}; fd_partial = openat(fd_rootfs, LXC_PARTIAL_FNAME, O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0000); if (fd_partial < 0) return syserror("errno(%d) - Failed to create \"%d/" LXC_PARTIAL_FNAME "\" to mark container as partially created", errno, fd_rootfs); lk.l_type = F_WRLCK; lk.l_whence = SEEK_SET; ret = fcntl(fd_partial, F_OFD_SETLKW, &lk); if (ret < 0) { if (errno == EINVAL) { ret = flock(fd_partial, LOCK_EX); if (ret == 0) return move_fd(fd_partial); } return syserror("Failed to lock partial file \"%d/" LXC_PARTIAL_FNAME"\"", fd_rootfs); } TRACE("Created \"%d/" LXC_PARTIAL_FNAME "\" to mark container as partially created", fd_rootfs); return move_fd(fd_partial); } static void remove_partial(struct lxc_container *c, int fd) { __do_free char *path = NULL; int ret; size_t len; close(fd); /* $lxcpath + '/' + $name + '/partial' + \0 */ len = strlen(c->config_path) + 1 + strlen(c->name) + 1 + strlen(LXC_PARTIAL_FNAME) + 1; path = must_realloc(NULL, len); ret = strnprintf(path, len, "%s/%s/%s", c->config_path, c->name, LXC_PARTIAL_FNAME); if (ret < 0) return; ret = unlink(path); if (ret < 0) SYSERROR("Failed to remove partial file %s", path); } /* LOCKING * 1. container_mem_lock(c) protects the struct lxc_container from multiple threads. * 2. container_disk_lock(c) protects the on-disk container data - in particular the * container configuration file. * The container_disk_lock also takes the container_mem_lock. * 3. thread_mutex protects process data (ex: fd table) from multiple threads. * NOTHING mutexes two independent programs with their own struct * lxc_container for the same c->name, between API calls. For instance, * c->config_read(); c->start(); Between those calls, data on disk * could change (which shouldn't bother the caller unless for instance * the rootfs get moved). c->config_read(); update; c->config_write(); * Two such updaters could race. The callers should therefore check their * results. Trying to prevent that would necessarily expose us to deadlocks * due to hung callers. So I prefer to keep the locks only within our own * functions, not across functions. * * If you're going to clone while holding a lxccontainer, increment * c->numthreads (under privlock) before forking. When deleting, * decrement numthreads under privlock, then if it hits 0 you can delete. * Do not ever use a lxccontainer whose numthreads you did not bump. */ static void lxc_container_free(struct lxc_container *c) { if (!c) return; free(c->configfile); c->configfile = NULL; free(c->error_string); c->error_string = NULL; if (c->slock) { lxc_putlock(c->slock); c->slock = NULL; } if (c->privlock) { lxc_putlock(c->privlock); c->privlock = NULL; } free(c->name); c->name = NULL; if (c->lxc_conf) { lxc_conf_free(c->lxc_conf); c->lxc_conf = NULL; } free(c->config_path); c->config_path = NULL; free(c); } /* Consider the following case: * * |====================================================================| * | freer | racing get()er | * |====================================================================| * | lxc_container_put() | lxc_container_get() | * | \ lxclock(c->privlock) | c->numthreads < 1? (no) | * | \ c->numthreads = 0 | \ lxclock(c->privlock) -> waits | * | \ lxcunlock() | \ | * | \ lxc_container_free() | \ lxclock() returns | * | | \ c->numthreads < 1 -> return 0 | * | \ \ (free stuff) | | * | \ \ sem_destroy(privlock) | | * |_______________________________|____________________________________| * * When the get()er checks numthreads the first time, one of the following * is true: * 1. freer has set numthreads = 0. get() returns 0 * 2. freer is between lxclock and setting numthreads to 0. get()er will * sem_wait on privlock, get lxclock after freer() drops it, then see * numthreads is 0 and exit without touching lxclock again.. * 3. freer has not yet locked privlock. If get()er runs first, then put()er * will see --numthreads = 1 and not call lxc_container_free(). */ int lxc_container_get(struct lxc_container *c) { if (!c) return 0; /* If someone else has already started freeing the container, don't try * to take the lock, which may be invalid. */ if (c->numthreads < 1) return 0; if (container_mem_lock(c)) return 0; /* Bail without trying to unlock, bc the privlock is now probably in * freed memory. */ if (c->numthreads < 1) return 0; c->numthreads++; container_mem_unlock(c); return 1; } int lxc_container_put(struct lxc_container *c) { if (!c) return -1; if (container_mem_lock(c)) return -1; c->numthreads--; if (c->numthreads < 1) { container_mem_unlock(c); lxc_container_free(c); return 1; } container_mem_unlock(c); return 0; } static bool do_lxcapi_is_defined(struct lxc_container *c) { int statret; struct stat statbuf; bool ret = false; if (!c) return false; if (container_mem_lock(c)) return false; if (!c->configfile) goto on_error; statret = stat(c->configfile, &statbuf); if (statret != 0) goto on_error; ret = true; on_error: container_mem_unlock(c); return ret; } #define WRAP_API(rettype, fnname) \ static rettype fnname(struct lxc_container *c) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } #define WRAP_API_1(rettype, fnname, t1) \ static rettype fnname(struct lxc_container *c, t1 a1) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c, a1); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } #define WRAP_API_2(rettype, fnname, t1, t2) \ static rettype fnname(struct lxc_container *c, t1 a1, t2 a2) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c, a1, a2); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } #define WRAP_API_3(rettype, fnname, t1, t2, t3) \ static rettype fnname(struct lxc_container *c, t1 a1, t2 a2, t3 a3) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c, a1, a2, a3); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } #define WRAP_API_5(rettype, fnname, t1, t2, t3, t4, t5) \ static rettype fnname(struct lxc_container *c, t1 a1, t2 a2, t3 a3, \ t4 a4, t5 a5) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c, a1, a2, a3, a4, a5); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } #define WRAP_API_6(rettype, fnname, t1, t2, t3, t4, t5, t6) \ static rettype fnname(struct lxc_container *c, t1 a1, t2 a2, t3 a3, \ t4 a4, t5 a5, t6 a6) \ { \ rettype ret; \ bool reset_config = false; \ \ if (!current_config && c && c->lxc_conf) { \ current_config = c->lxc_conf; \ reset_config = true; \ } \ \ ret = do_##fnname(c, a1, a2, a3, a4, a5, a6); \ if (reset_config) \ current_config = NULL; \ \ return ret; \ } WRAP_API(bool, lxcapi_is_defined) static const char *do_lxcapi_state(struct lxc_container *c) { lxc_state_t s; if (!c) return NULL; s = lxc_getstate(c->name, c->config_path); return lxc_state2str(s); } WRAP_API(const char *, lxcapi_state) static bool is_stopped(struct lxc_container *c) { lxc_state_t s; s = lxc_getstate(c->name, c->config_path); return (s == STOPPED); } static bool do_lxcapi_is_running(struct lxc_container *c) { if (!c) return false; return !is_stopped(c); } WRAP_API(bool, lxcapi_is_running) static bool do_lxcapi_freeze(struct lxc_container *c) { int ret = 0; lxc_state_t s; if (!c || !c->lxc_conf) return false; s = lxc_getstate(c->name, c->config_path); if (s != FROZEN) { ret = cgroup_freeze(c->name, c->config_path, -1); if (ret == -ENOCGROUP2) ret = lxc_freeze(c->lxc_conf, c->name, c->config_path); } return ret == 0; } WRAP_API(bool, lxcapi_freeze) static bool do_lxcapi_unfreeze(struct lxc_container *c) { int ret = 0; lxc_state_t s; if (!c || !c->lxc_conf) return false; s = lxc_getstate(c->name, c->config_path); if (s == FROZEN) { ret = cgroup_unfreeze(c->name, c->config_path, -1); if (ret == -ENOCGROUP2) ret = lxc_unfreeze(c->lxc_conf, c->name, c->config_path); } return ret == 0; } WRAP_API(bool, lxcapi_unfreeze) static int do_lxcapi_console_getfd(struct lxc_container *c, int *ttynum, int *ptxfd) { if (!c) return -1; return lxc_terminal_getfd(c, ttynum, ptxfd); } WRAP_API_2(int, lxcapi_console_getfd, int *, int *) static int lxcapi_console(struct lxc_container *c, int ttynum, int stdinfd, int stdoutfd, int stderrfd, int escape) { int ret; if (!c) return -1; current_config = c->lxc_conf; ret = lxc_console(c, ttynum, stdinfd, stdoutfd, stderrfd, escape); current_config = NULL; return ret; } static int do_lxcapi_console_log(struct lxc_container *c, struct lxc_console_log *log) { int ret; if (!c) return -EINVAL; ret = lxc_cmd_console_log(c->name, do_lxcapi_get_config_path(c), log); if (ret < 0) { if (ret == -ENODATA) NOTICE("The console log is empty"); else if (ret == -EFAULT) NOTICE("The container does not keep a console log"); else if (ret == -ENOENT) NOTICE("The container does not keep a console log file"); else if (ret == -EIO) NOTICE("Failed to write console log to log file"); else ERROR("Failed to retrieve console log"); } return ret; } WRAP_API_1(int, lxcapi_console_log, struct lxc_console_log *) static pid_t do_lxcapi_init_pid(struct lxc_container *c) { if (!c) return -1; return lxc_cmd_get_init_pid(c->name, c->config_path); } WRAP_API(pid_t, lxcapi_init_pid) static int do_lxcapi_init_pidfd(struct lxc_container *c) { if (!c) return ret_errno(EBADF); return lxc_cmd_get_init_pidfd(c->name, c->config_path); } WRAP_API(int, lxcapi_init_pidfd) static int do_lxcapi_devpts_fd(struct lxc_container *c) { if (!c) return ret_errno(EBADF); return lxc_cmd_get_devpts_fd(c->name, c->config_path); } WRAP_API(int, lxcapi_devpts_fd) static bool load_config_locked(struct lxc_container *c, const char *fname) { if (!c->lxc_conf) c->lxc_conf = lxc_conf_init(); if (!c->lxc_conf) return false; if (lxc_config_read(fname, c->lxc_conf, false) != 0) return false; c->lxc_conf->name = c->name; return true; } static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file) { int lret; const char *fname; bool need_disklock = false, ret = false; if (!c) return false; fname = c->configfile; if (alt_file) fname = alt_file; if (!fname) return false; /* If we're reading something other than the container's config, we only * need to lock the in-memory container. If loading the container's * config file, take the disk lock. */ if (strequal(fname, c->configfile)) need_disklock = true; if (need_disklock) lret = container_disk_lock(c); else lret = container_mem_lock(c); if (lret) return false; ret = load_config_locked(c, fname); if (need_disklock) container_disk_unlock(c); else container_mem_unlock(c); return ret; } WRAP_API_1(bool, lxcapi_load_config, const char *) static bool do_lxcapi_want_daemonize(struct lxc_container *c, bool state) { if (!c || !c->lxc_conf) return false; if (container_mem_lock(c)) return false; c->daemonize = state; container_mem_unlock(c); return true; } WRAP_API_1(bool, lxcapi_want_daemonize, bool) static bool do_lxcapi_want_close_all_fds(struct lxc_container *c, bool state) { if (!c || !c->lxc_conf) return false; if (container_mem_lock(c)) return false; c->lxc_conf->close_all_fds = state; container_mem_unlock(c); return true; } WRAP_API_1(bool, lxcapi_want_close_all_fds, bool) static bool do_lxcapi_wait(struct lxc_container *c, const char *state, int timeout) { int ret; if (!c) return false; ret = lxc_wait(c->name, state, timeout, c->config_path); return ret == 0; } WRAP_API_2(bool, lxcapi_wait, const char *, int) static bool am_single_threaded(void) { __do_closedir DIR *dir = NULL; struct dirent *direntp; int count = 0; dir = opendir("/proc/self/task"); if (!dir) return false; while ((direntp = readdir(dir))) { if (strequal(direntp->d_name, ".")) continue; if (strequal(direntp->d_name, "..")) continue; count++; if (count > 1) break; } return count == 1; } static void push_arg(char ***argp, char *arg, int *nargs) { char *copy; char **argv; copy = must_copy_string(arg); do { argv = realloc(*argp, (*nargs + 2) * sizeof(char *)); } while (!argv); *argp = argv; argv[*nargs] = copy; (*nargs)++; argv[*nargs] = NULL; } static char **split_init_cmd(const char *incmd) { __do_free char *copy = NULL; char *p; char **argv; int nargs = 0; if (!incmd) return NULL; copy = must_copy_string(incmd); do { argv = malloc(sizeof(char *)); } while (!argv); argv[0] = NULL; lxc_iterate_parts (p, copy, " ") push_arg(&argv, p, &nargs); if (nargs == 0) { free(argv); return NULL; } return argv; } static void free_init_cmd(char **argv) { int i = 0; if (!argv) return; while (argv[i]) free(argv[i++]); free(argv); } static int lxc_rcv_status(int state_socket) { int ret; int state = -1; again: /* Receive container state. */ ret = lxc_abstract_unix_rcv_credential(state_socket, &state, sizeof(int)); if (ret <= 0) { if (errno != EINTR) return -1; TRACE("Caught EINTR; retrying"); goto again; } return state; } static bool wait_on_daemonized_start(struct lxc_handler *handler, int pid) { int ret, state; /* The first child is going to fork() again and then exits. So we reap * the first child here. */ ret = wait_for_pid(pid); if (ret < 0) DEBUG("Failed waiting on first child %d", pid); else DEBUG("First child %d exited", pid); /* Close write end of the socket pair. */ close_prot_errno_disarm(handler->state_socket_pair[1]); state = lxc_rcv_status(handler->state_socket_pair[0]); /* Close read end of the socket pair. */ close_prot_errno_disarm(handler->state_socket_pair[0]); if (state < 0) { SYSERROR("Failed to receive the container state"); return false; } /* If we receive anything else then running we know that the container * failed to start. */ if (state != RUNNING) { ERROR("Received container state \"%s\" instead of \"RUNNING\"", lxc_state2str(state)); return false; } TRACE("Container is in \"RUNNING\" state"); return true; } static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const argv[]) { int ret; struct lxc_handler *handler; struct lxc_conf *conf; char *default_args[] = { "/sbin/init", NULL, }; char **init_cmd = NULL; /* container does exist */ if (!c) return false; /* If anything fails before we set error_num, we want an error in there. */ c->error_num = 1; /* Container has not been setup. */ if (!c->lxc_conf) return false; ret = ongoing_create(c); switch (ret) { case LXC_CREATE_FAILED: ERROR("Failed checking for incomplete container creation"); return false; case LXC_CREATE_ONGOING: ERROR("Ongoing container creation detected"); return false; case LXC_CREATE_INCOMPLETE: ERROR("Failed to create container"); do_lxcapi_destroy(c); return false; } if (container_mem_lock(c)) return false; conf = c->lxc_conf; /* initialize handler */ handler = lxc_init_handler(NULL, c->name, conf, c->config_path, c->daemonize); container_mem_unlock(c); if (!handler) return false; if (!argv) { if (useinit && conf->execute_cmd) argv = init_cmd = split_init_cmd(conf->execute_cmd); else argv = init_cmd = split_init_cmd(conf->init_cmd); } /* ... otherwise use default_args. */ if (!argv) { if (useinit) { ERROR("No valid init detected"); lxc_put_handler(handler); return false; } argv = default_args; } /* I'm not sure what locks we want here.Any? Is liblxc's locking enough * here to protect the on disk container? We don't want to exclude * things like lxc_info while the container is running. */ if (c->daemonize) { bool started; char title[2048]; pid_t pid_first, pid_second; pid_first = fork(); if (pid_first < 0) { free_init_cmd(init_cmd); lxc_put_handler(handler); return false; } /* first parent */ if (pid_first != 0) { /* Set to NULL because we don't want father unlink * the PID file, child will do the free and unlink. */ c->pidfile = NULL; /* Wait for container to tell us whether it started * successfully. */ started = wait_on_daemonized_start(handler, pid_first); free_init_cmd(init_cmd); lxc_put_handler(handler); return started; } /* first child */ /* We don't really care if this doesn't print all the * characters. All that it means is that the proctitle will be * ugly. Similarly, we also don't care if setproctitle() fails. */ ret = strnprintf(title, sizeof(title), "[lxc monitor] %s %s", c->config_path, c->name); if (ret > 0) { ret = setproctitle(title); if (ret < 0) INFO("Failed to set process title to %s", title); else INFO("Set process title to %s", title); } /* We fork() a second time to be reparented to init. Like * POSIX's daemon() function we change to "/" and redirect * std{in,out,err} to /dev/null. */ pid_second = fork(); if (pid_second < 0) { SYSERROR("Failed to fork first child process"); _exit(EXIT_FAILURE); } /* second parent */ if (pid_second != 0) { free_init_cmd(init_cmd); lxc_put_handler(handler); _exit(EXIT_SUCCESS); } /* second child */ /* change to / directory */ ret = chdir("/"); if (ret < 0) { SYSERROR("Failed to change to \"/\" directory"); _exit(EXIT_FAILURE); } ret = inherit_fds(handler, true); if (ret < 0) _exit(EXIT_FAILURE); /* redirect std{in,out,err} to /dev/null */ ret = null_stdfds(); if (ret < 0) { ERROR("Failed to redirect std{in,out,err} to /dev/null"); _exit(EXIT_FAILURE); } /* become session leader */ ret = setsid(); if (ret < 0) TRACE("Process %d is already process group leader", lxc_raw_getpid()); } else if (!am_single_threaded()) { ERROR("Cannot start non-daemonized container when threaded"); free_init_cmd(init_cmd); lxc_put_handler(handler); return false; } /* We need to write PID file after daemonize, so we always write the * right PID. */ if (c->pidfile) { int w; char pidstr[INTTYPE_TO_STRLEN(pid_t)]; w = strnprintf(pidstr, sizeof(pidstr), "%d", lxc_raw_getpid()); if (w < 0) { free_init_cmd(init_cmd); lxc_put_handler(handler); SYSERROR("Failed to write monitor pid to \"%s\"", c->pidfile); if (c->daemonize) _exit(EXIT_FAILURE); return false; } ret = lxc_write_to_file(c->pidfile, pidstr, w, false, 0600); if (ret < 0) { free_init_cmd(init_cmd); lxc_put_handler(handler); SYSERROR("Failed to write monitor pid to \"%s\"", c->pidfile); if (c->daemonize) _exit(EXIT_FAILURE); return false; } } conf->reboot = REBOOT_NONE; /* Unshare the mount namespace if requested */ if (conf->monitor_unshare) { ret = unshare(CLONE_NEWNS); if (ret < 0) { SYSERROR("Failed to unshare mount namespace"); lxc_put_handler(handler); ret = 1; goto on_error; } ret = mount(NULL, "/", NULL, MS_SLAVE|MS_REC, NULL); if (ret < 0) { SYSERROR("Failed to recursively turn root mount tree into dependent mount. Continuing..."); lxc_put_handler(handler); ret = 1; goto on_error; } } reboot: if (conf->reboot == REBOOT_INIT) { /* initialize handler */ handler = lxc_init_handler(handler, c->name, conf, c->config_path, c->daemonize); if (!handler) { ret = 1; goto on_error; } } ret = inherit_fds(handler, c->daemonize); if (ret < 0) { lxc_put_handler(handler); ret = 1; goto on_error; } if (useinit) ret = lxc_execute(c->name, argv, 1, handler, c->config_path, c->daemonize, &c->error_num); else ret = lxc_start(argv, handler, c->config_path, c->daemonize, &c->error_num); if (conf->reboot == REBOOT_REQ) { INFO("Container requested reboot"); conf->reboot = REBOOT_INIT; goto reboot; } on_error: if (c->pidfile) { unlink(c->pidfile); free(c->pidfile); c->pidfile = NULL; } free_init_cmd(init_cmd); if (c->daemonize && ret != 0) _exit(EXIT_FAILURE); else if (c->daemonize) _exit(EXIT_SUCCESS); if (ret != 0) return false; return true; } static bool lxcapi_start(struct lxc_container *c, int useinit, char *const argv[]) { bool ret; current_config = c ? c->lxc_conf : NULL; ret = do_lxcapi_start(c, useinit, argv); current_config = NULL; return ret; } /* Note, there MUST be an ending NULL. */ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...) { va_list ap; char **inargs = NULL; bool bret = false; /* container exists */ if (!c) return false; current_config = c->lxc_conf; va_start(ap, useinit); inargs = lxc_va_arg_list_to_argv(ap, 0, 1); va_end(ap); if (!inargs) goto on_error; /* pass NULL if no arguments were supplied */ bret = do_lxcapi_start(c, useinit, *inargs ? inargs : NULL); on_error: if (inargs) { char **arg; for (arg = inargs; *arg; arg++) free(*arg); free(inargs); } current_config = NULL; return bret; } static bool do_lxcapi_stop(struct lxc_container *c) { int ret; if (!c) return false; ret = lxc_cmd_stop(c->name, c->config_path); return ret == 0; } WRAP_API(bool, lxcapi_stop) static int do_create_container_dir(const char *path, struct lxc_conf *conf) { __do_close int fd_rootfs = -EBADF; int ret = -1; mode_t mask = umask(0002); ret = mkdir(path, 0770); umask(mask); if (ret < 0 && errno != EEXIST) return -errno; fd_rootfs = open_at(-EBADF, path, O_DIRECTORY | O_CLOEXEC, PROTECT_LOOKUP_ABSOLUTE_XDEV_SYMLINKS, 0); if (fd_rootfs < 0) return syserror("Failed to open container directory \"%d(%s)\"", fd_rootfs, path); if (list_empty(&conf->id_map)) return move_fd(fd_rootfs); ret = userns_exec_mapped_root(NULL, fd_rootfs, conf); if (ret < 0) return syserror_ret(-1, "Failed to chown rootfs \"%s\"", path); return move_fd(fd_rootfs); } /* Create the standard expected container dir. */ static int create_container_dir(struct lxc_container *c) { __do_free char *s = NULL; int ret; size_t len; len = strlen(c->config_path) + strlen(c->name) + 2; s = malloc(len); if (!s) return ret_errno(ENOMEM); ret = strnprintf(s, len, "%s/%s", c->config_path, c->name); if (ret < 0) return -errno; return do_create_container_dir(s, c->lxc_conf); } /* do_storage_create: thin wrapper around storage_create(). Like * storage_create(), it returns a mounted bdev on success, NULL on error. */ static struct lxc_storage *do_storage_create(struct lxc_container *c, const char *type, struct bdev_specs *specs) { __do_free char *dest = NULL; int ret; size_t len; struct lxc_storage *bdev; /* rootfs.path or lxcpath/lxcname/rootfs */ if (c->lxc_conf->rootfs.path && (access(c->lxc_conf->rootfs.path, F_OK) == 0)) { const char *rpath = c->lxc_conf->rootfs.path; len = strlen(rpath) + 1; dest = must_realloc(NULL, len); ret = strnprintf(dest, len, "%s", rpath); } else { const char *lxcpath = do_lxcapi_get_config_path(c); len = strlen(c->name) + 1 + strlen(lxcpath) + 1 + strlen(LXC_ROOTFS_DNAME) + 1; dest = must_realloc(NULL, len); ret = strnprintf(dest, len, "%s/%s/%s", lxcpath, c->name, LXC_ROOTFS_DNAME); } if (ret < 0) return NULL; bdev = storage_create(dest, type, c->name, specs, c->lxc_conf); if (!bdev) { ERROR("Failed to create \"%s\" storage", type); return NULL; } if (!c->set_config_item(c, "lxc.rootfs.path", bdev->src)) { ERROR("Failed to set \"lxc.rootfs.path = %s\"", bdev->src); storage_put(bdev); return NULL; } /* If we are not root, chown the rootfs dir to root in the target user * namespace. */ if (am_guest_unpriv() || !list_empty(&c->lxc_conf->id_map)) { ret = chown_mapped_root(bdev->dest, c->lxc_conf); if (ret < 0) { ERROR("Error chowning \"%s\" to container root", bdev->dest); suggest_default_idmap(); storage_put(bdev); return NULL; } } return bdev; } /* Strip path and return name of file for argv[0] passed to execvp */ static char *lxctemplatefilename(char *tpath) { char *p; p = tpath + strlen(tpath) - 1; while ( (p-1) >= tpath && *(p-1) != '/') p--; return p; } static bool create_run_template(struct lxc_container *c, char *tpath, bool need_null_stdfds, char *const argv[]) { int ret; pid_t pid; if (!tpath) return true; pid = fork(); if (pid < 0) { SYSERROR("Failed to fork task for container creation template"); return false; } if (pid == 0) { /* child */ int i, len; char *namearg, *patharg, *rootfsarg; char **newargv; int nargs = 0; struct lxc_storage *bdev = NULL; struct lxc_conf *conf = c->lxc_conf; uid_t euid; if (need_null_stdfds) { ret = null_stdfds(); if (ret < 0) _exit(EXIT_FAILURE); } ret = lxc_storage_prepare(conf); if (ret) { ERROR("Failed to initialize storage"); _exit(EXIT_FAILURE); } bdev = conf->rootfs.storage; euid = geteuid(); if (euid == 0) { ret = unshare(CLONE_NEWNS); if (ret < 0) { ERROR("Failed to unshare CLONE_NEWNS"); _exit(EXIT_FAILURE); } if (detect_shared_rootfs() && mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL)) SYSERROR("Failed to recursively turn root mount tree into dependent mount. Continuing..."); } if (!strequal(bdev->type, "dir") && !strequal(bdev->type, "btrfs")) { if (euid != 0) { ERROR("Unprivileged users can only create " "btrfs and directory-backed containers"); _exit(EXIT_FAILURE); } if (strequal(bdev->type, "overlay") || strequal(bdev->type, "overlayfs")) { /* If we create an overlay container we need to * rsync the contents into * //rootfs. * However, the overlay mount function will * mount * //delta0 * over * //rootfs * which means we would rsync the rootfs into * the delta directory. That doesn't make sense * since the delta directory only exists to * record the differences to * //rootfs. So * let's simply bind-mount here and then rsync * directly into * //rootfs. */ char *src; src = ovl_get_rootfs(bdev->src, &(size_t){0}); if (!src) { ERROR("Failed to get rootfs"); _exit(EXIT_FAILURE); } ret = mount(src, bdev->dest, "bind", MS_BIND | MS_REC, NULL); if (ret < 0) { ERROR("Failed to mount rootfs"); _exit(EXIT_FAILURE); } } else { ret = bdev->ops->mount(bdev); if (ret < 0) { ERROR("Failed to mount rootfs"); _exit(EXIT_FAILURE); } } } else { /* TODO come up with a better way here! */ const char *src; free(bdev->dest); src = lxc_storage_get_path(bdev->src, bdev->type); bdev->dest = strdup(src); } /* Create our new array, pre-pend the template name and base * args. */ if (argv) for (nargs = 0; argv[nargs]; nargs++) ; /* template, path, rootfs and name args */ nargs += 4; newargv = malloc(nargs * sizeof(*newargv)); if (!newargv) _exit(EXIT_FAILURE); newargv[0] = lxctemplatefilename(tpath); /* --path */ len = strlen(c->config_path) + strlen(c->name) + strlen("--path=") + 2; patharg = malloc(len); if (!patharg) _exit(EXIT_FAILURE); ret = strnprintf(patharg, len, "--path=%s/%s", c->config_path, c->name); if (ret < 0) _exit(EXIT_FAILURE); newargv[1] = patharg; /* --name */ len = strlen("--name=") + strlen(c->name) + 1; namearg = malloc(len); if (!namearg) _exit(EXIT_FAILURE); ret = strnprintf(namearg, len, "--name=%s", c->name); if (ret < 0) _exit(EXIT_FAILURE); newargv[2] = namearg; /* --rootfs */ len = strlen("--rootfs=") + 1 + strlen(bdev->dest); rootfsarg = malloc(len); if (!rootfsarg) _exit(EXIT_FAILURE); ret = strnprintf(rootfsarg, len, "--rootfs=%s", bdev->dest); if (ret < 0) _exit(EXIT_FAILURE); newargv[3] = rootfsarg; /* add passed-in args */ if (argv) for (i = 4; i < nargs; i++) newargv[i] = argv[i - 4]; /* add trailing NULL */ nargs++; newargv = realloc(newargv, nargs * sizeof(*newargv)); if (!newargv) _exit(EXIT_FAILURE); newargv[nargs - 1] = NULL; /* If we're running the template in a mapped userns, then we * prepend the template command with: lxc-usernsexec <-m map1> * ... <-m mapn> -- and we append "--mapped-uid x", where x is * the mapped uid for our geteuid() */ if (!list_empty(&conf->id_map)) { int extraargs, hostuid_mapped, hostgid_mapped; char **n2; char txtuid[20], txtgid[20]; struct id_map *map; int n2args = 1; n2 = malloc(n2args * sizeof(*n2)); if (!n2) _exit(EXIT_FAILURE); newargv[0] = tpath; tpath = "lxc-usernsexec"; n2[0] = "lxc-usernsexec"; list_for_each_entry(map, &conf->id_map, head) { n2args += 2; n2 = realloc(n2, n2args * sizeof(char *)); if (!n2) _exit(EXIT_FAILURE); n2[n2args - 2] = "-m"; n2[n2args - 1] = malloc(200); if (!n2[n2args - 1]) _exit(EXIT_FAILURE); ret = strnprintf(n2[n2args - 1], 200, "%c:%lu:%lu:%lu", map->idtype == ID_TYPE_UID ? 'u' : 'g', map->nsid, map->hostid, map->range); if (ret < 0) _exit(EXIT_FAILURE); } hostuid_mapped = mapped_hostid(geteuid(), conf, ID_TYPE_UID); extraargs = hostuid_mapped >= 0 ? 1 : 3; n2 = realloc(n2, (nargs + n2args + extraargs) * sizeof(char *)); if (!n2) _exit(EXIT_FAILURE); if (hostuid_mapped < 0) { hostuid_mapped = find_unmapped_nsid(conf, ID_TYPE_UID); n2[n2args++] = "-m"; if (hostuid_mapped < 0) { ERROR("Failed to find free uid to map"); _exit(EXIT_FAILURE); } n2[n2args++] = malloc(200); if (!n2[n2args - 1]) { SYSERROR("out of memory"); _exit(EXIT_FAILURE); } ret = strnprintf(n2[n2args - 1], 200, "u:%d:%d:1", hostuid_mapped, geteuid()); if (ret < 0) _exit(EXIT_FAILURE); } hostgid_mapped = mapped_hostid(getegid(), conf, ID_TYPE_GID); extraargs = hostgid_mapped >= 0 ? 1 : 3; n2 = realloc(n2, (nargs + n2args + extraargs) * sizeof(char *)); if (!n2) _exit(EXIT_FAILURE); if (hostgid_mapped < 0) { hostgid_mapped = find_unmapped_nsid(conf, ID_TYPE_GID); n2[n2args++] = "-m"; if (hostgid_mapped < 0) { ERROR("Failed to find free gid to map"); _exit(EXIT_FAILURE); } n2[n2args++] = malloc(200); if (!n2[n2args - 1]) { SYSERROR("out of memory"); _exit(EXIT_FAILURE); } ret = strnprintf(n2[n2args - 1], 200, "g:%d:%d:1", hostgid_mapped, getegid()); if (ret < 0) _exit(EXIT_FAILURE); } n2[n2args++] = "--"; for (i = 0; i < nargs; i++) n2[i + n2args] = newargv[i]; n2args += nargs; /* Finally add "--mapped-uid $uid" to tell template what * to chown cached images to. */ n2args += 4; n2 = realloc(n2, n2args * sizeof(char *)); if (!n2) _exit(EXIT_FAILURE); /* note n2[n2args-1] is NULL */ n2[n2args - 5] = "--mapped-uid"; ret = strnprintf(txtuid, 20, "%d", hostuid_mapped); if (ret < 0) { free(newargv); free(n2); _exit(EXIT_FAILURE); } n2[n2args - 4] = txtuid; n2[n2args - 3] = "--mapped-gid"; ret = strnprintf(txtgid, 20, "%d", hostgid_mapped); if (ret < 0) { free(newargv); free(n2); _exit(EXIT_FAILURE); } n2[n2args - 2] = txtgid; n2[n2args - 1] = NULL; free(newargv); newargv = n2; } execvp(tpath, newargv); SYSERROR("Failed to execute template %s", tpath); _exit(EXIT_FAILURE); } ret = wait_for_pid(pid); if (ret != 0) { ERROR("Failed to create container from template"); return false; } return true; } static bool prepend_lxc_header(char *path, const char *t, char *const argv[]) { ssize_t len, flen; char *contents; FILE *f; int ret = -1; ssize_t nbytes; #if HAVE_OPENSSL unsigned int md_len = 0; unsigned char md_value[EVP_MAX_MD_SIZE]; char *tpath; #endif f = fopen(path, "re"); if (f == NULL) return false; ret = fseek(f, 0, SEEK_END); if (ret < 0) goto out_error; ret = -1; flen = ftell(f); if (flen < 0) goto out_error; ret = fseek(f, 0, SEEK_SET); if (ret < 0) goto out_error; ret = fseek(f, 0, SEEK_SET); if (ret < 0) goto out_error; ret = -1; contents = malloc(flen + 1); if (!contents) goto out_error; len = fread(contents, 1, flen, f); if (len != flen) goto out_free_contents; contents[flen] = '\0'; ret = fclose(f); f = NULL; if (ret < 0) goto out_free_contents; #if HAVE_OPENSSL tpath = get_template_path(t); if (!tpath) { ERROR("Invalid template \"%s\" specified", t); goto out_free_contents; } ret = sha1sum_file(tpath, md_value, &md_len); if (ret < 0) { ERROR("Failed to get sha1sum of %s", tpath); free(tpath); goto out_free_contents; } free(tpath); #endif f = fopen(path, "we"); if (f == NULL) { SYSERROR("Reopening config for writing"); free(contents); return false; } fprintf(f, "# Template used to create this container: %s\n", t); if (argv) { fprintf(f, "# Parameters passed to the template:"); while (*argv) { fprintf(f, " %s", *argv); argv++; } fprintf(f, "\n"); } #if HAVE_OPENSSL fprintf(f, "# Template script checksum (SHA-1): "); for (size_t i = 0; i < md_len; i++) fprintf(f, "%02x", md_value[i]); fprintf(f, "\n"); #endif fprintf(f, "# For additional config options, please look at lxc.container.conf(5)\n"); fprintf(f, "\n# Uncomment the following line to support nesting containers:\n"); fprintf(f, "#lxc.include = " LXCTEMPLATECONFIG "/nesting.conf\n"); fprintf(f, "# (Be aware this has security implications)\n\n"); nbytes = fwrite(contents, 1, flen, f); if (nbytes < 0 || nbytes != flen) { SYSERROR("Writing original contents"); free(contents); fclose(f); return false; } ret = 0; out_free_contents: free(contents); out_error: if (f) { int newret; newret = fclose(f); if (ret == 0) ret = newret; } if (ret < 0) { SYSERROR("Error prepending header"); return false; } return true; } static void lxcapi_clear_config(struct lxc_container *c) { if (!c || !c->lxc_conf) return; lxc_conf_free(c->lxc_conf); c->lxc_conf = NULL; } #define do_lxcapi_clear_config(c) lxcapi_clear_config(c) /* * lxcapi_create: * create a container with the given parameters. * @c: container to be created. It has the lxcpath, name, and a starting * configuration already set * @t: the template to execute to instantiate the root filesystem and * adjust the configuration. * @bdevtype: backing store type to use. If NULL, dir will be used. * @specs: additional parameters for the backing store, i.e. LVM vg to * use. * * @argv: the arguments to pass to the template, terminated by NULL. If no * arguments, you can just pass NULL. */ static bool __lxcapi_create(struct lxc_container *c, const char *t, const char *bdevtype, struct bdev_specs *specs, int flags, char *const argv[]) { __do_close int fd_rootfs = -EBADF; __do_free char *path_template = NULL; int partial_fd; mode_t mask; pid_t pid; bool bret = false, rootfs_managed = true; if (!c) return false; if (t) { path_template = get_template_path(t); if (!path_template) return log_error(false, "Template \"%s\" not found", t); } /* If a template is passed in, and the rootfs already is defined in the * container config and exists, then the caller is trying to create an * existing container. Return an error, but do NOT delete the container. */ if (do_lxcapi_is_defined(c) && c->lxc_conf && c->lxc_conf->rootfs.path && access(c->lxc_conf->rootfs.path, F_OK) == 0 && path_template) return log_error(false, "Container \"%s\" already exists in \"%s\"", c->name, c->config_path); if (!c->lxc_conf && !do_lxcapi_load_config(c, lxc_global_config_value("lxc.default_config"))) return log_error(false, "Failed to load default configuration file %s", lxc_global_config_value("lxc.default_config")); fd_rootfs = create_container_dir(c); if (fd_rootfs < 0) return log_error(false, "Failed to create container %s", c->name); if (c->lxc_conf->rootfs.path) rootfs_managed = false; /* If both template and rootfs.path are set, template is setup as * rootfs.path. The container is already created if we have a config and * rootfs.path is accessible */ if (!c->lxc_conf->rootfs.path && !path_template) { /* No template passed in and rootfs does not exist. */ if (!c->save_config(c, NULL)) { ERROR("Failed to save initial config for \"%s\"", c->name); goto out; } bret = true; goto out; } /* Rootfs passed into configuration, but does not exist. */ if (c->lxc_conf->rootfs.path && access(c->lxc_conf->rootfs.path, F_OK) != 0) { ERROR("The rootfs \"%s\" does not exist", c->lxc_conf->rootfs.path); goto out; } if (do_lxcapi_is_defined(c) && c->lxc_conf->rootfs.path && !path_template) { /* Rootfs already existed, user just wanted to save the loaded * configuration. */ if (!c->save_config(c, NULL)) ERROR("Failed to save initial config for \"%s\"", c->name); bret = true; goto out; } /* Mark that this container as being created */ partial_fd = create_partial(fd_rootfs, c); if (partial_fd < 0) { SYSERROR("Failed to mark container as being partially created"); goto out; } /* No need to get disk lock bc we have the partial lock. */ mask = umask(0022); /* Create the storage. * Note we can't do this in the same task as we use to execute the * template because of the way zfs works. * After you 'zfs create', zfs mounts the fs only in the initial * namespace. */ pid = fork(); if (pid < 0) { SYSERROR("Failed to fork task for container creation template"); goto out_unlock; } if (pid == 0) { /* child */ struct lxc_storage *bdev = NULL; bdev = do_storage_create(c, bdevtype, specs); if (!bdev) { ERROR("Failed to create %s storage for %s", bdevtype ? bdevtype : "(none)", c->name); _exit(EXIT_FAILURE); } /* Save config file again to store the new rootfs location. */ if (!do_lxcapi_save_config(c, NULL)) { ERROR("Failed to save initial config for %s", c->name); /* Parent task won't see the storage driver in the * config so we delete it. */ bdev->ops->umount(bdev); bdev->ops->destroy(bdev); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } if (!wait_exited(pid)) goto out_unlock; /* Reload config to get the rootfs. */ lxc_conf_free(c->lxc_conf); c->lxc_conf = NULL; if (!load_config_locked(c, c->configfile)) goto out_unlock; if (!create_run_template(c, path_template, !!(flags & LXC_CREATE_QUIET), argv)) goto out_unlock; /* Now clear out the lxc_conf we have, reload from the created * container. */ do_lxcapi_clear_config(c); if (t) { if (!prepend_lxc_header(c->configfile, path_template, argv)) { ERROR("Failed to prepend header to config file"); goto out_unlock; } } bret = load_config_locked(c, c->configfile); out_unlock: umask(mask); remove_partial(c, partial_fd); out: if (!bret) { bool reset_managed = c->lxc_conf->rootfs.managed; /* * Ensure that we don't destroy storage we didn't create * ourselves. */ if (!rootfs_managed) c->lxc_conf->rootfs.managed = false; container_destroy(c, NULL); c->lxc_conf->rootfs.managed = reset_managed; } return bret; } static bool do_lxcapi_create(struct lxc_container *c, const char *t, const char *bdevtype, struct bdev_specs *specs, int flags, char *const argv[]) { return __lxcapi_create(c, t, bdevtype, specs, flags, argv); } WRAP_API_5(bool, lxcapi_create, const char *, const char *, struct bdev_specs *, int, char *const *) static bool do_lxcapi_reboot(struct lxc_container *c) { __do_close int pidfd = -EBADF; pid_t pid = -1; int ret; int rebootsignal = SIGINT; if (!c) return false; if (!do_lxcapi_is_running(c)) return false; pidfd = do_lxcapi_init_pidfd(c); if (pidfd < 0) { pid = do_lxcapi_init_pid(c); if (pid <= 0) return false; } if (c->lxc_conf && c->lxc_conf->rebootsignal) rebootsignal = c->lxc_conf->rebootsignal; if (pidfd >= 0) ret = lxc_raw_pidfd_send_signal(pidfd, rebootsignal, NULL, 0); else ret = kill(pid, rebootsignal); if (ret < 0) return log_warn(false, "Failed to send signal %d to pid %d", rebootsignal, pid); return true; } WRAP_API(bool, lxcapi_reboot) static bool do_lxcapi_reboot2(struct lxc_container *c, int timeout) { __do_close int pidfd = -EBADF, state_client_fd = -EBADF; int rebootsignal = SIGINT; pid_t pid = -1; lxc_state_t states[MAX_STATE] = {0}; int killret, ret; if (!c) return false; if (!do_lxcapi_is_running(c)) return true; pidfd = do_lxcapi_init_pidfd(c); if (pidfd < 0) { pid = do_lxcapi_init_pid(c); if (pid <= 0) return true; } if (c->lxc_conf && c->lxc_conf->rebootsignal) rebootsignal = c->lxc_conf->rebootsignal; /* Add a new state client before sending the shutdown signal so that we * don't miss a state. */ if (timeout != 0) { states[RUNNING] = 2; ret = lxc_cmd_add_state_client(c->name, c->config_path, states, &state_client_fd); if (ret < 0) return false; if (state_client_fd < 0) return false; if (ret == RUNNING) return true; if (ret < MAX_STATE) return false; } /* Send reboot signal to container. */ if (pidfd >= 0) killret = lxc_raw_pidfd_send_signal(pidfd, rebootsignal, NULL, 0); else killret = kill(pid, rebootsignal); if (killret < 0) return log_warn(false, "Failed to send signal %d to pidfd(%d)/pid(%d)", rebootsignal, pidfd, pid); TRACE("Sent signal %d to pidfd(%d)/pid(%d)", rebootsignal, pidfd, pid); if (timeout == 0) return true; ret = lxc_cmd_sock_rcv_state(state_client_fd, timeout); if (ret < 0) return false; TRACE("Received state \"%s\"", lxc_state2str(ret)); if (ret != RUNNING) return false; return true; } WRAP_API_1(bool, lxcapi_reboot2, int) static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout) { __do_close int pidfd = -EBADF, state_client_fd = -EBADF; int haltsignal = SIGPWR; pid_t pid = -1; lxc_state_t states[MAX_STATE] = {0}; int killret, ret; if (!c) return false; if (!do_lxcapi_is_running(c)) return true; pidfd = do_lxcapi_init_pidfd(c); pid = do_lxcapi_init_pid(c); if (pid <= 0) return true; /* Detect whether we should send SIGRTMIN + 3 (e.g. systemd). */ if (c->lxc_conf && c->lxc_conf->haltsignal) haltsignal = c->lxc_conf->haltsignal; else if (task_blocks_signal(pid, (SIGRTMIN + 3))) haltsignal = (SIGRTMIN + 3); /* * Add a new state client before sending the shutdown signal so * that we don't miss a state. */ if (timeout != 0) { states[STOPPED] = 1; ret = lxc_cmd_add_state_client(c->name, c->config_path, states, &state_client_fd); if (ret < 0) return false; if (state_client_fd < 0) return false; if (ret == STOPPED) return true; if (ret < MAX_STATE) return false; } if (pidfd >= 0) { struct pollfd pidfd_poll = { .events = POLLIN, .fd = pidfd, }; killret = lxc_raw_pidfd_send_signal(pidfd, haltsignal, NULL, 0); if (killret < 0) return log_warn(false, "Failed to send signal %d to pidfd %d", haltsignal, pidfd); TRACE("Sent signal %d to pidfd %d", haltsignal, pidfd); /* * No need for going through all of the state server * complications anymore. We can just poll on pidfds. :) */ if (timeout != 0) { ret = poll(&pidfd_poll, 1, timeout * 1000); if (ret < 0 || !(pidfd_poll.revents & POLLIN)) return false; TRACE("Pidfd polling detected container exit"); } } else { killret = kill(pid, haltsignal); if (killret < 0) return log_warn(false, "Failed to send signal %d to pid %d", haltsignal, pid); TRACE("Sent signal %d to pid %d", haltsignal, pid); } if (timeout == 0) return true; ret = lxc_cmd_sock_rcv_state(state_client_fd, timeout); if (ret < 0) return false; TRACE("Received state \"%s\"", lxc_state2str(ret)); if (ret != STOPPED) return false; return true; } WRAP_API_1(bool, lxcapi_shutdown, int) static bool lxcapi_createl(struct lxc_container *c, const char *t, const char *bdevtype, struct bdev_specs *specs, int flags, ...) { bool bret = false; char **args = NULL; va_list ap; if (!c) return false; current_config = c->lxc_conf; /* * since we're going to wait for create to finish, I don't think we * need to get a copy of the arguments. */ va_start(ap, flags); args = lxc_va_arg_list_to_argv(ap, 0, 0); va_end(ap); if (!args) { ERROR("Failed to allocate memory"); goto out; } bret = __lxcapi_create(c, t, bdevtype, specs, flags, args); out: free(args); current_config = NULL; return bret; } static void do_clear_unexp_config_line(struct lxc_conf *conf, const char *key) { if (strequal(key, "lxc.cgroup")) return clear_unexp_config_line(conf, key, true); if (strequal(key, "lxc.network")) return clear_unexp_config_line(conf, key, true); if (strequal(key, "lxc.net")) return clear_unexp_config_line(conf, key, true); /* Clear a network with a specific index. */ if (strnequal(key, "lxc.net.", 8)) { int ret; const char *idx; idx = key + 8; ret = lxc_safe_uint(idx, &(unsigned int){0}); if (!ret) return clear_unexp_config_line(conf, key, true); } if (strequal(key, "lxc.hook")) return clear_unexp_config_line(conf, key, true); return clear_unexp_config_line(conf, key, false); } static bool do_lxcapi_clear_config_item(struct lxc_container *c, const char *key) { int ret = 1; struct lxc_config_t *config; if (!c || !c->lxc_conf) return false; if (container_mem_lock(c)) return false; config = lxc_get_config(key); ret = config->clr(key, c->lxc_conf, NULL); if (!ret) do_clear_unexp_config_line(c->lxc_conf, key); container_mem_unlock(c); return ret == 0; } WRAP_API_1(bool, lxcapi_clear_config_item, const char *) static inline bool enter_net_ns(struct lxc_container *c) { pid_t pid = do_lxcapi_init_pid(c); if (pid < 0) return false; if ((geteuid() != 0 || (c->lxc_conf && !list_empty(&c->lxc_conf->id_map))) && (access("/proc/self/ns/user", F_OK) == 0)) if (!switch_to_ns(pid, "user")) return false; return switch_to_ns(pid, "net"); } /* Used by qsort and bsearch functions for comparing names. */ static inline int string_cmp(char **first, char **second) { return strcmp(*first, *second); } /* Used by qsort and bsearch functions for comparing container names. */ static inline int container_cmp(struct lxc_container **first, struct lxc_container **second) { return strcmp((*first)->name, (*second)->name); } static bool add_to_array(char ***names, char *cname, int pos) { __do_free char *dup_cname = NULL; char **newnames; dup_cname = strdup(cname); if (!dup_cname) return false; newnames = realloc(*names, (pos + 1) * sizeof(char *)); if (!newnames) return ret_set_errno(false, ENOMEM); newnames[pos] = move_ptr(dup_cname); /* Sort the array as we will use binary search on it. */ qsort(newnames, pos + 1, sizeof(char *), (int (*)(const void *, const void *))string_cmp); *names = newnames; return true; } static bool add_to_clist(struct lxc_container ***list, struct lxc_container *c, int pos, bool sort) { struct lxc_container **newlist; newlist = realloc(*list, (pos + 1) * sizeof(struct lxc_container *)); if (!newlist) return ret_set_errno(false, ENOMEM); newlist[pos] = c; /* Sort the array as we will use binary search on it. */ if (sort) qsort(newlist, pos + 1, sizeof(struct lxc_container *), (int (*)(const void *, const void *))container_cmp); *list = newlist; return true; } static char **get_from_array(char ***names, char *cname, int size) { if (!*names) return NULL; return bsearch(&cname, *names, size, sizeof(char *), (int (*)(const void *, const void *))string_cmp); } static bool array_contains(char ***names, char *cname, int size) { if (get_from_array(names, cname, size)) return true; return false; } static char **do_lxcapi_get_interfaces(struct lxc_container *c) { pid_t pid; int i, count = 0, pipefd[2]; char **interfaces = NULL; char interface[IFNAMSIZ]; if (pipe2(pipefd, O_CLOEXEC)) return log_error_errno(NULL, errno, "Failed to create pipe"); pid = fork(); if (pid < 0) { close(pipefd[0]); close(pipefd[1]); return log_error_errno(NULL, errno, "Failed to fork task to get interfaces information"); } if (pid == 0) { call_cleaner(netns_freeifaddrs) struct netns_ifaddrs *ifaddrs = NULL; struct netns_ifaddrs *ifa = NULL; int ret = 1; int nbytes; /* close the read-end of the pipe */ close(pipefd[0]); if (!enter_net_ns(c)) { SYSERROR("Failed to enter network namespace"); goto out; } /* Grab the list of interfaces */ if (netns_getifaddrs(&ifaddrs, -1, &(bool){false})) { SYSERROR("Failed to get interfaces list"); goto out; } /* Iterate through the interfaces */ for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) { nbytes = lxc_write_nointr(pipefd[1], ifa->ifa_name, IFNAMSIZ); if (nbytes < 0) goto out; count++; } ret = 0; out: /* close the write-end of the pipe, thus sending EOF to the reader */ close(pipefd[1]); _exit(ret); } /* close the write-end of the pipe */ close(pipefd[1]); while (lxc_read_nointr(pipefd[0], &interface, IFNAMSIZ) == IFNAMSIZ) { interface[IFNAMSIZ - 1] = '\0'; if (array_contains(&interfaces, interface, count)) continue; if (!add_to_array(&interfaces, interface, count)) ERROR("Failed to add \"%s\" to array", interface); count++; } if (wait_for_pid(pid)) { for (i = 0; i < count; i++) free(interfaces[i]); free(interfaces); interfaces = NULL; } /* close the read-end of the pipe */ close(pipefd[0]); /* Append NULL to the array */ if (interfaces) interfaces = (char **)lxc_append_null_to_array((void **)interfaces, count); return interfaces; } WRAP_API(char **, lxcapi_get_interfaces) static char **do_lxcapi_get_ips(struct lxc_container *c, const char *interface, const char *family, int scope) { int i, ret; pid_t pid; int pipefd[2]; char address[INET6_ADDRSTRLEN]; int count = 0; char **addresses = NULL; ret = pipe2(pipefd, O_CLOEXEC); if (ret < 0) return log_error_errno(NULL, errno, "Failed to create pipe"); pid = fork(); if (pid < 0) { SYSERROR("Failed to create new process"); close(pipefd[0]); close(pipefd[1]); return NULL; } if (pid == 0) { call_cleaner(netns_freeifaddrs) struct netns_ifaddrs *ifaddrs = NULL; struct netns_ifaddrs *ifa = NULL; ssize_t nbytes; char addressOutputBuffer[INET6_ADDRSTRLEN]; char *address_ptr = NULL; void *address_ptr_tmp = NULL; /* close the read-end of the pipe */ close(pipefd[0]); if (!enter_net_ns(c)) { SYSERROR("Failed to attach to network namespace"); goto out; } /* Grab the list of interfaces */ if (netns_getifaddrs(&ifaddrs, -1, &(bool){false})) { SYSERROR("Failed to get interfaces list"); goto out; } /* Iterate through the interfaces */ for (ifa = ifaddrs; ifa; ifa = ifa->ifa_next) { if (ifa->ifa_addr == NULL) continue; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" if (ifa->ifa_addr->sa_family == AF_INET) { if (family && !strequal(family, "inet")) continue; address_ptr_tmp = &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr; } else { if (family && !strequal(family, "inet6")) continue; if (((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_scope_id != (uint32_t)scope) continue; address_ptr_tmp = &((struct sockaddr_in6 *)ifa->ifa_addr)->sin6_addr; } #pragma GCC diagnostic pop if (interface && !strequal(interface, ifa->ifa_name)) continue; else if (!interface && strequal("lo", ifa->ifa_name)) continue; address_ptr = (char *)inet_ntop(ifa->ifa_addr->sa_family, address_ptr_tmp, addressOutputBuffer, sizeof(addressOutputBuffer)); if (!address_ptr) continue; nbytes = lxc_write_nointr(pipefd[1], address_ptr, INET6_ADDRSTRLEN); if (nbytes != INET6_ADDRSTRLEN) { SYSERROR("Failed to send ipv6 address \"%s\"", address_ptr); goto out; } count++; } ret = 0; out: /* close the write-end of the pipe, thus sending EOF to the reader */ close(pipefd[1]); _exit(ret); } /* close the write-end of the pipe */ close(pipefd[1]); while (lxc_read_nointr(pipefd[0], &address, INET6_ADDRSTRLEN) == INET6_ADDRSTRLEN) { address[INET6_ADDRSTRLEN - 1] = '\0'; if (!add_to_array(&addresses, address, count)) ERROR("PARENT: add_to_array failed"); count++; } if (wait_for_pid(pid)) { for (i = 0; i < count; i++) free(addresses[i]); free(addresses); addresses = NULL; } /* close the read-end of the pipe */ close(pipefd[0]); /* Append NULL to the array */ if (addresses) addresses = (char **)lxc_append_null_to_array((void **)addresses, count); return addresses; } WRAP_API_3(char **, lxcapi_get_ips, const char *, const char *, int) static int do_lxcapi_get_config_item(struct lxc_container *c, const char *key, char *retv, int inlen) { int ret = -1; struct lxc_config_t *config; if (!c || !c->lxc_conf) return -1; if (container_mem_lock(c)) return -1; config = lxc_get_config(key); ret = config->get(key, retv, inlen, c->lxc_conf, NULL); container_mem_unlock(c); return ret; } WRAP_API_3(int, lxcapi_get_config_item, const char *, char *, int) static char* do_lxcapi_get_running_config_item(struct lxc_container *c, const char *key) { char *ret; if (!c || !c->lxc_conf) return NULL; if (container_mem_lock(c)) return NULL; ret = lxc_cmd_get_config_item(c->name, key, do_lxcapi_get_config_path(c)); container_mem_unlock(c); return ret; } WRAP_API_1(char *, lxcapi_get_running_config_item, const char *) static int do_lxcapi_get_keys(struct lxc_container *c, const char *key, char *retv, int inlen) { int ret = -1; /* List all config items. */ if (!key) return lxc_list_config_items(retv, inlen); if (!c || !c->lxc_conf) return -1; if (container_mem_lock(c)) return -1; /* Support 'lxc.net.', i.e. 'lxc.net.0' * This is an intelligent result to show which keys are valid given the * type of nic it is. */ if (strnequal(key, "lxc.net.", 8)) ret = lxc_list_net(c->lxc_conf, key, retv, inlen); else ret = lxc_list_subkeys(c->lxc_conf, key, retv, inlen); container_mem_unlock(c); return ret; } WRAP_API_3(int, lxcapi_get_keys, const char *, char *, int) static bool do_lxcapi_save_config(struct lxc_container *c, const char *alt_file) { __do_close int fd_config = -EBADF, fd_rootfs = -EBADF; int lret = -1; bool bret = false, need_disklock = false; if (!alt_file) alt_file = c->configfile; if (!alt_file) return log_error(false, "No config file found"); /* If we haven't yet loaded a config, load the stock config. */ if (!c->lxc_conf) { if (!do_lxcapi_load_config(c, lxc_global_config_value("lxc.default_config"))) { return log_error(false, "Error loading default configuration file %s while saving %s", lxc_global_config_value("lxc.default_config"), c->name); } } fd_rootfs = create_container_dir(c); if (fd_rootfs < 0) return log_error(false, "Failed to create container directory"); /* If we're writing to the container's config file, take the disk lock. * Otherwise just take the memlock to protect the struct lxc_container * while we're traversing it. */ if (strequal(c->configfile, alt_file)) need_disklock = true; if (need_disklock) lret = container_disk_lock(c); else lret = container_mem_lock(c); if (lret) return log_error(false, "Failed to acquire lock"); fd_config = open(alt_file, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (fd_config < 0) { SYSERROR("Failed to open config file \"%s\"", alt_file); goto on_error; } lret = write_config(fd_config, c->lxc_conf); if (lret < 0) { SYSERROR("Failed to write config file \"%s\"", alt_file); goto on_error; } bret = true; TRACE("Saved config file \"%s\"", alt_file); on_error: if (need_disklock) container_disk_unlock(c); else container_mem_unlock(c); return bret; } WRAP_API_1(bool, lxcapi_save_config, const char *) static bool mod_rdep(struct lxc_container *c0, struct lxc_container *c, bool inc) { FILE *f1; struct stat fbuf; void *buf = NULL; char *del = NULL; char path[PATH_MAX]; char newpath[PATH_MAX]; int fd, ret, n = 0, v = 0; bool bret = false; size_t len = 0, bytes = 0; if (container_disk_lock(c0)) return false; ret = strnprintf(path, sizeof(path), "%s/%s/lxc_snapshots", c0->config_path, c0->name); if (ret < 0) goto out; ret = strnprintf(newpath, sizeof(newpath), "%s\n%s\n", c->config_path, c->name); if (ret < 0) goto out; /* If we find an lxc-snapshot file using the old format only listing the * number of snapshots we will keep using it. */ f1 = fopen(path, "re"); if (f1) { n = fscanf(f1, "%d", &v); fclose(f1); if (n == 1 && v == 0) { ret = remove(path); if (ret < 0) SYSERROR("Failed to remove \"%s\"", path); n = 0; } } if (n == 1) { v += inc ? 1 : -1; f1 = fopen(path, "we"); if (!f1) goto out; if (fprintf(f1, "%d\n", v) < 0) { ERROR("Error writing new snapshots value"); fclose(f1); goto out; } ret = fclose(f1); if (ret != 0) { SYSERROR("Error writing to or closing snapshots file"); goto out; } } else { /* Here we know that we have or can use an lxc-snapshot file * using the new format. */ if (inc) { f1 = fopen(path, "ae"); if (!f1) goto out; if (fprintf(f1, "%s", newpath) < 0) { ERROR("Error writing new snapshots entry"); ret = fclose(f1); if (ret != 0) SYSERROR("Error writing to or closing snapshots file"); goto out; } ret = fclose(f1); if (ret != 0) { SYSERROR("Error writing to or closing snapshots file"); goto out; } } else if (!inc) { if ((fd = open(path, O_RDWR | O_CLOEXEC)) < 0) goto out; if (fstat(fd, &fbuf) < 0) { close(fd); goto out; } if (fbuf.st_size != 0) { buf = lxc_strmmap(NULL, fbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (buf == MAP_FAILED) { SYSERROR("Failed to create mapping %s", path); close(fd); goto out; } len = strlen(newpath); while ((del = strstr((char *)buf, newpath))) { memmove(del, del + len, strlen(del) - len + 1); bytes += len; } lxc_strmunmap(buf, fbuf.st_size); if (ftruncate(fd, fbuf.st_size - bytes) < 0) { SYSERROR("Failed to truncate file %s", path); close(fd); goto out; } } close(fd); } /* If the lxc-snapshot file is empty, remove it. */ if (stat(path, &fbuf) < 0) goto out; if (!fbuf.st_size) { ret = remove(path); if (ret < 0) SYSERROR("Failed to remove \"%s\"", path); } } bret = true; out: container_disk_unlock(c0); return bret; } void mod_all_rdeps(struct lxc_container *c, bool inc) { __do_free char *lxcpath = NULL, *lxcname = NULL; __do_fclose FILE *f = NULL; size_t pathlen = 0, namelen = 0; struct lxc_container *p; char path[PATH_MAX]; int ret; ret = strnprintf(path, sizeof(path), "%s/%s/lxc_rdepends", c->config_path, c->name); if (ret < 0) { ERROR("Path name too long"); return; } f = fopen(path, "re"); if (!f) return; while (getline(&lxcpath, &pathlen, f) != -1) { if (getline(&lxcname, &namelen, f) == -1) { ERROR("badly formatted file %s", path); return; } remove_trailing_newlines(lxcpath); remove_trailing_newlines(lxcname); if ((p = lxc_container_new(lxcname, lxcpath)) == NULL) { ERROR("Unable to find dependent container %s:%s", lxcpath, lxcname); continue; } if (!mod_rdep(p, c, inc)) ERROR("Failed to update snapshots file for %s:%s", lxcpath, lxcname); lxc_container_put(p); } } static bool has_fs_snapshots(struct lxc_container *c) { __do_fclose FILE *f = NULL; char path[PATH_MAX]; int ret, v; struct stat fbuf; ret = strnprintf(path, sizeof(path), "%s/%s/lxc_snapshots", c->config_path, c->name); if (ret < 0) return false; /* If the file doesn't exist there are no snapshots. */ if (stat(path, &fbuf) < 0) return false; v = fbuf.st_size; if (v != 0) { f = fopen(path, "re"); if (!f) return false; ret = fscanf(f, "%d", &v); if (ret != 1) INFO("Container uses new lxc-snapshots format %s", path); } return v != 0; } static bool has_snapshots(struct lxc_container *c) { __do_closedir DIR *dir = NULL; char path[PATH_MAX]; struct dirent *direntp; int count = 0; if (!get_snappath_dir(c, path)) return false; dir = opendir(path); if (!dir) return false; while ((direntp = readdir(dir))) { if (strequal(direntp->d_name, ".")) continue; if (strequal(direntp->d_name, "..")) continue; count++; break; } return count > 0; } static bool do_destroy_container(struct lxc_conf *conf) { int ret; if (am_guest_unpriv()) { ret = userns_exec_full(conf, storage_destroy_wrapper, conf, "storage_destroy_wrapper"); if (ret < 0) return false; return true; } return storage_destroy(conf); } static int lxc_rmdir_onedev_wrapper(void *data) { char *arg = (char *) data; return lxc_rmdir_onedev(arg, "snaps"); } static int lxc_unlink_exec_wrapper(void *data) { char *arg = data; return unlink(arg); } static bool container_destroy(struct lxc_container *c, struct lxc_storage *storage) { const char *p1; size_t len; struct lxc_conf *conf; char *path = NULL; bool bret = false; int ret = 0; if (!c || !do_lxcapi_is_defined(c)) return false; conf = c->lxc_conf; if (container_disk_lock(c)) return false; if (!is_stopped(c)) { /* We should queue some sort of error - in c->error_string? */ ERROR("container %s is not stopped", c->name); goto out; } if (conf && !list_empty(&conf->hooks[LXCHOOK_DESTROY])) { /* Start of environment variable setup for hooks */ if (setenv("LXC_NAME", c->name, 1)) SYSERROR("Failed to set environment variable for container name"); if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) SYSERROR("Failed to set environment variable for config path"); if (conf->rootfs.mount && setenv("LXC_ROOTFS_MOUNT", conf->rootfs.mount, 1)) SYSERROR("Failed to set environment variable for rootfs mount"); if (conf->rootfs.path && setenv("LXC_ROOTFS_PATH", conf->rootfs.path, 1)) SYSERROR("Failed to set environment variable for rootfs mount"); if (conf->console.path && setenv("LXC_CONSOLE", conf->console.path, 1)) SYSERROR("Failed to set environment variable for console path"); if (conf->console.log_path && setenv("LXC_CONSOLE_LOGPATH", conf->console.log_path, 1)) SYSERROR("Failed to set environment variable for console log"); /* End of environment variable setup for hooks */ if (run_lxc_hooks(c->name, "destroy", conf, NULL)) { ERROR("Failed to execute clone hook for \"%s\"", c->name); goto out; } } if (current_config && conf == current_config) { current_config = NULL; if (conf->logfd != -1) { close(conf->logfd); conf->logfd = -1; } } /* LXC is not managing the storage of the container. */ if (conf && !conf->rootfs.managed) goto on_success; if (conf && conf->rootfs.path && conf->rootfs.mount) { if (!do_destroy_container(conf)) { ERROR("Error destroying rootfs for %s", c->name); goto out; } INFO("Destroyed rootfs for %s", c->name); } mod_all_rdeps(c, false); p1 = do_lxcapi_get_config_path(c); /* strlen(p1) * + * / * + * strlen(c->name) * + * / * + * strlen("config") = 6 * + * \0 */ len = strlen(p1) + 1 + strlen(c->name) + 1 + strlen(LXC_CONFIG_FNAME) + 1; path = malloc(len); if (!path) { ERROR("Failed to allocate memory"); goto out; } /* For an overlay container the rootfs is considered immutable and * cannot be removed when restoring from a snapshot. */ if (storage && (strequal(storage->type, "overlay") || strequal(storage->type, "overlayfs")) && (storage->flags & LXC_STORAGE_INTERNAL_OVERLAY_RESTORE)) { ret = strnprintf(path, len, "%s/%s/%s", p1, c->name, LXC_CONFIG_FNAME); if (ret < 0) goto out; if (am_guest_unpriv()) ret = userns_exec_1(conf, lxc_unlink_exec_wrapper, path, "lxc_unlink_exec_wrapper"); else ret = unlink(path); if (ret < 0) { SYSERROR("Failed to destroy config file \"%s\" for \"%s\"", path, c->name); goto out; } INFO("Destroyed config file \"%s\" for \"%s\"", path, c->name); bret = true; goto out; } ret = strnprintf(path, len, "%s/%s", p1, c->name); if (ret < 0) goto out; if (am_guest_unpriv()) ret = userns_exec_full(conf, lxc_rmdir_onedev_wrapper, path, "lxc_rmdir_onedev_wrapper"); else ret = lxc_rmdir_onedev(path, "snaps"); if (ret < 0) { ERROR("Failed to destroy directory \"%s\" for \"%s\"", path, c->name); goto out; } INFO("Destroyed directory \"%s\" for \"%s\"", path, c->name); on_success: bret = true; out: if (path) free(path); container_disk_unlock(c); return bret; } static bool do_lxcapi_destroy(struct lxc_container *c) { if (!c || !lxcapi_is_defined(c)) return false; if (c->lxc_conf && c->lxc_conf->rootfs.managed) { if (has_snapshots(c)) { ERROR("Container %s has snapshots; not removing", c->name); return false; } if (has_fs_snapshots(c)) { ERROR("container %s has snapshots on its rootfs", c->name); return false; } } return container_destroy(c, NULL); } WRAP_API(bool, lxcapi_destroy) static bool do_lxcapi_destroy_with_snapshots(struct lxc_container *c) { if (!c || !lxcapi_is_defined(c)) return false; if (!lxcapi_snapshot_destroy_all(c)) { ERROR("Error deleting all snapshots"); return false; } return lxcapi_destroy(c); } WRAP_API(bool, lxcapi_destroy_with_snapshots) int lxc_set_config_item_locked(struct lxc_conf *conf, const char *key, const char *v) { int ret; struct lxc_config_t *config; bool bret = true; config = lxc_get_config(key); ret = config->set(key, v, conf, NULL); if (ret < 0) return -EINVAL; if (lxc_config_value_empty(v)) do_clear_unexp_config_line(conf, key); else bret = do_append_unexp_config_line(conf, key, v); if (!bret) return -ENOMEM; return 0; } static bool do_set_config_item_locked(struct lxc_container *c, const char *key, const char *v) { int ret; if (!c->lxc_conf) c->lxc_conf = lxc_conf_init(); if (!c->lxc_conf) return false; ret = lxc_set_config_item_locked(c->lxc_conf, key, v); if (ret < 0) return false; return true; } static bool do_lxcapi_set_config_item(struct lxc_container *c, const char *key, const char *v) { bool b = false; if (!c) return false; if (container_mem_lock(c)) return false; b = do_set_config_item_locked(c, key, v); container_mem_unlock(c); return b; } WRAP_API_2(bool, lxcapi_set_config_item, const char *, const char *) static char *lxcapi_config_file_name(struct lxc_container *c) { if (!c || !c->configfile) return NULL; return strdup(c->configfile); } static const char *lxcapi_get_config_path(struct lxc_container *c) { if (!c || !c->config_path) return NULL; return (const char *)(c->config_path); } /* * not for export * Just recalculate the c->configfile based on the * c->config_path, which must be set. * The lxc_container must be locked or not yet public. */ static bool set_config_filename(struct lxc_container *c) { char *newpath; int len, ret; if (!c->config_path) return false; /* $lxc_path + "/" + c->name + "/" + "config" + '\0' */ len = strlen(c->config_path) + 1 + strlen(c->name) + 1 + strlen(LXC_CONFIG_FNAME) + 1; newpath = malloc(len); if (!newpath) return false; ret = strnprintf(newpath, len, "%s/%s/%s", c->config_path, c->name, LXC_CONFIG_FNAME); if (ret < 0) { fprintf(stderr, "Error printing out config file name\n"); free(newpath); return false; } free(c->configfile); c->configfile = newpath; return true; } static bool do_lxcapi_set_config_path(struct lxc_container *c, const char *path) { char *p; bool b = false; char *oldpath = NULL; if (!c) return b; if (container_mem_lock(c)) return b; p = strdup(path); if (!p) { ERROR("Out of memory setting new lxc path"); goto err; } b = true; if (c->config_path) oldpath = c->config_path; c->config_path = p; /* Since we've changed the config path, we have to change the * config file name too */ if (!set_config_filename(c)) { ERROR("Out of memory setting new config filename"); b = false; free(c->config_path); c->config_path = oldpath; oldpath = NULL; } err: free(oldpath); container_mem_unlock(c); return b; } WRAP_API_1(bool, lxcapi_set_config_path, const char *) static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsys, const char *value) { call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL; int ret; if (!c) return false; if (is_stopped(c)) return false; ret = cgroup_set(c->name, c->config_path, subsys, value); if (ret < 0 && ERRNO_IS_NOT_SUPPORTED(ret)) { cgroup_ops = cgroup_init(c->lxc_conf); if (!cgroup_ops) return false; ret = cgroup_ops->set(cgroup_ops, subsys, value, c->name, c->config_path); } return ret == 0; } WRAP_API_2(bool, lxcapi_set_cgroup_item, const char *, const char *) static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys, char *retv, int inlen) { call_cleaner(cgroup_exit) struct cgroup_ops *cgroup_ops = NULL; int ret; if (!c) return -1; if (is_stopped(c)) return -1; ret = cgroup_get(c->name, c->config_path, subsys, retv, inlen); if (ret < 0 && ERRNO_IS_NOT_SUPPORTED(ret)) { cgroup_ops = cgroup_init(c->lxc_conf); if (!cgroup_ops) return -1; return cgroup_ops->get(cgroup_ops, subsys, retv, inlen, c->name, c->config_path); } return ret; } WRAP_API_3(int, lxcapi_get_cgroup_item, const char *, char *, int) const char *lxc_get_global_config_item(const char *key) { return lxc_global_config_value(key); } const char *lxc_get_version(void) { return LXC_VERSION; } static int copy_file(const char *old, const char *new) { int in, out; ssize_t len, ret; char buf[8096]; struct stat sbuf; if (file_exists(new)) { ERROR("copy destination %s exists", new); return -1; } ret = stat(old, &sbuf); if (ret < 0) { INFO("Error stat'ing %s", old); return -1; } in = open(old, O_RDONLY); if (in < 0) { SYSERROR("Error opening original file %s", old); return -1; } out = open(new, O_CREAT | O_EXCL | O_WRONLY, 0644); if (out < 0) { SYSERROR("Error opening new file %s", new); close(in); return -1; } for (;;) { len = lxc_read_nointr(in, buf, 8096); if (len < 0) { SYSERROR("Error reading old file %s", old); goto err; } if (len == 0) break; ret = lxc_write_nointr(out, buf, len); if (ret < len) { /* should we retry? */ SYSERROR("Error: write to new file %s was interrupted", new); goto err; } } close(in); close(out); /* We set mode, but not owner/group. */ ret = chmod(new, sbuf.st_mode); if (ret) { SYSERROR("Error setting mode on %s", new); return -1; } return 0; err: close(in); close(out); return -1; } static int copyhooks(struct lxc_container *oldc, struct lxc_container *c) { __do_free char *cpath = NULL; int i, len, ret; struct string_entry *entry; len = strlen(oldc->config_path) + strlen(oldc->name) + 3; cpath = malloc(len); if (!cpath) return ret_errno(ENOMEM); ret = strnprintf(cpath, len, "%s/%s/", oldc->config_path, oldc->name); if (ret < 0) return -1; for (i = 0; i < NUM_LXC_HOOKS; i++) { list_for_each_entry(entry, &c->lxc_conf->hooks[i], head) { __do_free char *hookname = NULL; char *fname, *new_hook; char tmppath[PATH_MAX]; fname = strrchr(entry->val, '/'); if (!fname) return 0; /* If this hook is public - ignore. */ if (!strnequal(entry->val, cpath, len - 1)) continue; /* copy the script, and change the entry in confile */ ret = strnprintf(tmppath, sizeof(tmppath), "%s/%s/%s", c->config_path, c->name, fname+1); if (ret < 0) return -1; ret = copy_file(entry->val, tmppath); if (ret < 0) return -1; new_hook = strdup(tmppath); if (!new_hook) return syserror("out of memory copying hook path"); hookname = move_ptr(entry->val); entry->val = move_ptr(new_hook); } } if (!clone_update_unexp_hooks(c->lxc_conf, oldc->config_path, c->config_path, oldc->name, c->name)) { return syserror_ret(-1, "Error saving new hooks in clone"); } do_lxcapi_save_config(c, NULL); return 0; } static int copy_fstab(struct lxc_container *oldc, struct lxc_container *c) { char newpath[PATH_MAX]; char *oldpath = oldc->lxc_conf->fstab; int ret; if (!oldpath) return 0; clear_unexp_config_line(c->lxc_conf, "lxc.mount.fstab", false); char *p = strrchr(oldpath, '/'); if (!p) return -1; ret = strnprintf(newpath, sizeof(newpath), "%s/%s%s", c->config_path, c->name, p); if (ret < 0) { ERROR("error printing new path for %s", oldpath); return -1; } if (file_exists(newpath)) { ERROR("error: fstab file %s exists", newpath); return -1; } if (copy_file(oldpath, newpath) < 0) { ERROR("error: copying %s to %s", oldpath, newpath); return -1; } free(c->lxc_conf->fstab); c->lxc_conf->fstab = strdup(newpath); if (!c->lxc_conf->fstab) { ERROR("error: allocating pathname"); return -1; } if (!do_append_unexp_config_line(c->lxc_conf, "lxc.mount.fstab", newpath)) { ERROR("error saving new lxctab"); return -1; } return 0; } static void copy_rdepends(struct lxc_container *c, struct lxc_container *c0) { char path0[PATH_MAX], path1[PATH_MAX]; int ret; ret = strnprintf(path0, sizeof(path0), "%s/%s/lxc_rdepends", c0->config_path, c0->name); if (ret < 0) { WARN("Error copying reverse dependencies"); return; } ret = strnprintf(path1, sizeof(path1), "%s/%s/lxc_rdepends", c->config_path, c->name); if (ret < 0) { WARN("Error copying reverse dependencies"); return; } if (copy_file(path0, path1) < 0) { INFO("Error copying reverse dependencies"); return; } } static bool add_rdepends(struct lxc_container *c, struct lxc_container *c0) { __do_fclose FILE *f = NULL; int ret; char path[PATH_MAX]; ret = strnprintf(path, sizeof(path), "%s/%s/lxc_rdepends", c->config_path, c->name); if (ret < 0) return false; f = fopen(path, "ae"); if (!f) return false; /* If anything goes wrong, just return an error. */ return fprintf(f, "%s\n%s\n", c0->config_path, c0->name) > 0; } /* * If the fs natively supports snapshot clones with no penalty, * then default to those even if not requested. * Currently we only do this for btrfs. */ static bool should_default_to_snapshot(struct lxc_container *c0, struct lxc_container *c1) { __do_free char *p0 = NULL, *p1 = NULL; int ret; size_t l0 = strlen(c0->config_path) + strlen(c0->name) + 2; size_t l1 = strlen(c1->config_path) + strlen(c1->name) + 2; char *rootfs = c0->lxc_conf->rootfs.path; p0 = must_realloc(NULL, l0 + 1); p1 = must_realloc(NULL, l1 + 1); ret = strnprintf(p0, l0, "%s/%s", c0->config_path, c0->name); if (ret < 0) return false; ret = strnprintf(p1, l1, "%s/%s", c1->config_path, c1->name); if (ret < 0) return false; if (!is_btrfs_fs(p0) || !is_btrfs_fs(p1)) return false; if (is_btrfs_subvol(rootfs) <= 0) return false; return btrfs_same_fs(p0, p1) == 0; } static int copy_storage(struct lxc_container *c0, struct lxc_container *c, const char *newtype, int flags, const char *bdevdata, uint64_t newsize) { struct lxc_storage *bdev; bool need_rdep; if (should_default_to_snapshot(c0, c)) flags |= LXC_CLONE_SNAPSHOT; bdev = storage_copy(c0, c->name, c->config_path, newtype, flags, bdevdata, newsize, &need_rdep); if (!bdev) { ERROR("Error copying storage."); return -1; } /* Set new rootfs. */ free(c->lxc_conf->rootfs.path); c->lxc_conf->rootfs.path = strdup(bdev->src); storage_put(bdev); if (!c->lxc_conf->rootfs.path) { ERROR("Out of memory while setting storage path."); return -1; } /* Append a new lxc.rootfs.path entry to the unexpanded config. */ clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.path", false); if (!do_append_unexp_config_line(c->lxc_conf, "lxc.rootfs.path", c->lxc_conf->rootfs.path)) { ERROR("Error saving new rootfs to cloned config."); return -1; } if (flags & LXC_CLONE_SNAPSHOT) copy_rdepends(c, c0); if (need_rdep) { if (!add_rdepends(c, c0)) WARN("Error adding reverse dependency from %s to %s", c->name, c0->name); } mod_all_rdeps(c, true); return 0; } struct clone_update_data { struct lxc_container *c0; struct lxc_container *c1; int flags; char **hookargs; }; static int clone_update_rootfs(struct clone_update_data *data) { struct lxc_container *c0 = data->c0; struct lxc_container *c = data->c1; int flags = data->flags; char **hookargs = data->hookargs; int ret = -1; char path[PATH_MAX]; struct lxc_storage *bdev; FILE *fout; struct lxc_conf *conf = c->lxc_conf; /* update hostname in rootfs */ /* we're going to mount, so run in a clean namespace to simplify cleanup */ (void)lxc_drop_groups(); if (setgid(0) < 0) { ERROR("Failed to setgid to 0"); return -1; } if (setuid(0) < 0) { ERROR("Failed to setuid to 0"); return -1; } if (unshare(CLONE_NEWNS) < 0) return -1; ret = lxc_storage_prepare(conf); if (ret) return -1; bdev = conf->rootfs.storage; if (!strequal(bdev->type, "dir")) { if (unshare(CLONE_NEWNS) < 0) { ERROR("error unsharing mounts"); lxc_storage_put(conf); return -1; } if (detect_shared_rootfs() && mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL)) SYSERROR("Failed to recursively turn root mount tree into dependent mount. Continuing..."); if (bdev->ops->mount(bdev) < 0) { lxc_storage_put(conf); return -1; } } else { /* TODO come up with a better way */ free(bdev->dest); bdev->dest = strdup(lxc_storage_get_path(bdev->src, bdev->type)); } if (!list_empty(&conf->hooks[LXCHOOK_CLONE])) { /* Start of environment variable setup for hooks */ if (c0->name && setenv("LXC_SRC_NAME", c0->name, 1)) SYSERROR("failed to set environment variable for source container name"); if (setenv("LXC_NAME", c->name, 1)) SYSERROR("failed to set environment variable for container name"); if (conf->rcfile && setenv("LXC_CONFIG_FILE", conf->rcfile, 1)) SYSERROR("failed to set environment variable for config path"); if (bdev->dest && setenv("LXC_ROOTFS_MOUNT", bdev->dest, 1)) SYSERROR("failed to set environment variable for rootfs mount"); if (conf->rootfs.path && setenv("LXC_ROOTFS_PATH", conf->rootfs.path, 1)) SYSERROR("failed to set environment variable for rootfs mount"); if (run_lxc_hooks(c->name, "clone", conf, hookargs)) { ERROR("Error executing clone hook for %s", c->name); lxc_storage_put(conf); return -1; } } if (!(flags & LXC_CLONE_KEEPNAME)) { ret = strnprintf(path, sizeof(path), "%s/etc/hostname", bdev->dest); lxc_storage_put(conf); if (ret < 0) return -1; if (!file_exists(path)) return 0; if (!(fout = fopen(path, "we"))) { SYSERROR("unable to open %s: ignoring", path); return 0; } if (fprintf(fout, "%s", c->name) < 0) { fclose(fout); return -1; } if (fclose(fout) < 0) return -1; } else { lxc_storage_put(conf); } return 0; } static int clone_update_rootfs_wrapper(void *data) { struct clone_update_data *arg = (struct clone_update_data *) data; return clone_update_rootfs(arg); } /* * We want to support: sudo lxc-clone -o o1 -n n1 -s -L|-fssize fssize -v|--vgname vgname \ -p|--lvprefix lvprefix -t|--fstype fstype -B backingstore -s [ implies overlay] -s -B overlay only rootfs gets converted (copied/snapshotted) on clone. */ static int create_file_dirname(char *path, struct lxc_conf *conf) { __do_close int fd_rootfs = -EBADF; char *p; p = strrchr(path, '/'); if (!p) return -1; *p = '\0'; fd_rootfs = do_create_container_dir(path, conf); *p = '/'; return fd_rootfs >= 0; } static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char *newname, const char *lxcpath, int flags, const char *bdevtype, const char *bdevdata, uint64_t newsize, char **hookargs) { char newpath[PATH_MAX]; int fd, ret; struct clone_update_data data; size_t saved_unexp_len; pid_t pid; int storage_copied = 0; char *origroot = NULL, *saved_unexp_conf = NULL; struct lxc_container *c2 = NULL; if (!c || !do_lxcapi_is_defined(c)) return NULL; if (container_mem_lock(c)) return NULL; if (!is_stopped(c) && !(flags & LXC_CLONE_ALLOW_RUNNING)) { ERROR("error: Original container (%s) is running. Use --allowrunning if you want to force a snapshot of the running container.", c->name); goto out; } /* Make sure the container doesn't yet exist. */ if (!newname) newname = c->name; if (!lxcpath) lxcpath = do_lxcapi_get_config_path(c); ret = strnprintf(newpath, sizeof(newpath), "%s/%s/%s", lxcpath, newname, LXC_CONFIG_FNAME); if (ret < 0) { SYSERROR("clone: failed making config pathname"); goto out; } if (file_exists(newpath)) { ERROR("error: clone: %s exists", newpath); goto out; } ret = create_file_dirname(newpath, c->lxc_conf); if (ret < 0 && errno != EEXIST) { ERROR("Error creating container dir for %s", newpath); goto out; } /* Copy the configuration. Tweak it as needed. */ if (c->lxc_conf->rootfs.path) { origroot = c->lxc_conf->rootfs.path; c->lxc_conf->rootfs.path = NULL; } fd = open(newpath, O_WRONLY | O_CREAT | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (fd < 0) { SYSERROR("Failed to open \"%s\"", newpath); goto out; } saved_unexp_conf = c->lxc_conf->unexpanded_config; saved_unexp_len = c->lxc_conf->unexpanded_len; c->lxc_conf->unexpanded_config = strdup(saved_unexp_conf); if (!c->lxc_conf->unexpanded_config) { close(fd); goto out; } clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.path", false); write_config(fd, c->lxc_conf); close(fd); c->lxc_conf->rootfs.path = origroot; free(c->lxc_conf->unexpanded_config); c->lxc_conf->unexpanded_config = saved_unexp_conf; saved_unexp_conf = NULL; c->lxc_conf->unexpanded_len = saved_unexp_len; ret = strnprintf(newpath, sizeof(newpath), "%s/%s/%s", lxcpath, newname, LXC_ROOTFS_DNAME); if (ret < 0) { SYSERROR("clone: failed making rootfs pathname"); goto out; } ret = mkdir(newpath, 0755); if (ret < 0) { /* For an overlay container the rootfs is considered immutable * and will not have been removed when restoring from a * snapshot. */ if (errno != ENOENT && !(flags & LXC_STORAGE_INTERNAL_OVERLAY_RESTORE)) { SYSERROR("Failed to create directory \"%s\"", newpath); goto out; } } if (am_guest_unpriv()) { if (chown_mapped_root(newpath, c->lxc_conf) < 0) { ERROR("Error chowning %s to container root", newpath); goto out; } } c2 = lxc_container_new(newname, lxcpath); if (!c2) { ERROR("clone: failed to create new container (%s %s)", newname, lxcpath); goto out; } /* copy/snapshot rootfs's */ ret = copy_storage(c, c2, bdevtype, flags, bdevdata, newsize); if (ret < 0) goto out; /* update utsname */ if (!(flags & LXC_CLONE_KEEPNAME)) { clear_unexp_config_line(c2->lxc_conf, "lxc.utsname", false); clear_unexp_config_line(c2->lxc_conf, "lxc.uts.name", false); if (!do_set_config_item_locked(c2, "lxc.uts.name", newname)) { ERROR("Error setting new hostname"); goto out; } } /* copy hooks */ ret = copyhooks(c, c2); if (ret < 0) { ERROR("error copying hooks"); goto out; } if (copy_fstab(c, c2) < 0) { ERROR("error copying fstab"); goto out; } /* update macaddrs */ if (!(flags & LXC_CLONE_KEEPMACADDR)) { if (!network_new_hwaddrs(c2->lxc_conf)) { ERROR("Error updating mac addresses"); goto out; } } /* Update absolute paths for overlay mount directories. */ if (ovl_update_abs_paths(c2->lxc_conf, c->config_path, c->name, lxcpath, newname) < 0) goto out; /* We've now successfully created c2's storage, so clear it out if we * fail after this. */ storage_copied = 1; if (!c2->save_config(c2, NULL)) goto out; if ((pid = fork()) < 0) { SYSERROR("fork"); goto out; } if (pid > 0) { ret = wait_for_pid(pid); if (ret) goto out; container_mem_unlock(c); return c2; } data.c0 = c; data.c1 = c2; data.flags = flags; data.hookargs = hookargs; if (am_guest_unpriv()) ret = userns_exec_full(c->lxc_conf, clone_update_rootfs_wrapper, &data, "clone_update_rootfs_wrapper"); else ret = clone_update_rootfs(&data); if (ret < 0) _exit(EXIT_FAILURE); container_mem_unlock(c); _exit(EXIT_SUCCESS); out: container_mem_unlock(c); if (c2) { if (!storage_copied) c2->lxc_conf->rootfs.path = NULL; c2->destroy(c2); lxc_container_put(c2); } return NULL; } static struct lxc_container *lxcapi_clone(struct lxc_container *c, const char *newname, const char *lxcpath, int flags, const char *bdevtype, const char *bdevdata, uint64_t newsize, char **hookargs) { struct lxc_container * ret; current_config = c ? c->lxc_conf : NULL; ret = do_lxcapi_clone(c, newname, lxcpath, flags, bdevtype, bdevdata, newsize, hookargs); current_config = NULL; return ret; } static bool do_lxcapi_rename(struct lxc_container *c, const char *newname) { struct lxc_storage *bdev; struct lxc_container *newc; if (!c || !c->name || !c->config_path || !c->lxc_conf) return false; if (has_fs_snapshots(c) || has_snapshots(c)) { ERROR("Renaming a container with snapshots is not supported"); return false; } if (lxc_storage_prepare(c->lxc_conf)) { ERROR("Failed to find original backing store type"); return false; } bdev = c->lxc_conf->rootfs.storage; newc = lxcapi_clone(c, newname, c->config_path, LXC_CLONE_KEEPMACADDR, NULL, bdev->type, 0, NULL); lxc_storage_put(c->lxc_conf); if (!newc) { lxc_container_put(newc); return false; } if (newc && lxcapi_is_defined(newc)) lxc_container_put(newc); if (!container_destroy(c, NULL)) { ERROR("Could not destroy existing container %s", c->name); return false; } return true; } WRAP_API_1(bool, lxcapi_rename, const char *) static int lxcapi_attach(struct lxc_container *c, lxc_attach_exec_t exec_function, void *exec_payload, lxc_attach_options_t *options, pid_t *attached_process) { int ret; if (!c) return -1; current_config = c->lxc_conf; ret = lxc_attach(c, exec_function, exec_payload, options, attached_process); current_config = NULL; return ret; } static int do_lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *const argv[]) { lxc_attach_command_t command; pid_t pid; int ret; if (!c) return -1; command.program = (char *)program; command.argv = (char **)argv; ret = lxc_attach(c, lxc_attach_run_command, &command, options, &pid); if (ret < 0) return ret; return lxc_wait_for_pid_status(pid); } static int lxcapi_attach_run_wait(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *const argv[]) { int ret; current_config = c ? c->lxc_conf : NULL; ret = do_lxcapi_attach_run_wait(c, options, program, argv); current_config = NULL; return ret; } static int get_next_index(const char *lxcpath, char *cname) { __do_free char *fname = NULL; struct stat sb; int i = 0, ret; fname = must_realloc(NULL, strlen(lxcpath) + 20); for (;;) { sprintf(fname, "%s/snap%d", lxcpath, i); ret = stat(fname, &sb); if (ret != 0) return i; i++; } } static bool get_snappath_dir(struct lxc_container *c, char *snappath) { int ret; /* * If the old style snapshot path exists, use it * /var/lib/lxc -> /var/lib/lxcsnaps */ ret = strnprintf(snappath, PATH_MAX, "%ssnaps", c->config_path); if (ret < 0) return false; if (dir_exists(snappath)) { ret = strnprintf(snappath, PATH_MAX, "%ssnaps/%s", c->config_path, c->name); if (ret < 0) return false; return true; } /* * Use the new style path * /var/lib/lxc -> /var/lib/lxc + c->name + /snaps + \0 */ ret = strnprintf(snappath, PATH_MAX, "%s/%s/snaps", c->config_path, c->name); if (ret < 0) return false; return true; } static int do_lxcapi_snapshot(struct lxc_container *c, const char *commentfile) { __do_free char *dfnam = NULL; int len; int i, flags, ret; time_t timer; struct tm tm_info; struct lxc_container *c2; char snappath[PATH_MAX], newname[20]; char buffer[25]; FILE *f; if (!c || !lxcapi_is_defined(c)) return -1; if (!storage_can_backup(c->lxc_conf)) { ERROR("%s's backing store cannot be backed up", c->name); ERROR("Your container must use another backing store type"); return -1; } if (!get_snappath_dir(c, snappath)) return -1; i = get_next_index(snappath, c->name); if (mkdir_p(snappath, 0755) < 0) { ERROR("Failed to create snapshot directory %s", snappath); return -1; } ret = strnprintf(newname, 20, "snap%d", i); if (ret < 0) return -1; /* * We pass LXC_CLONE_SNAPSHOT to make sure that a rdepends file entry is * created in the original container */ flags = LXC_CLONE_SNAPSHOT | LXC_CLONE_KEEPMACADDR | LXC_CLONE_KEEPNAME | LXC_CLONE_KEEPBDEVTYPE | LXC_CLONE_MAYBE_SNAPSHOT; if (storage_is_dir(c->lxc_conf)) { ERROR("Snapshot of directory-backed container requested"); ERROR("Making a copy-clone. If you do want snapshots, then"); ERROR("please create overlay clone first, snapshot that"); ERROR("and keep the original container pristine"); flags &= ~LXC_CLONE_SNAPSHOT | LXC_CLONE_MAYBE_SNAPSHOT; } c2 = do_lxcapi_clone(c, newname, snappath, flags, NULL, NULL, 0, NULL); if (!c2) { ERROR("Failed to clone of %s:%s", c->config_path, c->name); return -1; } lxc_container_put(c2); /* Now write down the creation time. */ time(&timer); if (!localtime_r(&timer, &tm_info)) { ERROR("Failed to get localtime"); return -1; } strftime(buffer, 25, "%Y:%m:%d %H:%M:%S", &tm_info); len = strlen(snappath) + 1 + strlen(newname) + 1 + strlen(LXC_TIMESTAMP_FNAME) + 1; dfnam = must_realloc(NULL, len); ret = strnprintf(dfnam, len, "%s/%s/%s", snappath, newname, LXC_TIMESTAMP_FNAME); if (ret < 0) return -1; f = fopen(dfnam, "we"); if (!f) { ERROR("Failed to open %s", dfnam); return -1; } if (fprintf(f, "%s", buffer) < 0) { SYSERROR("Writing timestamp"); fclose(f); return -1; } ret = fclose(f); if (ret != 0) { SYSERROR("Writing timestamp"); return -1; } if (commentfile) { __do_free char *path = NULL; /* $p / $name / comment \0 */ len = strlen(snappath) + 1 + strlen(newname) + 1 + strlen(LXC_COMMENT_FNAME) + 1; path = must_realloc(NULL, len); ret = strnprintf(path, len, "%s/%s/%s", snappath, newname, LXC_COMMENT_FNAME); if (ret < 0) return -1; return copy_file(commentfile, path) < 0 ? -1 : i; } return i; } WRAP_API_1(int, lxcapi_snapshot, const char *) static void lxcsnap_free(struct lxc_snapshot *s) { free(s->name); free(s->comment_pathname); free(s->timestamp); free(s->lxcpath); } static char *get_snapcomment_path(char *snappath, char *name) { __do_free char *s = NULL; /* $snappath/$name/comment */ int ret, len = strlen(snappath) + strlen(name) + 10; s = malloc(len); if (!s) return NULL; ret = strnprintf(s, len, "%s/%s/comment", snappath, name); if (ret < 0) return NULL; return move_ptr(s); } static char *get_timestamp(char* snappath, char *name) { __do_free char *s = NULL; __do_fclose FILE *fin = NULL; char path[PATH_MAX]; int ret, len; ret = strnprintf(path, sizeof(path), "%s/%s/ts", snappath, name); if (ret < 0) return NULL; fin = fopen(path, "re"); if (!fin) return NULL; (void) fseek(fin, 0, SEEK_END); len = ftell(fin); (void) fseek(fin, 0, SEEK_SET); if (len > 0) { s = malloc(len+1); if (s) { ssize_t nbytes; s[len] = '\0'; nbytes = fread(s, 1, len, fin); if (nbytes < 0 || nbytes != (ssize_t)len) return log_error_errno(NULL, errno, "reading timestamp"); } } return move_ptr(s); } static int do_lxcapi_snapshot_list(struct lxc_container *c, struct lxc_snapshot **ret_snaps) { __do_closedir DIR *dir = NULL; char snappath[PATH_MAX], path2[PATH_MAX]; int count = 0, ret; struct dirent *direntp; struct lxc_snapshot *snaps =NULL, *nsnaps; if (!c || !lxcapi_is_defined(c)) return -1; if (!get_snappath_dir(c, snappath)) { ERROR("path name too long"); return -1; } dir = opendir(snappath); if (!dir) { INFO("Failed to open %s - assuming no snapshots", snappath); return 0; } while ((direntp = readdir(dir))) { if (strequal(direntp->d_name, ".")) continue; if (strequal(direntp->d_name, "..")) continue; ret = strnprintf(path2, sizeof(path2), "%s/%s/%s", snappath, direntp->d_name, LXC_CONFIG_FNAME); if (ret < 0) { ERROR("pathname too long"); goto out_free; } if (!file_exists(path2)) continue; nsnaps = realloc(snaps, (count + 1)*sizeof(*snaps)); if (!nsnaps) { SYSERROR("Out of memory"); goto out_free; } snaps = nsnaps; snaps[count].free = lxcsnap_free; snaps[count].name = strdup(direntp->d_name); if (!snaps[count].name) goto out_free; snaps[count].lxcpath = strdup(snappath); if (!snaps[count].lxcpath) { free(snaps[count].name); goto out_free; } snaps[count].comment_pathname = get_snapcomment_path(snappath, direntp->d_name); snaps[count].timestamp = get_timestamp(snappath, direntp->d_name); count++; } *ret_snaps = snaps; return count; out_free: if (snaps) { for (int i = 0; i < count; i++) lxcsnap_free(&snaps[i]); free(snaps); } return -1; } WRAP_API_1(int, lxcapi_snapshot_list, struct lxc_snapshot **) static bool do_lxcapi_snapshot_restore(struct lxc_container *c, const char *snapname, const char *newname) { char clonelxcpath[PATH_MAX]; int flags = 0; struct lxc_container *snap, *rest; struct lxc_storage *bdev; bool b = false; if (!c || !c->name || !c->config_path) return false; if (has_fs_snapshots(c)) { ERROR("container rootfs has dependent snapshots"); return false; } if (lxc_storage_prepare(c->lxc_conf)) { ERROR("Failed to find original backing store type"); return false; } bdev = c->lxc_conf->rootfs.storage; /* For an overlay container the rootfs is considered immutable * and cannot be removed when restoring from a snapshot. We pass this * internal flag along to communicate this to various parts of the * codebase. */ if (strequal(bdev->type, "overlay") || strequal(bdev->type, "overlayfs")) bdev->flags |= LXC_STORAGE_INTERNAL_OVERLAY_RESTORE; if (!newname) newname = c->name; if (!get_snappath_dir(c, clonelxcpath)) { lxc_storage_put(c->lxc_conf); return false; } /* how should we lock this? */ snap = lxc_container_new(snapname, clonelxcpath); if (!snap || !lxcapi_is_defined(snap)) { ERROR("Could not open snapshot %s", snapname); if (snap) lxc_container_put(snap); lxc_storage_put(c->lxc_conf); return false; } if (strequal(c->name, newname)) { if (!container_destroy(c, bdev)) { ERROR("Could not destroy existing container %s", newname); lxc_container_put(snap); lxc_storage_put(c->lxc_conf); return false; } } if (!strequal(bdev->type, "dir") && !strequal(bdev->type, "loop")) flags = LXC_CLONE_SNAPSHOT | LXC_CLONE_MAYBE_SNAPSHOT; if (strequal(bdev->type, "overlay") || strequal(bdev->type, "overlayfs")) flags |= LXC_STORAGE_INTERNAL_OVERLAY_RESTORE; rest = lxcapi_clone(snap, newname, c->config_path, flags, bdev->type, NULL, 0, NULL); lxc_storage_put(c->lxc_conf); if (rest && lxcapi_is_defined(rest)) b = true; if (rest) lxc_container_put(rest); lxc_container_put(snap); return b; } WRAP_API_2(bool, lxcapi_snapshot_restore, const char *, const char *) static bool do_snapshot_destroy(const char *snapname, const char *clonelxcpath) { struct lxc_container *snap = NULL; bool bret = false; snap = lxc_container_new(snapname, clonelxcpath); if (!snap) { ERROR("Could not find snapshot %s", snapname); goto err; } if (!do_lxcapi_destroy(snap)) { ERROR("Could not destroy snapshot %s", snapname); goto err; } bret = true; err: if (snap) lxc_container_put(snap); return bret; } static bool remove_all_snapshots(const char *path) { __do_closedir DIR *dir = NULL; struct dirent *direntp; bool bret = true; dir = opendir(path); if (!dir) { SYSERROR("opendir on snapshot path %s", path); return false; } while ((direntp = readdir(dir))) { if (strequal(direntp->d_name, ".")) continue; if (strequal(direntp->d_name, "..")) continue; if (!do_snapshot_destroy(direntp->d_name, path)) { bret = false; continue; } } if (rmdir(path)) SYSERROR("Error removing directory %s", path); return bret; } static bool do_lxcapi_snapshot_destroy(struct lxc_container *c, const char *snapname) { char clonelxcpath[PATH_MAX]; if (!c || !c->name || !c->config_path || !snapname) return false; if (!get_snappath_dir(c, clonelxcpath)) return false; return do_snapshot_destroy(snapname, clonelxcpath); } WRAP_API_1(bool, lxcapi_snapshot_destroy, const char *) static bool do_lxcapi_snapshot_destroy_all(struct lxc_container *c) { char clonelxcpath[PATH_MAX]; if (!c || !c->name || !c->config_path) return false; if (!get_snappath_dir(c, clonelxcpath)) return false; return remove_all_snapshots(clonelxcpath); } WRAP_API(bool, lxcapi_snapshot_destroy_all) static bool do_lxcapi_may_control(struct lxc_container *c) { if (!c) return false; return lxc_try_cmd(c->name, c->config_path) == 0; } WRAP_API(bool, lxcapi_may_control) static bool do_add_remove_node(pid_t init_pid, const char *path, bool add, struct stat *st) { int ret; char *tmp; pid_t pid; char chrootpath[PATH_MAX]; char *directory_path = NULL; pid = fork(); if (pid < 0) { SYSERROR("Failed to fork()"); return false; } if (pid) { ret = wait_for_pid(pid); if (ret != 0) { ERROR("Failed to create device node"); return false; } return true; } /* prepare the path */ ret = strnprintf(chrootpath, sizeof(chrootpath), "/proc/%d/root", init_pid); if (ret < 0) return false; ret = chroot(chrootpath); if (ret < 0) _exit(EXIT_FAILURE); ret = chdir("/"); if (ret < 0) _exit(EXIT_FAILURE); /* remove path if it exists */ ret = faccessat(AT_FDCWD, path, F_OK, AT_SYMLINK_NOFOLLOW); if(ret == 0) { ret = unlink(path); if (ret < 0) { SYSERROR("Failed to remove \"%s\"", path); _exit(EXIT_FAILURE); } } if (!add) _exit(EXIT_SUCCESS); /* create any missing directories */ tmp = strdup(path); if (!tmp) _exit(EXIT_FAILURE); directory_path = dirname(tmp); ret = mkdir_p(directory_path, 0755); if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create path \"%s\"", directory_path); free(tmp); _exit(EXIT_FAILURE); } /* create the device node */ ret = mknod(path, st->st_mode, st->st_rdev); free(tmp); if (ret < 0) { SYSERROR("Failed to create device node at \"%s\"", path); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } static bool add_remove_device_node(struct lxc_container *c, const char *src_path, const char *dest_path, bool add) { int ret; struct stat st; char value[LXC_MAX_BUFFER]; const char *p; pid_t init_pid; /* make sure container is running */ if (!do_lxcapi_is_running(c)) { ERROR("container is not running"); return false; } /* use src_path if dest_path is NULL otherwise use dest_path */ p = dest_path ? dest_path : src_path; /* make sure we can access p */ if(access(p, F_OK) < 0 || stat(p, &st) < 0) return false; /* continue if path is character device or block device */ if (S_ISCHR(st.st_mode)) ret = strnprintf(value, sizeof(value), "c %d:%d rwm", major(st.st_rdev), minor(st.st_rdev)); else if (S_ISBLK(st.st_mode)) ret = strnprintf(value, sizeof(value), "b %d:%d rwm", major(st.st_rdev), minor(st.st_rdev)); else return false; if (ret < 0) return false; init_pid = do_lxcapi_init_pid(c); if (init_pid < 0) { ERROR("Failed to get init pid"); return false; } if (!do_add_remove_node(init_pid, p, add, &st)) return false; /* add or remove device to/from cgroup access list */ if (add) { if (!do_lxcapi_set_cgroup_item(c, "devices.allow", value)) { ERROR("set_cgroup_item failed while adding the device node"); return false; } } else { if (!do_lxcapi_set_cgroup_item(c, "devices.deny", value)) { ERROR("set_cgroup_item failed while removing the device node"); return false; } } return true; } static bool do_lxcapi_add_device_node(struct lxc_container *c, const char *src_path, const char *dest_path) { // cannot mknod if we're not privileged wrt init_user_ns if (am_host_unpriv()) { ERROR(LXC_UNPRIV_EOPNOTSUPP, __FUNCTION__); return false; } return add_remove_device_node(c, src_path, dest_path, true); } WRAP_API_2(bool, lxcapi_add_device_node, const char *, const char *) static bool do_lxcapi_remove_device_node(struct lxc_container *c, const char *src_path, const char *dest_path) { if (am_guest_unpriv()) { ERROR(LXC_UNPRIV_EOPNOTSUPP, __FUNCTION__); return false; } return add_remove_device_node(c, src_path, dest_path, false); } WRAP_API_2(bool, lxcapi_remove_device_node, const char *, const char *) static bool do_lxcapi_attach_interface(struct lxc_container *c, const char *ifname, const char *dst_ifname) { pid_t init_pid; int ret = 0; if (am_guest_unpriv()) { ERROR(LXC_UNPRIV_EOPNOTSUPP, __FUNCTION__); return false; } if (!ifname) { ERROR("No source interface name given"); return false; } ret = lxc_netdev_isup(ifname); if (ret > 0) { /* netdev of ifname is up. */ ret = lxc_netdev_down(ifname); if (ret) goto err; } init_pid = do_lxcapi_init_pid(c); if (init_pid < 0) { ERROR("Failed to get init pid"); goto err; } ret = lxc_netdev_move_by_name(ifname, init_pid, dst_ifname); if (ret) goto err; INFO("Moved network device \"%s\" to network namespace of %d", ifname, init_pid); return true; err: return false; } WRAP_API_2(bool, lxcapi_attach_interface, const char *, const char *) static bool do_lxcapi_detach_interface(struct lxc_container *c, const char *ifname, const char *dst_ifname) { int ret; pid_t pid, pid_outside; __do_free char *physname = NULL; /* * TODO - if this is a physical device, then we need am_host_unpriv. * But for other types guest privilege suffices. */ if (am_guest_unpriv()) { ERROR(LXC_UNPRIV_EOPNOTSUPP, __FUNCTION__); return false; } if (!ifname) { ERROR("No source interface name given"); return false; } pid_outside = lxc_raw_getpid(); pid = fork(); if (pid < 0) { ERROR("Failed to fork"); return false; } if (pid == 0) { /* child */ pid_t init_pid; init_pid = do_lxcapi_init_pid(c); if (init_pid < 0) { ERROR("Failed to get init pid"); _exit(EXIT_FAILURE); } if (!switch_to_ns(init_pid, "net")) { ERROR("Failed to enter network namespace"); _exit(EXIT_FAILURE); } /* create new mount namespace for use with remounting /sys and is_wlan() below. */ ret = unshare(CLONE_NEWNS); if (ret < 0) { ERROR("Failed to unshare mount namespace"); _exit(EXIT_FAILURE); } /* set / recursively as private so that mount propagation doesn't affect us. */ if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0) < 0) { ERROR("Failed to recursively set / as private in mount namespace"); _exit(EXIT_FAILURE); } ret = lxc_netdev_isup(ifname); if (ret < 0) { ERROR("Failed to determine whether network device \"%s\" is up", ifname); _exit(EXIT_FAILURE); } /* netdev of ifname is up. */ if (ret) { ret = lxc_netdev_down(ifname); if (ret) { ERROR("Failed to set network device \"%s\" down", ifname); _exit(EXIT_FAILURE); } } /* remount /sys so is_wlan() can check if this device is a wlan device. */ lxc_attach_remount_sys_proc(); physname = is_wlan(ifname); if (physname) ret = lxc_netdev_move_wlan(physname, ifname, pid_outside, dst_ifname); else ret = lxc_netdev_move_by_name(ifname, pid_outside, dst_ifname); /* -EINVAL means there is no netdev named as ifname. */ if (ret < 0) { if (ret == -EINVAL) ERROR("Network device \"%s\" not found", ifname); else ERROR("Failed to remove network device \"%s\"", ifname); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } ret = wait_for_pid(pid); if (ret != 0) return false; INFO("Moved network device \"%s\" to network namespace of %d", ifname, pid_outside); return true; } WRAP_API_2(bool, lxcapi_detach_interface, const char *, const char *) static int do_lxcapi_migrate(struct lxc_container *c, unsigned int cmd, struct migrate_opts *opts, unsigned int size) { int ret = -1; struct migrate_opts *valid_opts = opts; uint64_t features_to_check = 0; /* If the caller has a bigger (newer) struct migrate_opts, let's make * sure that the stuff on the end is zero, i.e. that they didn't ask us * to do anything special. */ if (size > sizeof(*opts)) { unsigned char *addr; unsigned char *end; addr = (void *)opts + sizeof(*opts); end = (void *)opts + size; for (; addr < end; addr++) if (*addr) return -E2BIG; } /* If the caller has a smaller struct, let's zero out the end for them * so we don't accidentally use bits of it that they didn't know about * to initialize. */ if (size < sizeof(*opts)) { valid_opts = malloc(sizeof(*opts)); if (!valid_opts) return -ENOMEM; memset(valid_opts, 0, sizeof(*opts)); memcpy(valid_opts, opts, size); } switch (cmd) { case MIGRATE_PRE_DUMP: if (!do_lxcapi_is_running(c)) { ERROR("container is not running"); goto on_error; } ret = !__criu_pre_dump(c, valid_opts); break; case MIGRATE_DUMP: if (!do_lxcapi_is_running(c)) { ERROR("container is not running"); goto on_error; } ret = !__criu_dump(c, valid_opts); break; case MIGRATE_RESTORE: if (do_lxcapi_is_running(c)) { ERROR("container is already running"); goto on_error; } ret = !__criu_restore(c, valid_opts); break; case MIGRATE_FEATURE_CHECK: features_to_check = valid_opts->features_to_check; ret = !__criu_check_feature(&features_to_check); if (ret) { /* Something went wrong. Let's let the caller * know which feature checks failed. */ valid_opts->features_to_check = features_to_check; } break; default: ERROR("invalid migrate command %u", cmd); ret = -EINVAL; } on_error: if (size < sizeof(*opts)) free(valid_opts); return ret; } WRAP_API_3(int, lxcapi_migrate, unsigned int, struct migrate_opts *, unsigned int) static bool do_lxcapi_checkpoint(struct lxc_container *c, char *directory, bool stop, bool verbose) { struct migrate_opts opts; memset(&opts, 0, sizeof(opts)); opts.directory = directory; opts.stop = stop; opts.verbose = verbose; return !do_lxcapi_migrate(c, MIGRATE_DUMP, &opts, sizeof(opts)); } WRAP_API_3(bool, lxcapi_checkpoint, char *, bool, bool) static bool do_lxcapi_restore(struct lxc_container *c, char *directory, bool verbose) { struct migrate_opts opts; memset(&opts, 0, sizeof(opts)); opts.directory = directory; opts.verbose = verbose; return !do_lxcapi_migrate(c, MIGRATE_RESTORE, &opts, sizeof(opts)); } WRAP_API_2(bool, lxcapi_restore, char *, bool) /* @st_mode is the st_mode field of the stat(source) return struct */ static int create_mount_target(const char *dest, mode_t st_mode) { char *dirdup, *destdirname; int ret; dirdup = strdup(dest); if (!dirdup) { SYSERROR("Failed to duplicate target name \"%s\"", dest); return -1; } destdirname = dirname(dirdup); ret = mkdir_p(destdirname, 0755); if (ret < 0) { SYSERROR("Failed to create \"%s\"", destdirname); free(dirdup); return ret; } free(dirdup); (void)remove(dest); if (S_ISDIR(st_mode)) ret = mkdir(dest, 0000); else ret = mknod(dest, S_IFREG | 0000, 0); if (ret == 0) TRACE("Created mount target \"%s\"", dest); else if (ret < 0 && errno != EEXIST) { SYSERROR("Failed to create mount target \"%s\"", dest); return -1; } return 0; } static int do_lxcapi_mount(struct lxc_container *c, const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data, struct lxc_mount *mnt) { char *suff, *sret; char template[PATH_MAX], path[PATH_MAX]; pid_t pid, init_pid; struct stat sb; bool is_dir; int ret = -1, fd = -EBADF; if (!c || !c->lxc_conf) { ERROR("Container or configuration is NULL"); return -EINVAL; } if (!c->lxc_conf->shmount.path_host) { ERROR("Host path to shared mountpoint must be specified in the config\n"); return -EINVAL; } ret = strnprintf(template, sizeof(template), "%s/.lxcmount_XXXXXX", c->lxc_conf->shmount.path_host); if (ret < 0) { SYSERROR("Error writing shmounts tempdir name"); goto out; } /* Create a temporary file / dir under the shared mountpoint */ if (!source || strequal(source, "")) { /* If source is not specified, maybe we want to mount a filesystem? */ sb.st_mode = S_IFDIR; } else { ret = stat(source, &sb); if (ret < 0) { SYSERROR("Error getting stat info about the source \"%s\"", source); goto out; } } is_dir = (S_ISDIR(sb.st_mode) != 0); if (is_dir) { sret = mkdtemp(template); if (!sret) { SYSERROR("Could not create shmounts temporary dir"); goto out; } } else { fd = lxc_make_tmpfile(template, false); if (fd < 0) { SYSERROR("Could not create shmounts temporary file"); goto out; } } /* Do the fork */ pid = fork(); if (pid < 0) { SYSERROR("Could not fork"); goto out; } if (pid == 0) { /* Do the mount */ ret = mount(source, template, filesystemtype, mountflags, data); if (ret < 0) { SYSERROR("Failed to mount onto \"%s\"", template); _exit(EXIT_FAILURE); } TRACE("Mounted \"%s\" onto \"%s\"", source, template); init_pid = do_lxcapi_init_pid(c); if (init_pid < 0) { ERROR("Failed to obtain container's init pid"); _exit(EXIT_FAILURE); } /* Enter the container namespaces */ if (!list_empty(&c->lxc_conf->id_map)) { if (!switch_to_ns(init_pid, "user")) { ERROR("Failed to enter user namespace"); _exit(EXIT_FAILURE); } if (!lxc_switch_uid_gid(0, 0)) _exit(EXIT_FAILURE); } if (!switch_to_ns(init_pid, "mnt")) { ERROR("Failed to enter mount namespace"); _exit(EXIT_FAILURE); } ret = create_mount_target(target, sb.st_mode); if (ret < 0) _exit(EXIT_FAILURE); suff = strrchr(template, '/'); if (!suff) goto cleanup_target_in_child; ret = strnprintf(path, sizeof(path), "%s%s", c->lxc_conf->shmount.path_cont, suff); if (ret < 0) { SYSERROR("Error writing container mountpoint name"); goto cleanup_target_in_child; } ret = mount(path, target, NULL, MS_MOVE | MS_REC, NULL); if (ret < 0) { SYSERROR("Failed to move the mount from \"%s\" to \"%s\"", path, target); goto cleanup_target_in_child; } TRACE("Moved mount from \"%s\" to \"%s\"", path, target); _exit(EXIT_SUCCESS); cleanup_target_in_child: (void)remove(target); _exit(EXIT_FAILURE); } ret = wait_for_pid(pid); if (ret < 0) SYSERROR("Wait for the child with pid %ld failed", (long)pid); else ret = 0; if (umount2(template, MNT_DETACH)) SYSWARN("Failed to remove temporary mount \"%s\"", template); if (is_dir) (void)rmdir(template); else (void)unlink(template); out: if (fd >= 0) close(fd); return ret; } WRAP_API_6(int, lxcapi_mount, const char *, const char *, const char *, unsigned long, const void *, struct lxc_mount *) static int do_lxcapi_umount(struct lxc_container *c, const char *target, unsigned long flags, struct lxc_mount *mnt) { pid_t pid, init_pid; int ret = -1; if (!c || !c->lxc_conf) { ERROR("Container or configuration is NULL"); return -EINVAL; } /* Do the fork */ pid = fork(); if (pid < 0) { SYSERROR("Could not fork"); return -1; } if (pid == 0) { init_pid = do_lxcapi_init_pid(c); if (init_pid < 0) { ERROR("Failed to obtain container's init pid"); _exit(EXIT_FAILURE); } /* Enter the container namespaces */ if (!list_empty(&c->lxc_conf->id_map)) { if (!switch_to_ns(init_pid, "user")) { ERROR("Failed to enter user namespace"); _exit(EXIT_FAILURE); } } if (!switch_to_ns(init_pid, "mnt")) { ERROR("Failed to enter mount namespace"); _exit(EXIT_FAILURE); } /* Do the unmount */ ret = umount2(target, flags); if (ret < 0) { SYSERROR("Failed to umount \"%s\"", target); _exit(EXIT_FAILURE); } _exit(EXIT_SUCCESS); } ret = wait_for_pid(pid); if (ret < 0) { SYSERROR("Wait for the child with pid %ld failed", (long)pid); return -ret; } return 0; } WRAP_API_3(int, lxcapi_umount, const char *, unsigned long, struct lxc_mount*) static int lxcapi_attach_run_waitl(struct lxc_container *c, lxc_attach_options_t *options, const char *program, const char *arg, ...) { va_list ap; const char **argv; int ret; if (!c) return -1; current_config = c->lxc_conf; va_start(ap, arg); argv = lxc_va_arg_list_to_argv_const(ap, 1); va_end(ap); if (!argv) { ERROR("Memory allocation error."); ret = -1; goto out; } argv[0] = arg; ret = do_lxcapi_attach_run_wait(c, options, program, (const char * const *)argv); free((void*)argv); out: current_config = NULL; return ret; } static int do_lxcapi_seccomp_notify_fd(struct lxc_container *c) { if (!c || !c->lxc_conf) return ret_set_errno(-1, -EINVAL); return lxc_seccomp_get_notify_fd(&c->lxc_conf->seccomp); } WRAP_API(int, lxcapi_seccomp_notify_fd) static int do_lxcapi_seccomp_notify_fd_active(struct lxc_container *c) { if (!c || !c->lxc_conf) return ret_set_errno(-1, -EINVAL); return lxc_cmd_get_seccomp_notify_fd(c->name, c->config_path); } WRAP_API(int, lxcapi_seccomp_notify_fd_active) struct lxc_container *lxc_container_new(const char *name, const char *configpath) { struct lxc_container *c; size_t len; int rc; if (!name) return NULL; c = malloc(sizeof(*c)); if (!c) { fprintf(stderr, "Failed to allocate memory for %s\n", name); return NULL; } memset(c, 0, sizeof(*c)); if (configpath) c->config_path = strdup(configpath); else c->config_path = strdup(lxc_global_config_value("lxc.lxcpath")); if (!c->config_path) { fprintf(stderr, "Failed to allocate memory for %s\n", name); goto err; } remove_trailing_slashes(c->config_path); len = strlen(name); c->name = malloc(len + 1); if (!c->name) { fprintf(stderr, "Failed to allocate memory for %s\n", name); goto err; } (void)strlcpy(c->name, name, len + 1); c->numthreads = 1; c->slock = lxc_newlock(c->config_path, name); if (!c->slock) { fprintf(stderr, "Failed to create lock for %s\n", name); goto err; } c->privlock = lxc_newlock(NULL, NULL); if (!c->privlock) { fprintf(stderr, "Failed to create private lock for %s\n", name); goto err; } if (!set_config_filename(c)) { fprintf(stderr, "Failed to create config file name for %s\n", name); goto err; } if (file_exists(c->configfile) && !lxcapi_load_config(c, NULL)) { fprintf(stderr, "Failed to load config for %s\n", name); goto err; } rc = ongoing_create(c); switch (rc) { case LXC_CREATE_INCOMPLETE: SYSERROR("Failed to complete container creation for %s", c->name); container_destroy(c, NULL); lxcapi_clear_config(c); break; case LXC_CREATE_ONGOING: /* container creation going on */ break; case LXC_CREATE_FAILED: /* container creation failed */ if (errno != EACCES && errno != EPERM) { /* insufficient privileges */ SYSERROR("Failed checking for incomplete container %s creation", c->name); goto err; } break; } c->daemonize = true; c->pidfile = NULL; /* Assign the member functions. */ c->is_defined = lxcapi_is_defined; c->state = lxcapi_state; c->is_running = lxcapi_is_running; c->freeze = lxcapi_freeze; c->unfreeze = lxcapi_unfreeze; c->console = lxcapi_console; c->console_getfd = lxcapi_console_getfd; c->devpts_fd = lxcapi_devpts_fd; c->init_pid = lxcapi_init_pid; c->init_pidfd = lxcapi_init_pidfd; c->load_config = lxcapi_load_config; c->want_daemonize = lxcapi_want_daemonize; c->want_close_all_fds = lxcapi_want_close_all_fds; c->start = lxcapi_start; c->startl = lxcapi_startl; c->stop = lxcapi_stop; c->config_file_name = lxcapi_config_file_name; c->wait = lxcapi_wait; c->set_config_item = lxcapi_set_config_item; c->destroy = lxcapi_destroy; c->destroy_with_snapshots = lxcapi_destroy_with_snapshots; c->rename = lxcapi_rename; c->save_config = lxcapi_save_config; c->get_keys = lxcapi_get_keys; c->create = lxcapi_create; c->createl = lxcapi_createl; c->shutdown = lxcapi_shutdown; c->reboot = lxcapi_reboot; c->reboot2 = lxcapi_reboot2; c->clear_config = lxcapi_clear_config; c->clear_config_item = lxcapi_clear_config_item; c->get_config_item = lxcapi_get_config_item; c->get_running_config_item = lxcapi_get_running_config_item; c->get_cgroup_item = lxcapi_get_cgroup_item; c->set_cgroup_item = lxcapi_set_cgroup_item; c->get_config_path = lxcapi_get_config_path; c->set_config_path = lxcapi_set_config_path; c->clone = lxcapi_clone; c->get_interfaces = lxcapi_get_interfaces; c->get_ips = lxcapi_get_ips; c->attach = lxcapi_attach; c->attach_run_wait = lxcapi_attach_run_wait; c->attach_run_waitl = lxcapi_attach_run_waitl; c->snapshot = lxcapi_snapshot; c->snapshot_list = lxcapi_snapshot_list; c->snapshot_restore = lxcapi_snapshot_restore; c->snapshot_destroy = lxcapi_snapshot_destroy; c->snapshot_destroy_all = lxcapi_snapshot_destroy_all; c->may_control = lxcapi_may_control; c->add_device_node = lxcapi_add_device_node; c->remove_device_node = lxcapi_remove_device_node; c->attach_interface = lxcapi_attach_interface; c->detach_interface = lxcapi_detach_interface; c->checkpoint = lxcapi_checkpoint; c->restore = lxcapi_restore; c->migrate = lxcapi_migrate; c->console_log = lxcapi_console_log; c->mount = lxcapi_mount; c->umount = lxcapi_umount; c->seccomp_notify_fd = lxcapi_seccomp_notify_fd; c->seccomp_notify_fd_active = lxcapi_seccomp_notify_fd_active; return c; err: lxc_container_free(c); return NULL; } int lxc_get_wait_states(const char **states) { int i; if (states) for (i=0; i