Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14488
Modified Files:
Tag: Directory71RtmBranch
config.c
Log Message:
[173687] deadlock caused by error log rotation and logging
need to set localuser before creating/opening error log.
Index: config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/config.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- config.c 19 Apr 2005 22:07:36 -0000 1.5
+++ config.c 24 Nov 2005 01:38:35 -0000 1.5.2.1
@@ -222,12 +222,14 @@
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 @@
}
}
+#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,