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)  

nre.systemMS.cpp
Go to the documentation of this file.
1 
6 #include <string.h>
7 #include <time.h>
8 #include "rsRuleExecSubmit.hpp"
10 #include "rcMisc.h"
11 #include "execMyRule.h"
12 #include "region.h"
14 #include "irods_load_plugin.hpp"
15 #include "sockComm.h"
16 #include "rsRuleExecDel.hpp"
17 #include "ruleExecDel.h"
18 #include "rsExecMyRule.hpp"
19 
21 #include "irods_log.hpp"
22 #include "irods_re_structs.hpp"
23 #include "irods_ms_plugin.hpp"
24 
25 #include <string>
26 #include <vector>
27 
28 static std::vector<std::string> GlobalDelayExecStack;
29 
30 int checkFilePerms( char *fileName );
31 
32 int
33 fillSubmitConditions( const char *action, const char *inDelayCondition, bytesBuf_t *packedReiAndArgBBuf,
34  ruleExecSubmitInp_t *ruleSubmitInfo, ruleExecInfo_t *rei );
35 
36 
37 //#define evaluateExpression(expr, eaVal, rei) \
38 // computeExpression(expr, NULL,rei, 0, eaVal)
39 
110 int _delayExec(const char*, const char*, const char*, ruleExecInfo_t*);
111 int delayExec( msParam_t *mPA, msParam_t *mPB, msParam_t *mPC, ruleExecInfo_t *rei ) {
112  int i;
113  char actionCall[MAX_ACTION_SIZE];
114  char recoveryActionCall[MAX_ACTION_SIZE];
115  char delayCondition[MAX_ACTION_SIZE];
116 
117  if ( mPA && mPA->inOutStruct ) {
118  rstrcpy( delayCondition, ( char * ) mPA->inOutStruct, MAX_ACTION_SIZE );
119  } else {
120  delayCondition[0] = '\0';
121  }
122  if ( mPB && mPB->inOutStruct ) {
123  rstrcpy( actionCall, ( char * ) mPB->inOutStruct, MAX_ACTION_SIZE );
124  } else {
125  actionCall[0] = '\0';
126  }
127  if ( mPC && mPC->inOutStruct ) {
128  rstrcpy( recoveryActionCall, ( char * ) mPC->inOutStruct, MAX_ACTION_SIZE );
129  } else {
130  recoveryActionCall[0] = '\0';
131  }
132  i = _delayExec( actionCall, recoveryActionCall, delayCondition, rei );
133  return i;
134 }
135 
136 std::map<std::string, std::vector<std::string>>
137 getTaggedValues(const char *str);
139  const char* _xml,
140  char* _plugin_name) {
141  boost::optional<std::map<std::string, std::vector<std::string>>> taggedValues;
142  try {
143  taggedValues = getTaggedValues(_xml);
144  } catch ( const irods::exception& e) {
146  }
147 
148  auto it = taggedValues->find("INST_NAME");
149  if ( it != taggedValues->end() ) {
150  rstrcpy(
151  _plugin_name,
152  it->second.front().c_str(),
153  MAX_NAME_LEN);
154  taggedValues->erase(it);
155  }
156 } // set_plugin_instance_name
157 
158 int _delayExec( const char *inActionCall, const char *recoveryActionCall,
159  const char *delayCondition, ruleExecInfo_t *rei ) {
160 
161  char *args[MAX_NUM_OF_ARGS_IN_ACTION];
162  int i;
163  /* char action[MAX_ACTION_SIZE]; */
164  bytesBuf_t *packedReiAndArgBBuf = NULL;
165 
166  RE_TEST_MACRO( " Calling _delayExec" );
167 
169  delayCondition,
170  rei->pluginInstanceName);
171 
172  args[0] = NULL;
173  args[1] = NULL;
174  /* Pack Rei and Args */
175  i = packReiAndArg( rei, args, 0, &packedReiAndArgBBuf );
176  if ( i < 0 ) {
177  return i;
178  }
179  /* fill Conditions into Submit Struct */
180  ruleExecSubmitInp_t * ruleSubmitInfo = ( ruleExecSubmitInp_t * ) malloc( sizeof( ruleExecSubmitInp_t ) );
181  memset(ruleSubmitInfo, 0, sizeof(ruleExecSubmitInp_t));
182  i = fillSubmitConditions( inActionCall, delayCondition, packedReiAndArgBBuf, ruleSubmitInfo, rei );
183  if ( i < 0 ) {
184  free( ruleSubmitInfo );
185  return i;
186  }
187 
188  /* Store ReiArgs Struct in a File */
189  char *ruleExecId = nullptr;
190  i = rsRuleExecSubmit( rei->rsComm, ruleSubmitInfo, &ruleExecId );
191  if ( packedReiAndArgBBuf ) {
192  clearBBuf( packedReiAndArgBBuf );
193  free( packedReiAndArgBBuf );
194  }
195  free( ruleSubmitInfo );
196  free( ruleExecId );
197 
198  if ( i >= 0 ) {
199  GlobalDelayExecStack.push_back(std::to_string(i));
200  }
201 
202  return i;
203 }
204 
206 
207  int i;
208  ruleExecDelInp_t ruleExecDelInp;
209  memset(&ruleExecDelInp,0,sizeof(ruleExecDelInp));
210 
211  if(!GlobalDelayExecStack.empty()) {
212  auto itr = GlobalDelayExecStack.rbegin();
213  itr->copy(
214  ruleExecDelInp.ruleExecId,
215  itr->size());
216  GlobalDelayExecStack.pop_back();
217  }
218  else {
219  rodsLog(
220  LOG_ERROR,
221  "%s - GlobalDelayExecStack is empty",
222  __FUNCTION__ );
224  }
225 
226  i = rsRuleExecDel( rei->rsComm, &ruleExecDelInp );
227  return i;
228 
229 }
230 
231 
232 static int carryOverMsParam(
233  msParamArray_t *sourceMsParamArray,
234  msParamArray_t *targetMsParamArray ) {
235 
236  int i;
237  msParam_t *mP, *mPt;
238  if ( sourceMsParamArray == NULL ) {
239  return 0;
240  }
241 
242  for ( i = 0; i < sourceMsParamArray->len ; i++ ) {
243  mPt = sourceMsParamArray->msParam[i];
244  if ( ( mP = getMsParamByLabel( targetMsParamArray, mPt->label ) ) != NULL ) {
245  free( mP->inpOutBuf );
246  int status = replInOutStruct(mPt->inOutStruct, &mP->inOutStruct, mPt->type);
247  if ( status < 0 ) {
248  rodsLogError( LOG_ERROR, status, "%s encountered an error when calling replInOutStruct", __PRETTY_FUNCTION__);
249  }
250  mP->inpOutBuf = replBytesBuf(mPt->inpOutBuf);
251  }
252  else
253  addMsParamToArray( targetMsParamArray,
254  mPt->label, mPt->type, mPt->inOutStruct, mPt->inpOutBuf, 1 );
255  }
256 
257  return 0;
258 }
259 
298 int remoteExec( msParam_t *mPD, msParam_t *mPA, msParam_t *mPB, msParam_t *mPC, ruleExecInfo_t *rei ) {
299  execMyRuleInp_t execMyRuleInp;
300  msParamArray_t *tmpParamArray, *aParamArray;
301  msParamArray_t *outParamArray = NULL;
302  char tmpStr[LONG_NAME_LEN];
303 
304  memset( &execMyRuleInp, 0, sizeof( execMyRuleInp ) );
305  execMyRuleInp.condInput.len = 0;
307  rstrcpy( tmpStr, ( char * ) mPD->inOutStruct, LONG_NAME_LEN );
308 
309  //i = evaluateExpression( tmpStr, tmpStr1, rei );
310  //if ( i < 0 ) {
311  // return i;
312  //}
313  //parseHostAddrStr( tmpStr1, &execMyRuleInp.addr );
314  parseHostAddrStr( tmpStr, &execMyRuleInp.addr );
315 
316 
317  snprintf( execMyRuleInp.myRule, META_STR_LEN, "remExec{%s}", ( char* )mPB->inOutStruct );
318 
319  addKeyVal( &execMyRuleInp.condInput, "execCondition", ( char * ) mPA->inOutStruct );
320  tmpParamArray = ( msParamArray_t * ) malloc( sizeof( msParamArray_t ) );
321  memset( tmpParamArray, 0, sizeof( msParamArray_t ) );
322  int i = replMsParamArray( rei->msParamArray, tmpParamArray );
323  if ( i < 0 ) {
324  free( tmpParamArray );
325  return i;
326  }
327  aParamArray = rei->msParamArray;
328  rei->msParamArray = tmpParamArray;
329  execMyRuleInp.inpParamArray = rei->msParamArray;
330  i = rsExecMyRule( rei->rsComm, &execMyRuleInp, &outParamArray );
331  carryOverMsParam( outParamArray, aParamArray );
332  rei->msParamArray = aParamArray;
333  clearMsParamArray( tmpParamArray, 0 );
334  free( tmpParamArray );
335  return i;
336 }
337 
339  ruleExecDelInp_t ruleExecDelInp;
340 
341  RE_TEST_MACRO( " Calling recover_delayExec" );
342 
343  if(!GlobalDelayExecStack.empty()) {
344  auto itr = GlobalDelayExecStack.rbegin();
345  itr->copy(
346  ruleExecDelInp.ruleExecId,
347  itr->size());
348  GlobalDelayExecStack.pop_back();
349  }
350  else {
351  rodsLog(
352  LOG_ERROR,
353  "%s - GlobalDelayExecStack is empty",
354  __FUNCTION__ );
356  }
357 
358  return 0;
359 
360 }
361 
362 
363 int
364 doForkExec( char *prog, char *arg1 ) {
365  int pid, i;
366 
367  i = checkFilePerms( prog );
368  if ( i ) {
369  return i;
370  }
371 
372  i = checkFilePerms( arg1 );
373  if ( i ) {
374  return i;
375  }
376 
377 #ifndef windows_platform
378  pid = fork();
379  if ( pid == -1 ) {
380  return -1;
381  }
382 
383  if ( pid ) {
384  /* This is still the parent. */
385  }
386  else {
387  /* child */
388  for ( i = 0; i < 100; i++ ) {
389  close( i );
390  }
391  i = execl( prog, prog, arg1, ( char * ) 0 );
392  printf( "execl failed %d\n", i );
393  return 0;
394  }
395 #else
396  /* windows platform */
397  if ( _spawnl( _P_NOWAIT, prog, prog, arg1 ) == -1 ) {
398  return -1;
399  }
400 #endif
401 
402  return 0;
403 }
404 
405 
435 int
438 }
439 
440 
441 
442 /* check that a file exists and is not writable by group or other */
443 int
444 checkFilePerms( char *fileName ) {
445  struct stat buf;
446  if ( stat( fileName, &buf ) == -1 ) {
447  printf( "Stat failed for file %s\n",
448  fileName );
449  return -1;
450  }
451 
452  if ( buf.st_mode & 022 ) {
453  printf( "File is writable by group or other: %s.\n",
454  fileName );
455  return -2;
456  }
457  return 0;
458 }
459 
489 int
490 msiFreeBuffer( msParam_t* memoryParam, ruleExecInfo_t *rei ) {
491 
492 
493  RE_TEST_MACRO( "Loopback on msiFreeBuffer" );
494 
495  if ( !strcmp( memoryParam->type, "STR_PI" ) &&
496  ( !strcmp( ( char* )memoryParam->inOutStruct, "stdout" ) ||
497  !strcmp( ( char* )memoryParam->inOutStruct, "stderr" )
498  )
499  ) {
500  msParam_t *mP = nullptr;
501  msParamArray_t *inMsParamArray;
502  inMsParamArray = rei->msParamArray;
503  if ( ( ( mP = getMsParamByLabel( inMsParamArray, "ruleExecOut" ) ) != NULL ) &&
504  ( mP->inOutStruct != NULL ) ) {
505  execCmdOut_t *myExecCmdOut = ( execCmdOut_t * ) mP->inOutStruct;
506  if ( !strcmp( ( char* )memoryParam->inOutStruct, "stdout" ) ) {
507  if ( myExecCmdOut->stdoutBuf.buf != NULL ) {
508  free( myExecCmdOut->stdoutBuf.buf );
509  myExecCmdOut->stdoutBuf.buf = NULL;
510  myExecCmdOut->stdoutBuf.len = 0;
511  }
512  }
513  if ( !strcmp( ( char* )memoryParam->inOutStruct, "stderr" ) ) {
514  if ( myExecCmdOut->stderrBuf.buf != NULL ) {
515  free( myExecCmdOut->stderrBuf.buf );
516  myExecCmdOut->stderrBuf.buf = NULL;
517  myExecCmdOut->stderrBuf.len = 0;
518  }
519  }
520  }
521  return 0;
522  }
523 
524  if ( memoryParam->inpOutBuf ) {
525  free( memoryParam->inpOutBuf->buf );
526  memoryParam->inpOutBuf->len = 0;
527  memoryParam->inpOutBuf->buf = nullptr;
528  }
529  return 0;
530 
531 }
532 
563 int
564 msiSleep( msParam_t* secPtr, msParam_t* microsecPtr, ruleExecInfo_t* ) {
565 
566  int sec, microsec;
567 
568  sec = atoi( ( char * ) secPtr->inOutStruct );
569  microsec = atoi( ( char * ) microsecPtr->inOutStruct );
570 
571  rodsSleep( sec, microsec );
572  return 0;
573 }
574 
610 int
611 msiGetDiffTime( msParam_t* inpParam1, msParam_t* inpParam2, msParam_t* inpParam3, msParam_t* outParam, ruleExecInfo_t *rei ) {
612  long hours, minutes, seconds;
613  char timeStr[TIME_LEN];
614  char *format;
615 
616 
617  /* For testing mode when used with irule --test */
618  RE_TEST_MACRO( " Calling msiGetDiffTime" )
619 
620 
621  if ( rei == NULL || rei->rsComm == NULL ) {
622  rodsLog( LOG_ERROR, "msiGetDiffTime: input rei or rsComm is NULL" );
624  }
625 
626 
627  /* Check for proper input */
628  if ( ( parseMspForStr( inpParam1 ) == NULL ) ) {
629  rodsLog( LOG_ERROR, "msiGetDiffTime: input inpParam1 is NULL" );
630  return USER__NULL_INPUT_ERR;
631  }
632 
633  if ( ( parseMspForStr( inpParam2 ) == NULL ) ) {
634  rodsLog( LOG_ERROR, "msiGetDiffTime: input inpParam2 is NULL" );
635  return USER__NULL_INPUT_ERR;
636  }
637 
638 
639  /* get time values from strings */
640  seconds = atol( ( char * ) inpParam2->inOutStruct ) - atol( ( char * )inpParam1->inOutStruct );
641 
642  /* get desired output format */
643  format = ( char * ) inpParam3->inOutStruct;
644 
645 
646  /* did they ask for human readable format? */
647  if ( format && !strcmp( format, "human" ) ) {
648  /* get hours-minutes-seconds */
649  hours = seconds / 3600;
650  seconds = seconds % 3600;
651  minutes = seconds / 60;
652  seconds = seconds % 60;
653 
654  snprintf( timeStr, TIME_LEN, "%ldh %ldm %lds", hours, minutes, seconds );
655  }
656  else {
657  snprintf( timeStr, TIME_LEN, "%011ld", seconds );
658  }
659 
660 
661  /* result goes to outParam */
662  fillStrInMsParam( outParam, timeStr );
663 
664  return 0;
665 }
666 
667 
700 int
701 msiGetSystemTime( msParam_t* outParam, msParam_t* inpParam, ruleExecInfo_t *rei ) {
702  char *format;
703  char tStr0[TIME_LEN], tStr[TIME_LEN];
704 
705  /* For testing mode when used with irule --test */
706  RE_TEST_MACRO( " Calling msiGetSystemTime" )
707 
708 
709  if ( rei == NULL || rei->rsComm == NULL ) {
710  rodsLog( LOG_ERROR, "msiGetSystemTime: input rei or rsComm is NULL" );
712  }
713 
714 
715  format = ( char * ) inpParam->inOutStruct;
716 
717  if ( !format || strcmp( format, "human" ) ) {
718  getNowStr( tStr );
719  }
720  else {
721  getNowStr( tStr0 );
722  getLocalTimeFromRodsTime( tStr0, tStr );
723  }
724 
725  fillStrInMsParam( outParam, tStr );
726 
727  return 0;
728 }
729 
730 
763 int
765  //CID26185: prevent buffer overrun
766  char sys_time[TIME_LEN + 1], *hr_time;
767 
768  /* For testing mode when used with irule --test */
769  RE_TEST_MACRO( " Calling msiHumanToSystemTime" )
770 
771 
772  /* microservice check */
773  if ( rei == NULL || rei->rsComm == NULL ) {
774  rodsLog( LOG_ERROR, "msiHumanToSystemTime: input rei or rsComm is NULL" );
776  }
777 
778 
779  /* parse inpParam (date input string) */
780  if ( ( hr_time = parseMspForStr( inpParam ) ) == NULL ) {
781  rodsLog( LOG_ERROR, "msiHumanToSystemTime: parseMspForStr error for input param." );
782  return rei->status;
783  }
784 
785 
786  /* left padding with a zero for DB format. Might change that later */
787  memset( sys_time, '\0', TIME_LEN );
788  sys_time[0] = '0';
789 
790 
791  /* conversion */
792  if ( !localToUnixTime( hr_time, &sys_time[1] ) ) {
793  fillStrInMsParam( outParam, sys_time );
794  }
795 
796 
797  return 0;
798 }
799 
800 
801 
834 int
836  char *inStr;
837  bytesBuf_t *outBuf;
838 
839  /* parse str_msp */
840  if ( ( inStr = parseMspForStr( str_msp ) ) == NULL ) {
841  rodsLog( LOG_ERROR, "msiStrToBytesBuf: input str_msp is NULL." );
842  return USER__NULL_INPUT_ERR;
843  }
844 
845  /* buffer init */
846  outBuf = ( bytesBuf_t * )malloc( sizeof( bytesBuf_t ) );
847  memset( outBuf, 0, sizeof( bytesBuf_t ) );
848 
849  /* fill string in buffer */
850  outBuf->len = strlen( inStr );
851  outBuf->buf = strdup( inStr );
852 
853  /* fill buffer in buf_msp */
854  fillBufLenInMsParam( buf_msp, outBuf->len, outBuf );
855 
856  return 0;
857 }
858 
899 int
901  int single_buff_sz;
902  try {
903  single_buff_sz = irods::get_advanced_setting<const int>(irods::CFG_MAX_SIZE_FOR_SINGLE_BUFFER) * 1024 * 1024;
904  } catch ( const irods::exception& e ) {
905  irods::log(e);
906  return e.code();
907  }
908 
909  /*check buf_msp */
910  if ( buf_msp == NULL || buf_msp->inOutStruct == NULL ) {
911  rodsLog( LOG_ERROR, "msiBytesBufToStr: input buf_msp is NULL." );
912  return USER__NULL_INPUT_ERR;
913  }
914  bytesBuf_t * inBuf = buf_msp->inpOutBuf;
915  if ( inBuf->len < 0 || inBuf->len > ( single_buff_sz - 10 ) ) {
916  rodsLog( LOG_ERROR, "msiBytesBufToStr: input buf_msp is NULL." );
917  return USER_INPUT_FORMAT_ERR;
918  }
919  char *outStr = ( char * ) malloc( ( inBuf->len + 1 ) );
920  outStr[inBuf->len] = '\0';
921  strncpy( outStr, ( char * ) inBuf->buf, inBuf->len );
922  fillStrInMsParam( str_msp, outStr );
923  free( outStr );
924 
925  return 0;
926 }
927 
928 
929 
965 int
967  msParam_t* outKVPairs,
968  ruleExecInfo_t* rei ) {
969 
970  irods::ms_table MicrosTable;
971  keyValPair_t *results; /* the output data structure */
972 
973 
974  /* For testing mode when used with irule --test */
975  RE_TEST_MACRO( " Calling msiEnabledMS" )
976 
977 
978  /* Sanity test */
979  if ( rei == NULL || rei->rsComm == NULL ) {
980  rodsLog( LOG_ERROR, "msiListEnabledMS: input rei or rsComm is NULL." );
982  }
983 
984  /* Allocate memory for our result struct */
985  results = ( keyValPair_t* )malloc( sizeof( keyValPair_t ) );
986  memset( results, 0, sizeof( keyValPair_t ) );
987 
988  // =-=-=-=-=-=-=-
989  // scan table for msvc names and add to kvp struct
990  irods::ms_table::iterator itr = MicrosTable.begin();
991  for ( ; itr != MicrosTable.end(); ++itr ) {
992  addKeyVal( results, itr->first.c_str(), "core" );
993 
994  } // for i
995 
996  // =-=-=-=-=-=-=-
997  // scan plugin directory for additional plugins
998  std::string plugin_home;
1000  if ( !ret.ok() ) {
1001  free( results );
1002  irods::log( PASS( ret ) );
1003  return ret.code();
1004  }
1005 
1008  ret = name_gen.list_plugins( plugin_home, plugin_list );
1009  if ( ret.ok() ) {
1010  irods::plugin_name_generator::plugin_list_t::iterator it = plugin_list.begin();
1011  for ( ; it != plugin_list.end(); ++it ) {
1012  addKeyVal( results, it->c_str(), "plugin" );
1013  }
1014  }
1015 
1016  /* Send results out to outKVPairs */
1017  fillMsParam( outKVPairs, NULL, KeyValPair_MS_T, results, NULL );
1018 
1019  return 0;
1020 }
1021 
1022 
1058 int
1060  msParam_t* inpFormatParam, ruleExecInfo_t *rei ) {
1061  char *format;
1062  char *dateFormat;
1063  char tStr[TIME_LEN];
1064  time_t myTime;
1065  struct tm *mytm;
1066 
1067  /* For testing mode when used with irule --test */
1068  RE_TEST_MACRO( " Calling msiGetFormattedSystemTime" );
1069 
1070 
1071  if ( rei == NULL || rei->rsComm == NULL ) {
1072  rodsLog( LOG_ERROR,
1073  "msiGetFormattedSystemTime: input rei or rsComm is NULL" );
1075  }
1076  format = ( char* )inpParam->inOutStruct;
1077  dateFormat = ( char* )inpFormatParam->inOutStruct;
1078 
1079  if ( !format || strcmp( format, "human" ) ) {
1080  getNowStr( tStr );
1081  }
1082  else {
1083  myTime = time( NULL );
1084  mytm = localtime( &myTime );
1085 
1086  snprintf( tStr, TIME_LEN, dateFormat,
1087  mytm->tm_year + 1900, mytm->tm_mon + 1, mytm->tm_mday,
1088  mytm->tm_hour, mytm->tm_min, mytm->tm_sec );
1089  }
1090  fillStrInMsParam( outParam, tStr );
1091  return 0;
1092 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
remoteExec
int remoteExec(msParam_t *mPD, msParam_t *mPA, msParam_t *mPB, msParam_t *mPC, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:298
NULL
#define NULL
Definition: rodsDef.h:70
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
irods::lookup_table
Definition: irods_lookup_table.hpp:24
irods_ms_plugin.hpp
irods_server_properties.hpp
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
USER_INPUT_FORMAT_ERR
@ USER_INPUT_FORMAT_ERR
Definition: rodsErrorTable.h:270
BytesBuf::buf
void * buf
Definition: rodsDef.h:199
ExecCmdOut
Definition: execCmd.h:20
rsRuleExecSubmit
int rsRuleExecSubmit(rsComm_t *rsComm, ruleExecSubmitInp_t *ruleExecSubmitInp, char **ruleExecId)
Definition: rsRuleExecSubmit.cpp:14
fillSubmitConditions
int fillSubmitConditions(const char *action, const char *inDelayCondition, bytesBuf_t *packedReiAndArgBBuf, ruleExecSubmitInp_t *ruleSubmitInfo, ruleExecInfo_t *rei)
Definition: irods_re_structs.cpp:490
irods::plugin_name_generator
Definition: irods_plugin_name_generator.hpp:15
msiFreeBuffer
int msiFreeBuffer(msParam_t *memoryParam, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:490
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
fillBufLenInMsParam
void fillBufLenInMsParam(msParam_t *msParam, int myInt, bytesBuf_t *bytesBuf)
Definition: msParam.cpp:287
rsExecMyRule
int rsExecMyRule(rsComm_t *rsComm, execMyRuleInp_t *execMyRuleInp, msParamArray_t **outParamArray)
Definition: rsExecMyRule.cpp:9
replInOutStruct
int replInOutStruct(void *inStruct, void **outStruct, const char *type)
Definition: msParam.cpp:173
msiGetFormattedSystemTime
int msiGetFormattedSystemTime(msParam_t *outParam, msParam_t *inpParam, msParam_t *inpFormatParam, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:1059
delayExec
int delayExec(msParam_t *mPA, msParam_t *mPB, msParam_t *mPC, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:111
irods::plugin_name_generator::plugin_list_t
std::vector< std::string > plugin_list_t
Definition: irods_plugin_name_generator.hpp:19
rodsSleep
int rodsSleep(int sec, int microSec)
Definition: sockComm.cpp:1270
ExecMyRuleInp::outParamDesc
char outParamDesc[256]
Definition: execMyRule.h:13
GlobalDelayExecStack
static std::vector< std::string > GlobalDelayExecStack
Definition: nre.systemMS.cpp:28
ExecMyRuleInp::condInput
keyValPair_t condInput
Definition: execMyRule.h:12
rcMisc.h
parseMspForStr
char * parseMspForStr(msParam_t *inpParam)
Definition: msParam.cpp:893
LONG_NAME_LEN
#define LONG_NAME_LEN
Definition: rodsDef.h:57
irods::lookup_table::begin
iterator begin()
Definition: irods_lookup_table.hpp:53
replBytesBuf
bytesBuf_t * replBytesBuf(const bytesBuf_t *in)
Definition: msParam.cpp:208
irods::lookup_table::iterator
irods_hash_map::iterator iterator
Definition: irods_lookup_table.hpp:31
msiHumanToSystemTime
int msiHumanToSystemTime(msParam_t *inpParam, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:764
fillMsParam
int fillMsParam(msParam_t *msParam, const char *label, const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:222
execMyRule.h
recover_remoteExec
int recover_remoteExec(msParam_t *, msParam_t *, char *, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:338
getNowStr
void getNowStr(char *timeStr)
Definition: rcMisc.cpp:1590
irods::CFG_MAX_SIZE_FOR_SINGLE_BUFFER
const std::string CFG_MAX_SIZE_FOR_SINGLE_BUFFER("maximum_size_for_single_buffer_in_megabytes")
msiGetSystemTime
int msiGetSystemTime(msParam_t *outParam, msParam_t *inpParam, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:701
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
replMsParamArray
int replMsParamArray(msParamArray_t *msParamArray, msParamArray_t *outMsParamArray)
Definition: msParam.cpp:129
run_tests.action
action
Definition: run_tests.py:114
ruleExecDel.h
MsParam::type
char * type
Definition: msParam.h:78
MAX_ACTION_SIZE
#define MAX_ACTION_SIZE
Definition: reDefines.h:22
region.h
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
BytesBuf::len
int len
Definition: rodsDef.h:198
rsRuleExecDel.hpp
irods::PLUGIN_TYPE_MICROSERVICE
const std::string PLUGIN_TYPE_MICROSERVICE("microservices")
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
irods::resolve_plugin_path
static error resolve_plugin_path(const std::string &_type, std::string &_path)
Definition: irods_load_plugin.hpp:33
ExecMyRuleInp::myRule
char myRule[(1024 *20)]
Definition: execMyRule.h:10
irods::error::code
long long code() const
Definition: irods_error.cpp:194
getLocalTimeFromRodsTime
int getLocalTimeFromRodsTime(const char *timeStrIn, char *timeStrOut)
Definition: rcMisc.cpp:1602
msiSleep
int msiSleep(msParam_t *secPtr, msParam_t *microsecPtr, ruleExecInfo_t *)
Definition: nre.systemMS.cpp:564
rsRuleExecDel
int rsRuleExecDel(rsComm_t *rsComm, ruleExecDelInp_t *ruleExecDelInp)
Definition: rsRuleExecDel.cpp:46
META_STR_LEN
#define META_STR_LEN
Definition: rodsDef.h:65
rsExecMyRule.hpp
checkFilePerms
int checkFilePerms(char *fileName)
Definition: nre.systemMS.cpp:444
TIME_LEN
#define TIME_LEN
Definition: rodsDef.h:54
MsParamArray::msParam
msParam_t ** msParam
Definition: msParam.h:87
ExecCmdOut::stdoutBuf
bytesBuf_t stdoutBuf
Definition: execCmd.h:21
pid_age.pid
pid
Definition: pid_age.py:12
rsRuleExecSubmit.hpp
irods_load_plugin.hpp
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
MAX_NUM_OF_ARGS_IN_ACTION
#define MAX_NUM_OF_ARGS_IN_ACTION
Definition: irods_re_structs.hpp:13
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
MsParam
Definition: msParam.h:76
irods::log
void log(const error &)
Definition: irods_log.cpp:13
getTaggedValues
std::map< std::string, std::vector< std::string > > getTaggedValues(const char *str)
Definition: irods_re_structs.cpp:462
RETRY_WITHOUT_RECOVERY_ERR
@ RETRY_WITHOUT_RECOVERY_ERR
Definition: rodsErrorTable.h:662
irods::lookup_table::end
iterator end()
Definition: irods_lookup_table.hpp:56
msiGoodFailure
int msiGoodFailure(ruleExecInfo_t *)
Definition: nre.systemMS.cpp:436
BytesBuf
Definition: rodsDef.h:197
irods::error
Definition: irods_error.hpp:23
MsParam::inpOutBuf
bytesBuf_t * inpOutBuf
Definition: msParam.h:81
run_tests.results
def results
Definition: run_tests.py:154
msiBytesBufToStr
int msiBytesBufToStr(msParam_t *buf_msp, msParam_t *str_msp, ruleExecInfo_t *)
Definition: nre.systemMS.cpp:900
irods::plugin_name_generator::list_plugins
error list_plugins(const std::string &_dir_name, plugin_list_t &_list)
Definition: irods_plugin_name_generator.cpp:87
MsParamArray::len
int len
Definition: msParam.h:85
ruleExecSubmitInp_t
Definition: ruleExecSubmit.h:21
addMsParamToArray
int addMsParamToArray(msParamArray_t *msParamArray, const char *label, const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf, int replFlag)
Definition: msParam.cpp:47
MsParam::label
char * label
Definition: msParam.h:77
ExecMyRuleInp
Definition: execMyRule.h:9
_delayExec
int _delayExec(const char *, const char *, const char *, ruleExecInfo_t *)
Definition: nre.systemMS.cpp:158
RuleExecInfo::pluginInstanceName
char pluginInstanceName[(1024+64)]
Definition: irods_re_structs.hpp:23
irods_plugin_name_generator.hpp
msiGetDiffTime
int msiGetDiffTime(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:611
RuleExecInfo::msParamArray
msParamArray_t * msParamArray
Definition: irods_re_structs.hpp:24
fillStrInMsParam
void fillStrInMsParam(msParam_t *msParam, const char *myStr)
Definition: msParam.cpp:278
msiStrToBytesBuf
int msiStrToBytesBuf(msParam_t *str_msp, msParam_t *buf_msp, ruleExecInfo_t *)
Definition: nre.systemMS.cpp:835
KeyValPair_MS_T
#define KeyValPair_MS_T
Definition: msParam.h:37
msiListEnabledMS
int msiListEnabledMS(msParam_t *outKVPairs, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:966
RuleExecInfo
Definition: irods_re_structs.hpp:18
irods_re_structs.hpp
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
RE_TEST_MACRO
#define RE_TEST_MACRO(msg)
Definition: reDefines.h:58
KeyValPair::len
int len
Definition: objInfo.h:121
ALL_MS_PARAM_KW
#define ALL_MS_PARAM_KW
Definition: rodsKeyWdDef.h:73
irods::exception
Definition: irods_exception.hpp:15
icatHighLevelRoutines.hpp
localToUnixTime
int localToUnixTime(char *localTime, char *unixTime)
Definition: rcMisc.cpp:2035
sockComm.h
doForkExec
int doForkExec(char *prog, char *arg1)
Definition: nre.systemMS.cpp:364
recover_delayExec
int recover_delayExec(msParam_t *, msParam_t *, ruleExecInfo_t *rei)
Definition: nre.systemMS.cpp:205
packReiAndArg
int packReiAndArg(ruleExecInfo_t *rei, char *myArgv[], int myArgc, bytesBuf_t **packedReiAndArgBBuf)
Definition: irods_re_structs.cpp:390
parseHostAddrStr
int parseHostAddrStr(char *hostAddr, rodsHostAddr_t *addr)
Definition: rcMisc.cpp:3552
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
MsParamArray
Definition: msParam.h:84
ExecMyRuleInp::addr
rodsHostAddr_t addr
Definition: execMyRule.h:11
clearBBuf
int clearBBuf(bytesBuf_t *myBBuf)
Definition: rcMisc.cpp:101
KeyValPair
Definition: objInfo.h:120
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
carryOverMsParam
static int carryOverMsParam(msParamArray_t *sourceMsParamArray, msParamArray_t *targetMsParamArray)
Definition: nre.systemMS.cpp:232
ruleExecDelInp_t
Definition: ruleExecDel.h:7
buf
static char buf[64+50+1]
Definition: rsAuthRequest.cpp:21
ruleExecDelInp_t::ruleExecId
char ruleExecId[64]
Definition: ruleExecDel.h:8
ExecMyRuleInp::inpParamArray
msParamArray_t * inpParamArray
Definition: execMyRule.h:14
irods_log.hpp
USER__NULL_INPUT_ERR
@ USER__NULL_INPUT_ERR
Definition: rodsErrorTable.h:247
ExecCmdOut::stderrBuf
bytesBuf_t stderrBuf
Definition: execCmd.h:22
set_plugin_instance_name
void set_plugin_instance_name(const char *_xml, char *_plugin_name)
Definition: nre.systemMS.cpp:138