#50445 ldbm_config_*_set functions need to validate valuse in apply=0 mode
Opened 6 months ago by lkrispen. Modified 5 months ago

The ldbm_config_*_set() functions can be called with apply value of 0 or 1. The idea is to check the validity of the attribute value without applying it. The idea behind this is that in dse.ldif "database" we do nt have transactions and need to check first that all attributes in a list of mods can be changend (apply=0) and then if everything is fine do it again with apply=1.

But unfortunately many functions, eg ldbm_config_db_cache_set() do nothing if called with apply=0, only with apply=1 they do the checks


Metadata Update from @mreynolds:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Issue set to the milestone: 1.4.2

6 months ago

There is another need for this to be fixed. There is a memory leak caused by ldbm_config_modify_entry_callback() which manipulates the list of mods in the pblock and if the check fails the mods will not be freed.
This can be fixed by:

 @@ -2525,11 +2525,11 @@ ldbm_config_modify_entry_callback(Slapi_PBlock *pb, Slapi_Entry *entryBefore, Sl
                              slapi_valueset_free(origvalues);
                          }
                      }
 +                    reapply_mods = 1; /* there is at least one mod we removed */
                  }
                  continue;
              }

 -            reapply_mods = 1; /* there is at least one mod we removed */
              /* when deleting a value, and this is the last or only value, set
                 the config param to its default value
                 when adding a value, if the value is set to its default value, replace

but this requires that config violations are detected already in the loop with apply=0

Login to comment on this ticket.

Metadata