a99c7c
From b9c42fed9b6f60801f908c368d0d97a2a69f7bb2 Mon Sep 17 00:00:00 2001
a99c7c
From: Florence Blanc-Renaud <flo@redhat.com>
a99c7c
Date: Wed, 15 Dec 2021 10:47:02 +0100
a99c7c
Subject: [PATCH] Config plugin: return EmptyModlist when no change is applied
a99c7c
a99c7c
When ipa config-mod is called with the option --enable-sid,
a99c7c
the code needs to trap EmptyModlist exception (it is expected
a99c7c
that no LDAP attribute is modified by this operation).
a99c7c
The code had a flaw and was checking:
a99c7c
    'enable_sid' in options
a99c7c
instead of
a99c7c
    options['enable_sid']
a99c7c
a99c7c
"'enable_sid' in options" always returns true as this option
a99c7c
is a Flag with a default value, hence always present even if
a99c7c
not specified on the command line.
a99c7c
a99c7c
Fixes: https://pagure.io/freeipa/issue/9063
a99c7c
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
a99c7c
---
a99c7c
 ipaserver/plugins/config.py | 2 +-
a99c7c
 1 file changed, 1 insertion(+), 1 deletion(-)
a99c7c
a99c7c
diff --git a/ipaserver/plugins/config.py b/ipaserver/plugins/config.py
a99c7c
index eae401fc3f7a1b7628eb211db206ba4bc2b36754..24446beb0b03a1510a96316eae915780817db102 100644
a99c7c
--- a/ipaserver/plugins/config.py
a99c7c
+++ b/ipaserver/plugins/config.py
a99c7c
@@ -707,7 +707,7 @@ class config_mod(LDAPUpdate):
a99c7c
         if (isinstance(exc, errors.EmptyModlist) and
a99c7c
                 call_func.__name__ == 'update_entry' and
a99c7c
                 ('ca_renewal_master_server' in options or
a99c7c
-                 'enable_sid' in options)):
a99c7c
+                 options['enable_sid'])):
a99c7c
             return
a99c7c
 
a99c7c
         super(config_mod, self).exc_callback(
a99c7c
-- 
a99c7c
2.34.1
a99c7c