Skip to content

Commit b56047d

Browse files
committed
Validate CONFIG_DIR
1 parent 1afa215 commit b56047d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/VWF/Config.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ sub new
6060

6161
my @config_dirs;
6262
if($ENV{'CONFIG_DIR'}) {
63+
# Validate directory exists
64+
throw Error::Simple("CONFIG_DIR '$ENV{CONFIG_DIR}' does not exist or is not readable" )
65+
unless -d $ENV{'CONFIG_DIR'} && -r $ENV{'CONFIG_DIR'};
6366
@config_dirs = ($ENV{'CONFIG_DIR'});
6467
} else {
6568
if($args{config_directory}) {

lib/VWF/Display.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ sub new
145145
my $config;
146146
eval {
147147
# Try default first, then domain-specific config first
148-
if($config = Config::Abstraction->new(config_dirs => [$config_dir], config_files => ['default', $info->domain_name()])) {
148+
if($config = Config::Abstraction->new(config_dirs => [$config_dir], config_files => ['default', $info->domain_name()], logger => $args{'logger'})) {
149149
$config = $config->all();
150150
}
151151
};

0 commit comments

Comments
 (0)