Skip to content

Commit

Permalink
Item13838: use filetest access when checking !-w
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Oct 27, 2015
1 parent 2f492a6 commit 37b150a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/lib/Foswiki/Configure/Checkers/Htpasswd/LockFileName.pm
Expand Up @@ -10,6 +10,8 @@ our @ISA = ('Foswiki::Configure::Checker');
sub check_current_value {
my ( $this, $reporter ) = @_;

use filetest 'access';

#NOTE: If there are any other PasswordManagers that require .htpasswd,
# they should be added to this list.
return
Expand Down
6 changes: 6 additions & 0 deletions core/lib/Foswiki/Configure/Package.pm
Expand Up @@ -224,6 +224,7 @@ sub option {

sub _log {
my $this = shift;
use filetest 'access';

# Don't actually write any logs if simulating the install
return if $this->{nolog};
Expand Down Expand Up @@ -872,6 +873,7 @@ sub _install {

# foreach file in list, move it to the correct place
foreach my $file (@names) {
use filetest 'access';

if ( $file =~ m/^(:?bin|tools)\/[^\/]+$/ ) {
my $perlLoc = Foswiki::Configure::FileUtil::getPerlLocation();
Expand Down Expand Up @@ -1033,6 +1035,8 @@ sub _installAttachments {
my $twebTopic = shift; # Mapped target web/topic
my $meta = shift;

use filetest 'access';

#my $attached = shift; # Count of files attached,

foreach my $key ( sort keys %{ $this->{_manifest}{ATTACH}{$webTopic} } ) {
Expand Down Expand Up @@ -1091,6 +1095,8 @@ sub _moveFile {
$force # Force copy even if simulate - used for the .tgz archive
) = @_;

use filetest 'access';

my @path = split( /[\/\\]+/, $to, -1 ); # -1 allows directories
pop(@path);
if ( !$this->option('SIMULATE') || $force ) {
Expand Down
2 changes: 2 additions & 0 deletions core/lib/Foswiki/Logger/PlainFile.pm
Expand Up @@ -140,6 +140,8 @@ sub log {
}
elsif ( $Foswiki::cfg{isVALID} ) {

use filetest 'access'; # Try to get more meaningful diagnostics.

# Only whine if there is a known good configuration (in which case
# $Foswiki::cfg{Log}{Dir} will be set sensibly)
if ( !-w $log ) {
Expand Down

0 comments on commit 37b150a

Please sign in to comment.