[Pkg-openldap-devel] Bug#517556: Bug#517556: upgrading slapd fails with multiple databases and dbconfig settings in slapd.conf

Peter Marschall peter at adpm.de
Sun Mar 15 18:41:23 UTC 2009


Hi,

On Sunday, 8. March 2009, Steve Langasek wrote:
> Thanks for this patch.  I'm pondering whether adding this new function is
> the right thing to do, as opposed to simply redefining is_empty_dir - is
> there any reason we should ever treat a directory with only DB_CONFIG in it
> as non-empty?
I had a closer look at the code: it should be possible.

> For that matter, doesn't this patch result in different behavior for the
> first database (restoring DB_CONFIG from the backup) vs. the subsequent
> databases (using the DB_CONFIG autogenerated from slapd.conf)?  Once we
> decide on a consistent behavior here, I think it's possible to always
> ignore DB_CONFIG when detecting non-empty dirs, simplifying the code.
Oh, you're right.

Please find attached an update patch (unfortunately not tested), that
tries to address both issues:
- it ignores a DB_CONFIG in is_empty_dir
- it tries to only restore DB_CONFIG from backup/ load default DB_CONFIG
  if there is no DB_CONFIG in the database directory
  This is done for all databases before the first slapadd,
  to keep the same logic for all.

PS: sorry for not answering earlier, I only have time on weekends.

Regards
PEter

-- 
Peter Marschall
peter at adpm.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slapd.scripts-common.patch
Type: text/x-diff
Size: 2130 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-openldap-devel/attachments/20090315/289dabc0/attachment.patch 


More information about the Pkg-openldap-devel mailing list