Subject: libpolkit-gobject-consolekit-1-0: Ships the elogind variant of the library

From: "Plasma (David Paul)" <[email-masked]>
Date: Fri, 26 Sep 2025 19:57:42 -0500

Package: libpolkit-gobject-consolekit-1-0
Version: 0.105+26+devuan1
Severity: grave
Justification: ships the wrong shared-object library

Dear Maintainer,

Starting from version 0.105-26+devuan1, the
libpolkit-gobject-consolekit-1-0 package incorrectly ships the variant
of libpolkit-gobject-1.so.0.0.0 compiled with elogind session-tracking
rather than the variant compiled with ConsoleKit session-tracking. This
can be easily verified by comparing the checksums of the included
libpolkit-gobject-1.so.0.0.0 file in each of the
libpolkit-gobject-consolekit-1-0 and libpolkit-gobject-elogind-1-0
packages.

# Fix

Once this report is assigned a bug number, I will shortly be submitting
'git am'-ready patches to remedy this issue.

# Explanation

The issue lies with an interaction involving three commands in the
override_dh_install recipe in debian/rules, specifically
```
	dh_install -plibpolkit-gobject-consolekit-1-0 \
		--sourcedir=debian/install/consolekit
	dh_install -a -Nlibpolkit-gobject-consolekit-1-0
	[...]
	dh_install
```

The first command is required in order to copy the build of the
ConsoleKit variant of the library from its non-standard DESTDIR at
debian/install to the staging directory for the 
libpolkit-gobject-consolekit-1-0 binary package.

The second command then handles staging the files for the rest of the
arch-dependent packages, copying files from debian/tmp, the default
DESTDIR.

This leaves the third command with the task of staging the files for
all the remaining binary package which by this point should be all of
the arch-independent packages. However, because the command lacks
either a '-i' or '--remaining-packages' argument, it incorrectly stages
the files for *all* binary packages, copying files from only the
standard DESTDIR. This has the unfortunate consequence of re-staging
the libpolkit-gobject-consolekit-1-0 package, copying the elogind
variant of the library from within debian/tmp rather than the
ConsoleKit variant from debian/install.

-- 
Plasma

---

From: Simon Richter <[email-masked]>
Date: Sat, 27 Sep 2025 10:05:41 +0900

Hi,

On 9/27/25 09:57, Plasma (David Paul) wrote:

> standard DESTDIR.

Is that a Devuan specific change, or is that bug also present in the 
Debian package?

    Simon

---

From: "Plasma (David Paul)" <[email-masked]>
Date: Fri, 26 Sep 2025 20:13:26 -0500

Control: tags -1 patch

Dear Maintainer,

Attached are two patches which fix #911. They can be applied to the
head of the suites/unstable branch in the policykit-1 packaging
repository. Please also consider backporting them into
excalibur-proposed for the upcoming Excalibur release.

-- 
Plasma
From 375408241ad69054800e5d4790915d89b4a59ee4 Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <[email-masked]>
Date: Fri, 26 Sep 2025 16:00:39 -0500
Subject: [PATCH 1/2] refactor: rules: Move ubuntu-specific snippet

dh_auto_install is concerned with copying build artifacts to some
$DESTDIR, usually by running the buildsystem's install command.
dh_install handles copying individual files from a $DESTDIR to
binary-package-specific directories. The ubuntu-specific snippet
fits conceptually in the former category, so move it from
override_dh_install to override_dh_auto_install.
---
 debian/rules | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/debian/rules b/debian/rules
index 8bba501e..ddb2be3c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,6 +80,12 @@ override_dh_auto_install:
 	dh_auto_install
 	dh_auto_install --builddirectory=build-consolekit --destdir=debian/install/consolekit
 
+	# on Debian/Devuan use sudo group; on Ubuntu, also allow the admin group for
+	# historical reasons
+	if dpkg-vendor --is ubuntu; then \
+		install -m644 debian/49-ubuntu-admin.rules debian/tmp/usr/share/polkit-1/rules.d/; \
+	fi
+
 override_dh_install:
 	dh_install \
 	-plibpolkit-gobject-consolekit-1-0       \
@@ -88,9 +94,4 @@ override_dh_install:
 	dh_install -a                           \
 	-Nlibpolkit-gobject-consolekit-1-0
 
-	# on Debian/Devuan use sudo group; on Ubuntu, also allow the admin group for
-	# historical reasons
-	if dpkg-vendor --is ubuntu; then \
-		install -m644 debian/49-ubuntu-admin.rules debian/tmp/usr/share/polkit-1/rules.d/; \
-	fi
 	dh_install
-- 
2.30.2

From d703477bfdabe4b2fae81a748568f3f3acb3032d Mon Sep 17 00:00:00 2001
From: "Plasma (David Paul)" <[email-masked]>
Date: Fri, 26 Sep 2025 20:02:23 -0500
Subject: [PATCH 2/2] Fix override_dh_install target

Closes: #911
---
 debian/changelog | 6 ++++++
 debian/rules     | 5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index dc89fa70..28abc520 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+policykit-1 (126-2devuan2) UNRELEASED; urgency=medium
+
+  * d/rules: Fix override_dh_install target. (Closes: #911)
+
+ -- Plasma (David Paul) <[email-masked]>  Fri, 26 Sep 2025 19:23:41 -0500
+
 policykit-1 (126-2devuan1) unstable; urgency=medium
 
   * Merge tag debian/126-2.
diff --git a/debian/rules b/debian/rules
index ddb2be3c..3d94358b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -91,7 +91,4 @@ override_dh_install:
 	-plibpolkit-gobject-consolekit-1-0       \
 	--sourcedir=debian/install/consolekit
 
-	dh_install -a                           \
-	-Nlibpolkit-gobject-consolekit-1-0
-
-	dh_install
+	dh_install --remaining-packages
-- 
2.30.2

---

From: David Paul <[email-masked]>
Date: Fri, 26 Sep 2025 20:26:47 -0500

On Sat, 27 Sep 2025 10:05:41 +0900
Simon Richter <[email-masked]> wrote:

> > all the remaining binary package which by this point should be all
> > of the arch-independent packages. However, because the command lacks
> > either a '-i' or '--remaining-packages' argument, it incorrectly
> > stages the files for *all* binary packages, copying files from only
> > the standard DESTDIR.  
> 

This is a Devuan-specific issue. Debian is unaffected by this bug, but
may wish to adopt a modified version of the refactor present in the
first of the two patches I submitted to resolve this Devuan issue.
Adapting the refactor patch for Debian may not be worth it though as,
apart from simplifying the second patch in the series, the refactor
patch borders on splitting hairs. See the attached commit message for
details.

-- 
Plasma

---

From: Mark Hindley <[email-masked]>
Date: Mon, 29 Sep 2025 15:21:38 +0100

Plasma,

Thanks for your analysis and care with this.

I prefer to resolve the first of your suggested patches by realigning more
closely with Debian's d/rules.

Mark

commit 2f09bfa62e597cbfb9385e2807c84db05cd68247
Author: Mark Hindley <[email-masked]>
Date:   Mon Sep 29 15:05:08 2025 +0100

    d/rules: reduce unnecessary delta with Debian.

diff --git a/debian/rules b/debian/rules
index 8bba501e..152405ee 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,6 +80,14 @@ override_dh_auto_install:
 	dh_auto_install
 	dh_auto_install --builddirectory=build-consolekit --destdir=debian/install/consolekit
 
+execute_before_dh_install:
+	# on Debian use sudo group; on Ubuntu, also allow the admin group for
+	# on Debian/Devuan use sudo group; on Ubuntu, also allow the admin group for
+	# historical reasons
+	if dpkg-vendor --is ubuntu; then \
+		install -m644 debian/49-ubuntu-admin.rules debian/tmp/usr/share/polkit-1/rules.d/; \
+	fi
+
 override_dh_install:
 	dh_install \
 	-plibpolkit-gobject-consolekit-1-0       \
@@ -88,9 +96,4 @@ override_dh_install:
 	dh_install -a                           \
 	-Nlibpolkit-gobject-consolekit-1-0