Commit 8fd515e0 authored by Julius Goryavsky's avatar Julius Goryavsky

HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix

Compilation correction after MDEV-33420.
parent 3f9f5ca4
FIND_PACKAGE(CURL)
IF(NOT CURL_FOUND)
# Can't build plugin
MESSAGE_ONCE(WARNING "Hashicorp Key Management plugin requires curl development package")
RETURN()
ENDIF()
SET_PACKAGE_PROPERTIES(CURL PROPERTIES TYPE REQUIRED)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
set(CPACK_RPM_hashicorp-key-management_PACKAGE_SUMMARY "Hashicorp Key Management plugin for MariaDB" PARENT_SCOPE)
set(CPACK_RPM_hashicorp-key-management_PACKAGE_DESCRIPTION "This encryption plugin uses Hashicorp Vault for storing encryption
keys for MariaDB Data-at-Rest encryption." PARENT_SCOPE)
MYSQL_ADD_PLUGIN(HASHICORP_KEY_MANAGEMENT
hashicorp_key_management_plugin.cc
LINK_LIBRARIES CURL::libcurl
LINK_LIBRARIES ${CURL_LIBRARIES}
CONFIG hashicorp_key_management.cnf
COMPONENT hashicorp-key-management
MODULE_ONLY)
......
......@@ -987,7 +987,11 @@ int HCData::init ()
bool not_equal= token_env != NULL && strcmp(token_env, token) != 0;
if (token_env == NULL || not_equal)
{
setenv("VAULT_TOKEN", token, 1);
#if defined(HAVE_SETENV) || !defined(_WIN32)
setenv("VAULT_TOKEN", token, 1);
#else
_putenv_s("VAULT_TOKEN", token);
#endif
if (not_equal)
{
my_printf_error(ER_UNKNOWN_ERROR, PLUGIN_ERROR_HEADER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment