when slapd upgrade fails, later upgrade attempts overwrite saved backups of pre-upgrade configuration files

Bug #571481 reported by Nathan Stratton Treadway on 2010-04-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openldap (Debian)
New
Unknown
openldap (Ubuntu)
Wishlist
Ryan Tandy

Bug Description

When called in "upgrade" mode, the slapd.postinst script starts out by making a backup of the $SLAPD_CONF directory into /var/backups/slapd-<old-package-version>/ .

However, if the upgrade fails (e.g. because of bug #571057), then later attempts to run the upgrade script will still be called with the same old-package-version, and the script will blindly re-run the backup of $SLAPD_CONF onto the same destination directory, overwriting the original pre-upgrade-attempt versions of those files with the copies that include edits made by the earlier runs of the upgrade script.

I see there is some logic in the compute_backup_path function to check if the backup target already exists, and to abort the upgrade run if it does. Doing the same sort of check-and-abort in backup_config_once would be better than the current scenario, though it might be even nicer if the program could pick a new backup directory (e.g. /var/backups/slapd-<old-package-version>_try<count> or something) automatically, rather than aborting and forcing the user to clean up manually....

summary: - when slapd upgrade fails, later upgrade attempts overwrite saved copies
+ when slapd upgrade fails, later upgrade attempts overwrite saved backups
of pre-upgrade configuration files
C de-Avillez (hggdh2) wrote :

Makes sense, so marking confirmed/WishList. Nathan, would you care to prepare a patch?

Changed in openldap (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Ryan Tandy (rtandy) on 2014-08-29
Changed in openldap (Ubuntu):
assignee: nobody → Ryan Tandy (rtandy)
Changed in openldap (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.