c6736e9
From cfd9ba83811189d9e12c86d32b06b5fd15b5f358 Mon Sep 17 00:00:00 2001
c6736e9
From: Kamil Dudka <kdudka@redhat.com>
c6736e9
Date: Mon, 20 May 2013 13:49:34 +0200
dc26344
Subject: [PATCH 1/2] make the tests ready for SELinux
c6736e9
c6736e9
---
c6736e9
 test/root/permissions.test |    8 ++++----
c6736e9
 test/root/restore.test     |    2 +-
c6736e9
 test/root/setfacl.test     |    2 +-
c6736e9
 3 files changed, 6 insertions(+), 6 deletions(-)
c6736e9
65a8c02
diff --git a/test/root/permissions.test b/test/root/permissions.test
65a8c02
index afaf5f0..4880bd2 100644
65a8c02
--- a/test/root/permissions.test
65a8c02
+++ b/test/root/permissions.test
65a8c02
@@ -20,7 +20,7 @@ defined permissions.
65a8c02
 	$ cd d
65a8c02
 	$ umask 027
65a8c02
 	$ touch f
65a8c02
-	$ ls -l f | awk -- '{ print $1, $3, $4 }'
65a8c02
+	$ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/---\\./---/'
65a8c02
 	> -rw-r----- root root
65a8c02
 
65a8c02
 
65a8c02
@@ -40,7 +40,7 @@ Now, change the ownership of the file to bin:bin and verify that this
65a8c02
 gives user bin write access.
65a8c02
 
65a8c02
 	$ chown bin:bin f
65a8c02
-	$ ls -l f | awk -- '{ print $1, $3, $4 }'
65a8c02
+	$ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/---\\./---/'
65a8c02
 	> -rw-r----- bin bin
65a8c02
 	$ su bin
65a8c02
 	$ echo bin >> f
65a8c02
@@ -257,12 +257,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them.
65a8c02
 	$ mkdir -m 600 x
65a8c02
 	$ chown daemon:daemon x
65a8c02
 	$ echo j > x/j
65a8c02
-	$ ls -l x/j | awk -- '{ print $1, $3, $4 }'
65a8c02
+	$ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/---\\./---/'
65a8c02
 	> -rw-r----- root root
65a8c02
 
65a8c02
 	$ setfacl -m u:daemon:r x
65a8c02
 
65a8c02
-	$ ls -l x/j | awk -- '{ print $1, $3, $4 }'
65a8c02
+	$ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/---\\./---/'
65a8c02
 	> -rw-r----- root root
65a8c02
 	(With the bug this gives: `ls: x/j: Permission denied'.)
65a8c02
 
65a8c02
diff --git a/test/root/restore.test b/test/root/restore.test
65a8c02
index 6003cd4..5dbf73c 100644
65a8c02
--- a/test/root/restore.test
65a8c02
+++ b/test/root/restore.test
65a8c02
@@ -17,7 +17,7 @@ Ensure setuid bit is restored when the owner changes
65a8c02
 	$ chown bin passwd
65a8c02
 	$ chmod u+s passwd
65a8c02
 	$ setfacl --restore passwd.acl
65a8c02
-	$ ls -dl passwd | awk '{print $1 " " $3 " " $4}'
65a8c02
+	$ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\. root/ root/'
65a8c02
 	> -rwsr-xr-x root root
65a8c02
 
65a8c02
 	$ rm passwd passwd.acl
65a8c02
diff --git a/test/root/setfacl.test b/test/root/setfacl.test
65a8c02
index 630e9fb..dd7fe08 100644
65a8c02
--- a/test/root/setfacl.test
65a8c02
+++ b/test/root/setfacl.test
65a8c02
@@ -8,7 +8,7 @@ Setfacl utility tests. Run these tests on a filesystem with ACL support.
65a8c02
 	$ sg bin
65a8c02
 	$ umask 027
65a8c02
 	$ touch g
65a8c02
-	$ ls -dl g | awk '{print $1}'
65a8c02
+	$ ls -dl g | awk '{print $1}' | sed 's/\\.$//'
65a8c02
 	> -rw-r-----
65a8c02
 
65a8c02
 	$ setfacl -m m:- g
c6736e9
-- 
c6736e9
1.7.1
c6736e9
dc26344
dc26344
From 3720a8a3cf55e295eca55457fad8177f6277f620 Mon Sep 17 00:00:00 2001
dc26344
From: Kamil Dudka <kdudka@redhat.com>
dc26344
Date: Mon, 20 May 2013 15:00:47 +0200
dc26344
Subject: [PATCH 2/2] test: fix insufficient quoting of '\'
dc26344
dc26344
This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which
dc26344
caused sbits-restore.test to fail in the following way in case SELinux
dc26344
was disabled:
dc26344
dc26344
*** sbits-restore.test ***
dc26344
[3] $ umask 022 -- ok
dc26344
[4] $ mkdir d -- ok
dc26344
[5] $ touch d/g -- ok
dc26344
[6] $ touch d/u -- ok
dc26344
[7] $ chmod u+s d/u -- ok
dc26344
[8] $ chmod g+s d/g -- ok
dc26344
[9] $ chmod +t d -- ok
dc26344
[10] $ getfacl -R d > d.acl -- ok
dc26344
[11] $ rm -R d -- ok
dc26344
[12] $ mkdir d -- ok
dc26344
[13] $ touch d/g -- ok
dc26344
[14] $ touch d/u -- ok
dc26344
[15] $ setfacl --restore d.acl -- ok
dc26344
[16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed
dc26344
drwxr-xr-                             != drwxr-xr-t
dc26344
[18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed
dc26344
-rwSr--r-                             != -rwSr--r--
dc26344
[20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed
dc26344
-rw-r-Sr-                             != -rw-r-Sr--
dc26344
[22] $ rm -Rf d -- ok
dc26344
17 commands (14 passed, 3 failed)
dc26344
---
dc26344
 test/cp.test            |    2 +-
dc26344
 test/misc.test          |    6 +++---
dc26344
 test/sbits-restore.test |    6 +++---
dc26344
 3 files changed, 7 insertions(+), 7 deletions(-)
dc26344
dc26344
diff --git a/test/cp.test b/test/cp.test
dc26344
index 0867f63..a927195 100644
dc26344
--- a/test/cp.test
dc26344
+++ b/test/cp.test
dc26344
@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given.
dc26344
 	> -rw-rw-r--+
dc26344
 	
dc26344
 	$ cp f g
dc26344
-	$ ls -l g | awk -- '{ print $1 }' | sed 's/\.$//g'
dc26344
+	$ ls -l g | awk -- '{ print $1 }' | sed 's/\\.$//g'
dc26344
 	> -rw-r--r--
dc26344
 	
dc26344
 	$ rm g
dc26344
diff --git a/test/misc.test b/test/misc.test
dc26344
index 6e98053..29372b7 100644
dc26344
--- a/test/misc.test
dc26344
+++ b/test/misc.test
dc26344
@@ -254,7 +254,7 @@ Add some users and groups
dc26344
 Symlink in directory with default ACL?
dc26344
 	 
dc26344
 	$ ln -s d d/l
dc26344
-	$ ls -dl d/l | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d/l | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> lrwxrwxrwx
dc26344
 
dc26344
 	$ ls -dl -L d/l | awk '{print $1}'
dc26344
@@ -343,7 +343,7 @@ Remove the default ACL
dc26344
 Reset to base entries
dc26344
 	 
dc26344
 	$ setfacl -b d
dc26344
-	$ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> drwxr-x---
dc26344
 
dc26344
 	$ getfacl --omit-header d
dc26344
@@ -355,7 +355,7 @@ Reset to base entries
dc26344
 Now, chmod should change the group_obj entry
dc26344
 	 
dc26344
 	$ chmod 775 d
dc26344
-	$ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> drwxrwxr-x
dc26344
 	
dc26344
 	$ getfacl --omit-header d
dc26344
diff --git a/test/sbits-restore.test b/test/sbits-restore.test
dc26344
index de21340..5899b0a 100644
dc26344
--- a/test/sbits-restore.test
dc26344
+++ b/test/sbits-restore.test
dc26344
@@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via --restore works
dc26344
 	$ touch d/g
dc26344
 	$ touch d/u
dc26344
 	$ setfacl --restore d.acl
dc26344
-	$ ls -dl d | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> drwxr-xr-t
dc26344
-	$ ls -dl d/u | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d/u | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> -rwSr--r--
dc26344
-	$ ls -dl d/g | awk '{print $1}' | sed 's/\.$//g'
dc26344
+	$ ls -dl d/g | awk '{print $1}' | sed 's/\\.$//g'
dc26344
 	> -rw-r-Sr--
dc26344
 	$ rm -Rf d
dc26344
-- 
dc26344
1.7.1
dc26344