Skip to content

Commit 9325ff4

Browse files
committed
systemd: Add overlay for systemd to change token prompts type
Use PAM_TEXT_INFO for security token prompts in systemd-homed. The prompts for security token interaction were previously sent as error messages. This commit changes them to informational messages. Additionally, the unused patch for a soft-lock in cosmic-greeter has been removed. Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
1 parent 9ef379b commit 9325ff4

File tree

5 files changed

+63
-108
lines changed

5 files changed

+63
-108
lines changed

REUSE.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ path = [
3434
"overlays/custom-packages/cosmic/cosmic-greeter/0001-Replace-fallback-background-with-Ghaf-default.patch",
3535
"overlays/custom-packages/cosmic/cosmic-applets/*.patch",
3636
"overlays/custom-packages/system76-scheduler/0001-fix-add-missing-loop-in-process-scheduler-refresh-ta.patch",
37-
"overlays/custom-packages/cosmic/cosmic-greeter/0001-Fix-softlock.patch",
3837
"overlays/custom-packages/cosmic/cosmic-greeter/0002-fix-username-handle-empty-usernames.patch",
3938
"modules/secureboot/keys/*",
40-
"modules/hardware/passthrough/pci-acs-override/0001-pci-add-pcie_acs_override-for-pci-passthrough.patch"
39+
"modules/hardware/passthrough/pci-acs-override/0001-pci-add-pcie_acs_override-for-pci-passthrough.patch",
40+
"overlays/custom-packages/systemd/0001-pam_systemd_home-Use-PAM_TEXT_INFO-for-token-prompts.patch"
4141
]
4242

4343
[[annotations]]

overlays/custom-packages/cosmic/cosmic-greeter/0001-Fix-softlock.patch

Lines changed: 0 additions & 106 deletions
This file was deleted.

overlays/custom-packages/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
osquery-with-hostname = import ./osquery-with-hostname { inherit prev; };
2121
papirus-icon-theme = import ./papirus-icon-theme { inherit prev; };
2222
qemu_kvm = import ./qemu { inherit final prev; };
23+
systemd = import ./systemd { inherit prev; };
2324
tpm2-pkcs11 = import ./tpm2-pkcs11 { inherit prev; };
2425
tpm2-tools = import ./tpm2-tools { inherit prev; };
2526
xdg-desktop-portal-cosmic = import ./cosmic/xdg-desktop-portal-cosmic { inherit prev; };
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
From cb64146ec7de1bec4079c53895e8e38a59b131b3 Mon Sep 17 00:00:00 2001
2+
From: Vunny Sodhi <vunny.sodhi@unikie.com>
3+
Date: Wed, 21 Jan 2026 13:21:25 +0200
4+
Subject: [PATCH] pam_systemd_home: Use PAM_TEXT_INFO for token prompts
5+
6+
The prompts asking the user to physically authenticate
7+
or confirm presence on a security token are informational
8+
requests for action, not error conditions.
9+
10+
This commit changes the message type to PAM_TEXT_INFO,
11+
which is more appropriate for guiding the user through
12+
the authentication process.
13+
14+
Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
15+
---
16+
src/home/pam_systemd_home.c | 6 +++---
17+
1 file changed, 3 insertions(+), 3 deletions(-)
18+
19+
diff --git a/src/home/pam_systemd_home.c b/src/home/pam_systemd_home.c
20+
index 78cd06b8e8..a56af7838f 100644
21+
--- a/src/home/pam_systemd_home.c
22+
+++ b/src/home/pam_systemd_home.c
23+
@@ -438,7 +438,7 @@ static int handle_generic_user_record_error(
24+
25+
assert(secret);
26+
27+
- (void) pam_prompt_graceful(handle, PAM_ERROR_MSG, NULL, _("Please authenticate physically on security token of user %s."), user_name);
28+
+ (void) pam_prompt_graceful(handle, PAM_TEXT_INFO, NULL, _("Please authenticate physically on security token of user %s."), user_name);
29+
30+
r = user_record_set_pkcs11_protected_authentication_path_permitted(secret, true);
31+
if (r < 0)
32+
@@ -449,7 +449,7 @@ static int handle_generic_user_record_error(
33+
34+
assert(secret);
35+
36+
- (void) pam_prompt_graceful(handle, PAM_ERROR_MSG, NULL, _("Please confirm presence on security token of user %s."), user_name);
37+
+ (void) pam_prompt_graceful(handle, PAM_TEXT_INFO, NULL, _("Please confirm presence on security token of user %s."), user_name);
38+
39+
r = user_record_set_fido2_user_presence_permitted(secret, true);
40+
if (r < 0)
41+
@@ -460,7 +460,7 @@ static int handle_generic_user_record_error(
42+
43+
assert(secret);
44+
45+
- (void) pam_prompt_graceful(handle, PAM_ERROR_MSG, NULL, _("Please verify user on security token of user %s."), user_name);
46+
+ (void) pam_prompt_graceful(handle, PAM_TEXT_INFO, NULL, _("Please verify user on security token of user %s."), user_name);
47+
48+
r = user_record_set_fido2_user_verification_permitted(secret, true);
49+
if (r < 0)
50+
--
51+
2.52.0
52+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-FileCopyrightText: 2022-2026 TII (SSRC) and the Ghaf contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
{ prev }:
4+
prev.systemd.overrideAttrs (oldAttrs: {
5+
patches = oldAttrs.patches ++ [
6+
./0001-pam_systemd_home-Use-PAM_TEXT_INFO-for-token-prompts.patch
7+
];
8+
})

0 commit comments

Comments
 (0)