3d715adc21
If a Berkeley DB database is used as the underlying database, renaming the database before closing it can produce error messages like the following on close: /var/lib/heimdal-kdc/heimdal~.db: unable to flush: No such file or directory since the underlying database library caches the old file name. There is a rename() method in the Berkeley DB API, but it also invalidates the database handle and requires that it be reopened. Since the hdb_rename implementation does not require that the database be open, close the database before renaming it to avoid this problem. Signed-off-by: Love Hornquist Astrand <lha@h5l.org>