diff --git a/lib/core/include/irods/getRodsEnv.h b/lib/core/include/irods/getRodsEnv.h index 263ed82ba0..bcf0248224 100644 --- a/lib/core/include/irods/getRodsEnv.h +++ b/lib/core/include/irods/getRodsEnv.h @@ -55,13 +55,19 @@ typedef struct RodsEnvironment { // =-=-=-=-=-=-=- // override of plugin installation directory - char irodsPluginHome[MAX_NAME_LEN]; + __attribute__((deprecated("Use irodsPluginDirectory"))) char irodsPluginHome[MAX_NAME_LEN]; + // TODO Hmm, adding a new member will result in an ABI break. Users will have to + // recompile their C/C++ clients. If we don't add the new member, then users can't + // migrate their clients to the new variable. // =-=-=-=-=-=-=- // TCP keepalive configurations int tcp_keepalive_intvl; int tcp_keepalive_probes; int tcp_keepalive_time; + + // TODO This will result in an ABI break. + char irodsPluginDirectory[MAX_NAME_LEN]; } rodsEnv; #ifdef __cplusplus diff --git a/lib/core/include/irods/irods_configuration_keywords.hpp b/lib/core/include/irods/irods_configuration_keywords.hpp index 35eb6ad789..baad199fd6 100644 --- a/lib/core/include/irods/irods_configuration_keywords.hpp +++ b/lib/core/include/irods/irods_configuration_keywords.hpp @@ -168,7 +168,8 @@ namespace irods extern const char* const KW_CFG_SERVICE_ROLE_CONSUMER; extern const char* const KW_CFG_SERVICE_ROLE_PROXY; - extern const char* const KW_CFG_IRODS_PLUGINS_HOME; + [[deprecated("Use KW_CFG_PLUGIN_CONFIGURATION")]] extern const char* const KW_CFG_IRODS_PLUGINS_HOME; + extern const char* const KW_CFG_IRODS_PLUGIN_DIRECTORY; extern const char* const KW_CFG_PLUGIN_CONFIGURATION; diff --git a/lib/core/src/getRodsEnv.cpp b/lib/core/src/getRodsEnv.cpp index c6677f0dec..c6ecb587af 100644 --- a/lib/core/src/getRodsEnv.cpp +++ b/lib/core/src/getRodsEnv.cpp @@ -348,8 +348,13 @@ extern "C" { irods::KW_CFG_IRODS_CONNECTION_POOL_REFRESH_TIME, _env->irodsConnectionPoolRefreshTime ); - // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay) - capture_string_property(irods::KW_CFG_IRODS_PLUGINS_HOME, _env->irodsPluginHome, MAX_NAME_LEN); + capture_string_property(irods::KW_CFG_IRODS_PLUGIN_DIRECTORY, _env->irodsPluginHome, MAX_NAME_LEN); + + // If the "plugin_directory" is configured, ignore "plugins_home". + if (std::strlen(_env->irodsPluginHome) == 0) { + // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay) + capture_string_property(irods::KW_CFG_IRODS_PLUGINS_HOME, _env->irodsPluginHome, MAX_NAME_LEN); + } // If the configuration is not set for the TCP keepalive options, set the value to something invalid. This // indicates that we should not set the option on the socket, which will allow the socket to use the kernel @@ -642,10 +647,14 @@ extern "C" { env_var, _env->irodsTransBufferSizeForParaTrans ); - env_var = irods::KW_CFG_IRODS_PLUGINS_HOME; - capture_string_env_var( - env_var, - _env->irodsPluginHome ); + env_var = irods::KW_CFG_IRODS_PLUGIN_DIRECTORY; + capture_string_env_var(env_var, _env->irodsPluginHome); + + // If the "plugin_directory" is configured, ignore "plugins_home". + if (std::strlen(_env->irodsPluginHome) == 0) { + env_var = irods::KW_CFG_IRODS_PLUGINS_HOME; + capture_string_env_var(env_var, _env->irodsPluginHome); + } capture_integer_env_var(irods::KW_CFG_IRODS_TCP_KEEPALIVE_INTVL_IN_SECONDS, _env->tcp_keepalive_intvl); capture_integer_env_var(irods::KW_CFG_IRODS_TCP_KEEPALIVE_PROBES, _env->tcp_keepalive_probes); diff --git a/lib/core/src/irods_configuration_keywords.cpp b/lib/core/src/irods_configuration_keywords.cpp index 05f04e0774..91081cfaaf 100644 --- a/lib/core/src/irods_configuration_keywords.cpp +++ b/lib/core/src/irods_configuration_keywords.cpp @@ -165,6 +165,7 @@ namespace irods const char* const KW_CFG_SERVICE_ROLE_PROXY{"proxy"}; const char* const KW_CFG_IRODS_PLUGINS_HOME{"irods_plugins_home"}; + const char* const KW_CFG_IRODS_PLUGIN_DIRECTORY{"irods_plugin_directory"}; const char* const KW_CFG_PLUGIN_CONFIGURATION{"plugin_configuration"}; diff --git a/schemas/configuration/v4/service_account_environment.json.in b/schemas/configuration/v4/service_account_environment.json.in index 22c9f5240a..ed818de9f7 100644 --- a/schemas/configuration/v4/service_account_environment.json.in +++ b/schemas/configuration/v4/service_account_environment.json.in @@ -28,6 +28,7 @@ "irods_match_hash_policy": {"type": "string"}, "irods_maximum_size_for_single_buffer_in_megabytes": {"type": "integer"}, "irods_plugins_home": {"type": "string"}, + "irods_plugin_directory": {"type": "string"}, "irods_server_control_plane_encryption_algorithm": {"type": "string"}, "irods_server_control_plane_encryption_num_hash_rounds": {"type": "integer"}, "irods_server_control_plane_key": {"type": "string"},