Repository navigation
Fix KDE screen unlock and harden IPC, configuration, and packaging - #74
Merged
Merged
Conversation
…plementations - Updated documentation for KDE lock screen empty token injection (ADR 0005) - Documented check-kde CLI tool and configuration options - Micro-optimized AuthEngine's lockout map with std::map and transparent comparators (std::less<>) to eliminate std::string allocations on authentication - Pre-allocated std::string memory using fseek/ftell in scan_file to eliminate dynamic reallocation and loops during PAM stack scanning - Applied [[nodiscard]] to pure logic functions in kde_lockscreen.hpp and pam_config.hpp - Added physical shutter warning to IR camera troubleshooting guide
…kaging, and auth policies
…used-const-variable
…, and service hardening
- Proximity disconnect fail-safe revoking presence on read errors - Strict config parser syntax validation and stream error checking - Independent lock actions timer and deadline worker decoupled from camera loop - Correct threshold documentation in config and man pages - Script setup error recovery with early trap registration - Unified whitespace trimming via split_trimmed helper - Multi-camera policy outcome matrix covering all permutations - Relocate CPack conffiles out of debian/ to avoid duplicate conffile warnings - Deduplicate file descriptors, socket clients, user lookups, and embedding JSON helpers
- Replace unchecked json and vector operator[] indexing with .at(), .front(), and structured bindings - Replace magic numbers with named constants for timeouts, brightness, confidence, and umask - Remove unused array and charconv header includes - Use character literal for single-char string append
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves screen unlock usability issues on KDE Plasma (supporting both Plasma 5 and Plasma 6 with
pam_kwallet5.so/pam_kwallet6.so), and hardens the daemon, PAM module, CLI, and packaging against edge-case failures, hardware disconnects, blocking tasks, malformed configurations, and conffile conflicts.Key Changes
KDE Plasma Screen Unlock & KWallet Integration
PAM_SERVICE == "kde") and inspects the PAM stack forpam_kwallet5.soorpam_kwallet6.so.auto/single_entermode, injects an empty authtok (PAM_AUTHTOK = "") upon successful face authentication if unset. This prevents KWallet from double-prompting for a password while preserving password authentication fallback.Proximity Sensor Disconnect Fail-Safe
PresenceTripwire::poll_loop: explicitly invokes the presence callback with(false, 0)upon HID read errors or sensor disconnection.ReadErrorRevokesPreviouslyReportedPresence.Strict Configuration Parsing & Fail-Closed Loading
config_parser.hpp: rejects unclosed section headers, unterminated quotes, and unexpected non-comment tokens.badbit) and rejected directory inputs as configuration paths.config/config.inianddocs/man/linuxcampam.conf.5.mdto reflect that higher threshold values are stricter (score >= threshold).split_trimmed.Independent Lock Timer & Asynchronous Deadline Workers
PresenceActions: evaluates walk-away session locking on an independent thread timer decoupled from synchronoushandle_client()request processing.DeadlineWorker: guarantees cooperative cancellation and monotonic deadline bounds on blocking operations.poll()andMSG_DONTWAIT/MSG_NOSIGNALto eliminate Slowloris hangs.Authentication Policy Permutation Coverage
STRICT_ALL,ADAPTIVE, andLENIENT_ANYpolicies inAuthEngine.MultiCameraPolicyOutcomeMatrixtest suite exercising 432 permutations across policies, mandatory camera flags, and outcomes (success, capture failure, darkness, face not found).KDE Setup Script Reliability
scripts/setup_config.sh, encapsulated immutable operations in a subshell with anEXITtrap registered beforemktempor attribute mutation. Guaranteeschattr +irestoration under all exit paths includingset -e.tests/test_setup_config.py.Debian Packaging & Lifecycle Testing
packaging/cpack/conffilesoutside of debhelper's discovereddebian/directory, resolving duplicate/etc/linuxcampam/config.iniregistration warnings fromdh_installdeb.tests/debian_lifecycle_container.sh) covering install, upgrade, remove, and purge.Code Deduplication & Architecture Refactoring
src/common/resources.hpp: unified RAIIFileDescriptorandFileCloser.src/common/socket_client.hpp: unified UNIX domain socket client connection with monotonic timeout.src/common/user_lookup.hpp: unified safe dynamic buffergetpwnam_rusername lookup.may_access_user().embeddingArray().C++ Core Guidelines & Bounds Safety
operator[]indexing with bounds-safe.at(),.front(), and C++17 structured bindings.kMaxBrightness,kMaxConfidence,kPrivateFileUmask,kDefaultCmdTimeoutMs,kLongCmdTimeoutMs).<array>,<charconv>).Type of change
How Has This Been Tested?
tests/test_setup_config.pypassing (trap registration and attribute rollback).linuxcampam_tests): 161 tests passing (100%), including 432-permutation policy matrix, deadline workers, presence tripwire fail-safe, and independent lock timers.pam_integration_tests): 9 tests passing (100%), verifying KDE single-enter flow and KWallet authtok handling.tests/test_debian_lifecycle.shpassing with clean conffiles metadata.Checklist