From: Howard Chu Date: Sun, 28 Aug 2005 07:11:10 +0000 (+0000) Subject: ITS#3937 add config_syslog var to track state of loglevel directive, X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~545 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=055c1abbdcd6ab98d33fe8c457dee8740da65176;p=openldap ITS#3937 add config_syslog var to track state of loglevel directive, copy to ldap_syslog when in SLAP_SERVER_MODE --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index c25ac669fe..6b75c27b91 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1965,6 +1965,8 @@ str2loglevel( const char *s, int *l ) return 0; } +static int config_syslog; + static int config_loglevel(ConfigArgs *c) { int i; @@ -1975,18 +1977,21 @@ config_loglevel(ConfigArgs *c) { } if (c->op == SLAP_CONFIG_EMIT) { - return mask_to_verbs( loglevel_ops, ldap_syslog, &c->rvalue_vals ); + return mask_to_verbs( loglevel_ops, config_syslog, &c->rvalue_vals ); } else if ( c->op == LDAP_MOD_DELETE ) { if ( !c->line ) { - ldap_syslog = 0; + config_syslog = 0; } else { int level = verb_to_mask( c->line, loglevel_ops ); - ldap_syslog ^= level; + config_syslog ^= level; + } + if ( slapMode & SLAP_SERVER_MODE ) { + ldap_syslog = config_syslog; } return 0; } - ldap_syslog = 0; + config_syslog = 0; for( i=1; i < c->argc; i++ ) { int level; @@ -2007,7 +2012,10 @@ config_loglevel(ConfigArgs *c) { return( 1 ); } } - ldap_syslog |= level; + config_syslog |= level; + if ( slapMode & SLAP_SERVER_MODE ) { + ldap_syslog = config_syslog; + } } return(0); }