summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-08-16 21:46:36 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-08-16 21:46:36 +0000
commit60d8c895296606aac684e94cc884b7a49f1e3c45 (patch)
tree5c299312eb2d794e24c3c695fd6f21359c0cb4fe
parentaacbc75155836e53f69035b6084c9ed2ad18de63 (diff)
downloadcoreutils-60d8c895296606aac684e94cc884b7a49f1e3c45.tar.xz
Skip this test suite if we can't set up files
properly for the setuid-etc test.
-rw-r--r--ChangeLog4
-rwxr-xr-xtests/ls-2/tests27
2 files changed, 17 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 84ea7d883..326c49292 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2006-08-16 Paul Eggert <eggert@cs.ucla.edu>
+ * tests/ls-2/tests: Skip this test suite if we can't set up files
+ properly for the setuid-etc test. This simplifies some of the
+ hacks we were using to work around porting problems.
+
* tests/lang-default (LC_ALL): Set to "C", so we get
English-language diagnostics. Unset the other variables; it
should be portable to use 'unset' for this stuff nowadays.
diff --git a/tests/ls-2/tests b/tests/ls-2/tests
index d3133e8d8..8b30916b4 100755
--- a/tests/ls-2/tests
+++ b/tests/ls-2/tests
@@ -10,6 +10,19 @@ $PERL -e 1 > /dev/null 2>&1 || {
exit 77
}
+# Set up files used by the setuid-etc tests; skip this entire test if
+# that cannot be done for some reason.
+test=../../src/test
+touch setuid && chmod u+s setuid && $test -u setuid &&
+touch setgid && chmod g+s setgid && $test -g setgid &&
+mkdir sticky && chmod +t sticky && $test -k sticky &&
+mkdir owt && chmod +t,o+w owt && $test -k owt &&
+mkdir owr && chmod o+w owr || {
+ echo 1>&2 "$0: cannot create setuid/setgid/sticky files," \
+ "so can't run this test"
+ exit 77
+}
+
exec $PERL -w -I$srcdir/.. -MCoreutils -- - << \EOF
require 5.003;
use strict;
@@ -114,20 +127,6 @@ my @Tests =
. "\e[m"
},
- # This is a kludge to work around the fact that on some systems
- # the files we've just created have a `group ID' that is not one
- # of those associated with the current user. Hence, attempting
- # to do `chmod g+s setgid' fails. This substitution maps the
- # non-highlight 0m code to the expected one.
- {OUT_SUBST => 's/\[0msetgid/[30;43msetgid/'},
-
- {PRE => sub {
- system
- "touch setuid && chmod u+s setuid;"
- ."touch setgid && chmod g+s setgid;"
- ."mkdir sticky && chmod +t sticky;"
- ."mkdir owt && chmod +t,o+w owt;"
- ."mkdir owr && chmod o+w owr" }},
{POST => sub {
unlink qw(setuid setgid);
foreach my $dir (qw(owr owt sticky)) {rmdir $dir} }},