]> git.proxmox.com Git - lxc.git/blob - debian/patches/extra/0005-tests-lxc-test-apparmor-mount-check-environment-earl.patch
bump version to 3.0.1+pve1-1
[lxc.git] / debian / patches / extra / 0005-tests-lxc-test-apparmor-mount-check-environment-earl.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 Date: Tue, 24 Jul 2018 11:49:14 +0200
4 Subject: [PATCH] tests: lxc-test-apparmor-mount: check environment early
5
6 don't kill all my processes when running it as user...
7
8 Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 (cherry picked from commit 39e2cbec3cc9f49e3edd65b2aa4bdd3983a25fea)
10 ---
11 src/tests/lxc-test-apparmor-mount | 20 ++++++++++----------
12 1 file changed, 10 insertions(+), 10 deletions(-)
13
14 diff --git a/src/tests/lxc-test-apparmor-mount b/src/tests/lxc-test-apparmor-mount
15 index 144467c8..56d598f4 100755
16 --- a/src/tests/lxc-test-apparmor-mount
17 +++ b/src/tests/lxc-test-apparmor-mount
18 @@ -23,6 +23,16 @@
19
20 set -e
21
22 +# Only run on a normally configured ubuntu lxc system
23 +if [ ! -d /sys/class/net/lxcbr0 ]; then
24 + echo "lxcbr0 is not configured."
25 + exit 1
26 +fi
27 +if [ "$(id -u)" != "0" ]; then
28 + echo "ERROR: Must run as root."
29 + exit 1
30 +fi
31 +
32 if [ -f /proc/self/ns/cgroup ]; then
33 default_profile="lxc-container-default-cgns (enforce)"
34 else
35 @@ -74,16 +84,6 @@ clear_log() {
36
37 trap cleanup exit
38
39 -# Only run on a normally configured ubuntu lxc system
40 -if [ ! -d /sys/class/net/lxcbr0 ]; then
41 - echo "lxcbr0 is not configured."
42 - exit 1
43 -fi
44 -if [ "$(id -u)" != "0" ]; then
45 - echo "ERROR: Must run as root."
46 - exit 1
47 -fi
48 -
49 chmod 0666 "$logfile"
50
51 # This would be much simpler if we could run it as
52 --
53 2.11.0
54