This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In t/op/filetest.t, simplify the logic for testing read-only files.
authorNicholas Clark <nick@ccl4.org>
Thu, 24 May 2012 09:23:06 +0000 (11:23 +0200)
committerNicholas Clark <nick@ccl4.org>
Thu, 31 May 2012 16:09:44 +0000 (18:09 +0200)
commitdcefe67b927264e55ef5d32ae1bc2880ef1e3da9
treea614f8fca39d12477a15cd7638838761da3e70ef
parent64f0b68d1428d857bfaa5fb5cfc7dec0a33421dc
In t/op/filetest.t, simplify the logic for testing read-only files.

Only attempted to change the effective user ID if the test is running as
root. Don't bother consulting $Config to see whether assigning to $> is going
to work - just try it in an eval, and skip if it didn't. Only restore $> if
we know we changed it, and as we only change it from root, we already know
which value to restore it to.

The previous code to check $Config{d_seteuid} was incomplete, as it should
also have been checking for $Config{d_setreuid} and $Config{d_setresuid}, as
$> can use any of these.
t/op/filetest.t