mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 05:19:48 +01:00
Adding a pam configuration file (#115)
This commit is contained in:
parent
64bdc477b2
commit
fa2a875e33
3 changed files with 12 additions and 2 deletions
|
@ -22,6 +22,8 @@ include_directories(
|
|||
"protocols/"
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# configure
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
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
|
||||
install(TARGETS hyprlock)
|
||||
|
||||
install(FILES "pam/hyprlock" DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/pam.d")
|
||||
|
||||
|
|
5
pam/hyprlock
Normal file
5
pam/hyprlock
Normal file
|
@ -0,0 +1,5 @@
|
|||
# PAM configuration file for hyprlock
|
||||
# the 'login' configuration file (see /etc/pam.d/login)
|
||||
|
||||
auth include login
|
||||
|
|
@ -30,7 +30,7 @@ std::shared_ptr<CPassword::SVerificationResult> CPassword::verify(const std::str
|
|||
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;
|
||||
|
@ -63,4 +63,4 @@ std::shared_ptr<CPassword::SVerificationResult> CPassword::verify(const std::str
|
|||
}).detach();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue