From 4f9e4a2aca9c0821ad0d410ff64314eb251a8e98 Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Tue, 15 Oct 2024 23:18:35 -0400 Subject: [PATCH] squash. More path-related questions. --- lib/core/include/irods/irods_load_plugin.hpp | 5 ++++ lib/core/src/irods_environment_properties.cpp | 2 -- .../irods_get_full_path_for_config_file.cpp | 29 +++++++++---------- lib/core/src/osauth.cpp | 1 + 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/core/include/irods/irods_load_plugin.hpp b/lib/core/include/irods/irods_load_plugin.hpp index 8a8a0af597..d811f6db50 100644 --- a/lib/core/include/irods/irods_load_plugin.hpp +++ b/lib/core/include/irods/irods_load_plugin.hpp @@ -42,6 +42,11 @@ namespace irods fs::path plugin_home; + // TODO The directory used to resolve plugins is already configurable via + // the irods_environment.json file. This is very weird for server-side code + // because this override is comes from a client-side config file. + // + // TODO Lean on ::ProcessType for determining which location to load plugins from? rodsEnv env; int status = getRodsEnv( &env ); if ( !status ) { diff --git a/lib/core/src/irods_environment_properties.cpp b/lib/core/src/irods_environment_properties.cpp index 65873f277f..1cf37963c4 100644 --- a/lib/core/src/irods_environment_properties.cpp +++ b/lib/core/src/irods_environment_properties.cpp @@ -30,8 +30,6 @@ namespace irods { // that std::string json_file; try { - // TODO What does the server need that lives under the home directory? - // What does the client need that lives under the home directory? json_file = get_irods_home_directory().string(); } catch (const irods::exception& e) { irods::log(e); diff --git a/lib/core/src/irods_get_full_path_for_config_file.cpp b/lib/core/src/irods_get_full_path_for_config_file.cpp index 76ecd363ab..604249e413 100644 --- a/lib/core/src/irods_get_full_path_for_config_file.cpp +++ b/lib/core/src/irods_get_full_path_for_config_file.cpp @@ -1,22 +1,17 @@ -// =-=-=-=-=-=-=- -// boost includes -#include -#include -#include - -// =-=-=-=-=-=-=- -// stl includes -#include - -// =-=-=-=-=-=-=- -// irods includes #include "irods/rodsErrorTable.h" #include "irods/irods_log.hpp" #include "irods/irods_get_full_path_for_config_file.hpp" #include "irods/irods_default_paths.hpp" #include "irods/irods_exception.hpp" -namespace irods { +#include +#include +#include + +#include + +namespace irods +{ error get_full_path_for_config_file( const std::string& _cfg_file, std::string& _full_path ) { @@ -27,6 +22,7 @@ namespace irods { path.append(_cfg_file); if ( fs::exists(path) ) { _full_path = path.string(); + // TODO What should the log category be for this? rodsLog( LOG_DEBUG, "config file found [%s]", _full_path.c_str() ); return SUCCESS(); } @@ -38,7 +34,7 @@ namespace irods { std::string msg( "config file not found [" ); msg += _cfg_file + "]"; return ERROR(SYS_INVALID_INPUT_PARAM, msg); - } + } // get_full_path_for_config_file error get_full_path_for_unmoved_configs( const std::string& _cfg_file, @@ -50,6 +46,7 @@ namespace irods { path.append("config").append(_cfg_file); if ( fs::exists(path) ) { _full_path = path.string(); + // TODO What should the log category be for this? rodsLog( LOG_DEBUG, "config file found [%s]", _full_path.c_str() ); return SUCCESS(); } @@ -61,5 +58,5 @@ namespace irods { std::string msg( "config file not found [" ); msg += _cfg_file + "]"; return ERROR(SYS_INVALID_INPUT_PARAM, msg); - } -} + } // get_full_path_for_unmoved_configs +} // namespace irods diff --git a/lib/core/src/osauth.cpp b/lib/core/src/osauth.cpp index 0be3fa9819..f25db4e4c7 100644 --- a/lib/core/src/osauth.cpp +++ b/lib/core/src/osauth.cpp @@ -176,6 +176,7 @@ extern "C" { return USER__NULL_INPUT_ERR; } + // TODO Is osauth.cpp needed/used by anything? boost::filesystem::path default_os_auth_keyfile_path = irods::get_irods_config_directory(); default_os_auth_keyfile_path.append(OS_AUTH_KEYFILE); std::string default_os_auth_keyfile_path_string = default_os_auth_keyfile_path.string();