2023-09-19 11:33:51 +10:00
|
|
|
|
|
|
|
IF(PLUGIN_CRACKLIB_PASSWORD_CHECK STREQUAL "NO")
|
|
|
|
ADD_FEATURE_INFO(CRACKLIB_PASSWORD_CHECK "OFF" "CrackLib Password Validation Plugin")
|
|
|
|
RETURN()
|
|
|
|
ENDIF()
|
|
|
|
|
2014-11-25 21:48:13 +01:00
|
|
|
INCLUDE (CheckIncludeFiles)
|
|
|
|
INCLUDE (CheckLibraryExists)
|
|
|
|
|
2023-05-30 16:08:41 +02:00
|
|
|
SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB server" PARENT_SCOPE)
|
2021-11-22 19:34:47 +07:00
|
|
|
SET(CPACK_RPM_cracklib-password-check_PACKAGE_DESCRIPTION "This password validation plugin uses cracklib to allow only
|
2023-05-30 16:08:41 +02:00
|
|
|
sufficiently secure (as defined by cracklib) user passwords in MariaDB server." PARENT_SCOPE)
|
2021-11-22 19:34:47 +07:00
|
|
|
|
2014-11-25 21:48:13 +01:00
|
|
|
CHECK_LIBRARY_EXISTS(crack FascistCheckUser "" HAVE_LIBCRACK)
|
2015-02-12 12:26:37 +01:00
|
|
|
|
2015-02-16 23:18:32 +01:00
|
|
|
SET(CMAKE_REQUIRED_DEFINITIONS -Dsize_t=int) # debian hack, debian bug.
|
|
|
|
CHECK_INCLUDE_FILES (crack.h HAVE_CRACK_H)
|
|
|
|
|
2014-11-25 21:48:13 +01:00
|
|
|
IF (HAVE_ALLOCA_H AND HAVE_CRACK_H AND HAVE_LIBCRACK AND HAVE_MEMCPY)
|
2015-02-12 12:26:37 +01:00
|
|
|
MYSQL_ADD_PLUGIN(cracklib_password_check cracklib_password_check.c
|
2015-02-16 23:18:32 +01:00
|
|
|
LINK_LIBRARIES crack MODULE_ONLY
|
|
|
|
COMPONENT cracklib-password-check)
|
2019-01-24 23:30:11 -05:00
|
|
|
|
|
|
|
IF (RPM)
|
|
|
|
SET(inst_location ${INSTALL_SUPPORTFILESDIR})
|
|
|
|
INSTALL(DIRECTORY policy DESTINATION ${inst_location} COMPONENT cracklib-password-check)
|
|
|
|
FIND_PROGRAM(CHECKMODULE checkmodule)
|
|
|
|
FIND_PROGRAM(SEMODULE_PACKAGE semodule_package)
|
|
|
|
MARK_AS_ADVANCED(CHECKMODULE SEMODULE_PACKAGE)
|
|
|
|
|
|
|
|
# Build pp files in policy/selinux
|
|
|
|
IF(CHECKMODULE AND SEMODULE_PACKAGE)
|
|
|
|
FOREACH(pol mariadb-plugin-cracklib-password-check)
|
|
|
|
SET(src ${CMAKE_CURRENT_SOURCE_DIR}/policy/selinux/${pol}.te)
|
2024-01-26 01:33:28 +00:00
|
|
|
SET(tmp ${CMAKE_CURRENT_BINARY_DIR}/${pol}.mod)
|
2019-01-24 23:30:11 -05:00
|
|
|
SET(out ${CMAKE_CURRENT_BINARY_DIR}/${pol}.pp)
|
|
|
|
ADD_CUSTOM_COMMAND(OUTPUT ${out}
|
|
|
|
COMMAND ${CHECKMODULE} -M -m ${src} -o ${tmp}
|
|
|
|
COMMAND ${SEMODULE_PACKAGE} -m ${tmp} -o ${out}
|
2024-01-26 01:33:28 +00:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove ${tmp}
|
2019-01-24 23:30:11 -05:00
|
|
|
DEPENDS ${src})
|
|
|
|
ADD_CUSTOM_TARGET(${pol}-pp ALL DEPENDS ${out})
|
|
|
|
INSTALL(FILES ${out} DESTINATION ${inst_location}/policy/selinux COMPONENT cracklib-password-check)
|
|
|
|
ENDFOREACH()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
2014-11-25 21:48:13 +01:00
|
|
|
ENDIF()
|