Re: Bug#1040915: bookworm-pu: package dbus/1.14.8-2~deb12u1

2023-07-13 Thread Adam D. Barratt
On Thu, 2023-07-13 at 17:51 +0100, Simon McVittie wrote:
> On Thu, 13 Jul 2023 at 16:58:54 +0100, Adam D. Barratt wrote:
> > On Wed, 2023-07-12 at 12:34 +0100, Simon McVittie wrote:
> > > On Wed, 12 Jul 2023 at 12:12:47 +0100, Simon McVittie wrote:
> > > > [ Reason ]
> > > > https://bugs.debian.org/1040790
> > 
> > Please go ahead, bearing in mind that the window for 12.1 closes
> > over
> > the coming weekend.
> 
> I uploaded it already, it's in
> ;. The
> corresponding unstable update should reach testing tomorrow.
> 

Heh, that'll teach me to catch up on e-mail before reviewing the queue.

> I'm sorry for the timing. I fixed it as fast as I was able, as soon
> as I was aware of the issue (I know both should have happened
> quicker).
> 

FTAOD, it absolutely wasn't a complaint, rather just making sure you
were aware of the date.

Regards,

Adam



Re: Bug#1040915: bookworm-pu: package dbus/1.14.8-2~deb12u1

2023-07-13 Thread Simon McVittie
On Thu, 13 Jul 2023 at 16:58:54 +0100, Adam D. Barratt wrote:
> On Wed, 2023-07-12 at 12:34 +0100, Simon McVittie wrote:
> > On Wed, 12 Jul 2023 at 12:12:47 +0100, Simon McVittie wrote:
> > > [ Reason ]
> > > https://bugs.debian.org/1040790
> 
> Please go ahead, bearing in mind that the window for 12.1 closes over
> the coming weekend.

I uploaded it already, it's in
. The
corresponding unstable update should reach testing tomorrow.

I'm sorry for the timing. I fixed it as fast as I was able, as soon as
I was aware of the issue (I know both should have happened quicker).

smcv



Re: Bug#1040915: bookworm-pu: package dbus/1.14.8-2~deb12u1

2023-07-13 Thread Adam D. Barratt
Control: tags -1 + confirmed

On Wed, 2023-07-12 at 12:34 +0100, Simon McVittie wrote:
> On Wed, 12 Jul 2023 at 12:12:47 +0100, Simon McVittie wrote:
> > [ Reason ]
> > https://bugs.debian.org/1040790
> > [ Changes ]
> > All changes are part of resolving or testing #1040790.
> 
> Debdiff attached.
> 
> > [ Tests ]
> 
> I should also have mentioned that I'm running the proposed package on
> a bookworm desktop system and it works normally.
> 

Please go ahead, bearing in mind that the window for 12.1 closes over
the coming weekend.

Regards,

Adam



Re: Bug#1040915: bookworm-pu: package dbus/1.14.8-2~deb12u1

2023-07-12 Thread Simon McVittie
On Wed, 12 Jul 2023 at 12:12:47 +0100, Simon McVittie wrote:
> [ Reason ]
> https://bugs.debian.org/1040790
> [ Changes ]
> All changes are part of resolving or testing #1040790.

Debdiff attached.

> [ Tests ]

I should also have mentioned that I'm running the proposed package on
a bookworm desktop system and it works normally.

smcv
diffstat for dbus-1.14.8 dbus-1.14.8

 changelog|   16 +
 dbus-daemon.postinst |4 +--
 tests/control|9 +++
 tests/machine-id |   60 +++
 4 files changed, 87 insertions(+), 2 deletions(-)

diff -Nru dbus-1.14.8/debian/changelog dbus-1.14.8/debian/changelog
--- dbus-1.14.8/debian/changelog	2023-06-11 12:42:56.0 +0100
+++ dbus-1.14.8/debian/changelog	2023-07-11 20:59:33.0 +0100
@@ -1,3 +1,19 @@
+dbus (1.14.8-2~deb12u1) bookworm; urgency=medium
+
+  * Rebuild for bookworm
+
+ -- Simon McVittie   Tue, 11 Jul 2023 20:59:33 +0100
+
+dbus (1.14.8-2) unstable; urgency=high
+
+  * dbus-daemon.postinst: Stop trying to take DPKG_ROOT into account.
+This unintentionally disabled the code path that would copy systemd's
+/etc/machine-id in preference to creating an entirely new machine ID.
+(Closes: #1040790)
+  * d/tests: Add test coverage for #1040790
+
+ -- Simon McVittie   Tue, 11 Jul 2023 18:38:22 +0100
+
 dbus (1.14.8-1~deb12u1) bookworm; urgency=medium
 
   * Rebuild for bookworm
diff -Nru dbus-1.14.8/debian/dbus-daemon.postinst dbus-1.14.8/debian/dbus-daemon.postinst
--- dbus-1.14.8/debian/dbus-daemon.postinst	2023-06-11 12:42:56.0 +0100
+++ dbus-1.14.8/debian/dbus-daemon.postinst	2023-07-11 20:59:33.0 +0100
@@ -7,8 +7,8 @@
 # script does this anyway, but you also have to do this before a session
 # bus will work on non-systemd systems, so we do this here for the
 # benefit of people starting a temporary session bus in a chroot.
-mkdir -p "${DPKG_ROOT:-/}var/lib/dbus"
-dbus-uuidgen --ensure="${DPKG_ROOT:-/}var/lib/dbus/machine-id"
+mkdir -p /var/lib/dbus
+dbus-uuidgen --ensure
 fi
 
 #DEBHELPER#
diff -Nru dbus-1.14.8/debian/tests/control dbus-1.14.8/debian/tests/control
--- dbus-1.14.8/debian/tests/control	2023-06-11 12:42:56.0 +0100
+++ dbus-1.14.8/debian/tests/control	2023-07-11 20:59:33.0 +0100
@@ -25,6 +25,15 @@
 Restrictions: allow-stderr, superficial
 Depends: dbus-daemon
 
+Tests: machine-id
+Restrictions: allow-stderr, needs-root, superficial
+Depends: dbus-daemon
+
+Test-Command: debian/tests/machine-id with-systemd
+Features: test-name=machine-id_with_systemd
+Restrictions: allow-stderr, needs-root, superficial
+Depends: dbus-daemon, systemd
+
 Tests: dbus-session-bus-common
 Restrictions: allow-stderr, superficial
 Depends: dbus-session-bus-common
diff -Nru dbus-1.14.8/debian/tests/machine-id dbus-1.14.8/debian/tests/machine-id
--- dbus-1.14.8/debian/tests/machine-id	1970-01-01 01:00:00.0 +0100
+++ dbus-1.14.8/debian/tests/machine-id	2023-07-11 20:59:33.0 +0100
@@ -0,0 +1,60 @@
+#!/bin/sh
+set -eu
+
+# Regression test for https://bugs.debian.org/1040790
+
+mode="${1-}"
+
+export LC_ALL=C.UTF-8
+fail=
+set -x
+
+# dbus-daemon.deb provides a machine ID
+ls -l /etc/machine-id /var/lib/dbus/machine-id || :
+head /etc/machine-id /var/lib/dbus/machine-id || :
+uuid="$(dbus-uuidgen --get)"
+test -n "$uuid" || fail=yes
+# The machine ID consists of 32 lower-case hex digits (and the file
+# also has a newline)
+test "$uuid" = "$(perl -pe 'print "wrong: " unless /\A[a-z0-9]{32}\n\z/' /var/lib/dbus/machine-id)" || fail=yes
+
+# Intentionally not asserting that /etc/machine-id matches
+# /var/lib/dbus/machine-id: if the test container has both dbus and
+# systemd, and it was generated with a version of dbus that has #1040790,
+# then that assertion could fail.
+
+# If there is a systemd machine ID, installing dbus-daemon should
+# make the D-Bus machine ID be the same as it.
+# Unfortunately nothing currently guarantees that a Debian
+# system will have a machine ID, so this has to be conditional. (See
+# also #745876, #783716).
+if [ -e /etc/machine-id ] || [ "$mode" = with-systemd ]; then
+rm -f /var/lib/dbus/machine-id
+# This is for its side-effect of running the postinst, emulating
+# a fresh installation
+dpkg-reconfigure -fnoninteractive -pcritical dbus-daemon
+ls -l /etc/machine-id /var/lib/dbus/machine-id || :
+head /etc/machine-id /var/lib/dbus/machine-id || :
+uuid="$(dbus-uuidgen --get)"
+test -n "$uuid" || fail=yes
+test "$uuid" = "$(perl -pe 'print "wrong: " unless /\A[a-z0-9]{32}\n\z/' /var/lib/dbus/machine-id)" || fail=yes
+test "$uuid" = "$(perl -pe 'print "wrong: " unless /\A[a-z0-9]{32}\n\z/' /etc/machine-id)" || fail=yes
+fi
+
+# Similarly, if there is a D-Bus machine ID but no systemd machine ID
+# (for example if dbus-daemon happened to be installed before systemd),
+# then we expect systemd-machine-id-setup to copy ours.