Current Path: > > usr > share > perl5
Operation : Linux premium107.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 198.54.126.246 | Your IP: 216.73.216.181 Domains : 1034 Domain(s) Permission : [ 0755 ]
| Name | Type | Size | Last Modified | Actions |
|---|---|---|---|---|
| Attribute | Directory | - | - | |
| B | Directory | - | - | |
| CPAN | Directory | - | - | |
| Class | Directory | - | - | |
| Compress | Directory | - | - | |
| Config | Directory | - | - | |
| DBM_Filter | Directory | - | - | |
| Devel | Directory | - | - | |
| ExtUtils | Directory | - | - | |
| File | Directory | - | - | |
| Getopt | Directory | - | - | |
| I18N | Directory | - | - | |
| IO | Directory | - | - | |
| IPC | Directory | - | - | |
| Locale | Directory | - | - | |
| Math | Directory | - | - | |
| Memoize | Directory | - | - | |
| Module | Directory | - | - | |
| Net | Directory | - | - | |
| Pod | Directory | - | - | |
| Search | Directory | - | - | |
| Term | Directory | - | - | |
| Text | Directory | - | - | |
| Thread | Directory | - | - | |
| Tie | Directory | - | - | |
| Time | Directory | - | - | |
| URI | Directory | - | - | |
| Unicode | Directory | - | - | |
| User | Directory | - | - | |
| encoding | Directory | - | - | |
| overload | Directory | - | - | |
| pod | Directory | - | - | |
| unicore | Directory | - | - | |
| vendor_perl | Directory | - | - | |
| warnings | Directory | - | - | |
| AnyDBM_File.pm | File | 2618 bytes | July 28 2025 08:07:09. | |
| AutoLoader.pm | File | 15797 bytes | July 28 2025 08:07:09. | |
| AutoSplit.pm | File | 19637 bytes | July 28 2025 08:07:09. | |
| Benchmark.pm | File | 31025 bytes | July 28 2025 08:07:09. | |
| CORE.pod | File | 3188 bytes | July 28 2025 08:07:09. | |
| DB.pm | File | 18922 bytes | July 28 2025 08:07:09. | |
| DBM_Filter.pm | File | 14385 bytes | July 28 2025 08:07:09. | |
| DirHandle.pm | File | 1556 bytes | July 28 2025 08:07:09. | |
| Dumpvalue.pm | File | 17556 bytes | July 28 2025 08:07:09. | |
| English.pm | File | 4761 bytes | July 28 2025 08:07:09. | |
| FileCache.pm | File | 5572 bytes | July 28 2025 08:07:09. | |
| FileHandle.pm | File | 6784 bytes | July 28 2025 08:07:09. | |
| FindBin.pm | File | 4561 bytes | July 28 2025 08:07:09. | |
| Internals.pod | File | 2576 bytes | July 28 2025 08:07:09. | |
| Memoize.pm | File | 36192 bytes | July 28 2025 08:08:32. | |
| NEXT.pm | File | 18846 bytes | July 28 2025 08:07:09. | |
| PerlIO.pm | File | 10459 bytes | July 28 2025 08:07:09. | |
| Safe.pm | File | 25082 bytes | July 28 2025 08:07:09. | |
| SelectSaver.pm | File | 1076 bytes | July 28 2025 08:07:09. | |
| SelfLoader.pm | File | 17692 bytes | July 28 2025 08:08:32. | |
| Symbol.pm | File | 4799 bytes | July 28 2025 08:07:09. | |
| Test.pm | File | 30057 bytes | July 28 2025 08:08:32. | |
| Thread.pm | File | 8287 bytes | July 28 2025 08:07:09. | |
| UNIVERSAL.pm | File | 6594 bytes | July 28 2025 08:07:09. | |
| URI.pm | File | 34790 bytes | January 09 2018 06:42:55. | |
| XSLoader.pm | File | 11267 bytes | July 28 2025 08:07:09. | |
| _charnames.pm | File | 33166 bytes | July 28 2025 08:07:09. | |
| autouse.pm | File | 4238 bytes | July 28 2025 08:07:09. | |
| base.pm | File | 10980 bytes | July 28 2025 08:07:09. | |
| blib.pm | File | 2086 bytes | July 28 2025 08:07:09. | |
| bytes.pm | File | 3754 bytes | July 28 2025 08:07:09. | |
| bytes_heavy.pl | File | 758 bytes | July 28 2025 08:07:09. | |
| charnames.pm | File | 20867 bytes | July 28 2025 08:07:09. | |
| deprecate.pm | File | 3079 bytes | July 28 2025 08:07:09. | |
| diagnostics.pm | File | 19038 bytes | July 28 2025 08:07:09. | |
| dumpvar.pl | File | 15555 bytes | July 28 2025 08:07:09. | |
| feature.pm | File | 17085 bytes | July 28 2025 08:07:09. | |
| fields.pm | File | 9489 bytes | July 28 2025 08:07:09. | |
| filetest.pm | File | 4003 bytes | July 28 2025 08:07:09. | |
| if.pm | File | 3340 bytes | July 28 2025 08:07:09. | |
| integer.pm | File | 3254 bytes | July 28 2025 08:07:09. | |
| less.pm | File | 3204 bytes | July 28 2025 08:07:09. | |
| locale.pm | File | 4855 bytes | July 28 2025 08:07:09. | |
| meta_notation.pm | File | 2117 bytes | July 28 2025 08:07:09. | |
| open.pm | File | 8021 bytes | July 28 2025 08:08:32. | |
| overload.pm | File | 53314 bytes | July 28 2025 08:07:09. | |
| overloading.pm | File | 1808 bytes | July 28 2025 08:07:09. | |
| perl5db.pl | File | 316420 bytes | July 28 2025 08:07:09. | |
| sigtrap.pm | File | 7606 bytes | July 28 2025 08:07:09. | |
| sort.pm | File | 6081 bytes | July 28 2025 08:07:09. | |
| strict.pm | File | 4738 bytes | July 28 2025 08:07:09. | |
| subs.pm | File | 848 bytes | July 28 2025 08:07:09. | |
| utf8.pm | File | 9116 bytes | July 28 2025 08:07:09. | |
| utf8_heavy.pl | File | 31615 bytes | July 28 2025 08:07:09. | |
| vars.pm | File | 2414 bytes | July 28 2025 08:07:09. | |
| vmsish.pm | File | 4313 bytes | July 28 2025 08:07:09. | |
| warnings.pm | File | 44756 bytes | July 28 2025 08:07:09. |
package filetest;
our $VERSION = '1.03';
=head1 NAME
filetest - Perl pragma to control the filetest permission operators
=head1 SYNOPSIS
$can_perhaps_read = -r "file"; # use the mode bits
{
use filetest 'access'; # intuit harder
$can_really_read = -r "file";
}
$can_perhaps_read = -r "file"; # use the mode bits again
=head1 DESCRIPTION
This pragma tells the compiler to change the behaviour of the filetest
permission operators, C<-r> C<-w> C<-x> C<-R> C<-W> C<-X>
(see L<perlfunc>).
The default behaviour of file test operators is to use the simple
mode bits as returned by the stat() family of system calls. However,
many operating systems have additional features to define more complex
access rights, for example ACLs (Access Control Lists).
For such environments, C<use filetest> may help the permission
operators to return results more consistent with other tools.
The C<use filetest> or C<no filetest> statements affect file tests defined in
their block, up to the end of the closest enclosing block (they are lexically
block-scoped).
Currently, only the C<access> sub-pragma is implemented. It enables (or
disables) the use of access() when available, that is, on most UNIX systems and
other POSIX environments. See details below.
=head2 Consider this carefully
The stat() mode bits are probably right for most of the files and
directories found on your system, because few people want to use the
additional features offered by access(). But you may encounter surprises
if your program runs on a system that uses ACLs, since the stat()
information won't reflect the actual permissions.
There may be a slight performance decrease in the filetest operations
when the filetest pragma is in effect, because checking bits is very
cheap.
Also, note that using the file tests for security purposes is a lost cause
from the start: there is a window open for race conditions (who is to
say that the permissions will not change between the test and the real
operation?). Therefore if you are serious about security, just try
the real operation and test for its success - think in terms of atomic
operations. Filetests are more useful for filesystem administrative
tasks, when you have no need for the content of the elements on disk.
=head2 The "access" sub-pragma
UNIX and POSIX systems provide an abstract access() operating system call,
which should be used to query the read, write, and execute rights. This
function hides various distinct approaches in additional operating system
specific security features, like Access Control Lists (ACLs)
The extended filetest functionality is used by Perl only when the argument
of the operators is a filename, not when it is a filehandle.
=head2 Limitation with regard to C<_>
Because access() does not invoke stat() (at least not in a way visible
to Perl), B<the stat result cache "_" is not set>. This means that the
outcome of the following two tests is different. The first has the stat
bits of F</etc/passwd> in C<_>, and in the second case this still
contains the bits of C</etc>.
{ -d '/etc';
-w '/etc/passwd';
print -f _ ? 'Yes' : 'No'; # Yes
}
{ use filetest 'access';
-d '/etc';
-w '/etc/passwd';
print -f _ ? 'Yes' : 'No'; # No
}
Of course, unless your OS does not implement access(), in which case the
pragma is simply ignored. Best not to use C<_> at all in a file where
the filetest pragma is active!
As a side effect, as C<_> doesn't work, stacked filetest operators
(C<-f -w $file>) won't work either.
This limitation might be removed in a future version of perl.
=cut
$filetest::hint_bits = 0x00400000; # HINT_FILETEST_ACCESS
sub import {
if ( $_[1] eq 'access' ) {
$^H |= $filetest::hint_bits;
} else {
die "filetest: the only implemented subpragma is 'access'.\n";
}
}
sub unimport {
if ( $_[1] eq 'access' ) {
$^H &= ~$filetest::hint_bits;
} else {
die "filetest: the only implemented subpragma is 'access'.\n";
}
}
1;
SILENT KILLER Tool