ldap/servers/plugins/rootdn_access/rootdn_access.c | 11 ++++++-----
ldap/servers/plugins/rootdn_access/rootdn_access.h | 10 ++++------
2 files changed, 10 insertions(+), 11 deletions(-)
New commits:
commit 00349f6e05fdc66fe24e8034ce072234aa0cacfa
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Thu Jan 10 15:12:54 2013 -0500
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: ?
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c
b/ldap/servers/plugins/rootdn_access/rootdn_access.c
index 5323915..5328462 100644
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.c
+++ b/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 */
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.h
b/ldap/servers/plugins/rootdn_access/rootdn_access.h
index 80b8d4a..fa3431d 100644
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.h
+++ b/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"