mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Skip commented lines after substitution
LDAP updater now ignores commented out lines after substitution. Fixes: https://pagure.io/freeipa/issue/8111 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
committed by
Rob Crittenden
parent
9023033e18
commit
6ab306a2a3
@@ -371,6 +371,7 @@ class LDAPUpdate:
|
||||
|
||||
* Strip leading & trailing whitespace
|
||||
* Substitute any variables
|
||||
* Strip again and skip empty/commented lines after substitution
|
||||
* Get the action, attribute, and value
|
||||
* Each update has one list per disposition, append to specified disposition list
|
||||
'''
|
||||
@@ -382,6 +383,12 @@ class LDAPUpdate:
|
||||
# Perform variable substitution on constructued line
|
||||
logical_line = self._template_str(logical_line)
|
||||
|
||||
# skip line if substitution has added a comment. FIPS mode
|
||||
# disables some lines that way.
|
||||
logical_line = logical_line.strip()
|
||||
if not logical_line or logical_line.startswith('#'):
|
||||
return
|
||||
|
||||
items = logical_line.split(':', 2)
|
||||
|
||||
if len(items) == 0:
|
||||
|
||||
Reference in New Issue
Block a user