Control: retitle 709322 sks postinst script tries to upgrade DB_CONFIG 
configuration file
Control: priority 709322 important
Control: tags 709322 + patch

Casper Gielen wrote:

> + su debian-sks -c db5.1_upgrade -h /var/lib/sks/DB /var/lib/sks/DB/DB_CONFIG
> bash: warning: setlocale: LC_ALL: cannot change locale (nl_NL.UTF-8)
> db5.1_upgrade: Program version 5.1 doesn't match environment version 4.7
> db5.1_upgrade: DB_ENV->open: DB_VERSION_MISMATCH: Database environment 
> version mismatch
> dpkg: error processing sks (--configure):
>  subprocess installed post-installation script returned error exit status 1
>  Errors were encountered while processing:
>   sks

the bug here, of course, is that the postinst script has no business
trying to upgrade DB/DB_CONFIG (or PTree/DB_CONFIG) if that file exists.
If that file exists, it's a configuration/tuning mechanism for BDB, as
suggested (for example) on the sks-devel list:

 http://thread.gmane.org/gmane.comp.encryption.pgp.sks/3265/focus=3281

The fix is to avoid trying to back up such a config file as though it
were a database table:


diff --git a/debian/sks.postinst b/debian/sks.postinst
index ba93713..8c1da41 100755
--- a/debian/sks.postinst
+++ b/debian/sks.postinst
@@ -120,8 +120,12 @@ else
                cp -a ${SKS_DIR}/${DBHOME}/$log_file ${BACKUP_DIR}/${DBHOME}/
            done
 
+            if [ -e "${SKS_DIR}/${DBHOME}/DB_CONFIG" ]; then
+                cp -a ${SKS_DIR}/${DBHOME}/DB_CONFIG ${BACKUP_DIR}/${DBHOME}/
+            fi
+
            # Backup & upgrade database files
-           for db in $(cd ${SKS_DIR}/${DBHOME}; ls -1 | grep -Ev 
"^(__|log\.)"); do
+           for db in $(cd ${SKS_DIR}/${DBHOME}; ls -1 | grep -Ev 
"^(__|log\.|DB_CONFIG$)"); do
                # Backup database file
                su debian-sks -c "cp ${SKS_DIR}/${DBHOME}/${db} 
${BACKUP_DIR}/${DBHOME}/"
                # Upgrade database file

I've just pushed a "wheezy" branch with this change to
git://anonscm.debian.org/pkg-sks/pkg-sks.git -- i can upload a full
change as 1.1.3-3 to unstable shortly if that would be useful.  it would
be nice to get this fix into debian 7.2.

       --dkg

Attachment: pgp180AX0zKIj.pgp
Description: PGP signature

Reply via email to