Blob Blame History Raw
From 6acb134da07140618a03651756f490074ced3cbc Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Thu Apr 28 08:46:02 2022 -0400
Subject: Limit config file delimiters to =, catch empty values

ConfigParser allows both = and : as a delimiter. Limit to
just = to match the configuration file man page.

Don't allow empty values in options in the config file.

https://bugzilla.redhat.com/show_bug.cgi?id=2079739

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
 src/ipahealthcheck/core/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ipahealthcheck/core/config.py b/src/ipahealthcheck/core/config.py
index 3cd4e8e..e795a2d 100644
--- a/src/ipahealthcheck/core/config.py
+++ b/src/ipahealthcheck/core/config.py
@@ -107,7 +107,7 @@ def read_config(config_file):
                         format(config_file))
         return config
 
-    parser = ConfigParser()
+    parser = ConfigParser(delimiters='=')
     try:
         parser.read(config_file)
     except ParsingError as e:
-- 
2.31.1