summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/libglobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldap/servers/slapd/libglobs.c')
-rw-r--r--ldap/servers/slapd/libglobs.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 27075140..21ffa4c2 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -573,6 +573,10 @@ static struct config_get_and_set {
{CONFIG_SASLPATH_ATTRIBUTE, config_set_saslpath,
NULL, 0,
(void**)&global_slapdFrontendConfig.saslpath, CONFIG_STRING, (ConfigGetFunc)config_get_saslpath},
+ /* parameterizing run dir */
+ {CONFIG_RUNDIR_ATTRIBUTE, config_set_rundir,
+ NULL, 0,
+ (void**)&global_slapdFrontendConfig.rundir, CONFIG_STRING, (ConfigGetFunc)config_get_rundir},
{CONFIG_REWRITE_RFC1274_ATTRIBUTE, config_set_rewrite_rfc1274,
NULL, 0,
(void**)&global_slapdFrontendConfig.rewrite_rfc1274, CONFIG_ON_OFF, NULL},
@@ -4728,6 +4732,43 @@ config_set_bakdir(const char *attrname, char *value, char *errorbuf, int apply)
CFG_UNLOCK_WRITE(slapdFrontendConfig);
return retVal;
}
+
+char *
+config_get_rundir()
+{
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ char *retVal;
+
+ CFG_LOCK_READ(slapdFrontendConfig);
+ retVal = config_copy_strval(slapdFrontendConfig->rundir);
+ CFG_UNLOCK_READ(slapdFrontendConfig);
+
+ return retVal;
+}
+
+int
+config_set_rundir(const char *attrname, char *value, char *errorbuf, int apply)
+{
+ int retVal = LDAP_SUCCESS;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+
+ if ( config_value_is_null( attrname, value, errorbuf, 0 )) {
+ return LDAP_OPERATIONS_ERROR;
+ }
+
+ if (!apply) {
+ return retVal;
+ }
+
+ CFG_LOCK_WRITE(slapdFrontendConfig);
+ slapi_ch_free((void **)&slapdFrontendConfig->rundir);
+
+ slapdFrontendConfig->rundir = slapi_ch_strdup(value);
+
+ CFG_UNLOCK_WRITE(slapdFrontendConfig);
+ return retVal;
+}
+
char *
config_get_saslpath()
{