irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

miscServerFunct.cpp File Reference
#include <sys/wait.h>
#include "miscServerFunct.hpp"
#include "QUANTAnet_rbudpBase_c.h"
#include "QUANTAnet_rbudpSender_c.h"
#include "QUANTAnet_rbudpReceiver_c.h"
#include "dataObjOpen.h"
#include "dataObjLseek.h"
#include "rcMisc.h"
#include "dataObjOpr.hpp"
#include "dataObjClose.h"
#include "dataObjWrite.h"
#include "dataObjRead.h"
#include "modAVUMetadata.h"
#include "genQuery.h"
#include "rcPortalOpr.h"
#include "rcConnect.h"
#include "rodsConnect.h"
#include "sockComm.h"
#include "modAccessControl.h"
#include "rsDataObjOpen.hpp"
#include "rsDataObjClose.hpp"
#include "rsDataObjLseek.hpp"
#include "rsDataObjWrite.hpp"
#include "rsDataObjRead.hpp"
#include "rsGenQuery.hpp"
#include "rsModAVUMetadata.hpp"
#include "rsModAccessControl.hpp"
#include <string>
#include <vector>
#include <boost/thread/thread.hpp>
#include <boost/thread/scoped_thread.hpp>
#include <boost/lexical_cast.hpp>
#include <openssl/md5.h>
#include "rsGlobalExtern.hpp"
#include "rcGlobalExtern.h"
#include "irods_stacktrace.hpp"
#include "irods_network_factory.hpp"
#include "irods_buffer_encryption.hpp"
#include "irods_client_server_negotiation.hpp"
#include "irods_exception.hpp"
#include "irods_serialization.hpp"
#include "irods_server_properties.hpp"
#include "irods_hierarchy_parser.hpp"
#include "irods_threads.hpp"
#include "irods_lexical_cast.hpp"
#include "sockCommNetworkInterface.hpp"
#include "irods_random.hpp"
#include "irods_resource_manager.hpp"
#include "irods_default_paths.hpp"
#include <iomanip>
#include <fstream>
#include <boost/filesystem.hpp>
Include dependency graph for miscServerFunct.cpp:

Go to the source code of this file.

Typedefs

using leaf_bundle_t = irods::resource_manager::leaf_bundle_t
 

Functions

int svrToSvrConnectNoLogin (rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
 
int svrToSvrConnect (rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
 
int setupSrvPortalForParaOpr (rsComm_t *rsComm, dataOprInp_t *dataOprInp, int oprType, portalOprOut_t **portalOprOut)
 
int createSrvPortal (rsComm_t *rsComm, portList_t *thisPortList, int proto)
 
int acceptSrvPortal (rsComm_t *rsComm, portList_t *thisPortList)
 
int applyRuleForSvrPortal (int sockFd, int oprType, int preOrPost, int load, rsComm_t *rsComm)
 
int svrPortalPutGet (rsComm_t *rsComm)
 
int fillPortalTransferInp (portalTransferInp_t *myInput, rsComm_t *rsComm, int srcFd, int destFd, int srcRescTypeInx, int destRescTypeInx, int threadNum, rodsLong_t size, rodsLong_t offset, int flags)
 
void partialDataPut (portalTransferInp_t *myInput)
 
void partialDataGet (portalTransferInp_t *myInput)
 
void remToLocPartialCopy (portalTransferInp_t *myInput)
 
int rbudpRemLocCopy (dataCopyInp_t *dataCopyInp)
 
int remLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int sameHostCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
void sameHostPartialCopy (portalTransferInp_t *myInput)
 
void locToRemPartialCopy (portalTransferInp_t *myInput)
 
void getZoneServerId (char *zoneName, char *zoneSID)
 
int isUserPrivileged (rsComm_t *rsComm)
 
int intNoSupport (...)
 
rodsLong_t longNoSupport (...)
 
int svrPortalPutGetRbudp (rsComm_t *rsComm)
 
void reconnManager (rsComm_t *rsComm)
 
int svrChkReconnAtSendStart (rsComm_t *rsComm)
 
int svrChkReconnAtSendEnd (rsComm_t *rsComm)
 
int svrChkReconnAtReadStart (rsComm_t *rsComm)
 
int svrChkReconnAtReadEnd (rsComm_t *rsComm)
 
int svrSockOpenForInConn (rsComm_t *rsComm, int *portNum, char **addr, int proto)
 
char * getLocalSvrAddr ()
 
char * _getSvrAddr (rodsServerHost_t *rodsServerHost)
 
char * getSvrAddr (rodsServerHost_t *rodsServerHost)
 
int setLocalSrvAddr (char *outLocalAddr)
 
int forkAndExec (char *av[])
 
int singleRemLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int singleRemToLocCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int singleLocToRemCopy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
int singleL1Copy (rsComm_t *rsComm, dataCopyInp_t *dataCopyInp)
 
irods::error readStartupPack (irods::network_object_ptr _ptr, startupPack_t **startupPack, struct timeval *tv)
 
int initServiceUser ()
 
int isServiceUserSet ()
 
int changeToRootUser ()
 
int changeToServiceUser ()
 
int changeToUser (uid_t uid)
 
int dropRootPrivilege ()
 
int checkModArgType (const char *arg)
 
irods::error setRECacheSaltFromEnv ()
 
irods::error get_script_output_single_line (const std::string &script_language, const std::string &script_name, const std::vector< std::string > &args, std::string &output)
 
irods::error add_global_re_params_to_kvp_for_dynpep (keyValPair_t &_kvp)
 
irods::error get_catalog_service_role (std::string &_role)
 
irods::error get_default_rule_plugin_instance (std::string &_instance_name)
 
irods::error list_rule_plugin_instances (std::vector< std::string > &_instance_names)
 
void applyMetadataFromKVP (rsComm_t *rsComm, dataObjInp_t *dataObjInp)
 
void applyACLFromKVP (rsComm_t *rsComm, dataObjInp_t *dataObjInp)
 

Variables

char * __loc1
 

Typedef Documentation

◆ leaf_bundle_t

Function Documentation

◆ _getSvrAddr()

char* _getSvrAddr ( rodsServerHost_t rodsServerHost)

Definition at line 2404 of file miscServerFunct.cpp.

References rodsServerHost::hostName, isLoopbackAddress(), hostName::name, hostName::next, and NULL.

Referenced by getLocalSvrAddr(), and getSvrAddr().

Here is the call graph for this function:

◆ acceptSrvPortal()

int acceptSrvPortal ( rsComm_t rsComm,
portList_t thisPortList 
)

Definition at line 283 of file miscServerFunct.cpp.

References CLOSE_SOCK, portList_t::cookie, getTcpSockFromPortList(), LOG_ERROR, LOG_NOTICE, NULL, rodsLog(), rodsSetSockOpt(), SELECT_TIMEOUT_FOR_CONN, SYS_PORT_COOKIE_ERR, SYS_SOCK_ACCEPT_ERR, SYS_SOCK_SELECT_ERR, and rsComm_t::windowSize.

Referenced by svrPortalPutGet(), and svrPortalPutGetRbudp().

Here is the call graph for this function:

◆ add_global_re_params_to_kvp_for_dynpep()

irods::error add_global_re_params_to_kvp_for_dynpep ( keyValPair_t _kvp)

Definition at line 3100 of file miscServerFunct.cpp.

References addKeyVal(), irods::CLIENT_USER_NAME_KW(), irods::CLIENT_USER_PRIV_KW(), irods::CLIENT_USER_ZONE_KW(), terminate_irods_processes::e, irods::PROXY_USER_NAME_KW(), irods::PROXY_USER_PRIV_KW(), irods::PROXY_USER_ZONE_KW(), and SUCCESS.

Here is the call graph for this function:

◆ applyACLFromKVP()

void applyACLFromKVP ( rsComm_t rsComm,
dataObjInp_t dataObjInp 
)

◆ applyMetadataFromKVP()

void applyMetadataFromKVP ( rsComm_t rsComm,
dataObjInp_t dataObjInp 
)

◆ applyRuleForSvrPortal()

int applyRuleForSvrPortal ( int  sockFd,
int  oprType,
int  preOrPost,
int  load,
rsComm_t rsComm 
)

Definition at line 342 of file miscServerFunct.cpp.

References applyRuleArg(), LOG_ERROR, MAX_NAME_LEN, rodsLog(), RuleExecInfo::rsComm, irods.pypyodbc::status, and SYS_SOCK_READ_ERR.

Referenced by partialDataGet(), partialDataPut(), and svrPortalPutGet().

Here is the call graph for this function:

◆ changeToRootUser()

int changeToRootUser ( )

Definition at line 2871 of file miscServerFunct.cpp.

References isServiceUserSet(), LOG_ERROR, rodsLogError(), and SYS_USER_NO_PERMISSION.

Referenced by changeToUser(), and dropRootPrivilege().

Here is the call graph for this function:

◆ changeToServiceUser()

int changeToServiceUser ( )

Definition at line 2899 of file miscServerFunct.cpp.

References isServiceUserSet(), LOG_ERROR, rodsLog(), rodsLogError(), ServiceGid, ServiceUid, and SYS_USER_NO_PERMISSION.

Referenced by initServiceUser().

Here is the call graph for this function:

◆ changeToUser()

int changeToUser ( uid_t  uid)

Definition at line 2931 of file miscServerFunct.cpp.

References changeToRootUser(), isServiceUserSet(), LOG_ERROR, rodsLogError(), and SYS_USER_NO_PERMISSION.

Here is the call graph for this function:

◆ checkModArgType()

int checkModArgType ( const char *  arg)

Definition at line 3002 of file miscServerFunct.cpp.

References CAT_INVALID_ARGUMENT, and NULL.

Referenced by _rsModAVUMetadata().

◆ createSrvPortal()

int createSrvPortal ( rsComm_t rsComm,
portList_t thisPortList,
int  proto 
)

◆ dropRootPrivilege()

int dropRootPrivilege ( )

Definition at line 2962 of file miscServerFunct.cpp.

References changeToRootUser(), isServiceUserSet(), LOG_ERROR, rodsLogError(), ServiceUid, and SYS_USER_NO_PERMISSION.

Here is the call graph for this function:

◆ fillPortalTransferInp()

◆ forkAndExec()

int forkAndExec ( char *  av[])

Definition at line 2456 of file miscServerFunct.cpp.

References EXEC_CMD_ERROR, LOG_ERROR, RODS_FORK, rodsLog(), irods.pypyodbc::status, and SYS_FORK_ERROR.

Here is the call graph for this function:

◆ get_catalog_service_role()

irods::error get_catalog_service_role ( std::string &  _role)

Definition at line 3153 of file miscServerFunct.cpp.

References irods::CFG_CATALOG_SERVICE_ROLE(), terminate_irods_processes::e, error, and SUCCESS.

Referenced by _rsBulkDataObjReg(), _rsChkObjPermAndStat(), _rsDataObjRename(), _rsGetHierarchyForResc(), _rsModColl(), _rsModDataObjMeta(), _rsRegColl(), _rsRegDataObj(), _rsRegReplica(), _rsRuleExecDel(), _rsRuleExecSubmit(), _rsServerReport(), _rsUnregDataObj(), chkCollForBundleOpr(), cleanup(), irods::get_plugin_array(), initServer(), initServerInfo(), msiAclPolicy(), msiAddUserToGroup(), msiCommit(), msiCreateCollByAdmin(), msiCreateUser(), msiDeleteCollByAdmin(), msiDeleteUnusedAVUs(), msiDeleteUser(), msiQuota(), msiRenameCollection(), msiRenameLocalZone(), msiRollback(), rsAuthCheck(), rsBulkDataObjReg(), rsChkObjPermAndStat(), rsCollCreate(), rsDataObjLock(), rsDataObjRename(), rsDataObjUnlock(), rsEndTransaction(), rsGeneralAdmin(), rsGeneralRowInsert(), rsGeneralUpdate(), rsGenQuery(), rsGetHierarchyForResc(), rsGetLimitedPassword(), rsGetMiscSvrInfo(), rsGetTempPassword(), rsGetTempPasswordForOther(), rsIESClientHints(), rsModAccessControl(), rsModAVUMetadata(), rsModColl(), rsModDataObjMeta(), rsObjStat(), rsPamAuthRequest(), rsRegColl(), rsRegDataObj(), rsRegReplica(), rsRuleExecDel(), rsRuleExecMod(), rsRuleExecSubmit(), rsSimpleQuery(), rsSpecificQuery(), rsTicketAdmin(), rsUnregDataObj(), rsUserAdmin(), rsZoneReport(), runIrodsAgentFactory(), serverMain(), svrRegDataObj(), and svrUnregColl().

Here is the call graph for this function:

◆ get_default_rule_plugin_instance()

irods::error get_default_rule_plugin_instance ( std::string &  _instance_name)

Definition at line 3165 of file miscServerFunct.cpp.

References irods::CFG_INSTANCE_NAME_KW(), irods::CFG_PLUGIN_CONFIGURATION_KW(), terminate_irods_processes::e, ERROR, error, irods::get_server_property(), INVALID_ANY_CAST, KEY_NOT_FOUND, irods::PLUGIN_TYPE_RULE_ENGINE(), and SUCCESS.

Here is the call graph for this function:

◆ get_script_output_single_line()

irods::error get_script_output_single_line ( const std::string &  script_language,
const std::string &  script_name,
const std::vector< std::string > &  args,
std::string &  output 
)

Definition at line 3046 of file miscServerFunct.cpp.

References buf, terminate_irods_processes::e, ERROR, FILE_READ_ERR, irods::get_irods_home_directory(), irods::log(), NULL, generate_iadmin_commands_for_41_to_42_upgrade::output, size, SUCCESS, and SYS_FORK_ERROR.

Referenced by get_host_system_information(), irods::get_pid_age(), and irods::kill_server().

Here is the call graph for this function:

◆ getLocalSvrAddr()

char* getLocalSvrAddr ( )

Definition at line 2397 of file miscServerFunct.cpp.

References _getSvrAddr(), and LocalServerHost.

Referenced by svrSockOpenForInConn().

Here is the call graph for this function:

◆ getSvrAddr()

char* getSvrAddr ( rodsServerHost_t rodsServerHost)

Definition at line 2425 of file miscServerFunct.cpp.

References _getSvrAddr(), rodsServerHost::hostName, hostName::name, and NULL.

Referenced by setLocalSrvAddr().

Here is the call graph for this function:

◆ getZoneServerId()

void getZoneServerId ( char *  zoneName,
char *  zoneSID 
)

Definition at line 1945 of file miscServerFunct.cpp.

References LOCAL_ICAT, localSID, LOG_ERROR, zoneInfo::masterServerHost, MAX_NAME_LEN, MAX_PASSWORD_LEN, zoneInfo::next, NULL, rodsServerHost::rcatEnabled, remote_SID_key_map, rodsLog(), ZoneInfoHead, and zoneInfo::zoneName.

Referenced by rsAuthCheck().

Here is the call graph for this function:

◆ initServiceUser()

int initServiceUser ( )

Definition at line 2821 of file miscServerFunct.cpp.

References changeToServiceUser(), LOG_ERROR, NULL, rodsLogError(), ServiceGid, ServiceUid, and SYS_USER_RETRIEVE_ERR.

Here is the call graph for this function:

◆ intNoSupport()

int intNoSupport (   ...)

Definition at line 2010 of file miscServerFunct.cpp.

References SYS_NOT_SUPPORTED.

◆ isServiceUserSet()

int isServiceUserSet ( )

Definition at line 2858 of file miscServerFunct.cpp.

References ServiceUid.

Referenced by changeToRootUser(), changeToServiceUser(), changeToUser(), and dropRootPrivilege().

◆ isUserPrivileged()

◆ list_rule_plugin_instances()

irods::error list_rule_plugin_instances ( std::vector< std::string > &  _instance_names)

Definition at line 3181 of file miscServerFunct.cpp.

References irods::CFG_INSTANCE_NAME_KW(), irods::CFG_PLUGIN_CONFIGURATION_KW(), terminate_irods_processes::e, ERROR, error, INVALID_ANY_CAST, KEY_NOT_FOUND, irods::PLUGIN_TYPE_RULE_ENGINE(), and SUCCESS.

Referenced by rsExecMyRule().

Here is the call graph for this function:

◆ locToRemPartialCopy()

◆ longNoSupport()

rodsLong_t longNoSupport (   ...)

Definition at line 2015 of file miscServerFunct.cpp.

References SYS_NOT_SUPPORTED.

◆ partialDataGet()

◆ partialDataPut()

◆ rbudpRemLocCopy()

int rbudpRemLocCopy ( dataCopyInp_t dataCopyInp)

◆ readStartupPack()

irods::error readStartupPack ( irods::network_object_ptr  _ptr,
startupPack_t **  startupPack,
struct timeval *  tv 
)

◆ reconnManager()

◆ remLocCopy()

◆ remToLocPartialCopy()

◆ sameHostCopy()

◆ sameHostPartialCopy()

◆ setLocalSrvAddr()

int setLocalSrvAddr ( char *  outLocalAddr)

Definition at line 2437 of file miscServerFunct.cpp.

References getSvrAddr(), LocalServerHost, NAME_LEN, NULL, rstrcpy(), SYS_INVALID_SERVER_HOST, and USER__NULL_INPUT_ERR.

Referenced by _rsProcStatAll(), and localProcStat().

Here is the call graph for this function:

◆ setRECacheSaltFromEnv()

irods::error setRECacheSaltFromEnv ( )

Definition at line 3021 of file miscServerFunct.cpp.

References irods::CFG_RE_CACHE_SALT_KW(), terminate_irods_processes::e, ERROR, error, LOG_ERROR, LOG_NOTICE, NULL, rodsLog(), SP_RE_CACHE_SALT, SUCCESS, and SYS_GETENV_ERR.

Referenced by main(), and runIrodsAgentFactory().

Here is the call graph for this function:

◆ setupSrvPortalForParaOpr()

int setupSrvPortalForParaOpr ( rsComm_t rsComm,
dataOprInp_t dataOprInp,
int  oprType,
portalOprOut_t **  portalOprOut 
)

◆ singleL1Copy()

◆ singleLocToRemCopy()

◆ singleRemLocCopy()

int singleRemLocCopy ( rsComm_t rsComm,
dataCopyInp_t dataCopyInp 
)

Definition at line 2489 of file miscServerFunct.cpp.

References COPY_TO_LOCAL_OPR, DataCopyInp::dataOprInp, LOG_NOTICE, NULL, DataOprInp::oprType, rodsLog(), singleLocToRemCopy(), singleRemToLocCopy(), irods.pypyodbc::status, and SYS_INTERNAL_NULL_INPUT_ERR.

Referenced by remLocCopy().

Here is the call graph for this function:

◆ singleRemToLocCopy()

◆ svrChkReconnAtReadEnd()

◆ svrChkReconnAtReadStart()

int svrChkReconnAtReadStart ( rsComm_t rsComm)

Definition at line 2334 of file miscServerFunct.cpp.

References rsComm_t::agentState, thread_context::cond, CONN_WAIT_STATE, thread_context::lock, LOG_NOTICE, PROCESSING_STATE, RECEIVING_STATE, rsComm_t::reconnSock, rsComm_t::reconnThrState, rodsLog(), svrSwitchConnect(), and rsComm_t::thread_ctx.

Referenced by readAndProcClientMsg().

Here is the call graph for this function:

◆ svrChkReconnAtSendEnd()

◆ svrChkReconnAtSendStart()

int svrChkReconnAtSendStart ( rsComm_t rsComm)

Definition at line 2300 of file miscServerFunct.cpp.

References rsComm_t::agentState, thread_context::cond, CONN_WAIT_STATE, thread_context::lock, LOG_NOTICE, PROCESSING_STATE, rsComm_t::reconnSock, rsComm_t::reconnThrState, rodsLog(), SENDING_STATE, svrSwitchConnect(), and rsComm_t::thread_ctx.

Referenced by sendApiReply().

Here is the call graph for this function:

◆ svrPortalPutGet()

◆ svrPortalPutGetRbudp()

◆ svrSockOpenForInConn()

int svrSockOpenForInConn ( rsComm_t rsComm,
int portNum,
char **  addr,
int  proto 
)

Definition at line 2368 of file miscServerFunct.cpp.

References getLocalSvrAddr(), isLoopbackAddress(), LOG_NOTICE, NULL, rodsLog(), sockOpenForInConn(), and irods.pypyodbc::status.

Referenced by createSrvPortal(), and initAgent().

Here is the call graph for this function:

◆ svrToSvrConnect()

int svrToSvrConnect ( rsComm_t rsComm,
rodsServerHost_t rodsServerHost 
)

Definition at line 106 of file miscServerFunct.cpp.

References clientLogin(), rodsServerHost::conn, rodsServerHost::hostName, rodsServerHost::localFlag, LOG_NOTICE, hostName::name, rodsLog(), irods.pypyodbc::status, and svrToSvrConnectNoLogin().

Referenced by agentMain(), get_server_reports(), getAndConnRcatHost(), getAndConnReHost(), getAndConnRemoteZone(), getRemoteZoneHost(), remoteChkNVPathPerm(), remoteDataCopy(), remoteDataGet(), remoteDataPut(), remoteExecCmd(), remoteExecMyRule(), remoteFileChksum(), remoteFileChmod(), remoteFileClose(), remoteFileClosedir(), remoteFileCreate(), remoteFileGet(), remoteFileGetFsFreeSpace(), remoteFileLseek(), remoteFileMkdir(), remoteFileOpen(), remoteFileOpendir(), remoteFilePut(), remoteFileRead(), remoteFileReaddir(), remoteFileRename(), remoteFileRmdir(), remoteFileStageToCache(), remoteFileStat(), remoteFileSyncToArch(), remoteFileTruncate(), remoteFileUnlink(), remoteFileWrite(), remotePhyBundleColl(), remotePhyPathReg(), remoteProcStat(), remoteStructFileBundle(), remoteStructFileExtract(), remoteStructFileSync(), remoteSubStructFileClose(), remoteSubStructFileClosedir(), remoteSubStructFileCreate(), remoteSubStructFileGet(), remoteSubStructFileLseek(), remoteSubStructFileMkdir(), remoteSubStructFileOpen(), remoteSubStructFileOpendir(), remoteSubStructFilePut(), remoteSubStructFileRead(), remoteSubStructFileReaddir(), remoteSubStructFileRename(), remoteSubStructFileRmdir(), remoteSubStructFileStat(), remoteSubStructFileTruncate(), remoteSubStructFileUnlink(), remoteSubStructFileWrite(), remoteUnbunAndRegPhyBunfile(), resoAndConnHostByDataObjInfo(), and irods::resource_redirect().

Here is the call graph for this function:

◆ svrToSvrConnectNoLogin()

int svrToSvrConnectNoLogin ( rsComm_t rsComm,
rodsServerHost_t rodsServerHost 
)

Variable Documentation

◆ __loc1

char* __loc1

Definition at line 45 of file miscServerFunct.cpp.