From ae14879ab90b8bc747173aa406f8665e84cdc7af Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 5 Sep 2005 17:13:09 +0000 Subject: (setuid-etc): New test, for today's addition of colorization for setuid, setgid files and sticky, other-writable, sticky-and-other-writable directories. --- tests/ls-2/tests | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/ls-2') 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}; -- cgit v1.2.3-70-g09d2