Control: tags -1 + patch

Hi,

On Tue, 14 Mar 2023 00:20:10 +0100 Andreas Beckmann <a...@debian.org> wrote:
>
> Hi,
>
> during a test with piuparts I noticed your package failed to install
> because it tries to overwrite other packages files.
>
> From the attached log (scroll to the bottom...):
>
> https://ci.debian.net/data/autopkgtest/testing/amd64/p/phog/32130044/log.gz
>
> Preparing to unpack .../phog_0.1.3-1_amd64.deb ...
> Unpacking phog (0.1.3-1) ...
> dpkg: error processing archive /var/cache/apt/archives/phog_0.1.3-1_amd64.deb (--unpack): > trying to overwrite '/etc/pam.d/greetd', which is also in package greetd 0.9.0-2
> Errors were encountered while processing:
> /var/cache/apt/archives/phog_0.1.3-1_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
>
> greetd recently started to ship /etc/pam.d/greetd (with different
> content) itself.

Thanks for the heads-up!

I have a pending MR for fixing this bug on phog's side (see https://salsa.debian.org/DebianOnMobile-team/phog/-/merge_requests/5), however this would require small changes to greetd as well (+cc duck for that matter) to ensure users don't end up in a messed up situation.

I opened a MR on salsa's greetd (https://salsa.debian.org/debian/greetd/-/merge_requests/1), attaching the corresponding patches here as well for completeness.

@duck, any comment on the above?

Cheers,
Arnaud

>
>
> cheers,
>
> Andreas
>
>
From eca07bda4c0b272ded196008c3d4528c756f5bb6 Mon Sep 17 00:00:00 2001
From: Arnaud Ferraris <arnaud.ferra...@collabora.com>
Date: Wed, 15 Mar 2023 13:51:11 +0100
Subject: [PATCH 1/3] debian: update PAM config(s)

Except for the gnome-keyring bits, all items currently set in the
`greetd` PAM config are already part of the `login` config. Including
the latter makes the `greetd` config simpler.

This commit also calls the PAM modules needed for unlocking the KDE
wallet as well, and adds the `greetd-greeter` config (simply including
`login` as the greeter itself doesn't need to deal with keyrings).

Finally, switch to using debhelper for installing the configs instead of
handling those manually.
---
 debian/greetd.greetd-greeter.pam |  2 ++
 debian/greetd.greetd.pam         |  8 ++++++++
 debian/greetd.install            |  1 -
 debian/pam.d/greetd              | 22 ----------------------
 debian/rules                     |  5 ++++-
 5 files changed, 14 insertions(+), 24 deletions(-)
 create mode 100644 debian/greetd.greetd-greeter.pam
 create mode 100644 debian/greetd.greetd.pam
 delete mode 100644 debian/pam.d/greetd

diff --git a/debian/greetd.greetd-greeter.pam b/debian/greetd.greetd-greeter.pam
new file mode 100644
index 0000000..1ed7162
--- /dev/null
+++ b/debian/greetd.greetd-greeter.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+@include login
diff --git a/debian/greetd.greetd.pam b/debian/greetd.greetd.pam
new file mode 100644
index 0000000..7f2a906
--- /dev/null
+++ b/debian/greetd.greetd.pam
@@ -0,0 +1,8 @@
+#%PAM-1.0
+@include login
+
+-auth        optional        pam_gnome_keyring.so
+-auth        optional        pam_kwallet5.so
+
+-session     optional        pam_gnome_keyring.so auto_start
+-session     optional        pam_kwallet5.so auto_start
diff --git a/debian/greetd.install b/debian/greetd.install
index 0a3fbfb..83f2dad 100644
--- a/debian/greetd.install
+++ b/debian/greetd.install
@@ -1,4 +1,3 @@
 greetd.service /lib/systemd/system/
 config.toml /etc/greetd/
 debian/needrestart/50_greetd.conf /etc/needrestart/conf.d/
-debian/pam.d/greetd /etc/pam.d/
diff --git a/debian/pam.d/greetd b/debian/pam.d/greetd
deleted file mode 100644
index 062217b..0000000
--- a/debian/pam.d/greetd
+++ /dev/null
@@ -1,22 +0,0 @@
-#%PAM-1.0
-
-# Block login if they are globally disabled
-auth      requisite pam_nologin.so
-
-# Load environment from /etc/environment and ~/.pam_environment
-session      required pam_env.so readenv=1
-session      required pam_env.so readenv=1 envfile=/etc/default/locale
-
-@include common-auth
-
--auth  optional pam_gnome_keyring.so
-
-@include common-account
-
-session  required        pam_limits.so
-session  required        pam_loginuid.so
-@include common-session
-
--session optional        pam_gnome_keyring.so auto_start
-
-@include common-password
diff --git a/debian/rules b/debian/rules
index 523b72b..1c1d9c5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,10 +30,13 @@ execute_after_dh_install:
 	# bad perms
 	chmod a-x debian/greetd/lib/systemd/system/greetd.service
 
+override_dh_installpam:
+	dh_installpam --name=greetd
+	dh_installpam --name=greetd-greeter
+
 override_dh_installsystemd:
 	dh_installsystemd --no-stop-on-upgrade --no-start
 
 execute_after_dh_auto_clean:
 	make -C man clean
 	rm -f debian/cargo-checksum.json
-
-- 
2.39.1

From be90d0cb662cf94de32bbb95f9070a6127b25bef Mon Sep 17 00:00:00 2001
From: Arnaud Ferraris <arnaud.ferra...@collabora.com>
Date: Wed, 15 Mar 2023 13:52:39 +0100
Subject: [PATCH 2/3] d/control: break/replace older `phog`

`phog` used to ship the `greetd` and `greetd-greeter` PAM configs,
leading to conflicts with the latest version of the `greetd` package.
This commit ensures we avoid this conflict and maintain a clean
upgrade path for both those packages.
---
 debian/control | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 98466f4..c5d8cb6 100644
--- a/debian/control
+++ b/debian/control
@@ -35,7 +35,8 @@ Depends:
  adduser
 Provides: x-display-manager
 Suggests: wlgreet
+Breaks: phog (<< 0.1.3-2)
+Replaces: phog (<< 0.1.3-2)
 Description: minimal Wayland login manager
  greetd is a minimal and flexible login manager daemon that makes no
  assumptions about what you want to launch.
-
-- 
2.39.1

Reply via email to