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)  

rsExecCmd.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See dataObjRead.h for a description of this API call.*/
5 
6 #include <sys/types.h>
7 #ifndef windows_platform
8 #include <sys/wait.h>
9 #else
10 #include "Unix2Nt.hpp"
11 #endif
12 #include "execCmd.h"
13 #include "objMetaOpr.hpp"
14 #include "dataObjOpr.hpp"
15 #include "fileClose.h"
16 #include "miscServerFunct.hpp"
17 #include "rodsLog.h"
18 #include "icatDefines.h"
19 #include "rsGlobalExtern.hpp"
20 #include "rcGlobalExtern.h"
21 #include "rsExecCmd.hpp"
22 
25 #include "irods_re_structs.hpp"
26 
27 #include <boost/thread/mutex.hpp>
28 boost::mutex ExecCmdMutex;
30  return 0;
31 }
32 
33 int
34 rsExecCmd( rsComm_t *rsComm, execCmd_t *execCmdInp, execCmdOut_t **execCmdOut ) {
35  int status;
36  dataObjInfo_t *dataObjInfoHead = NULL;
38  int remoteFlag;
39  rodsHostAddr_t addr;
40  irods::error err = SUCCESS();
41 
42  ruleExecInfo_t rei;
43  initReiWithDataObjInp(&rei, rsComm, NULL);
44 
45  const char* args[4] = {
46  execCmdInp->cmd,
47  execCmdInp->cmdArgv,
48  execCmdInp->execAddr,
49  execCmdInp->hintPath
50  };
51 
52  status = applyRuleArg("acPreProcForExecCmd", args, 4, &rei, NO_SAVE_REI);
53  if (status < 0) {
55  "initAgent: acPreProcForExecCmd error, status = %d", status);
56  return (status);
57  }
58 
59  /* some sanity check on the cmd path */
60  if ( strchr( execCmdInp->cmd, '/' ) != NULL ) {
62  "rsExecCmd: bad cmd path %s", execCmdInp->cmd );
63  return BAD_EXEC_CMD_PATH;
64  }
65 
66  /* Also check for anonymous. As an additional safety precaution,
67  by default, do not allow the anonymous user (if defined) to
68  execute commands via rcExecCmd. If your site needs to allow
69  this for some particular feature, you can remove the
70  following check.
71  */
72  if ( strncmp( ANONYMOUS_USER, rsComm->clientUser.userName, NAME_LEN ) == 0 ) {
74  }
75 
76  memset( &addr, 0, sizeof( addr ) );
77  if ( *execCmdInp->hintPath != '\0' ) {
78  dataObjInp_t dataObjInp;
79  memset( &dataObjInp, 0, sizeof( dataObjInp ) );
80  rstrcpy( dataObjInp.objPath, execCmdInp->hintPath, MAX_NAME_LEN );
81 
82  // =-=-=-=-=-=-=-
83  // determine the resource hierarchy if one is not provided
84  std::string resc_hier;
85  char* resc_hier_ptr = getValByKey( &dataObjInp.condInput, RESC_HIER_STR_KW );
86  if ( resc_hier_ptr == NULL ) {
88  rsComm, &dataObjInp, resc_hier );
89  if ( !ret.ok() ) {
90  std::stringstream msg;
91  msg << "failed in irods::resolve_resource_hierarchy for [";
92  msg << dataObjInp.objPath << "]";
93  irods::log( PASSMSG( msg.str(), ret ) );
94  return ret.code();
95  }
96 
97  // =-=-=-=-=-=-=-
98  // we resolved the redirect and have a host, set the hier str for subsequent
99  // api calls, etc.
100  addKeyVal( &dataObjInp.condInput, RESC_HIER_STR_KW, resc_hier.c_str() );
101  addKeyVal( &execCmdInp->condInput, RESC_HIER_STR_KW, resc_hier.c_str() );
102  }
103  else {
104  resc_hier = resc_hier_ptr;
105 
106  }
107 
108  status = getDataObjInfo( rsComm, &dataObjInp, &dataObjInfoHead, ACCESS_READ_OBJECT, 0 );
109  if ( status < 0 ) {
111  "rsExecCmd: getDataObjInfo error for hintPath %s",
112  execCmdInp->hintPath );
113  return status;
114  }
115 
116  status = sortObjInfoForOpen( &dataObjInfoHead, &execCmdInp->condInput, 0 );
117 
118  if ( status < 0 || NULL == dataObjInfoHead ) {
119  return status; // JMC cppcheck nullptr
120  }
121 
122  if ( execCmdInp->addPathToArgv > 0 ) {
123  char tmpArgv[HUGE_NAME_LEN];
124  rstrcpy( tmpArgv, execCmdInp->cmdArgv, HUGE_NAME_LEN );
125  snprintf( execCmdInp->cmdArgv, HUGE_NAME_LEN, "%s %s",
126  dataObjInfoHead->filePath, tmpArgv );
127  }
128 
129  // =-=-=-=-=-=-=-
130  // extract the host location from the resource hierarchy
131  std::string location;
132  err = irods::get_loc_for_hier_string( dataObjInfoHead->rescHier, location );
133  if ( !err.ok() ) {
134  irods::log( PASSMSG( "rsExecCmd - failed in get_loc_for_hier_string", err ) );
135  return err.code();
136  }
137 
138  // =-=-=-=-=-=-=-
139  // extract zone name from resource hierarchy
140  std::string zone_name;
141  err = irods::get_resource_property<std::string>( dataObjInfoHead->rescId, irods::RESOURCE_ZONE, zone_name );
142  if ( !err.ok() ) {
143  irods::log( PASSMSG( "rsExecCmd - failed in get_resc_hier_property", err ) );
144  return err.code();
145  }
146 
147  rstrcpy( addr.zoneName, zone_name.c_str(), NAME_LEN );
148  rstrcpy( addr.hostAddr, location.c_str(), LONG_NAME_LEN );
149 
150  /* just in case we have to do it remote */
151  *execCmdInp->hintPath = '\0'; /* no need for hint */
152  rstrcpy( execCmdInp->execAddr, location.c_str(),
153  LONG_NAME_LEN );
154  freeAllDataObjInfo( dataObjInfoHead );
155  remoteFlag = resolveHost( &addr, &rodsServerHost );
156  }
157  else if ( *execCmdInp->execAddr != '\0' ) {
158  rstrcpy( addr.hostAddr, execCmdInp->execAddr, LONG_NAME_LEN );
159  remoteFlag = resolveHost( &addr, &rodsServerHost );
160  }
161  else {
163  remoteFlag = LOCAL_HOST;
164  }
165 
166  if ( remoteFlag == LOCAL_HOST ) {
167  status = _rsExecCmd( execCmdInp, execCmdOut );
168  }
169  else if ( remoteFlag == REMOTE_HOST ) {
170  status = remoteExecCmd( rsComm, execCmdInp, execCmdOut,
171  rodsServerHost );
172  }
173  else {
175  "rsFileOpenByHost: resolveHost of %s error, status = %d",
176  addr.hostAddr, remoteFlag );
178  }
179 
180  return status;
181 }
182 
183 int
184 remoteExecCmd( rsComm_t *rsComm, execCmd_t *execCmdInp,
185  execCmdOut_t **execCmdOut, rodsServerHost_t *rodsServerHost ) {
186  int status;
187 
188  if ( rodsServerHost == NULL ) {
190  "remoteExecCmd: Invalid rodsServerHost" );
192  }
193 
194  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
195  return status;
196  }
197 
198  status = rcExecCmd( rodsServerHost->conn, execCmdInp, execCmdOut );
199 
200  if ( status < 0 ) {
202  "remoteExecCmd: rcExecCmd failed for %s. status = %d",
203  execCmdInp->cmd, status );
204  }
205  else if ( status > 0 &&
206  getValByKey( &execCmdInp->condInput, STREAM_STDOUT_KW ) != NULL ) {
207  int fileInx = status;
208  ( *execCmdOut )->status = bindStreamToIRods( rodsServerHost, fileInx );
209  if ( ( *execCmdOut )->status < 0 ) {
210  fileCloseInp_t remFileCloseInp;
212  "remoteExecCmd: bindStreamToIRods failed. status = %d",
213  ( *execCmdOut )->status );
214  memset( &remFileCloseInp, 0, sizeof( remFileCloseInp ) );
215  remFileCloseInp.fileInx = fileInx;
216  rcFileClose( rodsServerHost->conn, &remFileCloseInp );
217  }
218  status = ( *execCmdOut )->status;
219  }
220  else {
221  status = 0;
222  }
223  return status;
224 }
225 
226 int
227 _rsExecCmd( execCmd_t *execCmdInp, execCmdOut_t **execCmdOut ) {
228  int childPid;
229  int stdoutFd[2];
230  int stderrFd[2];
231  int statusFd[2];
232  execCmdOut_t *myExecCmdOut;
233  bytesBuf_t statusBuf;
234  int status, childStatus;
235 
236 #ifndef windows_platform /* UNIX */
237  ExecCmdMutex.lock();
238  if ( pipe( stdoutFd ) < 0 )
239 #else
240  int pipe_buf_size = META_STR_LEN;
241  if ( _pipe( stdoutFd, pipe_buf_size, O_BINARY ) < 0 )
242 #endif
243  {
245  "_rsExecCmd: pipe create failed. errno = %d", errno );
246  ExecCmdMutex.unlock();
247  return SYS_PIPE_ERROR - errno;
248  }
249 
250 #ifndef windows_platform /* UNIX */
251  if ( pipe( stderrFd ) < 0 )
252 #else
253  if ( _pipe( stderrFd, pipe_buf_size, O_BINARY ) < 0 )
254 #endif
255  {
257  "_rsExecCmd: pipe create failed. errno = %d", errno );
258  ExecCmdMutex.unlock();
259  return SYS_PIPE_ERROR - errno;
260  }
261 
262 #ifndef windows_platform /* UNIX */
263  if ( pipe( statusFd ) < 0 )
264 #else
265  if ( _pipe( statusFd, pipe_buf_size, O_BINARY ) < 0 )
266 #endif
267  {
269  "_rsExecCmd: pipe create failed. errno = %d", errno );
270  ExecCmdMutex.unlock();
271  return SYS_PIPE_ERROR - errno;
272  }
273 
274 #ifndef windows_platform /* UNIX */
275  /* use fork instead of vfork to handle mylti-thread */
276  childPid = fork();
277 
278  ExecCmdMutex.unlock();
279  if ( childPid == 0 ) {
280  char *tmpStr;
281  /* Indicate that the call came from internal rule */
282  if ( ( tmpStr = getValByKey( &execCmdInp->condInput, EXEC_CMD_RULE_KW ) )
283  != NULL ) {
284  char *myStr = ( char* )malloc( NAME_LEN + 20 );
285  snprintf( myStr, NAME_LEN + 20, "%s=%s", EXEC_CMD_RULE_KW, tmpStr );
286  putenv( myStr );
287  //free( myStr ); // JMC cppcheck - leak ==> backport 'fix' from comm trunk for solaris
288  }
289  close( stdoutFd[0] );
290  close( stderrFd[0] );
291  close( statusFd[0] );
292  status = execCmd( execCmdInp, stdoutFd[1], stderrFd[1] );
293  if ( status < 0 ) {
294  status = EXEC_CMD_ERROR - errno;
295  }
296  /* send the status back to parent */
297  if ( write( statusFd[1], &status, 4 ) == -1 ) {
298  int errsv = errno;
299  irods::log( ERROR( errsv, "Write failed when sending status back to parent." ) );
300  }
301  /* gets here. must be bad */
302  exit( 1 );
303  }
304  else if ( childPid < 0 ) {
306  "_rsExecCmd: RODS_FORK failed. errno = %d", errno );
307  return SYS_FORK_ERROR;
308  }
309 #else /* Windows */
310  status = execCmd( execCmdInp, stdoutFd[1], stderrFd[1] );
311  if ( status < 0 ) {
312  status = EXEC_CMD_ERROR - errno;
313  }
314  if ( status < 0 ) {
315  rodsLog( LOG_ERROR, "_rsExecCmd: RODS_FORK failed. errno = %d", errno );
316  return SYS_FORK_ERROR;
317  }
318 #endif
319 
320 
321  /* the parent gets here */
322 #ifndef windows_platform
323  close( stdoutFd[1] );
324  close( stderrFd[1] );
325  close( statusFd[1] );
326 #endif
327 
328 
329  myExecCmdOut = *execCmdOut = ( execCmdOut_t* )malloc( sizeof( execCmdOut_t ) );
330  memset( myExecCmdOut, 0, sizeof( execCmdOut_t ) );
331 
332  readToByteBuf( stdoutFd[0], &myExecCmdOut->stdoutBuf );
333  if ( getValByKey( &execCmdInp->condInput, STREAM_STDOUT_KW ) != NULL &&
334  myExecCmdOut->stdoutBuf.len >= MAX_SZ_FOR_EXECMD_BUF ) {
335  /* more to come. don't close stdoutFd. close stderrFd and statusFd
336  * because the child is not done */
337  close( stderrFd[0] );
338  close( statusFd[0] );
339  myExecCmdOut->status = bindStreamToIRods( LocalServerHost, stdoutFd[0] );
340  if ( myExecCmdOut->status < 0 ) {
342  "_rsExecCmd: bindStreamToIRods failed. status = %d",
343  myExecCmdOut->status );
344  close( stdoutFd[0] );
345  }
346  }
347  else {
348  close( stdoutFd[0] );
349  readToByteBuf( stderrFd[0], &myExecCmdOut->stderrBuf );
350  close( stderrFd[0] );
351  memset( &statusBuf, 0, sizeof( statusBuf ) );
352  readToByteBuf( statusFd[0], &statusBuf );
353  close( statusFd[0] );
354  if ( statusBuf.len == sizeof( int ) + 1 ) {
355  myExecCmdOut->status = *( ( int * )statusBuf.buf );
356  free( statusBuf.buf );
357  }
358  childStatus = 0;
359 
360 #ifndef windows_platform /* UNIX */
361  status = waitpid( childPid, &childStatus, 0 );
362  if ( status >= 0 && myExecCmdOut->status >= 0 && childStatus != 0 ) {
364  "_rsExecCmd: waitpid status = %d, myExecCmdOut->status = %d, childStatus = %d", status, myExecCmdOut->status, childStatus );
365  myExecCmdOut->status = EXEC_CMD_ERROR;
366  }
367 #endif
368  } // else
369  return myExecCmdOut->status;
370 }
371 
372 int
373 execCmd( execCmd_t *execCmdInp, int stdOutFd, int stdErrFd ) {
374  char cmdPath[LONG_NAME_LEN];
375  char *av[LONG_NAME_LEN];
376  int status;
377 
378 
379  snprintf( cmdPath, LONG_NAME_LEN, "%s/%s", CMD_DIR, execCmdInp->cmd );
380  rodsLog( LOG_NOTICE, "execCmd:%s argv:%s", cmdPath, execCmdInp->cmdArgv );
381  initCmdArg( av, execCmdInp->cmdArgv, cmdPath );
382 
384 
385 #ifndef windows_platform
386  /* set up the pipe as the stdin, stdout and stderr */
387 
388  close( 0 );
389  close( 1 );
390  close( 2 );
391 
392  dup2( stdOutFd, 0 );
393  dup2( stdOutFd, 1 );
394  dup2( stdErrFd, 2 );
395  close( stdOutFd );
396  close( stdErrFd );
397 
398  status = execv( av[0], av );
399 
400 #else /* Windows: Can Windows redirect the stdin, etc, to a pipe? */
401  status = _spawnv( _P_NOWAIT, av[0], av );
402 #endif
403 
404  return status;
405 }
406 
407 int
408 initCmdArg( char *av[], char *cmdArgv, char *cmdPath ) {
409  int avInx = 0, i;
410  char *startPtr, *curPtr;
411  int quoteCnt, curLen;
412  char tmpCmdArgv[HUGE_NAME_LEN];
413 
414  av[avInx] = strdup( cmdPath );
415  avInx++;
416 
417  /* parse cmdArgv */
418 
419  if ( strlen( cmdArgv ) > 0 ) {
420  rstrcpy( tmpCmdArgv, cmdArgv, HUGE_NAME_LEN );
421  startPtr = curPtr = tmpCmdArgv;
422  quoteCnt = curLen = 0;
423  while ( *curPtr != '\0' ) {
424  if ( ( *curPtr == ' ' && quoteCnt == 0 && curLen > 0 ) ||
425  quoteCnt == 2 ) {
426  /* end of a argv */
427  *curPtr = '\0'; /* mark the end of argv */
428  curPtr++;
429  av[avInx] = strdup( startPtr );
430  avInx++;
431  startPtr = curPtr;
432  quoteCnt = curLen = 0;
433  }
434  else if ( *curPtr == ' ' && quoteCnt <= 1 && curLen == 0 ) {
435  /* skip over a leading blank */
436  curPtr++;
437  startPtr = curPtr;
438  }
439  else if ( ( *curPtr == '\'' || *curPtr == '\"' )
440  && ( *( curPtr - 1 ) == '\\' ) ) {
441  /* escaped quotes */
442  curPtr++;
443  curLen++;
444  }
445  else if ( *curPtr == '\'' || *curPtr == '\"' ) {
446  quoteCnt++;
447  /* skip over the quote */
448  if ( quoteCnt == 1 ) {
449  curPtr++;
450  startPtr = curPtr;
451  }
452  }
453  else {
454  /* just normal char */
455  curPtr++;
456  curLen++;
457  }
458  }
459  /* The last one */
460  if ( curLen > 0 ) {
461  av[avInx] = strdup( startPtr );
462  avInx++;
463  }
464  }
465 
466  /* put a NULL on the last one */
467 
468  av[avInx] = NULL;
469 
470  /* escaped quotes */
471  for ( i = 0; i < avInx ; i++ ) {
472  curPtr = av[i];
473  startPtr = curPtr;
474  while ( *curPtr != '\0' ) {
475  if ( *curPtr == '\\' && ( *( curPtr + 1 ) == '\'' || *( curPtr + 1 ) == '\"' ) ) {
476  curPtr++;
477  }
478  *startPtr = *curPtr;
479  curPtr++;
480  startPtr++;
481  }
482  *startPtr = '\0';
483  }
484 
485  return 0;
486 }
readToByteBuf
int readToByteBuf(int fd, bytesBuf_t *bytesBuf)
Definition: rcMisc.cpp:3892
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
DataObjInp::objPath
char objPath[(1024+64)]
Definition: dataObjInpOut.h:66
NULL
#define NULL
Definition: rodsDef.h:70
ACCESS_READ_OBJECT
#define ACCESS_READ_OBJECT
Definition: icatDefines.h:52
rsComm_t
Definition: rcConnect.h:145
ExecCmd::execAddr
char execAddr[256]
Definition: execCmd.h:13
ExecCmd::hintPath
char hintPath[(1024+64)]
Definition: execCmd.h:14
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
execCmd.h
BytesBuf::buf
void * buf
Definition: rodsDef.h:199
ExecCmdOut
Definition: execCmd.h:20
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
_rsExecCmd
int _rsExecCmd(execCmd_t *execCmdInp, execCmdOut_t **execCmdOut)
Definition: rsExecCmd.cpp:227
HUGE_NAME_LEN
#define HUGE_NAME_LEN
Definition: rodsDef.h:62
irods::resolve_resource_hierarchy
error resolve_resource_hierarchy(const std::string &, rsComm_t *, dataObjInp_t *, std::string &, dataObjInfo_t **_data_obj_info=0)
Definition: irods_resource_redirect.cpp:505
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
ExecCmdMutex
boost::mutex ExecCmdMutex
Definition: rsExecCmd.cpp:28
DataObjInfo::rescId
rodsLong_t rescId
Definition: objInfo.h:164
LONG_NAME_LEN
#define LONG_NAME_LEN
Definition: rodsDef.h:57
DataObjInfo::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:132
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
remoteExecCmd
int remoteExecCmd(rsComm_t *rsComm, execCmd_t *execCmdInp, execCmdOut_t **execCmdOut, rodsServerHost_t *rodsServerHost)
Definition: rsExecCmd.cpp:184
initExecCmdMutex
int initExecCmdMutex()
Definition: rsExecCmd.cpp:29
irods_resource_backport.hpp
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
manual_cleanup.zone_name
zone_name
Definition: manual_cleanup.py:16
rcGlobalExtern.h
DataObjInfo::filePath
char filePath[(1024+64)]
Definition: objInfo.h:137
initCmdArg
int initCmdArg(char *av[], char *cmdArgv, char *cmdPath)
Definition: rsExecCmd.cpp:408
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods_resource_redirect.hpp
LocalServerHost
rodsServerHost_t * LocalServerHost
Definition: irods_server_globals.cpp:20
fileClose.h
BytesBuf::len
int len
Definition: rodsDef.h:198
initReiWithDataObjInp
int initReiWithDataObjInp(ruleExecInfo_t *rei, rsComm_t *rsComm, dataObjInp_t *dataObjIn)
Definition: irods_re_structs.cpp:164
FileCloseInp
Definition: fileClose.h:6
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
rsGlobalExtern.hpp
irods::OPEN_OPERATION
const std::string OPEN_OPERATION("OPEN")
irods::error::code
long long code() const
Definition: irods_error.cpp:194
RESC_HIER_STR_KW
#define RESC_HIER_STR_KW
Definition: rodsKeyWdDef.h:225
STREAM_STDOUT_KW
#define STREAM_STDOUT_KW
Definition: rodsKeyWdDef.h:103
EXEC_CMD_ERROR
@ EXEC_CMD_ERROR
Definition: rodsErrorTable.h:265
FileCloseInp::fileInx
int fileInx
Definition: fileClose.h:7
EXEC_CMD_RULE_KW
#define EXEC_CMD_RULE_KW
Definition: rodsKeyWdDef.h:101
META_STR_LEN
#define META_STR_LEN
Definition: rodsDef.h:65
freeAllDataObjInfo
int freeAllDataObjInfo(dataObjInfo_t *dataObjInfoHead)
Definition: rcMisc.cpp:561
ExecCmdOut::status
int status
Definition: execCmd.h:23
ANONYMOUS_USER
#define ANONYMOUS_USER
Definition: rodsDef.h:133
execCmd
int execCmd(execCmd_t *execCmdInp, int stdOutFd, int stdErrFd)
Definition: rsExecCmd.cpp:373
ExecCmdOut::stdoutBuf
bytesBuf_t stdoutBuf
Definition: execCmd.h:21
BAD_EXEC_CMD_PATH
@ BAD_EXEC_CMD_PATH
Definition: rodsErrorTable.h:263
applyRuleArg
int applyRuleArg(const char *action, const char *args[20], int argc, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:95
DataObjInp
Definition: dataObjInpOut.h:65
CMD_DIR
#define CMD_DIR
Definition: execCmd.h:8
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
rsExecCmd
int rsExecCmd(rsComm_t *rsComm, execCmd_t *execCmdInp, execCmdOut_t **execCmdOut)
Definition: rsExecCmd.cpp:34
rcExecCmd
int rcExecCmd(rcComm_t *conn, execCmd_t *execCmdInp, execCmdOut_t **execCmdOut)
Definition: rcExecCmd.cpp:34
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
SYS_FORK_ERROR
@ SYS_FORK_ERROR
Definition: rodsErrorTable.h:116
sortObjInfoForOpen
int sortObjInfoForOpen(dataObjInfo_t **dataObjInfoHead, keyValPair_t *condInput, int writeFlag)
Definition: dataObjOpr.cpp:548
irods::RESOURCE_ZONE
const std::string RESOURCE_ZONE("resource_property_zone")
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
MAX_SZ_FOR_EXECMD_BUF
#define MAX_SZ_FOR_EXECMD_BUF
Definition: rodsDef.h:88
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rodsLog.h
irods::log
void log(const error &)
Definition: irods_log.cpp:13
rcFileClose
int rcFileClose(rcComm_t *conn, fileCloseInp_t *fileCloseInp)
Definition: rcFileClose.cpp:23
ExecCmd::condInput
keyValPair_t condInput
Definition: execCmd.h:17
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
icatDefines.h
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
bindStreamToIRods
int bindStreamToIRods(rodsServerHost_t *rodsServerHost, int fd)
Definition: fileOpr.cpp:576
getDataObjInfo
int getDataObjInfo(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t **dataObjInfoHead, char *accessPerm, int ignoreCondInput)
Definition: dataObjOpr.cpp:87
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
BytesBuf
Definition: rodsDef.h:197
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
SYS_PIPE_ERROR
@ SYS_PIPE_ERROR
Definition: rodsErrorTable.h:117
ExecCmd
Definition: execCmd.h:10
ThisComm
rsComm_t * ThisComm
Definition: irods_server_globals.cpp:45
rodsServerHost
Definition: rodsConnect.h:62
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
RuleExecInfo
Definition: irods_re_structs.hpp:18
irods_re_structs.hpp
ExecCmd::addPathToArgv
int addPathToArgv
Definition: execCmd.h:15
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
dataObjOpr.hpp
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
irods::get_loc_for_hier_string
error get_loc_for_hier_string(const std::string &_hier, std::string &_loc)
Definition: irods_resource_backport.cpp:633
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
ExecCmd::cmd
char cmd[256]
Definition: execCmd.h:11
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
USER_NOT_ALLOWED_TO_EXEC_CMD
@ USER_NOT_ALLOWED_TO_EXEC_CMD
Definition: rodsErrorTable.h:283
ExecCmd::cmdArgv
char cmdArgv[100000]
Definition: execCmd.h:12
DataObjInfo
Definition: objInfo.h:129
rodsHostAddr_t::zoneName
char zoneName[64]
Definition: rodsDef.h:298
closeAllL1desc
int closeAllL1desc(rsComm_t *rsComm)
Definition: objDesc.cpp:108
objMetaOpr.hpp
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375
rodsHostAddr_t
Definition: rodsDef.h:296
ExecCmdOut::stderrBuf
bytesBuf_t stderrBuf
Definition: execCmd.h:22
rsExecCmd.hpp