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)  

physPath.cpp
Go to the documentation of this file.
1 
4 /* physPath.c - routines for physical path operations
5  */
6 
7 #include <unistd.h> // JMC - backport 4598
8 #include <fcntl.h> // JMC - backport 4598
9 #include "rcMisc.h"
10 #include "rodsDef.h"
11 #include "rodsConnect.h"
12 #include "physPath.hpp"
13 #include "dataObjOpr.hpp"
14 #include "rodsDef.h"
15 #include "rodsPath.h"
16 #include "rsGlobalExtern.hpp"
17 #include "fileChksum.h"
18 #include "modDataObjMeta.h"
19 #include "objMetaOpr.hpp"
20 #include "collection.hpp"
21 #include "resource.hpp"
22 #include "dataObjClose.h"
23 #include "rcGlobalExtern.h"
24 #include "rsDataObjClose.hpp"
25 #include "genQuery.h"
26 #include "phyBundleColl.h"
27 #include "collCreate.h"
28 #include "rsFileChksum.hpp"
29 #include "rsModDataObjMeta.hpp"
30 #include "rsFileRename.hpp"
31 #include "rsGenQuery.hpp"
32 #include "rsCollCreate.hpp"
33 
34 #include <iostream>
35 #include <boost/lexical_cast.hpp>
36 
39 #include "irods_stacktrace.hpp"
41 #include "irods_log.hpp"
43 #include "irods_random.hpp"
44 
45 int getLeafRescPathName( const std::string& _resc_hier, std::string& _ret_string );
46 
47 int
48 getFileMode( dataObjInp_t *dataObjInp ) {
49  int createMode;
50  int defFileMode;
51 
52  defFileMode = getDefFileMode();
53  if ( dataObjInp != NULL &&
54  ( dataObjInp->createMode & 0110 ) != 0 ) {
55  if ( ( defFileMode & 0070 ) != 0 ) {
56  createMode = defFileMode | 0110;
57  }
58  else {
59  createMode = defFileMode | 0100;
60  }
61  }
62  else {
63  createMode = defFileMode;
64  }
65 
66  return createMode;
67 }
68 
69 int
70 getFileFlags( int l1descInx ) {
71  int flags;
72 
73  dataObjInp_t *dataObjInp = L1desc[l1descInx].dataObjInp;
74 
75  if ( dataObjInp != NULL ) {
76  flags = dataObjInp->openFlags;
77  }
78  else {
79  flags = O_RDONLY;
80  }
81 
82  return flags;
83 }
84 
85 
86 int
87 getFilePathName( rsComm_t *rsComm, dataObjInfo_t *dataObjInfo,
88  dataObjInp_t *dataObjInp ) {
89  char *filePath;
90  vaultPathPolicy_t vaultPathPolicy;
91  int status;
92 
93  if ( !dataObjInfo ) {
94  rodsLog( LOG_ERROR, "getFilePathName: input dataObjInfo is NULL" );
96  }
97 
98  if ( dataObjInp != NULL &&
99  ( filePath = getValByKey( &dataObjInp->condInput, FILE_PATH_KW ) ) != NULL
100  && strlen( filePath ) > 0 ) {
101  rstrcpy( dataObjInfo->filePath, filePath, MAX_NAME_LEN );
102  return 0;
103  }
104 
105  /* Make up a physical path */
106  if ( dataObjInfo->rescName[0] == '\0' ) {
108  "getFilePathName: rescName for %s not resolved",
109  dataObjInp->objPath );
110  return SYS_INVALID_RESC_INPUT;
111  }
112 
113  int chk_path = 0;
114  irods::error err = irods::get_resource_property< int >(
115  dataObjInfo->rescId,
117  if ( !err.ok() ) {
118  irods::log( PASS( err ) );
119  }
120 
121  if ( NO_CREATE_PATH == chk_path ) {
122  *dataObjInfo->filePath = '\0';
123  return 0;
124  }
125 
126  std::string vault_path;
127  status = getLeafRescPathName( dataObjInfo->rescHier, vault_path );
128  if ( status != 0 ) {
129  return status;
130  }
131 
132  status = getVaultPathPolicy( rsComm, dataObjInfo, &vaultPathPolicy );
133  if ( status < 0 ) {
134  return status;
135  }
136 
137  if ( vaultPathPolicy.scheme == GRAFT_PATH_S ) {
139  vault_path.c_str(), vaultPathPolicy.addUserName,
140  rsComm->clientUser.userName, vaultPathPolicy.trimDirCnt,
141  dataObjInfo->filePath );
142  }
143  else {
144  status = setPathForRandomScheme( dataObjInp->objPath,
145  vault_path.c_str(), rsComm->clientUser.userName,
146  dataObjInfo->filePath );
147  }
148 
149  return status;
150 }
151 
152 
153 int
155  vaultPathPolicy_t *outVaultPathPolicy ) {
156  ruleExecInfo_t rei;
157  msParam_t *msParam;
158  int status;
159 
160  if ( outVaultPathPolicy == NULL || dataObjInfo == NULL || rsComm == NULL ) {
162  "getVaultPathPolicy: NULL input" );
164  }
165  initReiWithDataObjInp( &rei, rsComm, NULL );
166 
167  rei.doi = dataObjInfo;
168 
169  // make resource properties available as rule session variables
171 
172  status = applyRule( "acSetVaultPathPolicy", NULL, &rei, NO_SAVE_REI );
174  free(rei.condInputData);
175  if ( status < 0 ) {
177  "getVaultPathPolicy: rule acSetVaultPathPolicy error, status = %d",
178  status );
179  return status;
180  }
181 
182  if ( ( msParam = getMsParamByLabel( &rei.inOutMsParamArray,
183  VAULT_PATH_POLICY ) ) == NULL ) {
184  /* use the default */
185  outVaultPathPolicy->scheme = DEF_VAULT_PATH_SCHEME;
186  outVaultPathPolicy->addUserName = DEF_ADD_USER_FLAG;
187  outVaultPathPolicy->trimDirCnt = DEF_TRIM_DIR_CNT;
188  }
189  else {
190  *outVaultPathPolicy = *( ( vaultPathPolicy_t * ) msParam->inOutStruct );
192  }
193  /* make sure trimDirCnt is <= 1 */
194  if ( outVaultPathPolicy->trimDirCnt > DEF_TRIM_DIR_CNT ) {
195  outVaultPathPolicy->trimDirCnt = DEF_TRIM_DIR_CNT;
196  }
197 
198  return 0;
199 }
200 
201 int
202 setPathForRandomScheme( char *objPath, const char *vaultPath, char *userName,
203  char *outPath ) {
204  int dir1, dir2;
205  char logicalCollName[MAX_NAME_LEN];
206  char logicalFileName[MAX_NAME_LEN];
207  int status;
208 
209  unsigned int myRandom = irods::getRandom<unsigned int>();
210  dir1 = myRandom & 0xf;
211  dir2 = ( myRandom >> 4 ) & 0xf;
212 
213  status = splitPathByKey( objPath,
214  logicalCollName, MAX_NAME_LEN, logicalFileName, MAX_NAME_LEN, '/' );
215 
216  if ( status < 0 ) {
218  "setPathForRandomScheme: splitPathByKey error for %s, status = %d",
219  outPath, status );
220  return status;
221  }
222 
223  snprintf( outPath, MAX_NAME_LEN,
224  "%s/%s/%d/%d/%s.%d", vaultPath, userName, dir1, dir2,
225  logicalFileName, ( uint ) time( NULL ) );
226  return 0;
227 }
228 
229 int
230 setPathForGraftPathScheme( char *objPath, const char *vaultPath, int addUserName,
231  char *userName, int trimDirCnt, char *outPath ) {
232  int i;
233  char *objPathPtr, *tmpPtr;
234  int len;
235 
236  objPathPtr = objPath + 1;
237 
238  for ( i = 0; i < trimDirCnt; i++ ) {
239  tmpPtr = strchr( objPathPtr, '/' );
240  if ( tmpPtr == NULL ) {
242  "setPathForGraftPathScheme: objPath %s too short", objPath );
243  break; /* just use the shorten one */
244  }
245  else {
246  /* skip over '/' */
247  objPathPtr = tmpPtr + 1;
248  /* don't skip over the trash path */
249  if ( i == 0 && strncmp( objPathPtr, "trash/", 6 ) == 0 ) {
250  break;
251  }
252  }
253  }
254 
255  if ( addUserName > 0 && userName != NULL ) {
256  len = snprintf( outPath, MAX_NAME_LEN,
257  "%s/%s/%s", vaultPath, userName, objPathPtr );
258  }
259  else {
260  len = snprintf( outPath, MAX_NAME_LEN,
261  "%s/%s", vaultPath, objPathPtr );
262  }
263 
264  if ( len >= MAX_NAME_LEN ) {
266  "setPathForGraftPathScheme: filePath %s too long", objPath );
267  return USER_STRLEN_TOOLONG;
268  }
269  else {
270  return 0;
271  }
272 }
273 
274 /* resolveDupFilePath - try to resolve deplicate file path in the same
275  * resource.
276  */
277 
278 int
280  dataObjInp_t *dataObjInp ) {
281  char tmpStr[NAME_LEN];
282  char *filePath;
283 
284  if ( getSizeInVault( rsComm, dataObjInfo ) == SYS_PATH_IS_NOT_A_FILE ) {
285  /* a dir */
286  return SYS_PATH_IS_NOT_A_FILE;
287  }
288  if ( chkAndHandleOrphanFile( rsComm, dataObjInfo->objPath, dataObjInfo->rescHier, dataObjInfo->filePath,
289  dataObjInfo->rescName, dataObjInfo->replStatus ) >= 0 ) {
290  /* this is an orphan file or has been renamed */
291  return 0;
292  }
293 
294  if ( dataObjInp != NULL ) {
295  filePath = getValByKey( &dataObjInp->condInput, FILE_PATH_KW );
296  if ( filePath != NULL && strlen( filePath ) > 0 ) {
297  return -1;
298  }
299  }
300 
301  if ( strlen( dataObjInfo->filePath ) >= MAX_NAME_LEN - 3 ) {
302  return -1;
303  }
304 
305  snprintf( tmpStr, NAME_LEN, ".%d", dataObjInfo->replNum );
306  strcat( dataObjInfo->filePath, tmpStr );
307 
308  return 0;
309 }
310 
311 int
312 getchkPathPerm( rsComm_t *rsComm, dataObjInp_t *dataObjInp,
313  dataObjInfo_t *dataObjInfo ) {
314  int chkPathPerm;
315  char *filePath;
316  ruleExecInfo_t rei;
317 
319  return NO_CHK_PATH_PERM;
320  }
321 
322  if ( dataObjInp == NULL || dataObjInfo == NULL ) {
323  return NO_CHK_PATH_PERM;
324  }
325 
326  if ( ( filePath = getValByKey( &dataObjInp->condInput, FILE_PATH_KW ) ) != NULL
327  && strlen( filePath ) > 0 ) {
328  /* the user input a path */
329  if ( !strlen( dataObjInfo->rescName ) ) {
330  chkPathPerm = NO_CHK_PATH_PERM;
331  }
332  else {
333  initReiWithDataObjInp( &rei, rsComm, dataObjInp );
334  rei.doi = dataObjInfo;
335 
336  // make resource properties available as rule session variables
338 
339  // =-=-=-=-=-=-=-
340  // JMC - backport 4774
341  rei.status = DISALLOW_PATH_REG; /* default */
342  applyRule( "acSetChkFilePathPerm", NULL, &rei, NO_SAVE_REI );
344  free(rei.condInputData);
345 
346  int chk_path = 0;
347  irods::error err = irods::get_resource_property< int >( dataObjInfo->rescId,
349  if ( !err.ok() ) {
350  irods::log( PASS( err ) );
351  }
352 
353  if ( err.ok() && ( rei.status == NO_CHK_PATH_PERM || NO_CHK_PATH_PERM == chk_path ) ) {
354  chkPathPerm = NO_CHK_PATH_PERM;
355  }
356  else {
357  chkPathPerm = rei.status;
358  // =-=-=-=-=-=-=-
359  }
360  }
361  }
362  else {
363  chkPathPerm = NO_CHK_PATH_PERM;
364  }
365  return chkPathPerm;
366 }
367 
368 int
370  char *myValue;
371 
372  myValue = getValByKey( condInput, COPIES_KW );
373 
374  if ( myValue == NULL ) {
375  return 1;
376  }
377  else if ( strcmp( myValue, "all" ) == 0 ) {
378  return ALL_COPIES;
379  }
380  else {
381  return atoi( myValue );
382  }
383 }
384 
385 int
386 getWriteFlag( int openFlag ) {
387  if ( openFlag & O_WRONLY || openFlag & O_RDWR ) {
388  return 1;
389  }
390  else {
391  return 0;
392  }
393 }
394 
396 getSizeInVault( rsComm_t *rsComm, dataObjInfo_t *dataObjInfo ) {
397  rodsStat_t *myStat = NULL;
398  int status;
399  rodsLong_t mysize;
400 
401  status = l3Stat( rsComm, dataObjInfo, &myStat );
402 
403  if ( status < 0 || NULL == myStat ) { // JMC cppcheck - nullptr
405  "getSizeInVault: l3Stat error for %s. status = %d",
406  dataObjInfo->filePath, status );
407  return status;
408  }
409  else {
410  if ( myStat->st_mode & S_IFDIR ) {
411  free( myStat );
413  }
414  mysize = myStat->st_size;
415  free( myStat );
416  return mysize;
417  }
418 }
419 
420 int
422  rsComm_t* rsComm,
423  dataObjInfo_t* dataObjInfo,
424  char** chksumStr ) { // JMC - backport 4527
425  fileChksumInp_t fileChksumInp;
426  int status = 0;
427 
428  // =-=-=-=-=-=-=-
429  int category = FILE_CAT; // only supporting file resource, not DB right now
430  char* orig_chksum = getValByKey( &dataObjInfo->condInput, ORIG_CHKSUM_KW );
431 
432  std::string location;
433  irods::error ret;
434  // JMC - legacy resource - switch ( RescTypeDef[rescTypeInx].rescCat) {
435  switch ( category ) {
436  case FILE_CAT:
437  // =-=-=-=-=-=-=-
438  // get the resource location for the hier string leaf
439  ret = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
440  if ( !ret.ok() ) {
441  irods::log( PASSMSG( "_dataObjChksum - failed in get_loc_for_hier_string", ret ) );
442  return -1;
443  }
444 
445  memset( &fileChksumInp, 0, sizeof( fileChksumInp ) );
446  rstrcpy( fileChksumInp.addr.hostAddr, location.c_str(), NAME_LEN );
447  rstrcpy( fileChksumInp.fileName, dataObjInfo->filePath, MAX_NAME_LEN );
448  rstrcpy( fileChksumInp.rescHier, dataObjInfo->rescHier, MAX_NAME_LEN );
449  rstrcpy( fileChksumInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN );
450  rstrcpy( fileChksumInp.in_pdmo, dataObjInfo->in_pdmo, MAX_NAME_LEN );
451 
452  if ( orig_chksum ) {
453  rstrcpy( fileChksumInp.orig_chksum, orig_chksum, CHKSUM_LEN );
454  }
455 
456  status = rsFileChksum( rsComm, &fileChksumInp, chksumStr );
457 
458  if ( status == DIRECT_ARCHIVE_ACCESS ) {
459  std::stringstream msg;
460  msg << "Data object: \"";
461  msg << dataObjInfo->filePath;
462  msg << "\" is located in an archive resource. Ignoring its checksum.";
463  irods::log( LOG_DEBUG, msg.str() );
464 
465  }
466  break;
467  default:
469  "_dataObjChksum: rescCat type %d is not recognized", category );
471  break;
472  }
473 
474  return status;
475 }
476 
477 int
479  char **chksumStr ) {
480  keyValPair_t regParam;
481  modDataObjMeta_t modDataObjMetaInp;
482  int status;
483 
484  status = _dataObjChksum( rsComm, dataObjInfo, chksumStr );
485  if ( status < 0 ) {
487  "dataObjChksumAndReg: _dataObjChksum error for %s, status = %d",
488  dataObjInfo->objPath, status );
489  return status;
490  }
491 
492  /* register it */
493  memset( &regParam, 0, sizeof( regParam ) );
494  addKeyVal( &regParam, CHKSUM_KW, *chksumStr );
495 
496  // always set pdmo flag here... total hack - harry
497  addKeyVal( &regParam, IN_PDMO_KW, dataObjInfo->rescHier );
498 
499  modDataObjMetaInp.dataObjInfo = dataObjInfo;
500  modDataObjMetaInp.regParam = &regParam;
501 
502  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
503 
504  clearKeyVal( &regParam );
505 
506  if ( status < 0 ) {
508  "dataObjChksumAndReg: rsModDataObjMeta error for %s, status = %d",
509  dataObjInfo->objPath, status );
510  /* don't return error because it is not fatal */
511  }
512 
513  return 0;
514 }
515 
516 /* chkAndHandleOrphanFile - Check whether the file is an orphan file.
517  * If it is, rename it.
518  * If it belongs to an old copy, move the old path and register it.
519  *
520  * return 0 - the filePath is NOT an orphan file.
521  * 1 - the filePath is an orphan file and has been renamed.
522  * < 0 - error
523  */
524 
525 int
526 chkAndHandleOrphanFile( rsComm_t *rsComm, char* objPath, char* rescHier, char *filePath, const char *_resc_name,
527  int replStatus ) {
528 
529  fileRenameInp_t fileRenameInp;
530  int status;
531  dataObjInfo_t myDataObjInfo;
532 
533  if ( strlen( filePath ) + 17 >= MAX_NAME_LEN ) {
534  /* the new path name will be too long to add "/orphan + random" */
535  return -1;
536  }
537 
538  /* check if the input filePath is assocated with a dataObj */
539 
540  memset( &myDataObjInfo, 0, sizeof( myDataObjInfo ) );
541  memset( &fileRenameInp, 0, sizeof( fileRenameInp ) );
542  if ( ( status = chkOrphanFile( rsComm, filePath, _resc_name, &myDataObjInfo ) ) == 0 ) {
543 
544  rstrcpy( fileRenameInp.oldFileName, filePath, MAX_NAME_LEN );
545  rstrcpy( fileRenameInp.rescHier, rescHier, MAX_NAME_LEN );
546  rstrcpy( fileRenameInp.objPath, objPath, MAX_NAME_LEN );
547 
548  /* not an orphan file */
549  if ( replStatus > OLD_COPY || isTrashPath( myDataObjInfo.objPath ) ) {
550  modDataObjMeta_t modDataObjMetaInp;
551  keyValPair_t regParam;
552 
553  /* a new copy or the current path is in trash.
554  * rename and reg the path of the old one */
555  char new_fn[ MAX_NAME_LEN ];
556  status = renameFilePathToNewDir( rsComm, REPL_DIR, &fileRenameInp,
557  1, new_fn );
558  if ( status < 0 ) {
559  char* sys_error = NULL;
560  const char* rods_error = rodsErrorName( status, &sys_error );
561  rodsLog( LOG_ERROR, "%s:%d renameFilePathToNewDir failed for file: %s - status = %d %s %s",
562  __FUNCTION__, __LINE__, filePath, status, rods_error, sys_error );
563  free( sys_error );
564  return status;
565  }
566  /* register the change */
567  memset( &regParam, 0, sizeof( regParam ) );
568  addKeyVal( &regParam, FILE_PATH_KW, new_fn );//fileRenameInp.newFileName );
569  modDataObjMetaInp.dataObjInfo = &myDataObjInfo;
570  modDataObjMetaInp.regParam = &regParam;
571  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
572  clearKeyVal( &regParam );
573  if ( status < 0 ) {
575  "%s:%d rsModDataObjMeta of %s error. stat = %d",
576  __FUNCTION__, __LINE__, fileRenameInp.newFileName, status );
577  /* need to rollback the change in path */
578  rstrcpy( fileRenameInp.oldFileName, fileRenameInp.newFileName,
579  MAX_NAME_LEN );
580  rstrcpy( fileRenameInp.newFileName, filePath, MAX_NAME_LEN );
581  rstrcpy( fileRenameInp.rescHier, myDataObjInfo.rescHier, MAX_NAME_LEN );
582  fileRenameOut_t* ren_out = 0;
583  status = rsFileRename( rsComm, &fileRenameInp, &ren_out );
584  free( ren_out );
585 
586  if ( status < 0 ) {
588  "%s:%d rsFileRename %s failed, status = %d",
589  __FUNCTION__, __LINE__, fileRenameInp.oldFileName, status );
590  return status;
591  }
592  /* this thing still failed */
593  return -1;
594  }
595  else {
596  return 0;
597  }
598  }
599  else {
600 
601  /* this is an old copy. change the path but don't
602  * actually rename it */
603  rstrcpy( fileRenameInp.oldFileName, filePath, MAX_NAME_LEN );
604  char new_fn[ MAX_NAME_LEN ];
605  status = renameFilePathToNewDir( rsComm, REPL_DIR, &fileRenameInp,
606  0, new_fn );
607  if ( status >= 0 ) {
608  //rstrcpy( filePath, fileRenameInp.newFileName, MAX_NAME_LEN );
609  rstrcpy( filePath, new_fn, MAX_NAME_LEN );
610  return 0;
611  }
612  else {
613  char* sys_error = NULL;
614  const char* rods_error = rodsErrorName( status, &sys_error );
615  rodsLog( LOG_ERROR, "%s:%d renameFilePathToNewDir failed for file: %s - status = %d %s %s",
616  __FUNCTION__, __LINE__, filePath, status, rods_error, sys_error );
617  free( sys_error );
618  return status;
619  }
620  }
621 
622  }
623  else if ( status > 0 ) {
624  /* this is an orphan file. need to rename it */
625  rstrcpy( fileRenameInp.oldFileName, filePath, MAX_NAME_LEN );
626  rstrcpy( fileRenameInp.rescHier, rescHier, MAX_NAME_LEN );
627  rstrcpy( fileRenameInp.objPath, objPath, MAX_NAME_LEN );
628  char new_fn[ MAX_NAME_LEN ];
629  status = renameFilePathToNewDir( rsComm, ORPHAN_DIR, &fileRenameInp,
630  1, new_fn );
631  if ( status >= 0 ) {
632  return 1;
633  }
634  else {
635  char* sys_error = NULL;
636  const char* rods_error = rodsErrorName( status, &sys_error );
637  rodsLog( LOG_ERROR, "%s:%d renameFilePathToNewDir failed for file: %s - status = %d %s %s",
638  __FUNCTION__, __LINE__, filePath, status, rods_error, sys_error );
639  free( sys_error );
640  return status;
641  }
642  }
643  else {
644  /* error */
645  rodsLog( LOG_ERROR, "%s:%d chkOrphanFile failed for file: %s",
646  __FUNCTION__, __LINE__, filePath );
647  return status;
648  }
649 }
650 
651 int
652 renameFilePathToNewDir( rsComm_t *rsComm, char *newDir,
653  fileRenameInp_t *fileRenameInp,
654  int renameFlag, char* new_fn ) {
655  int len, status;
656  char *oldPtr, *newPtr;
657  char *filePath = fileRenameInp->oldFileName;
658  // =-=-=-=-=-=-=-
659  // get the resource location for the hier string leaf
660  std::string location;
661  irods::error ret = irods::get_loc_for_hier_string( fileRenameInp->rescHier, location );
662  if ( !ret.ok() ) {
663  irods::log( PASSMSG( "renameFilePathToNewDir - failed in get_loc_for_hier_string", ret ) );
664  return -1;
665  }
666 
667  rstrcpy( fileRenameInp->addr.hostAddr, location.c_str(), NAME_LEN );
668 
669  std::string vault_path;
670  ret = irods::get_vault_path_for_hier_string( fileRenameInp->rescHier, vault_path );
671  if ( !ret.ok() ) {
672  std::stringstream msg;
673  msg << __FUNCTION__;
674  msg << " - Unable to determine vault path from resource hierarch: \"";
675  msg << fileRenameInp->rescHier;
676  msg << "\"";
677  irods::error result = PASSMSG( msg.str(), ret );
678  irods::log( result );
679  return result.code();
680  }
681 
682  len = vault_path.size();
683 
684  if ( vault_path.empty() ) {
685  std::stringstream msg;
686  msg << __FUNCTION__;
687  msg << " - Vault path is empty.";
689  irods::log( result );
690  return result.code();
691  }
692 
693  std::string file_path = filePath;
694  if ( file_path.find( vault_path ) != 0 ) {
695  /* not in rescVaultPath */
696  std::stringstream msg;
697  msg << __FUNCTION__;
698  msg << " - File: \"";
699  msg << filePath;
700  msg << "\" is not in vault: \"";
701  msg << vault_path;
702  msg << "\"";
703  irods::error result = ERROR( FILE_NOT_IN_VAULT, msg.str() );
704  irods::log( result );
705  return result.code();
706  }
707 
708  rstrcpy( fileRenameInp->newFileName, vault_path.c_str(), MAX_NAME_LEN );
709  oldPtr = filePath + len;
710  newPtr = fileRenameInp->newFileName + len;
711 
712  snprintf( newPtr, MAX_NAME_LEN - len, "/%s%s.%-u", newDir, oldPtr,
713  irods::getRandom<unsigned int>() );
714 
715 
716  if ( renameFlag > 0 ) {
717  fileRenameOut_t* ren_out = 0;
718  status = rsFileRename( rsComm, fileRenameInp, &ren_out );
719  strncpy( new_fn, ren_out->file_name, MAX_NAME_LEN );
720  free( ren_out );
721  if ( status < 0 ) {
723  "renameFilePathToNewDir:rsFileRename from %s to %s failed,stat=%d",
724  filePath, fileRenameInp->newFileName, status );
725  return status;
726  }
727  else {
728  return 0;
729  }
730  }
731  else {
732  return 0;
733  }
734 }
735 
736 /* syncDataObjPhyPath - sync the path of the phy path with the path of
737  * the data ovject. This is unsed by rename to sync the path of the
738  * phy path with the new path.
739  */
740 
741 int
743  dataObjInfo_t *dataObjInfoHead, char *acLCollection ) {
744  dataObjInfo_t *tmpDataObjInfo;
745  int status;
746  int savedStatus = 0;
747 
748  tmpDataObjInfo = dataObjInfoHead;
749  while ( tmpDataObjInfo != NULL ) {
750  status = syncDataObjPhyPathS( rsComm, dataObjInp, tmpDataObjInfo, acLCollection );
751 
752  if ( status < 0 ) {
753  savedStatus = status;
754  }
755 
756  tmpDataObjInfo = tmpDataObjInfo->next;
757  }
758 
759  return savedStatus;
760 }
761 
762 int
764  dataObjInfo_t *dataObjInfo, char *acLCollection ) {
765  int status, status1;
766  fileRenameInp_t fileRenameInp;
767  modDataObjMeta_t modDataObjMetaInp;
768  keyValPair_t regParam;
769  vaultPathPolicy_t vaultPathPolicy;
770  irods::error err;
771 
772  if ( strcmp( dataObjInfo->rescName, BUNDLE_RESC ) == 0 ) {
773  return 0;
774  }
775 
776  int create_path = 0;
777  err = irods::get_resource_property< int >(
778  dataObjInfo->rescId,
779  irods::RESOURCE_CREATE_PATH, create_path );
780  if ( !err.ok() ) {
781  irods::log( PASS( err ) );
782  }
783 
784  if ( NO_CREATE_PATH == create_path ) {
785  /* no need to sync for path created by resource */
786  return 0;
787  }
788 
789  status = getVaultPathPolicy( rsComm, dataObjInfo, &vaultPathPolicy );
790  if ( status < 0 ) {
792  "syncDataObjPhyPathS: getVaultPathPolicy error for %s, status = %d",
793  dataObjInfo->objPath, status );
794  }
795  else {
796  if ( vaultPathPolicy.scheme != GRAFT_PATH_S ) {
797  /* no need to sync */
798  return 0;
799  }
800  }
801 
802  if ( isInVault( dataObjInfo ) == 0 ) {
803  /* not in vault. */
804  return 0;
805  }
806 
807  err = irods::is_resc_live( dataObjInfo->rescId );
808  if ( !err.ok() ) {
809  irods::log( PASSMSG( "syncDataObjPhyPathS - failed in is_resc_live", err ) );
810  return err.code();
811  }
812 
813  // =-=-=-=-=-=-=-
814  // get the resource location for the hier string leaf
815  std::string location;
816  err = irods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
817  if ( !err.ok() ) {
818  irods::log( PASSMSG( "syncDataObjPhyPathS - failed in get_loc_for_hier_string", err ) );
819  return err.code();
820  }
821 
822  /* Save the current objPath */
823  memset( &fileRenameInp, 0, sizeof( fileRenameInp ) );
824  rstrcpy( fileRenameInp.oldFileName, dataObjInfo->filePath, MAX_NAME_LEN );
825  rstrcpy( fileRenameInp.rescHier, dataObjInfo->rescHier, MAX_NAME_LEN );
826  rstrcpy( fileRenameInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN );
827  if ( dataObjInp == NULL ) {
828  dataObjInp_t myDdataObjInp;
829  memset( &myDdataObjInp, 0, sizeof( myDdataObjInp ) );
830  rstrcpy( myDdataObjInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN );
831  status = getFilePathName( rsComm, dataObjInfo, &myDdataObjInp );
832  }
833  else {
834  status = getFilePathName( rsComm, dataObjInfo, dataObjInp );
835  }
836 
837  if ( strcmp( fileRenameInp.oldFileName, dataObjInfo->filePath ) == 0 ) {
838  return 0;
839  }
840 
841  /* see if the new file exist */
842  if ( getSizeInVault( rsComm, dataObjInfo ) >= 0 ) {
843  if ( ( status = chkAndHandleOrphanFile( rsComm, dataObjInfo->objPath, dataObjInfo->rescHier,
844  dataObjInfo->filePath, dataObjInfo->rescName, OLD_COPY ) ) <= 0 ) {
846  "%s: newFileName %s already in use. Status = %d",
847  __FUNCTION__, dataObjInfo->filePath, status );
848  return SYS_PHY_PATH_INUSE;
849  }
850  }
851 
852  /* rename it */
853  rstrcpy( fileRenameInp.addr.hostAddr, location.c_str(), NAME_LEN );
854  rstrcpy( fileRenameInp.newFileName, dataObjInfo->filePath,
855  MAX_NAME_LEN );
856 
857  fileRenameOut_t* ren_out = 0;
858  status = rsFileRename( rsComm, &fileRenameInp, &ren_out );
859  if ( status < 0 ) {
861  "syncDataObjPhyPath:rsFileRename from %s to %s failed,status=%d",
862  fileRenameInp.oldFileName, fileRenameInp.newFileName, status );
863  free( ren_out );
864  return status;
865  }
866 
867  // =-=-=-=-=-=-=-
868  // update phy path with possible new path from the resource
869  strncpy( dataObjInfo->filePath, ren_out->file_name, MAX_NAME_LEN );
870 
871  /* register the change */
872  memset( &regParam, 0, sizeof( regParam ) );
873  addKeyVal( &regParam, FILE_PATH_KW, ren_out->file_name );
874  free( ren_out );
875  if ( acLCollection != NULL ) {
876  addKeyVal( &regParam, ACL_COLLECTION_KW, acLCollection );
877  }
878  modDataObjMetaInp.dataObjInfo = dataObjInfo;
879  modDataObjMetaInp.regParam = &regParam;
880  status = rsModDataObjMeta( rsComm, &modDataObjMetaInp );
881  clearKeyVal( &regParam );
882  if ( status < 0 ) {
883  char tmpPath[MAX_NAME_LEN];
885  "syncDataObjPhyPath: rsModDataObjMeta of %s error. stat = %d",
886  fileRenameInp.newFileName, status );
887  /* need to rollback the change in path */
888  rstrcpy( tmpPath, fileRenameInp.oldFileName, MAX_NAME_LEN );
889  rstrcpy( fileRenameInp.oldFileName, fileRenameInp.newFileName,
890  MAX_NAME_LEN );
891  rstrcpy( fileRenameInp.newFileName, tmpPath, MAX_NAME_LEN );
892  fileRenameOut_t* ren_out = 0;
893  status1 = rsFileRename( rsComm, &fileRenameInp, &ren_out );
894  free( ren_out );
895 
896  if ( status1 < 0 ) {
898  "syncDataObjPhyPath: rollback rename %s failed, status = %d",
899  fileRenameInp.oldFileName, status1 );
900  }
901  return status;
902  }
903  return 0;
904 }
905 
906 /* syncCollPhyPath - sync the path of the phy path with the path of
907  * the data ovject in the new collection. This is unsed by rename to sync
908  * the path of the phy path with the new path.
909  */
910 
911 int
912 syncCollPhyPath( rsComm_t *rsComm, char *collection ) {
913  int status, i;
914  int savedStatus = 0;
915  genQueryOut_t *genQueryOut = NULL;
916  genQueryInp_t genQueryInp;
917  int continueInx;
918 
919  status = rsQueryDataObjInCollReCur( rsComm, collection,
920  &genQueryInp, &genQueryOut, NULL, 0 );
921 
922  if ( status < 0 && status != CAT_NO_ROWS_FOUND ) {
923  savedStatus = status; /* return the error code */
924  }
925 
926  while ( status >= 0 ) {
927  sqlResult_t *dataIdRes, *subCollRes, *dataNameRes, *replNumRes,
928  *rescNameRes, *filePathRes, *rescIdRes;
929  char *tmpDataId, *tmpDataName, *tmpSubColl, *tmpReplNum,
930  *tmpRescName, *tmpFilePath, *tmpRescId;
931  dataObjInfo_t dataObjInfo;
932 
933  memset( &dataObjInfo, 0, sizeof( dataObjInfo ) );
934 
935  if ( ( dataIdRes = getSqlResultByInx( genQueryOut, COL_D_DATA_ID ) )
936  == NULL ) {
938  "syncCollPhyPath: getSqlResultByInx for COL_D_DATA_ID failed" );
939  return UNMATCHED_KEY_OR_INDEX;
940  }
941  if ( ( subCollRes = getSqlResultByInx( genQueryOut, COL_COLL_NAME ) )
942  == NULL ) {
944  "syncCollPhyPath: getSqlResultByInx for COL_COLL_NAME failed" );
945  return UNMATCHED_KEY_OR_INDEX;
946  }
947  if ( ( dataNameRes = getSqlResultByInx( genQueryOut, COL_DATA_NAME ) )
948  == NULL ) {
950  "syncCollPhyPath: getSqlResultByInx for COL_DATA_NAME failed" );
951  return UNMATCHED_KEY_OR_INDEX;
952  }
953  if ( ( replNumRes = getSqlResultByInx( genQueryOut, COL_DATA_REPL_NUM ) )
954  == NULL ) {
956  "syncCollPhyPath:getSqlResultByIn for COL_DATA_REPL_NUM failed" );
957  return UNMATCHED_KEY_OR_INDEX;
958  }
959  if ( ( rescNameRes = getSqlResultByInx( genQueryOut, COL_D_RESC_NAME ) )
960  == NULL ) {
962  "syncCollPhyPath: getSqlResultByInx for COL_D_RESC_NAME failed" );
963  return UNMATCHED_KEY_OR_INDEX;
964  }
965  if ( ( filePathRes = getSqlResultByInx( genQueryOut, COL_D_DATA_PATH ) )
966  == NULL ) {
968  "syncCollPhyPath: getSqlResultByInx for COL_D_DATA_PATH failed" );
969  return UNMATCHED_KEY_OR_INDEX;
970  }
971 
972  if ( ( rescIdRes = getSqlResultByInx( genQueryOut, COL_D_RESC_ID ) )
973  == NULL ) {
975  "syncCollPhyPath: getSqlResultByInx for COL_D_RESC_ID failed" );
976  return UNMATCHED_KEY_OR_INDEX;
977  }
978 
979  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
980  tmpDataId = &dataIdRes->value[dataIdRes->len * i];
981  tmpDataName = &dataNameRes->value[dataNameRes->len * i];
982  tmpSubColl = &subCollRes->value[subCollRes->len * i];
983  tmpReplNum = &replNumRes->value[replNumRes->len * i];
984  tmpRescName = &rescNameRes->value[rescNameRes->len * i];
985  tmpFilePath = &filePathRes->value[filePathRes->len * i];
986  tmpRescId = &rescIdRes->value[rescIdRes->len * i];
987 
988  dataObjInfo.dataId = strtoll( tmpDataId, 0, 0 );
989  snprintf( dataObjInfo.objPath, MAX_NAME_LEN, "%s/%s",
990  tmpSubColl, tmpDataName );
991  dataObjInfo.replNum = atoi( tmpReplNum );
992  rstrcpy( dataObjInfo.rescName, tmpRescName, NAME_LEN );
993 
994  dataObjInfo.rescId = strtoll(tmpRescId, 0, 0);
995  std::string resc_hier;
996  resc_mgr.leaf_id_to_hier(dataObjInfo.rescId, resc_hier);
997 
998  rstrcpy( dataObjInfo.rescHier, resc_hier.c_str(), MAX_NAME_LEN );
999 
1000  rstrcpy( dataObjInfo.filePath, tmpFilePath, MAX_NAME_LEN );
1001 
1002  status = syncDataObjPhyPathS( rsComm, NULL, &dataObjInfo,
1003  collection );
1004  if ( status < 0 ) {
1005  rodsLog( LOG_ERROR,
1006  "syncCollPhyPath: syncDataObjPhyPathS error for %s,stat=%d",
1007  dataObjInfo.filePath, status );
1008  savedStatus = status;
1009  }
1010 
1011  }
1012 
1013  continueInx = genQueryOut->continueInx;
1014 
1015  freeGenQueryOut( &genQueryOut );
1016 
1017  if ( continueInx > 0 ) {
1018  /* More to come */
1019  genQueryInp.continueInx = continueInx;
1020  status = rsGenQuery( rsComm, &genQueryInp, &genQueryOut );
1021  }
1022  else {
1023  break;
1024  }
1025  }
1026 
1027  freeGenQueryOut( &genQueryOut );
1028  clearGenQueryInp( &genQueryInp );
1029 
1030  return savedStatus;
1031 }
1032 
1033 int
1034 isInVault( dataObjInfo_t *dataObjInfo ) {
1035  int len;
1036 
1037  if ( !dataObjInfo ) {
1039  }
1040 
1041  std::string vault_path;
1042  irods::error ret = irods::get_vault_path_for_hier_string( dataObjInfo->rescHier, vault_path );
1043  if ( !ret.ok() ) {
1044  std::stringstream msg;
1045  msg << __FUNCTION__;
1046  msg << " - Failed to get the vault path for the hierarchy: \"" << dataObjInfo->rescHier << "\"";
1047  ret = PASSMSG( msg.str(), ret );
1048  irods::log( ret );
1049  return ret.code();
1050  }
1051  len = vault_path.size();
1052 
1053  return has_prefix(dataObjInfo->filePath, vault_path.c_str());
1054 }
1055 
1056 int
1058  std::stringstream ss;
1059  try {
1060  ss << std::oct << irods::get_server_property<const std::string>(irods::CFG_DEFAULT_FILE_MODE_KW);
1061  } catch ( const irods::exception& e ) {
1062  return DEFAULT_FILE_MODE;
1063  }
1064  int mode_int;
1065  ss >> mode_int;
1066  return mode_int;
1067 }
1068 
1069 int
1071  std::stringstream ss;
1072  try {
1073  ss << std::oct << irods::get_server_property<const std::string>(irods::CFG_DEFAULT_DIR_MODE_KW);
1074  } catch ( const irods::exception& e ) {
1075  return DEFAULT_DIR_MODE;
1076  }
1077  int mode_int;
1078  ss >> mode_int;
1079  return mode_int;
1080 }
1081 
1082 int
1083 getLogPathFromPhyPath( char *phyPath, const char *rescVaultPath, char *outLogPath ) {
1084  int len;
1085  char *tmpPtr;
1086  zoneInfo_t *tmpZoneInfo = NULL;
1087  int status;
1088 
1089  if ( !phyPath || !rescVaultPath || !outLogPath ) {
1090  return USER__NULL_INPUT_ERR;
1091  }
1092 
1093  len = strlen( rescVaultPath );
1094  if ( strncmp( rescVaultPath, phyPath, len ) != 0 ) {
1095  return -1;
1096  }
1097  tmpPtr = phyPath + len;
1098 
1099  if ( *tmpPtr != '/' ) {
1100  return -1;
1101  }
1102 
1103  tmpPtr ++;
1104  status = getLocalZoneInfo( &tmpZoneInfo );
1105  if ( status < 0 || NULL == tmpZoneInfo ) {
1106  return status; // JMC cppcheck - nullptr
1107  }
1108 
1109  len = strlen( tmpZoneInfo->zoneName );
1110  if ( strncmp( tmpZoneInfo->zoneName, tmpPtr, len ) == 0 &&
1111  *( tmpPtr + len ) == '/' ) {
1112  /* start with zoneName */
1113  tmpPtr += ( len + 1 );
1114  }
1115 
1116  snprintf( outLogPath, MAX_NAME_LEN, "/%s/%s", tmpZoneInfo->zoneName,
1117  tmpPtr );
1118 
1119  return 0;
1120 }
1121 
1122 /* rsMkOrphanPath - given objPath, compose the orphan path which is
1123  * /myZone/trash/orphan/userName#userZone/filename.random
1124  * Also make the required directory.
1125  */
1126 int
1127 rsMkOrphanPath( rsComm_t *rsComm, char *objPath, char *orphanPath ) {
1128  int status;
1129  char *tmpStr;
1130  char *orphanPathPtr;
1131  int len = 0;
1132  char parentColl[MAX_NAME_LEN], childName[MAX_NAME_LEN];
1133  collInp_t collCreateInp;
1134 
1135  status = splitPathByKey( objPath, parentColl, MAX_NAME_LEN, childName, MAX_NAME_LEN, '/' );
1136 
1137  if ( status < 0 ) {
1138  rodsLog( LOG_ERROR,
1139  "rsMkOrphanPath: splitPathByKey error for %s, status = %d",
1140  objPath, status );
1141  return status;
1142  }
1143  orphanPathPtr = orphanPath;
1144  *orphanPathPtr = '/';
1145  orphanPathPtr++;
1146  tmpStr = objPath + 1;
1147  /* copy the zone */
1148  while ( *tmpStr != '\0' ) {
1149  *orphanPathPtr = *tmpStr;
1150  orphanPathPtr ++;
1151  len ++;
1152  if ( *tmpStr == '/' ) {
1153  tmpStr ++;
1154  break;
1155  }
1156  tmpStr ++;
1157  }
1158  len = strlen( rsComm->clientUser.userName ) +
1159  strlen( rsComm->clientUser.rodsZone );
1160  snprintf( orphanPathPtr, len + 20, "trash/orphan/%s#%s",
1161  rsComm->clientUser.userName, rsComm->clientUser.rodsZone );
1162 
1163  memset( &collCreateInp, 0, sizeof( collCreateInp ) );
1164  rstrcpy( collCreateInp.collName, orphanPath, MAX_NAME_LEN );
1165  addKeyVal( &collCreateInp.condInput, RECURSIVE_OPR__KW, "" ); // in case there is no trash/orphan collection
1166 
1167  status = rsCollCreate( rsComm, &collCreateInp );
1168 
1169  if ( status < 0 && status != CAT_NAME_EXISTS_AS_COLLECTION ) {
1171  "rsMkOrphanPath: rsCollCreate error for %s",
1172  orphanPath );
1173  }
1174  orphanPathPtr = orphanPath + strlen( orphanPath );
1175 
1176  snprintf( orphanPathPtr, strlen( childName ) + 20, "/%s.%-u",
1177  childName, irods::getRandom<unsigned int>() );
1178 
1179  return 0;
1180 }
1181 
1182 // =-=-=-=-=-=-=-
1183 // JMC - backport 4598
1184 int
1185 getDataObjLockPath( char *objPath, char **outLockPath ) {
1186  int i;
1187  char *objPathPtr, *tmpPtr;
1188  char tmpPath[MAX_NAME_LEN];
1189  int c;
1190  int len;
1191 
1192  if ( objPath == NULL || outLockPath == NULL ) {
1193  return USER__NULL_INPUT_ERR;
1194  }
1195  objPathPtr = objPath; // JMC - backport 4604
1196 
1197  /* skip over the first 3 '/' */
1198  for ( i = 0; i < 3; i++ ) {
1199  tmpPtr = strchr( objPathPtr, '/' );
1200  if ( tmpPtr == NULL ) {
1201  break; /* just use the shorten one */
1202  }
1203  else {
1204  /* skip over '/' */
1205  objPathPtr = tmpPtr + 1;
1206  }
1207  }
1208  rstrcpy( tmpPath, objPathPtr, MAX_NAME_LEN );
1209  /* replace all '/' with '.' */
1210  objPathPtr = tmpPath;
1211 
1212  while ( ( c = *objPathPtr ) != '\0' ) {
1213  if ( c == '/' ) {
1214  *objPathPtr = '.';
1215  }
1216  objPathPtr++;
1217  }
1218 
1219  std::string lock_path;
1221  LOCK_FILE_DIR,
1222  lock_path );
1223  if ( !ret.ok() ) {
1224  irods::log( PASS( ret ) );
1225  return ret.code();
1226  }
1227 
1228  len = lock_path.size() +
1229  strlen( tmpPath ) +
1230  strlen( LOCK_FILE_TRAILER ) + 10;
1231  *outLockPath = ( char * ) malloc( len );
1232 
1233  snprintf(
1234  *outLockPath,
1235  len,
1236  "%-s/%-s.%-s",
1237  lock_path.c_str(),
1238  tmpPath,
1240 
1241  return 0;
1242 }
1243 
1244 
1245 int
1246 executeFilesystemLockCommand( int cmd, int type, int fd, struct flock * lock ) {
1247  bzero( lock, sizeof( *lock ) );
1248  lock->l_type = type;
1249  lock->l_whence = SEEK_SET;
1250  int status = fcntl( fd, cmd, lock );
1251  if ( status < 0 ) {
1252  /* this is not necessary an error. cmd F_SETLK or F_GETLK can return
1253  * -1. */
1254  status = SYS_FS_LOCK_ERR - errno;
1255  close( fd );
1256  return status;
1257  }
1258  return 0;
1259 }
1260 
1261 /* fsDataObjLock - lock the data object using the local file system :(
1262  * Input:
1263  * char *objPath - The full Object path
1264  * int cmd - the fcntl cmd - valid values are F_SETLK, F_SETLKW and F_GETLK
1265  * int type - the fcntl type - valid values are F_UNLCK, F_WRLCK, F_RDLCK
1266  */
1267 int
1268 fsDataObjLock( char *objPath, int cmd, int type ) {
1269  int fd;
1270  char *path = NULL;
1271  int status = getDataObjLockPath( objPath, &path );
1272  if ( status < 0 || NULL == path ) {
1274  "fsDataObjLock: getDataObjLockPath error for %s", objPath );
1275  free( path );
1276  return status;
1277  }
1278  fd = open( path, O_RDWR | O_CREAT, 0644 );
1279  free( path );
1280  if ( fd < 0 ) {
1281  status = FILE_OPEN_ERR - errno;
1283  "fsDataObjLock: open error for %s", objPath );
1284  return status;
1285  }
1286  struct flock lock;
1288  if ( status < 0 ) {
1289  rodsLogError( LOG_DEBUG, status, "fsDataObjLock: fcntl error for %s, cmd = %d, type = %d",
1290  objPath, cmd, type ); // JMC - backport 4604
1291  return status;
1292  }
1293  if ( cmd == F_GETLK ) {
1294  /* get the status of locking the file. return F_UNLCK if no conflict */
1295  close( fd );
1296  return lock.l_type;
1297  }
1298  return fd;
1299 }
1300 
1301 int
1302 fsDataObjUnlock( int cmd, int type, int fd ) {
1303  struct flock lock;
1305  if ( status < 0 ) {
1306  rodsLogError( LOG_DEBUG, status, "fsDataObjLock: fcntl error on unlock, status = %d",
1307  status ); // JMC - backport 4604
1308  return status;
1309  }
1310  close( fd );
1311  return 0;
1312 }
1313 
1314 rodsLong_t
1316 
1317 {
1318  rodsStat_t *myStat = NULL;
1319  int status;
1320  rodsLong_t mysize;
1321  char sstr_buf[SHORT_STR_LEN];
1322  char time_buf[TIME_LEN];
1323 
1324  status = l3Stat( rsComm, dataObjInfo, &myStat );
1325 
1326  if ( status < 0 ) {
1327  rodsLog( LOG_DEBUG,
1328  "getFileMetaFromVault: l3Stat error for %s. status = %d",
1329  dataObjInfo->filePath, status );
1330  return status;
1331  }
1332 
1333  if ( myStat->st_mode & S_IFDIR ) {
1334  free( myStat );
1336  }
1337 
1338  snprintf( sstr_buf, SHORT_STR_LEN, "%u", myStat->st_uid );
1339  addKeyVal( &dataObjInfo->condInput, FILE_UID_KW, sstr_buf );
1340 
1341  snprintf( sstr_buf, SHORT_STR_LEN, "%u", myStat->st_gid );
1342  addKeyVal( &dataObjInfo->condInput, FILE_GID_KW, sstr_buf );
1343 
1344  snprintf( sstr_buf, SHORT_STR_LEN, "%u", myStat->st_mode );
1345  addKeyVal( &dataObjInfo->condInput, FILE_MODE_KW, sstr_buf );
1346 
1347  snprintf( time_buf, TIME_LEN, "%u", myStat->st_ctim );
1348  addKeyVal( &dataObjInfo->condInput, FILE_CTIME_KW, time_buf );
1349 
1350  snprintf( time_buf, TIME_LEN, "%u", myStat->st_mtim );
1351  addKeyVal( &dataObjInfo->condInput, FILE_MTIME_KW, time_buf );
1352  mysize = myStat->st_size;
1353  free( myStat );
1354  return mysize;
1355 }
1356 
1357 int
1359  const std::string& _resc_hier,
1360  std::string& _ret_string ) {
1361  rodsLong_t resc_id=0;
1362  irods::error ret = resc_mgr.hier_to_leaf_id(_resc_hier,resc_id);
1363  if(!ret.ok()) {
1364  irods::log(PASS(ret));
1365  return ret.code();
1366  }
1367 
1368  ret = irods::get_resource_property<std::string>( resc_id, irods::RESOURCE_PATH, _ret_string );
1369  if ( !ret.ok() ) {
1370  std::stringstream msg;
1371  msg << "Unable to get vault path for leaf: \"" << _resc_hier << "\"";
1372  irods::log( LOG_ERROR, msg.str() );
1373  return ret.code();
1374  }
1375 
1376  return 0;
1377 }
1378 
1379 // =-=-=-=-=-=-=-
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
renameFilePathToNewDir
int renameFilePathToNewDir(rsComm_t *rsComm, char *newDir, fileRenameInp_t *fileRenameInp, int renameFlag, char *new_fn)
Definition: physPath.cpp:652
L1desc
l1desc_t L1desc[1026]
Definition: irods_server_globals.cpp:29
NULL
#define NULL
Definition: rodsDef.h:70
rsCollCreate
int rsCollCreate(rsComm_t *rsComm, collInp_t *collCreateInp)
Definition: rsCollCreate.cpp:52
DEFAULT_FILE_MODE
#define DEFAULT_FILE_MODE
Definition: objInfo.h:240
rodsStat::st_mode
unsigned int st_mode
Definition: rodsType.h:56
rsComm_t
Definition: rcConnect.h:145
fileChksum.h
COL_DATA_REPL_NUM
#define COL_DATA_REPL_NUM
Definition: rodsGenQuery.h:166
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
FileChksumInp::objPath
char objPath[(1024+64)]
Definition: fileChksum.h:11
vaultPathPolicy_t
Definition: rodsDef.h:353
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
rodsStat::st_ctim
unsigned int st_ctim
Definition: rodsType.h:63
SYS_INVALID_RESC_INPUT
@ SYS_INVALID_RESC_INPUT
Definition: rodsErrorTable.h:100
rodsPath.h
getWriteFlag
int getWriteFlag(int openFlag)
Definition: physPath.cpp:386
GenQueryInp::continueInx
int continueInx
Definition: rodsGenQuery.h:28
getFileMetadataFromVault
rodsLong_t getFileMetadataFromVault(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:1315
DataObjInp::openFlags
int openFlags
Definition: dataObjInpOut.h:68
irods_server_properties.hpp
ACL_COLLECTION_KW
#define ACL_COLLECTION_KW
Definition: rodsKeyWdDef.h:107
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
modDataObjMeta.h
irods::get_vault_path_for_hier_string
error get_vault_path_for_hier_string(const std::string &_hier_string, std::string &_rtn_vault_path)
Definition: irods_resource_backport.cpp:658
CollInp
Definition: dataObjInpOut.h:157
UNMATCHED_KEY_OR_INDEX
@ UNMATCHED_KEY_OR_INDEX
Definition: rodsErrorTable.h:244
FileChksumInp::in_pdmo
char in_pdmo[(1024+64)]
Definition: fileChksum.h:13
getDefDirMode
int getDefDirMode()
Definition: physPath.cpp:1070
irods::RESOURCE_CHECK_PATH_PERM
const std::string RESOURCE_CHECK_PATH_PERM("resource_property_check_path_perm")
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
irods_get_full_path_for_config_file.hpp
rodsStat::st_uid
unsigned int st_uid
Definition: rodsType.h:58
irods_stacktrace.hpp
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
resc_mgr
irods::resource_manager resc_mgr
Definition: irods_resource_manager.cpp:31
getFileFlags
int getFileFlags(int l1descInx)
Definition: physPath.cpp:70
getSizeInVault
rodsLong_t getSizeInVault(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:396
setPathForGraftPathScheme
int setPathForGraftPathScheme(char *objPath, const char *vaultPath, int addUserName, char *userName, int trimDirCnt, char *outPath)
Definition: physPath.cpp:230
executeFilesystemLockCommand
int executeFilesystemLockCommand(int cmd, int type, int fd, struct flock *lock)
Definition: physPath.cpp:1246
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
FILE_NOT_IN_VAULT
@ FILE_NOT_IN_VAULT
Definition: rodsErrorTable.h:762
CHKSUM_KW
#define CHKSUM_KW
Definition: rodsKeyWdDef.h:25
GenQueryInp
Definition: rodsGenQuery.h:24
fileRenameOut_t
Definition: fileRename.h:16
rcMisc.h
FILE_CTIME_KW
#define FILE_CTIME_KW
Definition: rodsKeyWdDef.h:134
BUNDLE_RESC
#define BUNDLE_RESC
Definition: phyBundleColl.h:11
rsFileRename
int rsFileRename(rsComm_t *rsComm, fileRenameInp_t *fileRenameInp, fileRenameOut_t **)
Definition: rsFileRename.cpp:22
DataObjInfo::rescId
rodsLong_t rescId
Definition: objInfo.h:164
DataObjInfo::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:132
DataObjInfo::replStatus
int replStatus
Definition: objInfo.h:141
SYS_INVALID_RESC_TYPE
@ SYS_INVALID_RESC_TYPE
Definition: rodsErrorTable.h:98
fileRenameInp_t::newFileName
char newFileName[(1024+64)]
Definition: fileRename.h:10
zoneInfo::zoneName
char zoneName[64]
Definition: rodsConnect.h:75
NO_CREATE_PATH
@ NO_CREATE_PATH
Definition: objInfo.h:266
rodsStat::st_mtim
unsigned int st_mtim
Definition: rodsType.h:62
LOCK_FILE_DIR
#define LOCK_FILE_DIR
Definition: physPath.hpp:26
RuleExecInfo::doi
dataObjInfo_t * doi
Definition: irods_re_structs.hpp:28
irods::RESOURCE_PATH
const std::string RESOURCE_PATH("resource_property_path")
DataObjInfo::condInput
keyValPair_t condInput
Definition: objInfo.h:161
irods_resource_backport.hpp
irods::get_full_path_for_unmoved_configs
error get_full_path_for_unmoved_configs(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:43
VAULT_PATH_POLICY
#define VAULT_PATH_POLICY
Definition: rodsDef.h:342
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
fileRenameInp_t
Definition: fileRename.h:7
getFilePathName
int getFilePathName(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:87
rcGlobalExtern.h
DataObjInfo::filePath
char filePath[(1024+64)]
Definition: objInfo.h:137
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
rodsErrorName
const char * rodsErrorName(int errorValue, char **subName)
Definition: rodsLog.cpp:373
RECURSIVE_OPR__KW
#define RECURSIVE_OPR__KW
Definition: rodsKeyWdDef.h:66
FileChksumInp::rescHier
char rescHier[(1024+64)]
Definition: fileChksum.h:10
getLogPathFromPhyPath
int getLogPathFromPhyPath(char *phyPath, const char *rescVaultPath, char *outLogPath)
Definition: physPath.cpp:1083
irods::CFG_DEFAULT_FILE_MODE_KW
const std::string CFG_DEFAULT_FILE_MODE_KW("default_file_mode")
collCreate.h
rodsConnect.h
DataObjInfo::dataId
rodsLong_t dataId
Definition: objInfo.h:143
DataObjInfo::next
struct DataObjInfo * next
Definition: objInfo.h:163
syncDataObjPhyPath
int syncDataObjPhyPath(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfoHead, char *acLCollection)
Definition: physPath.cpp:742
rsFileRename.hpp
irods::get_resc_properties_as_kvp
error get_resc_properties_as_kvp(const std::string &, keyValPair_t *)
Definition: irods_resource_backport.cpp:500
initReiWithDataObjInp
int initReiWithDataObjInp(ruleExecInfo_t *rei, rsComm_t *rsComm, dataObjInp_t *dataObjIn)
Definition: irods_re_structs.cpp:164
rodsStat::st_size
rodsLong_t st_size
Definition: rodsType.h:53
generate_iadmin_commands_for_41_to_42_upgrade.cmd
list cmd
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:19
FileChksumInp::orig_chksum
char orig_chksum[64]
Definition: fileChksum.h:14
COL_DATA_NAME
#define COL_DATA_NAME
Definition: rodsGenQuery.h:165
LOCK_FILE_TRAILER
#define LOCK_FILE_TRAILER
Definition: physPath.hpp:27
RuleExecInfo::condInputData
keyValPair_t * condInputData
Definition: irods_re_structs.hpp:34
rsGlobalExtern.hpp
COPIES_KW
#define COPIES_KW
Definition: rodsKeyWdDef.h:11
GRAFT_PATH_S
@ GRAFT_PATH_S
Definition: rodsDef.h:345
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
irods::error::code
long long code() const
Definition: irods_error.cpp:194
rodsStat
Definition: rodsType.h:52
COL_D_RESC_NAME
#define COL_D_RESC_NAME
Definition: rodsGenQuery.h:171
l3Stat
int l3Stat(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, rodsStat_t **myStat)
Definition: rsDataObjClose.cpp:768
getSqlResultByInx
sqlResult_t * getSqlResultByInx(genQueryOut_t *genQueryOut, int attriInx)
Definition: rcMisc.cpp:1387
irods.pypyodbc.lock
lock
Definition: pypyodbc.py:66
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
DataObjInfo::in_pdmo
char in_pdmo[(1024+64)]
Definition: objInfo.h:162
GenQueryOut::continueInx
int continueInx
Definition: rodsGenQuery.h:70
NO_CHK_PATH_PERM
#define NO_CHK_PATH_PERM
Definition: objInfo.h:246
REPL_DIR
#define REPL_DIR
Definition: physPath.hpp:22
TIME_LEN
#define TIME_LEN
Definition: rodsDef.h:54
irods::CFG_DEFAULT_DIR_MODE_KW
const std::string CFG_DEFAULT_DIR_MODE_KW("default_dir_mode")
fsDataObjUnlock
int fsDataObjUnlock(int cmd, int type, int fd)
Definition: physPath.cpp:1302
vaultPathPolicy_t::addUserName
int addUserName
Definition: rodsDef.h:355
syncCollPhyPath
int syncCollPhyPath(rsComm_t *rsComm, char *collection)
Definition: physPath.cpp:912
getCopiesFromCond
int getCopiesFromCond(keyValPair_t *condInput)
Definition: physPath.cpp:369
ALL_COPIES
#define ALL_COPIES
Definition: objInfo.h:24
getVaultPathPolicy
int getVaultPathPolicy(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, vaultPathPolicy_t *outVaultPathPolicy)
Definition: physPath.cpp:154
rodsDef.h
getchkPathPerm
int getchkPathPerm(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:312
dataObjChksumAndReg
int dataObjChksumAndReg(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, char **chksumStr)
Definition: physPath.cpp:478
DataObjInp
Definition: dataObjInpOut.h:65
rsDataObjClose.hpp
genQuery.h
irods::RESOURCE_CREATE_PATH
const std::string RESOURCE_CREATE_PATH("resource_property_create_path")
DEF_VAULT_PATH_SCHEME
#define DEF_VAULT_PATH_SCHEME
Definition: rodsDef.h:349
_dataObjChksum
int _dataObjChksum(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, char **chksumStr)
Definition: physPath.cpp:421
l1desc::dataObjInp
dataObjInp_t * dataObjInp
Definition: objDesc.hpp:41
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
FileChksumInp
Definition: fileChksum.h:7
rsFileChksum.hpp
FILE_MODE_KW
#define FILE_MODE_KW
Definition: rodsKeyWdDef.h:133
CollInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:161
getLocalZoneInfo
int getLocalZoneInfo(zoneInfo_t **outZoneInfo)
Definition: rodsConnect.cpp:666
fsDataObjLock
int fsDataObjLock(char *objPath, int cmd, int type)
Definition: physPath.cpp:1268
GenQueryOut
Definition: rodsGenQuery.h:67
DataObjInfo::replNum
int replNum
Definition: objInfo.h:140
OLD_COPY
#define OLD_COPY
Definition: objInfo.h:114
LOCAL_PRIV_USER_AUTH
#define LOCAL_PRIV_USER_AUTH
Definition: rodsUser.h:36
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rsFileChksum
int rsFileChksum(rsComm_t *rsComm, fileChksumInp_t *fileChksumInp, char **chksumStr)
Definition: rsFileChksum.cpp:22
userInfo_t::rodsZone
char rodsZone[64]
Definition: rodsUser.h:67
MsParam
Definition: msParam.h:76
collection.hpp
splitPathByKey
int splitPathByKey(const char *srcPath, char *dir, size_t maxDirLen, char *file, size_t maxFileLen, char key)
Definition: stringOpr.cpp:222
GenQueryOut::rowCnt
int rowCnt
Definition: rodsGenQuery.h:68
physPath.hpp
irods::log
void log(const error &)
Definition: irods_log.cpp:13
fileRenameInp_t::rescHier
char rescHier[(1024+64)]
Definition: fileRename.h:11
modDataObjMeta_t::regParam
keyValPair_t * regParam
Definition: modDataObjMeta.h:9
fileRenameInp_t::objPath
char objPath[(1024+64)]
Definition: fileRename.h:12
SYS_PHY_PATH_INUSE
@ SYS_PHY_PATH_INUSE
Definition: rodsErrorTable.h:185
FILE_UID_KW
#define FILE_UID_KW
Definition: rodsKeyWdDef.h:129
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
dataObjClose.h
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
DEF_ADD_USER_FLAG
#define DEF_ADD_USER_FLAG
Definition: rodsDef.h:350
CHKSUM_LEN
#define CHKSUM_LEN
Definition: rodsDef.h:56
chkAndHandleOrphanFile
int chkAndHandleOrphanFile(rsComm_t *rsComm, char *objPath, char *rescHier, char *filePath, const char *_resc_name, int replStatus)
Definition: physPath.cpp:526
modDataObjMeta_t::dataObjInfo
dataObjInfo_t * dataObjInfo
Definition: modDataObjMeta.h:8
DataObjInp::createMode
int createMode
Definition: dataObjInpOut.h:67
RESCVAULTPATH_EMPTY_IN_STRUCT_ERR
@ RESCVAULTPATH_EMPTY_IN_STRUCT_ERR
Definition: rodsErrorTable.h:645
irods::resource_manager::leaf_id_to_hier
error leaf_id_to_hier(const rodsLong_t &, std::string &)
Definition: irods_resource_manager.cpp:1119
FileChksumInp::fileName
char fileName[(1024+64)]
Definition: fileChksum.h:9
SYS_PATH_IS_NOT_A_FILE
@ SYS_PATH_IS_NOT_A_FILE
Definition: rodsErrorTable.h:119
isInVault
int isInVault(dataObjInfo_t *dataObjInfo)
Definition: physPath.cpp:1034
SqlResult::value
char * value
Definition: rodsGenQuery.h:64
IN_PDMO_KW
#define IN_PDMO_KW
Definition: rodsKeyWdDef.h:227
getDefFileMode
int getDefFileMode()
Definition: physPath.cpp:1057
irods_hierarchy_parser.hpp
isTrashPath
int isTrashPath(char *myPath)
Definition: rcMisc.cpp:2395
irods::resource_manager::hier_to_leaf_id
error hier_to_leaf_id(const std::string &, rodsLong_t &)
Definition: irods_resource_manager.cpp:1082
CAT_NAME_EXISTS_AS_COLLECTION
@ CAT_NAME_EXISTS_AS_COLLECTION
Definition: rodsErrorTable.h:448
ORIG_CHKSUM_KW
#define ORIG_CHKSUM_KW
Definition: rodsKeyWdDef.h:26
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
fileRenameInp_t::oldFileName
char oldFileName[(1024+64)]
Definition: fileRename.h:9
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
vaultPathPolicy_t::scheme
vaultPathScheme_t scheme
Definition: rodsDef.h:354
getDataObjLockPath
int getDataObjLockPath(char *objPath, char **outLockPath)
Definition: physPath.cpp:1185
SqlResult
Definition: rodsGenQuery.h:61
FILE_GID_KW
#define FILE_GID_KW
Definition: rodsKeyWdDef.h:131
USER_STRLEN_TOOLONG
@ USER_STRLEN_TOOLONG
Definition: rodsErrorTable.h:237
RuleExecInfo
Definition: irods_re_structs.hpp:18
rsModDataObjMeta
int rsModDataObjMeta(rsComm_t *rsComm, modDataObjMeta_t *modDataObjMetaInp)
Definition: rsModDataObjMeta.cpp:23
COL_COLL_NAME
#define COL_COLL_NAME
Definition: rodsGenQuery.h:189
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
rsQueryDataObjInCollReCur
int rsQueryDataObjInCollReCur(rsComm_t *rsComm, char *collection, genQueryInp_t *genQueryInp, genQueryOut_t **genQueryOut, char *accessPerm, int singleFlag)
Definition: collection.cpp:131
rsModDataObjMeta.hpp
has_prefix
int has_prefix(const char *path, const char *prefix)
Definition: rodsPath.cpp:561
applyRule
int applyRule(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:65
resource.hpp
irods::exception
Definition: irods_exception.hpp:15
ORPHAN_DIR
#define ORPHAN_DIR
Definition: physPath.hpp:21
SqlResult::len
int len
Definition: rodsGenQuery.h:63
SYS_FS_LOCK_ERR
@ SYS_FS_LOCK_ERR
Definition: rodsErrorTable.h:188
syncDataObjPhyPathS
int syncDataObjPhyPathS(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t *dataObjInfo, char *acLCollection)
Definition: physPath.cpp:763
DISALLOW_PATH_REG
#define DISALLOW_PATH_REG
Definition: objInfo.h:245
CollInp::collName
char collName[(1024+64)]
Definition: dataObjInpOut.h:158
FILE_OPEN_ERR
@ FILE_OPEN_ERR
Definition: rodsErrorTable.h:494
FILE_MTIME_KW
#define FILE_MTIME_KW
Definition: rodsKeyWdDef.h:135
phyBundleColl.h
DataObjInfo::objPath
char objPath[(1024+64)]
Definition: objInfo.h:130
SHORT_STR_LEN
#define SHORT_STR_LEN
Definition: rodsDef.h:67
rsGenQuery.hpp
irods_random.hpp
userInfo_t::authInfo
authInfo_t authInfo
Definition: rodsUser.h:70
vaultPathPolicy_t::trimDirCnt
int trimDirCnt
Definition: rodsDef.h:356
FileChksumInp::addr
rodsHostAddr_t addr
Definition: fileChksum.h:8
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
COL_D_DATA_PATH
#define COL_D_DATA_PATH
Definition: rodsGenQuery.h:172
dataObjOpr.hpp
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
modDataObjMeta_t
Definition: modDataObjMeta.h:7
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
zoneInfo
Definition: rodsConnect.h:74
getFileMode
int getFileMode(dataObjInp_t *dataObjInp)
Definition: physPath.cpp:48
freeGenQueryOut
int freeGenQueryOut(genQueryOut_t **genQueryOut)
Definition: rcMisc.cpp:1133
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
KeyValPair
Definition: objInfo.h:120
DEFAULT_DIR_MODE
#define DEFAULT_DIR_MODE
Definition: objInfo.h:241
rsCollCreate.hpp
authInfo_t::authFlag
int authFlag
Definition: rodsUser.h:42
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
rodsStat::st_gid
unsigned int st_gid
Definition: rodsType.h:59
FILE_PATH_KW
#define FILE_PATH_KW
Definition: rodsKeyWdDef.h:28
type
int type
Definition: filesystem.cpp:103
DataObjInfo
Definition: objInfo.h:129
setPathForRandomScheme
int setPathForRandomScheme(char *objPath, const char *vaultPath, char *userName, char *outPath)
Definition: physPath.cpp:202
getLeafRescPathName
int getLeafRescPathName(const std::string &_resc_hier, std::string &_ret_string)
Definition: physPath.cpp:1358
clearGenQueryInp
void clearGenQueryInp(void *voidInp)
Definition: rcMisc.cpp:1118
resolveDupFilePath
int resolveDupFilePath(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:279
rsMkOrphanPath
int rsMkOrphanPath(rsComm_t *rsComm, char *objPath, char *orphanPath)
Definition: physPath.cpp:1127
rsGenQuery
int rsGenQuery(rsComm_t *rsComm, genQueryInp_t *genQueryInp, genQueryOut_t **genQueryOut)
Definition: rsGenQuery.cpp:604
DIRECT_ARCHIVE_ACCESS
@ DIRECT_ARCHIVE_ACCESS
Definition: rodsErrorTable.h:763
RuleExecInfo::inOutMsParamArray
msParamArray_t inOutMsParamArray
Definition: irods_re_structs.hpp:25
FILE_CAT
@ FILE_CAT
Definition: objInfo.h:236
irods_log.hpp
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
fileRenameInp_t::addr
rodsHostAddr_t addr
Definition: fileRename.h:8
objMetaOpr.hpp
irods::is_resc_live
error is_resc_live(rodsLong_t)
Definition: irods_resource_backport.cpp:263
COL_D_RESC_ID
#define COL_D_RESC_ID
Definition: rodsGenQuery.h:185
COL_D_DATA_ID
#define COL_D_DATA_ID
Definition: rodsGenQuery.h:163
chkOrphanFile
int chkOrphanFile(rsComm_t *rsComm, char *filePath, const char *rescName, dataObjInfo_t *dataObjInfo)
Definition: dataObjOpr.cpp:1099
USER__NULL_INPUT_ERR
@ USER__NULL_INPUT_ERR
Definition: rodsErrorTable.h:247
fileRenameOut_t::file_name
char file_name[(1024+64)]
Definition: fileRename.h:17
DEF_TRIM_DIR_CNT
#define DEF_TRIM_DIR_CNT
Definition: rodsDef.h:351