From 6e3b38286d3b4953033fe7a1c776d20f06de1cd7 Mon Sep 17 00:00:00 2001 From: hanjinpeng Date: Sun, 2 Jun 2024 17:42:17 +0800 Subject: vncpasswd add password complexity rule check to enhance security Use the library pwquality to check password complexity and improve security. Additionally, optional enable support is also set in CMake. --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ba6b3203..8e797f8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -324,6 +324,20 @@ if(UNIX AND NOT APPLE) endif() endif() +# check for password pwquality check support +option(ENABLE_PWQUALITY "Enable password pwquality check" ON) +if(ENABLE_PWQUALITY) + if(UNIX) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PWQUALITY pwquality) + if(PWQUALITY_FOUND) + add_definitions(-DHAVE_PWQUALITY) + endif() + endif() + endif() +endif() + # Generate config.h and make sure the source finds it configure_file(config.h.in config.h) add_definitions(-DHAVE_CONFIG_H) -- cgit v1.2.3