[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Acl-devel] [PATCH] test: fixups on SELinux machines for root testcases
From: |
zhe.he |
Subject: |
[Acl-devel] [PATCH] test: fixups on SELinux machines for root testcases |
Date: |
Wed, 2 Mar 2016 19:06:11 +0800 |
From: He Zhe <address@hidden>
ls adds a '.' at the end of the permission field list on SELinux
machines, filter this out so root tests work on SELinux machines.
Signed-off-by: He Zhe <address@hidden>
---
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
- [Acl-devel] [PATCH] test: fixups on SELinux machines for root testcases,
zhe.he <=