dirsrvtests/suites/dynamic-plugins/test_dynamic_plugins.py | 7 +++++++
ldap/servers/slapd/plugin.c | 13 ++++++++-----
2 files changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 1fe0088d6bdef7e1ad02ef0b27bb451ec61f8be6
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Apr 30 15:17:55 2015 -0400
Ticket 48177 - dynamic plugins should not return an error when modifying a critical
plugin
Bug Description: When dynamic plugins are enabled, any update to a
"critical" plugin
is rejected.
Fix Description: The operation should still be allowed, even though the change might
not be dynamically applied. Log an error instead stating that a
restart might be required.
https://fedorahosted.org/389/ticket/48177
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit aa0588ee576d75ac6802c1775a5aa7558957ab48)
diff --git a/dirsrvtests/suites/dynamic-plugins/test_dynamic_plugins.py
b/dirsrvtests/suites/dynamic-plugins/test_dynamic_plugins.py
index a2a174b..f5fc6f5 100644
--- a/dirsrvtests/suites/dynamic-plugins/test_dynamic_plugins.py
+++ b/dirsrvtests/suites/dynamic-plugins/test_dynamic_plugins.py
@@ -169,6 +169,13 @@ def test_dynamic_plugins(topology):
ldap.fatal('Failed to enable dynamic plugin!' +
e.message['desc'])
assert False
+ # Test that critical plugins can be updated even though the change might not be
applied
+ try:
+ topology.standalone.modify_s(DN_LDBM, [(ldap.MOD_REPLACE, 'description',
'test')])
+ except ldap.LDAPError, e:
+ ldap.fatal('Failed to apply change to critical plugin' +
e.message['desc'])
+ assert False
+
while 1:
#
# First run the tests with replication disabled, then rerun them with replication
set up
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index 2b3428e..e54c01d 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -2308,12 +2308,15 @@ plugin_restart(Slapi_Entry *pentryBefore, Slapi_Entry
*pentryAfter)
char returntext[SLAPI_DSE_RETURNTEXT_SIZE];
int rc = LDAP_SUCCESS;
- /* We can not restart the critical plugins */
+ /*
+ * We can not restart a critical plugin, but the operation should still
+ * be allowed
+ */
if(plugin_is_critical(pentryBefore)){
- LDAPDebug(LDAP_DEBUG_PLUGIN, "plugin_restart: Plugin (%s) is critical to server
operation. "
- "Any changes will not take effect until the server is restarted.\n",
- slapi_entry_get_dn(pentryBefore),0,0);
- return 1; /* failure - dse code will log a fatal message */
+ LDAPDebug(LDAP_DEBUG_ANY, "plugin_restart: Plugin (%s) is critical "
+ "to server operation. Server requires restart for changes to "
+ "take effect.\n", slapi_entry_get_dn(pentryBefore),0,0);
+ return 0;
}
slapi_rwlock_wrlock(global_rwlock);