summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2005-11-24 01:38:35 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2005-11-24 01:38:35 +0000
commit6021966d390b620e4f838bad21f6410c21800cf8 (patch)
tree9e512a9120fff398e11486c569979f9284cd319b
parentdc7d5ee942523229567349417ecc423c4402afdf (diff)
downloadds-6021966d390b620e4f838bad21f6410c21800cf8.tar.gz
ds-6021966d390b620e4f838bad21f6410c21800cf8.tar.xz
ds-6021966d390b620e4f838bad21f6410c21800cf8.zip
[173687] deadlock caused by error log rotation and logging
need to set localuser before creating/opening error log.
-rw-r--r--ldap/servers/slapd/config.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index bc2fd50c..26273317 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -222,12 +222,14 @@ slapd_bootstrap_config(const char *configdir)
char loglevel[BUFSIZ];
char maxdescriptors[BUFSIZ];
char val[BUFSIZ];
+ char _localuser[BUFSIZ];
char logenabled[BUFSIZ];
char schemacheck[BUFSIZ];
Slapi_DN plug_dn;
errorlog[0] = loglevel[0] = maxdescriptors[0] = '\0';
val[0] = logenabled[0] = schemacheck[0] = '\0';
+ _localuser[0] = '\0';
/* Convert LDIF to entry structures */
slapi_sdn_init_dn_byref(&plug_dn, PLUGIN_BASE_DN);
@@ -283,6 +285,21 @@ slapd_bootstrap_config(const char *configdir)
}
}
+#ifndef _WIN32
+ /* set the local user name; needed to set up error log */
+ if (!_localuser[0] &&
+ entry_has_attr_and_value(e, CONFIG_LOCALUSER_ATTRIBUTE,
+ _localuser, sizeof(_localuser)))
+ {
+ if (config_set_localuser(CONFIG_LOCALUSER_ATTRIBUTE,
+ _localuser, errorbuf, CONFIG_APPLY) != LDAP_SUCCESS)
+ {
+ LDAPDebug(LDAP_DEBUG_ANY, "%s: %s: %s. \n", configfile,
+ CONFIG_LOCALUSER_ATTRIBUTE, errorbuf);
+ }
+ }
+#endif
+
/* set the log file name */
if (!errorlog[0] &&
entry_has_attr_and_value(e, CONFIG_ERRORLOG_ATTRIBUTE,