A read-only mirror of https://github.com/hyprwm/hyprlock
Find a file
Maximilian Seidler 768ade88a8
pam: get username once (#974)
* pam: fix username race by using getpwuid_r instead of getpwuid

getpwuid() returns a pointer into a static buffer shared across all
threads. Any getpw*/getpwent call from another thread — including
those made internally by PAM modules during authentication — will
overwrite it before pam_start() reads pw_name, causing hyprlock to
authenticate as a random system user (root, bin, systemd-network)
or fail with 'user unknown'.

Replace with getpwuid_r(), which writes into a caller-supplied buffer,
and copy pw_name into a std::string before calling pam_start().

* pam: get username once

Instead of retrieving the username via getpwuid_r as in a69f526c95,
get the username once when initializing CPam and save it in a string.
This should be sufficent for making sure there are no problems with the
static buffer returned by getpwuid and is simpler.

* misc: clang-format

---------

Co-authored-by: mcgi5sr2 <mcgi5sr2@gmail.com>
2026-03-23 16:21:13 +00:00
.github CI/Nix: add cache-nix-action 2025-06-20 01:25:18 +03:00
assets example: Add config location hint to help new users (#771) 2025-05-09 18:54:54 +02:00
nix nix: separate overlay with deps 2026-03-02 18:30:57 +02:00
pam Adding a pam configuration file (#115) 2024-03-02 01:49:44 +02:00
protocols background: add screenshot 2024-02-21 21:39:14 +00:00
src pam: get username once (#974) 2026-03-23 16:21:13 +00:00
.clang-format core: initial commit 2024-02-18 23:08:03 +00:00
.clang-tidy clang-tidy: fix some errors (#751) 2025-04-21 20:17:15 +02:00
.gitignore core: fix background screenshot on nvidia (#656) 2025-01-24 14:25:37 +01:00
CMakeLists.txt animation: migrate PHLANIMVAR from SP to UP (#920) 2025-12-10 09:15:39 +00:00
flake.lock flake.lock: update 2026-03-02 18:31:14 +02:00
flake.nix nix: separate overlay with deps 2026-03-02 18:30:57 +02:00
LICENSE Initial commit 2024-02-18 16:10:12 +00:00
README.md misc: remove hyprland-protocols from README (#887) 2025-10-04 10:07:28 +00:00
VERSION version: bump to 0.9.3 2026-03-22 21:58:05 +00:00

hyprlock

Hyprland's simple, yet multi-threaded and GPU-accelerated screen locking utility.

Features

  • Uses the ext-session-lock protocol
  • Support for fractional-scale
  • Fully GPU accelerated
  • Multi-threaded resource acquisition
  • Blurred screenshot as the background
  • Native fingerprint support (using libfprint's dbus interface)
  • Some of Hyprland's eyecandy: gradient borders, blur, animations, shadows, etc.
  • and more...

How it looks

Docs / Configuration

See the wiki

Arch install

pacman -S hyprlock # binary x86 tagged release
# or
yay -S hyprlock-git # compiles from latest source

Building

Deps

You need the following dependencies

  • cairo
  • hyprgraphics
  • hyprlang
  • hyprutils
  • hyprwayland-scanner
  • mesa (required is libgbm, libdrm and the opengl runtime)
  • pam
  • pango
  • sdbus-cpp (>= 2.0.0)
  • wayland-client
  • wayland-protocols
  • xkbcommon

Sometimes distro packages are missing required development files. Such distros usually offer development versions of library package - commonly suffixed with -devel or -dev.

Building

Building:

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -S . -B ./build
cmake --build ./build --config Release --target hyprlock -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`

Installation:

sudo cmake --install build