Skip to content

Commit

Permalink
Adding a pam configuration file (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
alba4k authored Mar 1, 2024
1 parent 64bdc47 commit fa2a875
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 changes: 5 additions & 0 deletions pam/hyprlock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PAM configuration file for hyprlock
# the 'login' configuration file (see /etc/pam.d/login)

auth include login

4 changes: 2 additions & 2 deletions src/core/Password.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -63,4 +63,4 @@ std::shared_ptr<CPassword::SVerificationResult> CPassword::verify(const std::str
}).detach();

return result;
}
}

0 comments on commit fa2a875

Please sign in to comment.