#48887 Config set on off issues in libglobs
Opened 2 years ago by firstyear. Modified 2 years ago

It looks like in libglobs we have lots of this pattern:

    retVal = config_set_onoff ( attrname, value, &(slapdFrontendConfig->auditfaillog_logging_hide_unhashed_pw),
                                errorbuf, apply);
    if(strcasecmp(value,"on") == 0){
        auditfaillog_hide_unhashed_pw();
    } else {
        auditfaillog_expose_unhashed_pw();
    }
    return retVal;

In the case this value is set to say "512" or anything that is not "on" or "off" this has the behaviour of leaving the value set to current state (ie "on"), but on the running instance it acts as though off was taken.

As well, we aren't checking if we should be applying the value.

I think we should update all these to be like:

    retVal = config_set_onoff ( attrname, value, &(slapdFrontendConfig->logging_hr_timestamps),
                                errorbuf, apply);
    if (apply && retVal == LDAP_SUCCESS) {
        if(strcasecmp(value,"on") == 0){
            log_enable_hr_timestamps();
        } else {
            log_disable_hr_timestamps();
        }
    }
    return retVal;

Metadata Update from @firstyear:
- Issue set to the milestone: 1.3.6 backlog

2 years ago

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to new
- Issue close_status updated to: None
- Issue tagged with: Easyfix

2 years ago

Metadata Update from @firstyear:
- Custom field reviewstatus reset (from new)
- Issue set to the milestone: 1.3.7 backlog (was: 1.3.6 backlog)

2 years ago

Metadata Update from @ilias95:
- Issue assigned to ilias95

2 years ago

Which test suites would you run in order to make sure that such a change in libglobs.c didn't break anything?

Hmmm, that's a difficult question. I think that we've never been good about putting config tests in one place, because the tests normally relate to a feature. So the tests are all through out the code base. I'd say in that light, you need to do the full suite/ticket test.

Metadata Update from @ilias95:
- Assignee reset

2 years ago

Login to comment on this ticket.

Metadata