Преглед на файлове

Trac Ticket 75 - Unconfigure plugin opperations are being called.

https://fedorahosted.org/389/ticket/75

Fix descriptions:
When plugin is not enabled, the start function is not called,
but the initialization is made and the plugins are registered.
This patch calls the initialization/plugin registration only
when the plugin is enabled.
Noriko Hosoi преди 14 години
родител
ревизия
a8bacbae78
променени са 2 файла, в които са добавени 1 реда и са изтрити 9 реда
  1. 0 8
      ldap/servers/plugins/usn/usn.c
  2. 1 1
      ldap/servers/slapd/plugin.c

+ 0 - 8
ldap/servers/plugins/usn/usn.c

@@ -77,18 +77,10 @@ usn_init(Slapi_PBlock *pb)
 {
     int rc = 0;
     void *identity = NULL;
-    int enabled = 0;
 
     slapi_log_error(SLAPI_LOG_TRACE, USN_PLUGIN_SUBSYSTEM,
                     "--> usn_init\n");
 
-    slapi_pblock_get(pb, SLAPI_PLUGIN_ENABLED, &enabled);
-
-    if (!enabled) {
-        /* not enabled */
-        goto bail;
-    }
-
     slapi_pblock_get(pb, SLAPI_PLUGIN_IDENTITY, &identity);
 
     /* slapi_register_plugin always returns SUCCESS (0) */

+ 1 - 1
ldap/servers/slapd/plugin.c

@@ -2293,7 +2293,7 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group,
 	slapi_pblock_set(&pb, SLAPI_PLUGIN_ENABLED, &enabled);
 	slapi_pblock_set(&pb, SLAPI_PLUGIN_CONFIG_ENTRY, plugin_entry);
 
-	if ((*initfunc)(&pb) != 0)
+	if (enabled && (*initfunc)(&pb) != 0)
 	{
         LDAPDebug(LDAP_DEBUG_ANY, "Init function \"%s\" for \"%s\" plugin"
 				 " in library \"%s\" failed\n",