URL: https://github.com/SSSD/sssd/pull/981
Author: alexal
 Title: #981: Update __init__.py.in (save_domain)
Action: opened

PR body:
"""
We shouldn't modify the list of domain options in a loop. In some cases that 
will cause problems, for example when deleting provider options after deleting 
the provider itself.

Resolves: https://pagure.io/SSSD/sssd/issue/4149
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/981/head:pr981
git checkout pr981
From 6d2d3b8fd889ceb2b3e8057c910ef875444ce39f Mon Sep 17 00:00:00 2001
From: Alex Rodin <alex.ro...@sas.com>
Date: Tue, 4 Feb 2020 13:48:07 -0500
Subject: [PATCH] Update __init__.py.in

We shouldn't modify the list of domain options in a loop. In some cases (for example issue #4149) that will cause problems, for example when deleting provider options after deleting the provider itself.
---
 src/config/SSSDConfig/__init__.py.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/config/SSSDConfig/__init__.py.in b/src/config/SSSDConfig/__init__.py.in
index b3035fcffb..d47a4b56bc 100644
--- a/src/config/SSSDConfig/__init__.py.in
+++ b/src/config/SSSDConfig/__init__.py.in
@@ -2177,7 +2177,8 @@ class SSSDConfig(SSSDChangeConf):
         if name not in self.list_domains():
             self.add_section(sectionname, []);
 
-        for option in self.options(sectionname):
+        section_options = self.options(sectionname)[:]
+        for option in section_options:
             if option['type'] == 'option':
                 if option['name'] not in domain.get_all_options():
                     self.delete_option_subtree(section_subtree['value'], 'option', option['name'], True)
_______________________________________________
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://docs.fedoraproject.org/en-US/project/code-of-conduct/
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