Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: cyrus-im...@packages.debian.org
Control: affects -1 + src:cyrus-imapd

[ Reason ]
I entered a patch some months ago in Bullseye to permits migration to
Cyrus-Imapd 3.6 (Bookworm): without this patch, mailboxes maybe
corrupted.
I added also a postinst check to refuse upgrades if previous  version
wasn't > 3.2.6-2+deb11u2. However, I did a mistake in this patch and
migrations are not blocked. So user that didn't follow Bullseye upgrades
are loosing their mailboxes during Bopokworm upgrades (see #1037346).

[ Impact ]
Data loose risk for users that didn't migrate from 3.2.6-2+deb11u2.

[ Risks ]
No risk here, it just fixes the major risk on upgrades

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
 * fix dpkg --compare-versions use
 * update doc to replace minimal 3.2.10 by 3.2.6-2+deb11u2

Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index a6d3c31a..56cfb114 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+cyrus-imapd (3.6.1-4+deb12u1) UNRELEASED; urgency=medium
+
+  * Doc: add patch to fix minimal version needed before upgrade
+    (see #1037346)
+  * Fix postint version check (see #1037346)
+
+ -- Yadd <y...@debian.org>  Sat, 26 Aug 2023 07:06:45 +0400
+
 cyrus-imapd (3.6.1-4) unstable; urgency=medium
 
   * Update copyright
diff --git a/debian/cyrus-common.postinst b/debian/cyrus-common.postinst
index 86eb6f0a..10a36946 100755
--- a/debian/cyrus-common.postinst
+++ b/debian/cyrus-common.postinst
@@ -60,7 +60,7 @@ upgradesieve () {
 case "$1" in
     configure)
        # Refuse to update if previous version is lower than 3.2.6-2+deb11u2~
-       if [ -z "$1" ] || $(dpkg --compare-versions $1 lt '3.2.6-2+deb11u2~'); 
then
+       if [ -z "$2" ] || $(dpkg --compare-versions $2 lt '3.2.6-2+deb11u2~'); 
then
            echo "You must update cyrus-imapd to at least version 
3.2.6-2+deb11u2~" >&2
            echo "before updating it to version 3.6.x and run it, else your 
mailboxes" >&2
            echo "may be corrupted" >&2
diff --git a/debian/patches/fix-upgrade-versions.patch 
b/debian/patches/fix-upgrade-versions.patch
new file mode 100644
index 00000000..9d0bb2f9
--- /dev/null
+++ b/debian/patches/fix-upgrade-versions.patch
@@ -0,0 +1,37 @@
+Description: fix the minimal version needed to update
+Author: Yadd <y...@debian.org>
+Bug-Debian: https://bugs.debian.org/1037346
+Forwarded: not-needed
+Last-Update: 2023-07-19
+
+--- a/doc/html/_sources/imap/download/upgrade.rst.txt
++++ b/doc/html/_sources/imap/download/upgrade.rst.txt
+@@ -25,10 +25,9 @@
+ Versions to upgrade from
+ ########################
+ 
+-Before upgrading to 3.6, your deployment should be running either:
++Before upgrading to 3.6, your deployment should be running:
+ 
+-* 3.2.10 (or later), or
+-* 3.4.4 (or later)
++* 3.2.6-2+deb11u2 (or later)
+ 
+ If your existing deployment predates these releases, you should first upgrade
+ to one of these versions, let it run for a while, resolve any issues that
+--- a/doc/text/imap/download/upgrade.txt
++++ b/doc/text/imap/download/upgrade.txt
+@@ -59,11 +59,9 @@
+ Versions to upgrade from
+ ------------------------
+ 
+-Before upgrading to 3.6, your deployment should be running either:
++Before upgrading to 3.6, your deployment should be running:
+ 
+-* 3.2.10 (or later), or
+-
+-* 3.4.4 (or later)
++* 3.2.6-2+deb11u2 (or later)
+ 
+ If your existing deployment predates these releases, you should first
+ upgrade to one of these versions, let it run for a while, resolve any
diff --git a/debian/patches/series b/debian/patches/series
index b33e49ac..353fb72b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 0018-increase-test-timeout.patch
 #0019-propagate-XXFLAGS.patch
 0020_fix-cyr_cd-shebang.patch
+fix-upgrade-versions.patch
diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml
index 33c3a640..6a91c217 100644
--- a/debian/salsa-ci.yml
+++ b/debian/salsa-ci.yml
@@ -1,4 +1,7 @@
 ---
+variables:
+  RELEASE: 'bookworm'
+
 include:
   - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
   - 
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml

Reply via email to