1
0
Эх сурвалжийг харах

Ticket 552 - Adding rootdn-open-time without rootdn-close-time to RootDN Acess Control results in inconsistent configuration

Bug Description:  If you only add the rootdn-open-time attribute the server will fail to startup.

Fix Description:  If there is not a complete open and close time set, then ignore the settings altogether,
                  and log a message.

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

Reviewed by: ?
Mark Reynolds 13 жил өмнө
parent
commit
00349f6e05

+ 6 - 5
ldap/servers/plugins/rootdn_access/rootdn_access.c

@@ -198,7 +198,8 @@ rootdn_preop_bind_init(Slapi_PBlock *pb)
 }
 
 static int
-rootdn_start(Slapi_PBlock *pb){
+rootdn_start(Slapi_PBlock *pb)
+{
     /* Check if we're already started */
     if (g_plugin_started) {
         goto done;
@@ -207,6 +208,7 @@ rootdn_start(Slapi_PBlock *pb){
     slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "--> rootdn_start\n");
 
     g_plugin_started = 1;
+    rootdn_set_plugin_dn(ROOTDN_PLUGIN_DN);
 
     slapi_log_error(SLAPI_LOG_PLUGIN, ROOTDN_PLUGIN_SUBSYSTEM, "<-- rootdn_start\n");
 
@@ -317,7 +319,6 @@ rootdn_load_config(Slapi_PBlock *pb)
             /*
              *  convert the time to all seconds
              */
-
             strncpy(hour, closeTime,2);
             strncpy(min, closeTime+2,2);
             close_time = (atoi(hour) * 3600) + (atoi(min) * 60);
@@ -325,11 +326,11 @@ rootdn_load_config(Slapi_PBlock *pb)
         if((openTime && closeTime == NULL) || (openTime == NULL && closeTime)){
             /* If you are using TOD access control, you must have a open and close time */
             slapi_log_error(SLAPI_LOG_FATAL, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config: "
-                "there must be a open and a close time\n");
+                "there must be a open and a close time.  Ignoring time based settings.\n");
             slapi_ch_free_string(&closeTime);
             slapi_ch_free_string(&openTime);
-            result = -1;
-            goto free_and_return;
+            open_time = 0;
+            close_time = 0;
         }
         if(close_time && open_time && close_time <= open_time){
             /* Make sure the closing time is greater than the open time */

+ 4 - 6
ldap/servers/plugins/rootdn_access/rootdn_access.h

@@ -49,9 +49,7 @@
 #include <ctype.h>
 
 #define ROOTDN_PLUGIN_SUBSYSTEM  "rootdn-access-control-plugin"
-#define ROOTDN_FEATURE_DESC      "Root DN Access Control"
-#define ROOTDN_PLUGIN_DESC       "Root DN Access Control plugin"
-#define ROOTDN_PLUGIN_TYPE_DESC  "Root DN Access Control plugin"
-
-
-
+#define ROOTDN_FEATURE_DESC      "RootDN Access Control"
+#define ROOTDN_PLUGIN_DESC       "RootDN Access Control plugin"
+#define ROOTDN_PLUGIN_TYPE_DESC  "RootDN Access Control plugin"
+#define ROOTDN_PLUGIN_DN         "cn=RootDN Access Control,cn=plugins,cn=config"