Adding a pam configuration file (#115)

This commit is contained in:
Aaron Blasko 2024-03-02 00:49:44 +01:00 committed by GitHub
parent 64bdc477b2
commit fa2a875e33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 2 deletions

View File

@ -22,6 +22,8 @@ include_directories(
"protocols/" "protocols/"
) )
include(GNUInstallDirs)
# configure # configure
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
@ -80,3 +82,6 @@ protocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml" "linux-dmabuf-unst
# Installation # Installation
install(TARGETS hyprlock) install(TARGETS hyprlock)
install(FILES "pam/hyprlock" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d")

5
pam/hyprlock Normal file
View File

@ -0,0 +1,5 @@
# PAM configuration file for hyprlock
# the 'login' configuration file (see /etc/pam.d/login)
auth include login

View File

@ -30,7 +30,7 @@ std::shared_ptr<CPassword::SVerificationResult> CPassword::verify(const std::str
const pam_conv localConv = {conv, NULL}; const pam_conv localConv = {conv, NULL};
pam_handle_t* handle = 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) { if (ret != PAM_SUCCESS) {
result->success = false; result->success = false;
@ -63,4 +63,4 @@ std::shared_ptr<CPassword::SVerificationResult> CPassword::verify(const std::str
}).detach(); }).detach();
return result; return result;
} }