ldap/servers/slapd/libglobs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
New commits: commit 41822689b9135b1bfa2db39ac6f09de0f0599793 Author: William Brown firstyear@redhat.com Date: Mon Jun 13 14:55:24 2016 +1000
Ticket 47982 - Fix log hr timestamps when invalid value is set in cn=config
Bug Description: If an invalid (on / off) value was set, it would leave the config as "on", but then turn off logging anyway.
Fix Description: Check the return code of config_set_onoff, to determine if we need to make the logging change.
https://fedorahosted.org/389/ticket/47982
Author: wibrown
Review by: mreynolds (thanks!)
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index aa77783..a630c6c 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -1796,10 +1796,12 @@ config_set_logging_hr_timestamps(const char *attrname, char *value, char *errorb
retVal = config_set_onoff ( attrname, value, &(slapdFrontendConfig->logging_hr_timestamps), errorbuf, apply); - if(strcasecmp(value,"on") == 0){ - log_enable_hr_timestamps(); - } else { - log_disable_hr_timestamps(); + if (apply && retVal == LDAP_SUCCESS) { + if(strcasecmp(value,"on") == 0){ + log_enable_hr_timestamps(); + } else { + log_disable_hr_timestamps(); + } } return retVal; }
389-commits@lists.fedoraproject.org