Your message dated Thu, 29 Feb 2024 23:44:10 +0000
with message-id <e1rfq4q-00dqde...@fasolo.debian.org>
and subject line Bug#1064361: fixed in readline 8.2-3.1
has caused the Debian Bug report #1064361,
regarding libreadline8t64: file loss due to concurrent /usr-move and package 
rename (DEP17 P1)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1064361: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1064361
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: libreadline8t64
Version: 8.2-3.1~exp1
Severity: serious
Tags: patch
User: helm...@debian.org
Usertags: dep17p1
Control: affects -1 + libreadline8
X-Debbugs-Cc: vor...@debian.org, mwhud...@debian.org, bug-readl...@gnu.org

Hi,

readline upstream: Please skip the next paragraph.

the time64 transition causes a DEP17 P1 problem for the actual shared
libraries contained in libreadline8t64. These were located below /lib in
libreadline8 in bookworm and thus can be lost in an upgrade. I'm
attaching a patch to add protective diversions for this situation. Since
this library is rather close to essential, I'm using the conservative
method of keeping the diversions beyond postinst. In forky, we can
remove the diversions and in forky+1, we can remove the maintainer
scripts introduced here.

Given the proximity of readline to the base system (e.g. fdisk and
python3 depend on it), I also looked into alternatives.
https://adrien.dcln.fr/misc/armhf-time_t/2024-02-01T09:53:00/compat_reports/libreadline-dev/base_to_lfs/compat_report.html
indicates that we are not faced with LFS ABI changes, but
https://adrien.dcln.fr/misc/armhf-time_t/2024-02-01T09:53:00/compat_reports/libreadline-dev/lfs_to_time_t/compat_report.html
indicates that we are faced with history_get_time changing its return
type from 32bit to 64bit. Providing ABI duality here is even easier than
in the case of libselinux and upstream is vaguely active (last commit 3
weeks ago). Also note that this function already handles range errors
and returns 0 in that case. This behaviour could naturally be extended
for 2038. I think providing duality here would reduce the risk of failed
upgrades breaking user systems.

Context:
https://sources.debian.org/src/readline/8.2-3/history.c/?hl=241#L241

Sketch:

// .h
#if time64 changes ABI
typedef time_t time64_t;
typedef int32_t time32_t;
time64_t history_get_time64 (HIST_ENTRY *hist);
time32_t history_get_time (HIST_ENTRY *hist);
#define history_get_time history_get_time64
#else
time_t history_get_time (HIST_ENTRY *hist);
#endif

// .c
time_t
// The earlier #define may change the function name
history_get_time (HIST_ENTRY *hist)
{
  // original function unchanged
}

#if time64 changes ABI
#undef history_get_time
time32_t
history_get_time (HIST_ENTRY *hist)
{
  time64_t ret64 = history_get_time(hist);
  time32_t ret32 = ret64;
  if ((time64_t)ret32 != ret64)
    return (time32_t)0;
  return ret32;
}
#endif

I've directly Cced readline upstream to see whether they're interested.

Helmut
diff --minimal -Nru readline-8.2/debian/changelog readline-8.2/debian/changelog
--- readline-8.2/debian/changelog       2024-02-19 23:47:01.000000000 +0100
+++ readline-8.2/debian/changelog       2024-02-20 09:18:09.000000000 +0100
@@ -1,3 +1,11 @@
+readline (8.2-3.1~exp1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * DEP17 P1: Mitigate file loss due to package rename with concurrent
+    aliasing change. Closes: #-1.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Tue, 20 Feb 2024 09:18:09 +0100
+
 readline (8.2-3.1~exp1) experimental; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru readline-8.2/debian/libreadline8t64.postrm.in 
readline-8.2/debian/libreadline8t64.postrm.in
--- readline-8.2/debian/libreadline8t64.postrm.in       1970-01-01 
01:00:00.000000000 +0100
+++ readline-8.2/debian/libreadline8t64.postrm.in       2024-02-20 
09:17:54.000000000 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = remove; then
+       # DEP17 P1 mitigation. Remove these diversions via postinst once trixie 
is released.
+       for lib in libhistory.so.8 libhistory.so.8.2 libreadline.so.8 
libreadline.so.8.2; do
+               dpkg-divert --package libreadline8t64 --no-rename --divert 
"/lib/#DEB_HOST_MULTIARCH#/$lib.usr-is-merged" --remove 
"/lib/#DEB_HOST_MULTIARCH#/$lib"
+       done
+fi
+
+#DEBHELPER#
+
+exit 0
diff --minimal -Nru readline-8.2/debian/libreadline8t64.preinst.in 
readline-8.2/debian/libreadline8t64.preinst.in
--- readline-8.2/debian/libreadline8t64.preinst.in      1970-01-01 
01:00:00.000000000 +0100
+++ readline-8.2/debian/libreadline8t64.preinst.in      2024-02-20 
09:18:03.000000000 +0100
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if test "$1" = install -o "$1" = upgrade; then
+       # DEP17 P1 mitigation. Remove these diversions via postinst once trixie 
is released.
+       for lib in libhistory.so.8 libhistory.so.8.2 libreadline.so.8 
libreadline.so.8.2; do
+               dpkg-divert --package libreadline8t64 --no-rename --divert 
"/lib/#DEB_HOST_MULTIARCH#/$lib.usr-is-merged" --add 
"/lib/#DEB_HOST_MULTIARCH#/$lib"
+       done
+fi
+
+#DEBHELPER#
+
+exit 0
diff --minimal -Nru readline-8.2/debian/rules readline-8.2/debian/rules
--- readline-8.2/debian/rules   2024-02-19 23:47:01.000000000 +0100
+++ readline-8.2/debian/rules   2024-02-20 09:18:09.000000000 +0100
@@ -154,6 +154,9 @@
 
        touch configure-stamp
 
+debian/%:debian/%.in
+       sed 's/#DEB_HOST_MULTIARCH#/$(DEB_HOST_MULTIARCH)/g' $< > $@
+
 build: build-stamp $(if $(filter 
cross,$(DEB_BUILD_PROFILES)),,build-rlfe-stamp)
 build-arch: build
 build-indep: build
@@ -228,6 +231,7 @@
        rm -f debian/shlibs.local
        find . -type d | xargs chmod g-s
        rm -f support/config.guess support/config.sub
+       rm -f debian/libreadline8t64.preinst debian/libreadline8t64.postrm
        dh_clean
 
 install: install-stamp
@@ -441,7 +445,7 @@
        dh_md5sums -i
        dh_builddeb -i
 
-binary-arch: build install
+binary-arch: build install debian/libreadline8t64.preinst 
debian/libreadline8t64.postrm
        dh_testdir
        dh_testroot
        dh_installdocs -p$(p_rl) \

--- End Message ---
--- Begin Message ---
Source: readline
Source-Version: 8.2-3.1
Done: Benjamin Drung <bdr...@debian.org>

We believe that the bug you reported is fixed in the latest version of
readline, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1064...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Benjamin Drung <bdr...@debian.org> (supplier of updated readline package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 29 Feb 2024 22:49:06 +0000
Source: readline
Architecture: source
Version: 8.2-3.1
Distribution: unstable
Urgency: medium
Maintainer: Matthias Klose <d...@debian.org>
Changed-By: Benjamin Drung <bdr...@debian.org>
Closes: 1064322 1064361
Changes:
 readline (8.2-3.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Rename libraries for 64-bit time_t transition.  Closes: #1064322
   * DEP17 P1: Mitigate file loss due to package rename with concurrent
     aliasing change. Closes: #1064361.
Checksums-Sha1:
 458a16d902e667c22f8f07afc74191dd6d6ffeac 2794 readline_8.2-3.1.dsc
 7f9630553a0bd0f85f9a4a8a99b52140dd84d39a 33684 readline_8.2-3.1.debian.tar.xz
 2d5c34631558f9038f58582aa20f558b69825d4d 8579 readline_8.2-3.1_source.buildinfo
Checksums-Sha256:
 07e62d78157170b2a2978fffd73de951bc5d06f670bc3e3f773b3a4118d5f640 2794 
readline_8.2-3.1.dsc
 41038ff4079aa652712e6d45821e83c0a1eda49d24bfa39fbedfdd4e34c18569 33684 
readline_8.2-3.1.debian.tar.xz
 1995ff866c640a062744af31f149ed9290825ee9f35b2e784b8a34b7f2730202 8579 
readline_8.2-3.1_source.buildinfo
Files:
 3346efa5095d560266ff8d75c53784c5 2794 libs optional readline_8.2-3.1.dsc
 3cfd425daffebb4a5e01c7e0c7a57aaf 33684 libs optional 
readline_8.2-3.1.debian.tar.xz
 98d0150dd5f525a91dd205b08187487d 8579 libs optional 
readline_8.2-3.1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEpi0s+9ULm1vzYNVLFZ61xO/Id0wFAmXhCiAACgkQFZ61xO/I
d0ztVA//Wv8fgcf6yN9rVYBQXUDzlG53K74TR5Wt3bBhAMAFO6ZmYsuUpBHiBjc2
/uu8XvE00ZUrZDXJ5cznYCZQh+uVuVWEsBE2v+EPpSaqmLe16PLNX5/4WBmR/ZEJ
kBhfO4pLQ6r3GTkr3ijN4+AvoE8k03VGrvPL8cviR2duItbpHAgM2/Dg2hcCeLIb
1HfLaJ95c1cd5KQyINumb/ilXja4LFnRYFZAbbOy83yhKxd+yWeYDSNAcr5MdWac
ZDZypHblBlt7ojPv644KhZLWZ/tcnPtjNySRDzX0gZWuau0054BaIwQqjs3RpsRv
8WCxmfOyJzvhHzE885a+HhiXoNDxkT4IFHvOxeV9TMqYTiy++bjc/zK1K1E4C2dF
Di+ZDsc6qGrsgVRSOr8WGZSKhrBoIqqcQMhhhmw2hgKzdC6zq3BlTtXKlVrRCGmE
yWRkFm3Lcz/FGY/9oIVSlZOVwOqbZ8MKTci1hNTIRymYG+JD/NzzsWoLwLY3tKBu
sVrkEjxFPsl58bTKxI7tkiXHgK8lyTCc196fLYlhdJxOGCZSHFZRUkSMSUHJrDxJ
3iNEv2LjX51qBKqgW1HbOo5gzMKs/uyVQ0R4wjIMTXpANfTyFdJhVxRvwlavUCHt
GP7Lzu6LvbDkI2jLXw3ngHnUL7/+hsfyoC9xVRNrdpb8c/wQyOo=
=GyDk
-----END PGP SIGNATURE-----

Attachment: pgpPF_oBfwLGG.pgp
Description: PGP signature


--- End Message ---

Reply via email to