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