From 3b7c45179adc7c09015de4e756a859256dafdffb Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 11 Jan 2019 15:43:32 +0100 Subject: [PATCH] Harden directory statefile permissions --- centreon-plugins/centreon/plugins/statefile.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centreon-plugins/centreon/plugins/statefile.pm b/centreon-plugins/centreon/plugins/statefile.pm index becbb7039..e93d28c57 100644 --- a/centreon-plugins/centreon/plugins/statefile.pm +++ b/centreon-plugins/centreon/plugins/statefile.pm @@ -148,9 +148,9 @@ sub read { } if (! -e $self->{statefile_dir} . "/" . $self->{statefile}) { - if (! -w $self->{statefile_dir}) { + if (! -w $self->{statefile_dir} || ! -x $self->{statefile_dir}) { $self->error(1); - $self->{output}->add_option_msg(short_msg => "Cannot write statefile '" . $self->{statefile_dir} . "/" . $self->{statefile} . "'. Need write permissions on directory."); + $self->{output}->add_option_msg(short_msg => "Cannot write statefile '" . $self->{statefile_dir} . "/" . $self->{statefile} . "'. Need write/exec permissions on directory."); if ($self->{no_quit} == 0) { $self->{output}->option_exit(); }