From f69b4389539e0b04a47bc37facdb03bdd3cd3c9b Mon Sep 17 00:00:00 2001 From: Slack Coder Date: Tue, 28 Jan 2025 15:58:04 -0500 Subject: Ensure home directory is an absolute path --- ChangeLog.md | 1 + SBO-Lib/lib/SBO/Lib/Util.pm | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 15d2ead..7d6d551 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. ### Fixed + - Expect SBO_HOME to be an absolute path. Thanks pghvlaans! - Tests under 't/' for 15.0. ## [2.7.2] - 2024-12-03 diff --git a/SBO-Lib/lib/SBO/Lib/Util.pm b/SBO-Lib/lib/SBO/Lib/Util.pm index 3c611b8..073ba0a 100644 --- a/SBO-Lib/lib/SBO/Lib/Util.pm +++ b/SBO-Lib/lib/SBO/Lib/Util.pm @@ -422,7 +422,11 @@ sub read_config { } else { warn "Unable to open $conf_file.\n" if -f $conf_file; } + $config{SBO_HOME} = '/usr/sbo' if $config{SBO_HOME} eq 'FALSE'; + unless ($config{SBO_HOME} =~ qr#^(/|$)#) { + usage_error( "The configuration parameter SBO_HOME must be an absolute path."); + } } =head2 script_error -- cgit v1.2.3