summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-09-05 17:13:09 +0000
committerJim Meyering <jim@meyering.net>2005-09-05 17:13:09 +0000
commitae14879ab90b8bc747173aa406f8665e84cdc7af (patch)
treec0337a5c98a96bec07511618b6e55a2ef4c86cf9 /tests
parentac46781470f3a62c0fbbbdc5304f0de83b6acfa4 (diff)
downloadcoreutils-ae14879ab90b8bc747173aa406f8665e84cdc7af.tar.xz
(setuid-etc): New test, for today's addition of colorization for
setuid, setgid files and sticky, other-writable, sticky-and-other-writable directories.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ls-2/tests21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ls-2/tests b/tests/ls-2/tests
index f7c702dd9..690203ecd 100755
--- a/tests/ls-2/tests
+++ b/tests/ls-2/tests
@@ -97,6 +97,27 @@ my @Tests =
$mkdir, $rmdir, {EXIT => 2}],
['recursive-2', '-R d', {OUT => "d:\ne\n\nd/e:\n"}, $mkdir2, $rmdir2],
+
+ ['setuid-etc', '-1 -d --color=always owr owt setgid setuid sticky',
+ {OUT =>
+ "\e[0m\e[34;42mowr\e[0m\n"
+ . "\e[30;42mowt\e[0m\n"
+ . "\e[30;43msetgid\e[0m\n"
+ . "\e[37;41msetuid\e[0m\n"
+ . "\e[37;44msticky\e[0m\n"
+ . "\e[m"
+ },
+ {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} }},
+ ],
);
my $save_temps = $ENV{SAVE_TEMPS};