URL: https://github.com/SSSD/sssd/pull/709
Author: tdukaric
 Title: #709: Regex fails if there's a whitespace before option name
Action: opened

PR body:
"""
self.OPTCRE.match(line) fails if there's a whitespace before option name, which 
is valid for SSSD. This change will ignore any whitespace before the option 
name.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/709/head:pr709
git checkout pr709
From de857d71d5948d8b32c8696709ea7f296b153712 Mon Sep 17 00:00:00 2001
From: Tomislav Dukaric <tduka...@indeed.com>
Date: Fri, 7 Dec 2018 15:11:58 +0900
Subject: [PATCH] self.OPTCRE.match(line) fails if there's a whitespace before
 option name, which is valid for SSSD. This will ignore any whitespace before
 the option

---
 src/config/SSSDConfig/ipachangeconf.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/config/SSSDConfig/ipachangeconf.py b/src/config/SSSDConfig/ipachangeconf.py
index eff12d4fc..3348112d3 100644
--- a/src/config/SSSDConfig/ipachangeconf.py
+++ b/src/config/SSSDConfig/ipachangeconf.py
@@ -475,7 +475,7 @@ def newConf(self, file, options):
 # An SSSD-specific subclass of IPAChangeConf
 class SSSDChangeConf(IPAChangeConf):
     OPTCRE = re.compile(
-            r'(?P<option>[^:=\s][^:=]*)'          # very permissive!
+            r'\s*(?P<option>[^:=\s][^:=]*)'       # very permissive!
             r'\s*=\s*'                            # any number of space/tab,
                                                   # followed by separator
                                                   # followed by any # space/tab
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to