mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +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/"
|
"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
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};
|
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;
|
||||||
|
|
Loading…
Reference in a new issue