Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | From e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d Mon Sep 17 00:00:00 2001 |
| 2 | From: Kamil Dudka <kdudka@redhat.com> |
| 3 | Date: Mon, 20 May 2013 16:38:06 +0200 |
| 4 | Subject: [PATCH] test: fix insufficient quoting of '\' |
| 5 | |
| 6 | This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which |
| 7 | caused sbits-restore.test to fail in the following way in case SELinux |
| 8 | was disabled: |
| 9 | |
| 10 | *** sbits-restore.test *** |
| 11 | [3] $ umask 022 -- ok |
| 12 | [4] $ mkdir d -- ok |
| 13 | [5] $ touch d/g -- ok |
| 14 | [6] $ touch d/u -- ok |
| 15 | [7] $ chmod u+s d/u -- ok |
| 16 | [8] $ chmod g+s d/g -- ok |
| 17 | [9] $ chmod +t d -- ok |
| 18 | [10] $ getfacl -R d > d.acl -- ok |
| 19 | [11] $ rm -R d -- ok |
| 20 | [12] $ mkdir d -- ok |
| 21 | [13] $ touch d/g -- ok |
| 22 | [14] $ touch d/u -- ok |
| 23 | [15] $ setfacl --restore d.acl -- ok |
| 24 | [16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed |
| 25 | drwxr-xr- != drwxr-xr-t |
| 26 | [18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed |
| 27 | -rwSr--r- != -rwSr--r-- |
| 28 | [20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed |
| 29 | -rw-r-Sr- != -rw-r-Sr-- |
| 30 | [22] $ rm -Rf d -- ok |
| 31 | 17 commands (14 passed, 3 failed) |
| 32 | |
| 33 | Upstream-Status: Backport |
| 34 | http://git.savannah.gnu.org/cgit/acl.git/commit/?id=e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d |
| 35 | |
| 36 | Signed-off-by: Kamil Dudka <kdudka@redhat.com> |
| 37 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 38 | --- |
| 39 | test/cp.test | 2 +- |
| 40 | test/misc.test | 6 +++--- |
| 41 | test/sbits-restore.test | 6 +++--- |
| 42 | 3 files changed, 7 insertions(+), 7 deletions(-) |
| 43 | |
| 44 | diff --git a/test/cp.test b/test/cp.test |
| 45 | index 0867f63..a927195 100644 |
| 46 | --- a/test/cp.test |
| 47 | +++ b/test/cp.test |
| 48 | @@ -9,7 +9,7 @@ The cp utility should only copy ACLs if `-p' is given. |
| 49 | > -rw-rw-r--+ |
| 50 | |
| 51 | $ cp f g |
| 52 | - $ ls -l g | awk -- '{ print $1 }' | sed 's/\.$//g' |
| 53 | + $ ls -l g | awk -- '{ print $1 }' | sed 's/\\.$//g' |
| 54 | > -rw-r--r-- |
| 55 | |
| 56 | $ rm g |
| 57 | diff --git a/test/misc.test b/test/misc.test |
| 58 | index 6e98053..29372b7 100644 |
| 59 | --- a/test/misc.test |
| 60 | +++ b/test/misc.test |
| 61 | @@ -254,7 +254,7 @@ Add some users and groups |
| 62 | Symlink in directory with default ACL? |
| 63 | |
| 64 | $ ln -s d d/l |
| 65 | - $ ls -dl d/l | awk '{print $1}' | sed 's/\.$//g' |
| 66 | + $ ls -dl d/l | awk '{print $1}' | sed 's/\\.$//g' |
| 67 | > lrwxrwxrwx |
| 68 | |
| 69 | $ ls -dl -L d/l | awk '{print $1}' |
| 70 | @@ -343,7 +343,7 @@ Remove the default ACL |
| 71 | Reset to base entries |
| 72 | |
| 73 | $ setfacl -b d |
| 74 | - $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' |
| 75 | + $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' |
| 76 | > drwxr-x--- |
| 77 | |
| 78 | $ getfacl --omit-header d |
| 79 | @@ -355,7 +355,7 @@ Reset to base entries |
| 80 | Now, chmod should change the group_obj entry |
| 81 | |
| 82 | $ chmod 775 d |
| 83 | - $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' |
| 84 | + $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' |
| 85 | > drwxrwxr-x |
| 86 | |
| 87 | $ getfacl --omit-header d |
| 88 | diff --git a/test/sbits-restore.test b/test/sbits-restore.test |
| 89 | index de21340..5899b0a 100644 |
| 90 | --- a/test/sbits-restore.test |
| 91 | +++ b/test/sbits-restore.test |
| 92 | @@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via --restore works |
| 93 | $ touch d/g |
| 94 | $ touch d/u |
| 95 | $ setfacl --restore d.acl |
| 96 | - $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' |
| 97 | + $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' |
| 98 | > drwxr-xr-t |
| 99 | - $ ls -dl d/u | awk '{print $1}' | sed 's/\.$//g' |
| 100 | + $ ls -dl d/u | awk '{print $1}' | sed 's/\\.$//g' |
| 101 | > -rwSr--r-- |
| 102 | - $ ls -dl d/g | awk '{print $1}' | sed 's/\.$//g' |
| 103 | + $ ls -dl d/g | awk '{print $1}' | sed 's/\\.$//g' |
| 104 | > -rw-r-Sr-- |
| 105 | $ rm -Rf d |
| 106 | -- |
| 107 | 1.9.1 |
| 108 | |