Skip to content

Commit

Permalink
squash. Fixed acAclPolicy issue. initServerMain() was initializing Zo…
Browse files Browse the repository at this point in the history
…neInfoHead which caused rsGenQuery to init strict acls too early.
  • Loading branch information
korydraughn committed Sep 11, 2024
1 parent ebc7995 commit c548055
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 2 additions & 3 deletions server/core/src/initServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion server/main_server/src/agent_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand All @@ -708,6 +710,7 @@ namespace
log_af::error("{}: initServer error. status = {}", __func__, status);
return 1;
}
#endif

int zone_port;
try {
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion server/main_server/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char, max_msg_size> msg_buf{};
boost::interprocess::message_queue::size_type recvd_size{};
unsigned int priority{};
#endif

while (true) {
if (g_terminate) {
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit c548055

Please sign in to comment.