From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001 From: He Zhe 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 --- 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