diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | tests/ls-2/tests | 27 |
2 files changed, 17 insertions, 14 deletions
@@ -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} }}, |