Skip to content

Commit

Permalink
HASHICORP_KEY_MANAGEMENT: MDEV-33420 post-fix
Browse files Browse the repository at this point in the history
Compilation correction after MDEV-33420.
  • Loading branch information
sysprg committed Apr 20, 2024
1 parent 3f9f5ca commit 8fd515e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion plugin/hashicorp_key_management/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fd515e

Please sign in to comment.