From c548055f351fc514617ce2ebb55c33ffdd8adbe3 Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Wed, 11 Sep 2024 19:35:34 -0400 Subject: [PATCH] squash. Fixed acAclPolicy issue. initServerMain() was initializing ZoneInfoHead which caused rsGenQuery to init strict acls too early. --- server/core/src/initServer.cpp | 5 ++--- server/main_server/src/agent_main.cpp | 6 +++++- server/main_server/src/main.cpp | 6 +++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server/core/src/initServer.cpp b/server/core/src/initServer.cpp index 0d5bfb09a1..ff02d6db5a 100644 --- a/server/core/src/initServer.cpp +++ b/server/core/src/initServer.cpp @@ -129,9 +129,8 @@ int initServerInfo(int processType, rsComm_t* rsComm) /* queue the local zone */ status = queueZone(zone_name.c_str(), zone_port, nullptr, nullptr); - rodsLog(LOG_NOTICE, "initServerInfo - queueZone failed %d", status); if (status < 0) { - rodsLog(LOG_NOTICE, "initServerInfo - queueZone failed %d", status); + rodsLog(LOG_DEBUG, "initServerInfo - queueZone failed %d", status); // do not error out } } @@ -184,7 +183,7 @@ int initServerInfo(int processType, rsComm_t* rsComm) } // TODO This function invokes acAclPolicy which guarantees GenQuery1 honors - // the permission model. + // the permission model. acAclPolicy is invoked the first time _rsGenQuery is invoked. status = initZone( rsComm ); if ( status < 0 ) { rodsLog( LOG_SYS_FATAL, diff --git a/server/main_server/src/agent_main.cpp b/server/main_server/src/agent_main.cpp index fac5dfd5aa..87f8ee7517 100644 --- a/server/main_server/src/agent_main.cpp +++ b/server/main_server/src/agent_main.cpp @@ -292,11 +292,12 @@ int main(int _argc, char* _argv[]) // Initialize zone information for request processing. // initServerMain starts the listening socket and stores it in svrComm. // TODO initServerMain can likely be simplified. - RsComm svrComm; // RsComm contains a std::string, so never memset this type! + RsComm svrComm{}; // TODO RsComm contains a std::string, so never memset this type! if (const auto ec = initServerMain(svrComm, false, false); ec < 0) { log_af::error("{}: initServerMain error. [error code={}]", __func__, ec); return 1; } + #if 0 // This message queue gives child processes a way to notify the parent process. // This will only be used by the agent factory because iRODS 5.0 won't have a control plane. @@ -685,6 +686,7 @@ namespace // Consider non-pkg installs and pkg installs. setRsCommFromRodsEnv(&_comm); +#if 0 // Load server API table so that API plugins which are needed to stand up the server are // available for use. irods::api_entry_table& RsApiTable = irods::get_server_api_table(); @@ -708,6 +710,7 @@ namespace log_af::error("{}: initServer error. status = {}", __func__, status); return 1; } +#endif int zone_port; try { @@ -1073,6 +1076,7 @@ namespace if (!_comm.auth_scheme) { _comm.auth_scheme = strdup("native"); } + // The following is an artifact of the legacy authentication plugins. This operation is // only useful for certain plugins which are not supported in 4.3.0, so it is being // left out of compilation for now. Once we have determined that this is safe to do in diff --git a/server/main_server/src/main.cpp b/server/main_server/src/main.cpp index ce111af766..26892518cc 100644 --- a/server/main_server/src/main.cpp +++ b/server/main_server/src/main.cpp @@ -283,9 +283,11 @@ int main(int _argc, char* _argv[]) // THE PARENT PROCESS IS THE ONLY PROCESS THAT SHOULD/CAN REACT TO SIGNALS! // EVERYTHING IS PROPAGATED THROUGH/FROM THE PARENT PROCESS! +#if 0 std::array msg_buf{}; boost::interprocess::message_queue::size_type recvd_size{}; unsigned int priority{}; +#endif while (true) { if (g_terminate) { @@ -315,7 +317,9 @@ int main(int _argc, char* _argv[]) #endif // TODO This proves there is a bug in the delay server migration logic. // The following lines will be removed before merging. - // The issue with the migration logic is that it leads to an unused forked process when the successor is set to an invalid server. The iRODS server still works, it's just we get an extra child process that serves no purpose. + // The issue with the migration logic is that it leads to an unused forked process when + // the successor is set to an invalid server. The iRODS server still works, it's just we + // get an extra child process that serves no purpose. std::this_thread::sleep_for(std::chrono::seconds{1}); continue;