https://bugs.openldap.org/show_bug.cgi?id=9363
Issue ID: 9363 Summary: removing olcReadOnly on a DB does not set it to FALSE Product: OpenLDAP Version: 2.4.53 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: slapd Assignee: bugs@openldap.org Reporter: maxime.besson@worteks.com Target Milestone: ---
Created attachment 771 --> https://bugs.openldap.org/attachment.cgi?id=771&action=edit ldif config that reproduces the issue
I am running the following test:
* add olcReadOnly: TRUE on a MDB database in cn=config * Try to write to the MDB database => fails with "unwilling to perform" as expected * remove the olcReadOnly attribute from the MDB database * Try to write to the MDB database => still fails with the same error * Restart slapd * Try to write to the MDB database => OK
However the following test works as expected: * add olcReadOnly: TRUE on a MDB database in cn=config * Try to write to the MDB database => fails with "unwilling to perform" as expected * modify olcReadOnly to FALSE on the MDB database * Try to write to the MDB database => OK
It seems a little counter intuitive to me that removing a setting does not reset it to its default value. The fact that a slapd restart make writing possible again in the first test described above makes it seem to the casual user that olcReadOnly cannot be undone without a restart at all.
Tested in 2.4.53 and 2.4.44, config attached but it probably works with any config (hdb, etc)
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- This probably applies to all ON/OFF options that don't handle DELETEs themselves.
Might be worth tackling this in the config handling directly leaving users that expect the default == TRUE to use ARG_MAGIC and do it themselves?
openldap-its@openldap.org wrote:
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- This probably applies to all ON/OFF options that don't handle DELETEs themselves.
Note the comment in bconfig.c: /* single-valued attrs, no-ops */
I suppose for booleans it should not be a no-op. For others, it makes no sense to leave the setting without a value, and it's expected that you'll replace the deleted value with a new value.
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- openldap-its@openldap.org wrote:
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- This probably applies to all ON/OFF options that don't handle DELETEs themselves.
Note the comment in bconfig.c: /* single-valued attrs, no-ops */
I suppose for booleans it should not be a no-op. For others, it makes no sense to leave the setting without a value, and it's expected that you'll replace the deleted value with a new value.
https://bugs.openldap.org/show_bug.cgi?id=9363
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.0 Keywords| |OL_2_5_REQ
https://bugs.openldap.org/show_bug.cgi?id=9363
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.5.0 |2.5.1
https://bugs.openldap.org/show_bug.cgi?id=9363
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Keywords|OL_2_5_REQ | Resolution|--- |TEST
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- trunk:
Commits: • a44ba274 by Ondřej Kuzník at 2020-12-08T19:11:22+00:00 ITS#9363 Unset readonly on delete
• 356715fd by Ondřej Kuzník at 2020-12-08T19:11:22+00:00 ITS#9363 Zero out values on config delete
• 0c3b8a35 by Ondřej Kuzník at 2020-12-08T19:11:22+00:00 ITS#9363 Store defaults in ArgConf
• d9f20cc0 by Ondřej Kuzník at 2020-12-08T19:11:22+00:00 ITS#9363 Set appropriate defaults where needed
https://bugs.openldap.org/show_bug.cgi?id=9363
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|TEST |FIXED Status|RESOLVED |VERIFIED
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #4 from Quanah Gibson-Mount quanah@openldap.org --- • 3138c8d5 by Ondřej Kuzník at 2021-06-21T16:36:06+00:00 ITS#9363 Some missed MAGIC defaults
https://bugs.openldap.org/show_bug.cgi?id=9363
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- RE25:
• f2d9fcbc by Ondřej Kuzník at 2021-06-21T22:01:00+00:00 ITS#9363 Some missed MAGIC defaults