Skip to content

Commit

Permalink
added a pam configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
alba4k committed Mar 1, 2024
1 parent a7ec195 commit d134d39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ protocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml" "linux-dmabuf-unst

# Installation
install(TARGETS hyprlock)

install(FILES "pam/hyprlock" DESTINATION "/etc/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 d134d39

Please sign in to comment.