diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-16 21:46:36 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-08-16 21:46:36 +0000 |
commit | 60d8c895296606aac684e94cc884b7a49f1e3c45 (patch) | |
tree | 5c299312eb2d794e24c3c695fd6f21359c0cb4fe /tests/ls-2 | |
parent | aacbc75155836e53f69035b6084c9ed2ad18de63 (diff) | |
download | coreutils-60d8c895296606aac684e94cc884b7a49f1e3c45.tar.xz |
Skip this test suite if we can't set up files
properly for the setuid-etc test.
Diffstat (limited to 'tests/ls-2')
-rwxr-xr-x | tests/ls-2/tests | 27 |
1 files changed, 13 insertions, 14 deletions
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} }}, |