aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
blob: 8cc11a63e12878c2c83f679c96d135812e80e9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001
From: He Zhe <zhe.he@windriver.com>
Date: Wed, 2 Mar 2016 15:46:57 +0800
Subject: [PATCH] test: fixups on SELinux machines for root testcases

ls adds a '.' at the end of the permission field list on SELinux
machines, filter this out so root tests work on SELinux machines.

Upstream-Status: Accepted
http://git.savannah.gnu.org/cgit/acl.git/commit/?id=26a87d36f80d5e98bccb5878834d9e69dadfe3e9

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
 test/root/permissions.test | 8 ++++----
 test/root/restore.test     | 2 +-
 test/root/setfacl.test     | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/root/permissions.test b/test/root/permissions.test
index 9b9e3de..665339a 100644
--- a/test/root/permissions.test
+++ b/test/root/permissions.test
@@ -19,7 +19,7 @@ defined permissions.
 	$ cd d
 	$ umask 027
 	$ touch f
-	$ ls -l f | awk -- '{ print $1, $3, $4 }'
+	$ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
 	> -rw-r----- root root


@@ -39,7 +39,7 @@ Now, change the ownership of the file to bin:bin and verify that this
 gives user bin write access.

 	$ chown bin:bin f
-	$ ls -l f | awk -- '{ print $1, $3, $4 }'
+	$ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
 	> -rw-r----- bin bin
 	$ su bin
 	$ echo bin >> f
@@ -256,12 +256,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them.
 	$ mkdir -m 600 x
 	$ chown daemon:daemon x
 	$ echo j > x/j
-	$ ls -l x/j | awk -- '{ print $1, $3, $4 }'
+	$ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
 	> -rw-r----- root root

 	$ setfacl -m u:daemon:r x

-	$ ls -l x/j | awk -- '{ print $1, $3, $4 }'
+	$ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g'
 	> -rw-r----- root root
 	(With the bug this gives: `ls: x/j: Permission denied'.)

diff --git a/test/root/restore.test b/test/root/restore.test
index 63a9d01..c85097c 100644
--- a/test/root/restore.test
+++ b/test/root/restore.test
@@ -21,7 +21,7 @@ Cry immediately if we are not running as root.
 	$ chown bin passwd
 	$ chmod u+s passwd
 	$ setfacl --restore passwd.acl
-	$ ls -dl passwd | awk '{print $1 " " $3 " " $4}'
+	$ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g'
 	> -rwsr-xr-x root root

 	$ rm passwd passwd.acl
diff --git a/test/root/setfacl.test b/test/root/setfacl.test
index a46a9f4..7efbad7 100644
--- a/test/root/setfacl.test
+++ b/test/root/setfacl.test
@@ -12,7 +12,7 @@ Cry immediately if we are not running as root.
 	$ sg bin
 	$ umask 027
 	$ touch g
-	$ ls -dl g | awk '{print $1}'
+	$ ls -dl g | awk '{print $1}' | sed 's/\\.//g'
 	> -rw-r-----

 	$ setfacl -m m:- g
--
1.9.1