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

Bug #571481 reported by Nathan Stratton Treadway
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openldap (Debian)
Fix Released
Unknown
openldap (Ubuntu)
Fix Released
Wishlist
Unassigned

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
Revision history for this message
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)
Changed in openldap (Ubuntu):
assignee: nobody → Ryan Tandy (rtandy)
Changed in openldap (Debian):
status: Unknown → New
Changed in openldap (Debian):
status: New → Confirmed
Changed in openldap (Debian):
status: Confirmed → Fix Released
Revision history for this message
Ryan Tandy (rtandy) wrote :

Fixed in 2.4.51+dfsg-1 i.e. groovy

Changed in openldap (Ubuntu):
assignee: Ryan Tandy (rtandy) → nobody
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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