1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

x11/hyprlock: adapt to upstream PAM config

This commit is contained in:
Jan Beich 2024-03-02 00:54:46 +01:00
parent d2f834ba51
commit edc1fa3267
4 changed files with 21 additions and 25 deletions

View File

@ -3,6 +3,9 @@ DISTVERSIONPREFIX= v
DISTVERSION= 0.1.0
CATEGORIES= x11 wayland
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES+= fa2a875e339a.patch:-p1 # https://github.com/hyprwm/hyprlock/pull/115
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Hyprland's GPU-accelerated screen locking utility #'
WWW= https://github.com/hyprwm/hyprlock
@ -37,10 +40,6 @@ LIB_DEPENDS+= libdate-tz.so:devel/date
USES+= localbase:ldflags
.endif
post-install:
${INSTALL_DATA} ${WRKSRC}/pam/${PORTNAME} \
${STAGEDIR}${PREFIX}/etc/pam.d/${PORTNAME}
# XXX Drop after FreeBSD 13.2 EOL around 2024-05-01 (don't forget distinfo)
.if ${CXX} == c++ && exists(/usr/lib/libc++.so)
.if !exists(/usr/include/c++/v1/expected) || make(makesum) || make(fetch)

View File

@ -3,3 +3,5 @@ SHA256 (hyprwm-hyprlock-v0.1.0_GH0.tar.gz) = 5d0e6547ac073c78e95d4f086a258e1e571
SIZE (hyprwm-hyprlock-v0.1.0_GH0.tar.gz) = 49582
SHA256 (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = b5a9ff1793b1e2d388a3819bf35797002b1d2e40bb35a10c65605e0ea1435271
SIZE (llvm-llvm-project-llvmorg-16.0.1_GH0.tar.gz) = 179289803
SHA256 (fa2a875e339a.patch) = 51dea8716b4b2b0371b0380e904f9fd0d7b0a35d5527dbe52c0fb86831ea0871
SIZE (fa2a875e339a.patch) = 1973

View File

@ -1,21 +0,0 @@
"su" has "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 1970-01-01 00:00:00 UTC
+++ pam/hyprlock
@@ -0,0 +1 @@
+auth include unix-selfauth
--- src/core/Password.cpp.orig 2024-02-23 21:29:08 UTC
+++ src/core/Password.cpp
@@ -30,7 +30,7 @@ std::shared_ptr<CPassword::SVerificationResult> CPassw
const pam_conv localConv = {conv, NULL};
pam_handle_t* handle = NULL;
- int ret = pam_start("su", getlogin(), &localConv, &handle);
+ int ret = pam_start("hyprlock", getlogin(), &localConv, &handle);
if (ret != PAM_SUCCESS) {
result->success = false;

View File

@ -0,0 +1,16 @@
"login" has "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