summaryrefslogtreecommitdiff
path: root/x11/hyprlock/files/patch-pam_hyprlock
blob: 864ba47ea5b2977a0460cc9300d893a88336e2cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"login" and "su" have "auth sufficient pam_self.so" but a screen
locker is supposed to ask for password regardless.

pam_unix(8) requires root priveleges to access master.passwd(5),
so try authenticating via setuid helper first.

--- pam/hyprlock.orig	2024-03-01 23:49:44 UTC
+++ pam/hyprlock
@@ -1,5 +1,4 @@
-# PAM configuration file for hyprlock
-# the 'login' configuration file (see /etc/pam.d/login)
+# PAM configuration for hyprlock. Only uses auth facilities.
 
-auth        include     login
+auth        include     unix-selfauth
 
--- src/core/Auth.cpp.orig	2024-07-05 20:58:45 UTC
+++ src/core/Auth.cpp
@@ -56,11 +56,6 @@ CAuth::CAuth() {
 CAuth::CAuth() {
     static auto* const PPAMMODULE = (Hyprlang::STRING*)(g_pConfigManager->getValuePtr("general:pam_module"));
     m_sPamModule                  = *PPAMMODULE;
-
-    if (!std::filesystem::exists(std::filesystem::path("/etc/pam.d/") / m_sPamModule)) {
-        Debug::log(ERR, "Pam module \"/etc/pam.d/{}\" does not exist! Falling back to \"/etc/pam.d/su\"", m_sPamModule);
-        m_sPamModule = "su";
-    }
 }
 
 static void passwordCheckTimerCallback(std::shared_ptr<CTimer> self, void* data) {