summaryrefslogtreecommitdiff
path: root/tests/chmod
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-01-03 21:59:02 +0000
committerJim Meyering <jim@meyering.net>2006-01-03 21:59:02 +0000
commit39a400feebec3886e62a5f7f57cef1a0771827b0 (patch)
treec2182766d5898112bfd93e8fa1d34728f9af7916 /tests/chmod
parent035a7af4a68cbd104d545bb0d65e94c2483c024c (diff)
downloadcoreutils-39a400feebec3886e62a5f7f57cef1a0771827b0.tar.xz
Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).
Diffstat (limited to 'tests/chmod')
-rwxr-xr-xtests/chmod/no-x18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/chmod/no-x b/tests/chmod/no-x
index cf365c01a..247b052c3 100755
--- a/tests/chmod/no-x
+++ b/tests/chmod/no-x
@@ -30,11 +30,27 @@ fail=0
# This must exit nonzero.
chmod -R o=r d >/dev/null 2>out && fail=1
+
cat <<\EOF > exp
chmod: `d/no-x': Permission denied
EOF
-cmp out exp || fail=1
+# With native openat, du uses a different code path.
+cat <<\EOF > exp-native-openat
+chmod: cannot access `d/no-x/y': Permission denied
+chmod: fts_read failed: Permission denied
+EOF
+
+if cmp out exp >/dev/null 2>&1; then
+ :
+else
+ if cmp out exp-native-openat; then
+ :
+ else
+ fail=1
+ fi
+fi
+
test $fail = 1 && diff out exp 2> /dev/null
(exit $fail); exit $fail