From 2014d8f52ea6a9d086b25f8f0c5b8e6b1e1c161d Mon Sep 17 00:00:00 2001 From: Alex Rodin Date: Feb 10 2020 10:25:13 +0000 Subject: 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. Reviewed-by: Pavel Březina --- diff --git a/src/config/SSSDConfig/__init__.py.in b/src/config/SSSDConfig/__init__.py.in index b3035fc..d47a4b5 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)