Description of problem: 1) Error handling in ldbm_back_{add,delete,modify,modrdn} functions was incomplete. When any error occurs after the transaction begins, the changes made after that should be aborted. There were some cases the abort was not called. 2) If modrdn failed in ldbm_bacK_modrdn, new DN in the DN cache was not removed.
Created attachment 389871 [details] git patch file Files: ldap/servers/slapd/back-ldbm/id2entry.c ldap/servers/slapd/back-ldbm/ldbm_add.c ldap/servers/slapd/back-ldbm/ldbm_delete.c ldap/servers/slapd/back-ldbm/ldbm_modify.c ldap/servers/slapd/back-ldbm/ldbm_modrdn.c ldap/servers/slapd/libglobs.c Description: 1) modified the code so that the changes are aborted if an error is detected in back_ldbm_{add,delete,modify,modrdn}. 2) ldap_back_modrdn deletes DN from the DN cache if the modrdn operation failed. 3) config_set_instancedir has the explicit function type int.
Created attachment 389879 [details] git patch file (Directory_Server_8_2_Branch) Files: ldap/servers/slapd/back-ldbm/ldbm_add.c ldap/servers/slapd/back-ldbm/ldbm_delete.c ldap/servers/slapd/back-ldbm/ldbm_modify.c ldap/servers/slapd/back-ldbm/ldbm_modrdn.c Description: Back ported (1) in the 9.0 fix to 8.2. 1) Error handling in ldbm_back_{add,delete,modify,modrdn} functions was incomplete. When any error occurs after the transaction begins, the changes made after that should be aborted. There were some cases the abort was not called.
Reviewed by Nathan (Thank you!!) Pushed to master as well as Directory_Server_8_2_Branch. [master] $ git merge work Updating f81e7ea..508af98 Fast forward ldap/servers/slapd/back-ldbm/id2entry.c | 2 +- ldap/servers/slapd/back-ldbm/ldbm_add.c | 67 +++++++++++---------------- ldap/servers/slapd/back-ldbm/ldbm_delete.c | 53 +++++++++++++++------ ldap/servers/slapd/back-ldbm/ldbm_modify.c | 19 +++++-- ldap/servers/slapd/back-ldbm/ldbm_modrdn.c | 69 +++++++++++++++++++++------- ldap/servers/slapd/libglobs.c | 1 + 6 files changed, 132 insertions(+), 79 deletions(-) $ git push Counting objects: 23, done. Delta compression using 4 threads. Compressing objects: 100% (12/12), done. Writing objects: 100% (12/12), 2.86 KiB, done. Total 12 (delta 10), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git f81e7ea..508af98 master -> master [Directory_Server_8_2_Branch] $ git push origin ds82-local:Directory_Server_8_2_Branch Counting objects: 19, done. Delta compression using 4 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (10/10), 2.30 KiB, done. Total 10 (delta 8), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git 0fc8628..1ae9a08 ds82-local -> Directory_Server_8_2_Branch
can you please add steps to verify - thanks!
I'm afraid there are no simple steps to verify this bug. I ran into this bug when I was working on the subtree rename project. While the new entryrdn index code was half-baked, it returned unexpected errors and I found the parent functions listed above failed to abort the update request. Now we cannot expect such failures. (Plus 8.2 does not include the subtree rename code.) I would run some update operations against the server attached to the debugger, break in the listed functions and force to take an abort path by setting an error code to some return values. I guess it's out of QE's interest. :) If you don't mind, let me verify this bug.
please do :-) Thanks Noriko!
Created attachment 421319 [details] steps in gdb for add operation Once a fake error code is set, the add operation is correctly aborted. I also verified that modify, modrdn, and delete work fine.