view release on metacpan or search on metacpan
t/Installer.t view on Meta::CPAN
$environment->run_test('creates config file', sub {
App::Spoor::Installer::install(\%installation_config, $root_path);
ok(-d $config_file_directory, 'Spoor config directory created');
ok(-o $config_file_directory, 'Spoor config directory owned by effective user');
is((stat($config_file_directory))[2] & 07777, 0700, 'Spoor config directory has correct permissions');
ok(-f $config_file_path, 'Spoor config file created');
is((stat($config_file_path))[2] & 07777, 0600, 'Spoor config file has correct permissions');
});
my %expected_config = (
followers => {
login => {
t/Installer.t view on Meta::CPAN
$environment->run_test('creates directory structure for storing state', sub {
App::Spoor::Installer::install(\%installation_config, $root_path);
ok(-d $spoor_state_directory, 'Spoor state directory created');
ok(-o $spoor_state_directory, 'Spoor state directory owned by effective user');
is((stat($spoor_state_directory))[2] & 07777, 0700, 'Spoor state directory has correct permissions');
ok(-d $spoor_parsed_state_directory, 'Spoor parsed state directory created');
ok(-o $spoor_parsed_state_directory, 'Spoor parsed state directory owned by effective user');
is((stat($spoor_parsed_state_directory))[2] & 07777, 0700, 'Spoor parsed state directory has correct permissions');
ok(-d $spoor_transmitted_state_directory, 'Spoor transmitted state directory created');
ok(-o $spoor_transmitted_state_directory, 'Spoor transmitted state directory owned by effective user');
is(
(stat($spoor_transmitted_state_directory))[2] & 07777,
0700,
'Spoor transmitted state directory has correct permissions'
);
ok(-d $spoor_transmission_failed_state_directory, 'Spoor transmission failed state directory created');
ok(-o $spoor_transmission_failed_state_directory, 'Spoor transmission failed state directory owned by effective user');
is((stat($spoor_transmission_failed_state_directory))[2] & 07777,
0700,
'Spoor transmission failed state directory has correct permissions'
);
});
t/Installer.t view on Meta::CPAN
is(
path($login_follower_unit_file)->slurp_utf8,
App::Spoor::LoginUnitFile::contents(),
'Login unit file contents do not match'
);
is((stat($login_follower_unit_file))[2] & 07777,
0644,
'Spoor login follower unit file permissions'
);
});
t/Installer.t view on Meta::CPAN
is(
path($access_follower_unit_file)->slurp_utf8,
App::Spoor::AccessUnitFile::contents(),
'Access unit file contents do not match'
);
is((stat($access_follower_unit_file))[2] & 07777,
0644,
'Spoor access follower unit file permissions'
);
});
t/Installer.t view on Meta::CPAN
is(
path($error_follower_unit_file)->slurp_utf8,
App::Spoor::ErrorUnitFile::contents(),
'Error unit file contents do not match'
);
is((stat($error_follower_unit_file))[2] & 07777,
0644,
'Spoor error follower unit file permissions'
);
});
t/Installer.t view on Meta::CPAN
is(
path($transmitter_unit_file)->slurp_utf8,
App::Spoor::TransmitterUnitFile::contents(),
'Transmitter unit file contents do not match'
);
is((stat($transmitter_unit_file))[2] & 07777,
0644,
'Spoor transmitter unit file permissions'
);
});
$environment->run_test('creates the hook file in the cpanel directory', sub {
App::Spoor::Installer::install(\%installation_config, $root_path);
is(
(stat("$root_path/var/cpanel/perl5"))[2] & 07777,
0755,
'Perl5 dir permissions'
);
is(
(stat("$root_path/var/cpanel/perl5/lib"))[2] & 07777,
0755,
'Perl5 lib dir permissions'
);
ok(-f $cpanel_hook_file_path, 'Cpanel Hook File');
is(
path($cpanel_hook_file_path)->slurp_utf8,
App::Spoor::CpanelHookFile::contents('/var/log/spoor_forward'),
'Hook file contents'
);
is((stat($cpanel_hook_file_path))[2] & 07777,
0644,
'Cpanel hook file permissions'
);
});
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Devel/CheckOS.pm view on Meta::CPAN
$re_AssertOS = qr/$case_flag ^AssertOS$/x;
}
# sort by mtime, so oldest last
my @modules = sort {
(stat($a->{file}))[9] <=> (stat($b->{file}))[9]
} map {
my (undef, $dir_part, $file_part) = File::Spec->splitpath($_);
$file_part =~ s/\.pm$//;
my (@dirs) = grep {+length} File::Spec->splitdir($dir_part);
foreach my $i (reverse 1..$#dirs) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Syslogd.pm view on Meta::CPAN
# O_NOFOLLOW cannot catch a hard link or a file someone else pre-created
# for us to fill with their reading material, so check after opening
# Safe means all three: a regular file, owned by us, one link. By De
# Morgan, "not all three" is "any one of them fails".
my @st = stat($fh);
unless(-f _ && ($st[4] == $>) && ($st[3] == 1)) {
_discard($fh);
croak($self->i18n('unsafe_file', { file => $file }));
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Templer/Plugin/TimeStamp.pm view on Meta::CPAN
#
# Get mtime of the source file - if we've not already done so.
#
if ( !$mtime )
{
$mtime = ( stat( $page->source() ) )[9];
}
#
# Store formatted modification time
#
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Devel/App/Test/Generator/LCSAJ/Runtime.pm view on Meta::CPAN
my (undef, $file, $line) = caller(0);
return unless defined $file && defined $line;
# Resolve symlinks and relative components to a stable absolute path,
# cached per raw $file to avoid a stat() on every statement
my $norm = $NORM_CACHE{$file} //= _normalize(abs_path($file) // $file);
# Never record hits inside this module itself â suffix match is used
# so it works regardless of CWD or install prefix
return if $norm =~ m{(?:^|/)Devel/App/Test/Generator/LCSAJ/Runtime\.pm$};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/TestOnTap/PackInfo.pm view on Meta::CPAN
write_file($scriptFile, $script) || die("Failed to write '$scriptFile': $!\n");
if (!$IS_WINDOWS)
{
my $mode = (stat($scriptFile))[2];
$mode |= 0100;
chmod($mode, $scriptFile);
}
return $scriptFile;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
bin/todo.pl view on Meta::CPAN
}
sub check_config_perms {
return unless -e $CONFFILE;
my @stat = stat($CONFFILE);
my $mode = $stat[2];
if($mode & S_IRGRP || $mode & S_IROTH) {
warn("Config file $CONFFILE is readable by someone other than you, fixing.");
chmod 0600, $CONFFILE;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
bin/date-tag-file view on Meta::CPAN
# date-tag-file - pre-tag filename with timestamp of last modification
# 2020 Vlado Keselj http://web.cs.dal.ca/~vlado
# last update: 2020-05-26
$|=1;
for my $f (@ARGV) {
my @s = stat($f); die unless @s;
my $mtime = $s[9];
my ($S,$M,$H,$d,$m,$y,$wd,$yd,$isdst) = localtime($mtime);
$m+=1; $y+=1900;
my $tag=sprintf("%4d-%02d-%02d", $y, $m, $d);
my $nf = "$tag-$f"; die if -e $nf;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Validation/Automation/Purging.pm view on Meta::CPAN
chdir $log_dir
|| confess "Couldn't Change to $log_dir to remove old logs : $OS_ERROR";
@log_files = <*.$log_extn>;
@log_files_purge
= grep {
(time - (stat($_))[9])/(24 * 3600) > $log_ret_period
} @log_files;
if ( @log_files_purge ) {
$msg = "Log files in $log_dir older than $log_ret_period days:\n";
$msg .= join "\n", @log_files_purge;
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install.pm view on Meta::CPAN
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/WRT/Date.pm view on Meta::CPAN
my @mtimes;
for my $filename (@filenames) {
#my( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
# $atime, $mtime, $ctime, $blksize, $blocks )
# = stat( $filename );
push @mtimes, (stat $filename)[9];
}
# return a list if we've got more than one, a scalar
view all matches for this distribution