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)  

fileOpr.cpp
Go to the documentation of this file.
1 
4 /* fileOpr.c - File type operation. Will call low level file drivers
5  */
6 
7 #include "fileOpr.hpp"
8 #include "fileStat.h"
9 #include "rsGlobalExtern.hpp"
10 #include "rcGlobalExtern.h"
11 #include "collection.hpp"
12 #include "rsChkNVPathPerm.hpp"
13 #include "rsFileStat.hpp"
14 
15 // =-=-=-=-=-=-=-
16 #include "irods_log.hpp"
17 #include "irods_file_object.hpp"
19 #include "irods_stacktrace.hpp"
23 
24 int
26  memset( FileDesc, 0, sizeof( FileDesc ) );
27  return 0;
28 }
29 
30 int
32  int i;
33 
34  for ( i = 3; i < NUM_FILE_DESC; i++ ) {
35  if ( FileDesc[i].inuseFlag == FD_FREE ) {
37  return i;
38  };
39  }
40 
42  "allocFileDesc: out of FileDesc" );
43 
44  return SYS_OUT_OF_FILE_DESC;
45 }
46 
47 int
49  const std::string& objPath,
50  const std::string& fileName,
51  const std::string& rescHier,
52  int fd,
53  int mode ) {
54  int fileInx;
55 
56  fileInx = allocFileDesc();
57  if ( fileInx < 0 ) {
58  return fileInx;
59  }
60 
62  FileDesc[fileInx].objPath = strdup( objPath.c_str() );
63  FileDesc[fileInx].fileName = strdup( fileName.c_str() );
64  FileDesc[fileInx].rescHier = strdup( rescHier.c_str() );
65  FileDesc[fileInx].mode = mode;
66  FileDesc[fileInx].fd = fd;
67 
68  return fileInx;
69 }
70 
71 int
72 freeFileDesc( int fileInx ) {
73  if ( fileInx < 3 || fileInx >= NUM_FILE_DESC ) {
75  "freeFileDesc: fileInx %d out of range", fileInx );
77  }
78 
79  if ( FileDesc[fileInx].fileName != NULL ) {
80  free( FileDesc[fileInx].fileName );
81  }
82 
83  if ( FileDesc[fileInx].objPath != NULL ) {
84  free( FileDesc[fileInx].objPath );
85  }
86 
87  if ( FileDesc[fileInx].rescHier != NULL ) {
88  free( FileDesc[fileInx].rescHier );
89  }
90 
91  /* don't free driverDep (dirPtr is not malloced */
92 
93  memset( &FileDesc[fileInx], 0, sizeof( fileDesc_t ) );
94 
95  return 0;
96 }
97 
98 int
100  int remoteFlag;
101  if ( fileInx < 3 || fileInx >= NUM_FILE_DESC ) {
103  "getServerHostByFileInx: Bad fileInx value %d", fileInx );
105  }
106 
107  if ( FileDesc[fileInx].inuseFlag == 0 ) {
109  "getServerHostByFileInx: fileInx %d not active", fileInx );
111  }
112 
114  remoteFlag = ( *rodsServerHost )->localFlag;
115 
116  return remoteFlag;
117 }
118 
119 int
121  rsComm_t * rsComm,
122  size_t startDirLen,
123  const std::string& filePath,
124  const std::string& hier,
125  int mode ) {
126  int status;
127 
128  char myDir[MAX_NAME_LEN], myFile[MAX_NAME_LEN];
129 
130  if ( ( status = splitPathByKey( filePath.c_str(), myDir, MAX_NAME_LEN, myFile, MAX_NAME_LEN, '/' ) ) < 0 ) {
132  "mkDirForFilePath: splitPathByKey for %s error, status = %d",
133  filePath.c_str(), status );
134  return status;
135  }
136 
137  status = mkFileDirR( rsComm, startDirLen, myDir, hier, mode );
138  if ( status < 0 ) {
139  rodsLog( LOG_ERROR, "mkFileDirR failed in mkDirForFilePath with status %d", status );
140  }
141 
142  return status;
143 }
144 
145 // =-=-=-=-=-=-=-
146 // mk the directory recursively
148  rsComm_t * rsComm,
149  size_t startDirLen,
150  const std::string& destDir,
151  const std::string& hier,
152  int mode ) {
153 
154  std::string physical_directory_prefix;
155  if ( destDir.empty() ) {
156  rodsLog( LOG_ERROR, "mkFileDirR called with empty dest directory" );
157  return SYS_INVALID_INPUT_PARAM ;
158  }
159  if ( destDir.size() < startDirLen ) {
160  rodsLog( LOG_ERROR, "mkFileDirR called with a destDir: [%s]"
161  "shorter than its startDirLen: [%ju]",
162  destDir.c_str(), ( uintmax_t )startDirLen );
164  }
165  if ( !rsComm ) {
166  rodsLog( LOG_ERROR, "mkFileDirR called with null rsComm" );
168  }
169  if ( isValidFilePath( destDir ) ) {
170  std::string vault_path;
171  irods::error err = irods::get_vault_path_for_hier_string( hier, vault_path );
172  if ( !err.ok() ) {
173  rodsLog( LOG_ERROR, "%s", err.result().c_str() );
174  return err.code();
175  }
176 
177  if ( destDir.compare( 0, vault_path.size(), vault_path ) == 0 &&
178  ( destDir[ vault_path.size() ] == '/' || destDir.size() == vault_path.size() ) ) {
179  physical_directory_prefix = vault_path;
180  }
181  }
182 
183  std::vector< std::string > directories_to_create;
184 
185  std::string physical_directory = destDir;
186  if ( physical_directory[ physical_directory.size() - 1 ] == '/' ) {
187  physical_directory.erase( physical_directory.size() - 1 );
188  }
189  while ( physical_directory.size() > startDirLen ) {
190  irods::collection_object_ptr tmp_coll_obj(
192  physical_directory,
193  hier,
194  0, 0 ) );
195  struct stat statbuf;
196  irods::error stat_err = fileStat(
197  rsComm,
198  tmp_coll_obj,
199  &statbuf );
200  if ( stat_err.code() >= 0 ) {
201  if ( statbuf.st_mode & S_IFDIR ) {
202  break;
203  }
204  else {
206  "mkFileDirR: A local non-directory %s already exists \n",
207  physical_directory.c_str() );
208  return stat_err.code();
209  }
210  }
211  else {
212  directories_to_create.push_back( physical_directory.substr( physical_directory_prefix.size() ) );
213  }
214 
215  /* Go backward */
216  size_t index_of_last_slash = physical_directory.rfind( '/', physical_directory.size() - 1 );
217  if ( std::string::npos != index_of_last_slash ) {
218  physical_directory = physical_directory.substr( 0, index_of_last_slash );
219  }
220  else {
221  break;
222  }
223 
224  } // while
225 
226  std::string irods_directory_prefix = "/";
227  irods_directory_prefix += getLocalZoneName();
228 
229  /* Now we go forward and make the required dir */
230  while ( !directories_to_create.empty() ) {
231 
232  physical_directory = physical_directory_prefix;
233  physical_directory += directories_to_create.back();
234 
235  std::string irods_directory = irods_directory_prefix;
236  irods_directory += directories_to_create.back();
237 
238  directories_to_create.pop_back();
239 
240  irods::collection_object_ptr tmp_coll_obj(
242  physical_directory,
243  hier,
244  mode, 0 ) );
245 
246  irods::error mkdir_err = fileMkdir( rsComm, tmp_coll_obj );
247  if ( !mkdir_err.ok() && ( getErrno( mkdir_err.code() ) != EEXIST ) ) { // JMC - backport 4834
248  std::stringstream msg;
249  msg << "fileMkdir for [";
250  msg << physical_directory;
251  msg << "]";
252  irods::error ret_err = PASSMSG( msg.str(), mkdir_err );
253  irods::log( ret_err );
254 
255  return mkdir_err.code();
256  }
257  }
258  return 0;
259 }
260 
261 // =-=-=-=-=-=-=-
262 //
264  rsComm_t* rsComm,
265  const std::string& cacheDir,
266  const std::string& hier ) {
267  int status = 0;
268  char childPath[MAX_NAME_LEN];
269  struct stat myFileStat;
270  struct rodsDirent* myFileDirent = 0;
271 
272  // =-=-=-=-=-=-=-
273  // call opendir via resource plugin
274  irods::collection_object_ptr cacheDir_obj(
276  cacheDir,
277  hier,
278  0, 0 ) );
279  irods::error opendir_err = fileOpendir( rsComm, cacheDir_obj );
280 
281  // =-=-=-=-=-=-=-
282  // don't log an error as this is part
283  // of the functionality of this code
284  if ( !opendir_err.ok() ) {
285  return 0;
286  }
287 
288  // =-=-=-=-=-=-=-
289  // make call to readdir via resource plugin
290  irods::error readdir_err = fileReaddir( rsComm, cacheDir_obj, &myFileDirent );
291  while ( readdir_err.ok() && 0 == readdir_err.code() ) {
292  // =-=-=-=-=-=-=-
293  // handle relative paths
294  if ( strcmp( myFileDirent->d_name, "." ) == 0 ||
295  strcmp( myFileDirent->d_name, ".." ) == 0 ) {
296  readdir_err = fileReaddir( rsComm, cacheDir_obj, &myFileDirent );
297  continue;
298  }
299 
300  // =-=-=-=-=-=-=-
301  // get status of path
302  snprintf( childPath, MAX_NAME_LEN, "%s/%s", cacheDir.c_str(), myFileDirent->d_name );
303  irods::collection_object_ptr tmp_coll_obj(
305  childPath,
306  hier,
307  0, 0 ) );
308 
309  irods::error stat_err = fileStat( rsComm, tmp_coll_obj, &myFileStat );
310 
311  // =-=-=-=-=-=-=-
312  // handle hard error
313  if ( stat_err.code() < 0 ) {
314  rodsLog( LOG_ERROR, "chkEmptyDir: fileStat error for %s, status = %d",
315  childPath, stat_err.code() );
316  break;
317  }
318 
319  // =-=-=-=-=-=-=-
320  // path exists
321  if ( myFileStat.st_mode & S_IFREG ) {
323  rodsLog( LOG_ERROR, "chkEmptyDir: file %s exists",
324  childPath, status );
325  break;
326  }
327 
328  // =-=-=-=-=-=-=-
329  // recurse for another directory
330  if ( myFileStat.st_mode & S_IFDIR ) {
331  status = chkEmptyDir( rsComm, childPath, hier );
333  rodsLog( LOG_ERROR, "chkEmptyDir: dir %s is not empty", childPath );
334  break;
335  }
336  }
337 
338  // =-=-=-=-=-=-=-
339  // continue with child path
340  readdir_err = fileReaddir( rsComm, cacheDir_obj, &myFileDirent );
341 
342  } // while
343 
344  // =-=-=-=-=-=-=-
345  // make call to closedir via resource plugin, log error if necessary
346  irods::error closedir_err = fileClosedir( rsComm, cacheDir_obj );
347  if ( !closedir_err.ok() ) {
348  std::stringstream msg;
349  msg << "fileClosedir failed for [";
350  msg << cacheDir;
351  msg << "]";
352  irods::error log_err = PASSMSG( msg.str(), closedir_err );
353  irods::log( log_err );
354  }
355 
359  cacheDir,
360  hier, 0, 0 ) );
361  irods::error rmdir_err = fileRmdir( rsComm, coll_obj );
362  if ( !rmdir_err.ok() ) {
363  std::stringstream msg;
364  msg << "fileRmdir failed for [";
365  msg << cacheDir;
366  msg << "]";
367  irods::error err = PASSMSG( msg.str(), rmdir_err );
368  irods::log( err );
369  }
370  status = 0;
371  }
372 
373  return status;
374 
375 } // chkEmptyDir
376 
377 /* chkFilePathPerm - check the FilePath permission.
378  * If rodsServerHost
379  */
380 int
381 chkFilePathPerm( rsComm_t *rsComm, fileOpenInp_t *fileOpenInp,
382  rodsServerHost_t *rodsServerHost, int chkType ) { // JMC - backport 4774
383  int status;
384 
385  if ( chkType == NO_CHK_PATH_PERM ) {
386  return 0;
387  }
388  else if ( chkType == DISALLOW_PATH_REG ) {
389  return PATH_REG_NOT_ALLOWED;
390  }
391  // =-=-=-=-=-=-=-
392 
393  status = isValidFilePath( fileOpenInp->fileName ); // JMC - backport 4766
394  if ( status < 0 ) {
395  return status; // JMC - backport 4766
396  }
397 
398 
399  if ( rodsServerHost == NULL ) {
401  "chkFilePathPerm: NULL rodsServerHost" );
403  }
404 
405  // =-=-=-=-=-=-=-
406  // JMC - backport 4774
407  if ( chkType == CHK_NON_VAULT_PATH_PERM ) {
408  status = matchCliVaultPath( rsComm, fileOpenInp->fileName, rodsServerHost );
409 
410  if ( status == 1 ) {
411  /* a match in vault */
412  return status;
413  }
414  else if ( status == -1 ) {
415  /* in vault, but not in user's vault */
416  return CANT_REG_IN_VAULT_FILE;
417  }
418  }
419  else if ( chkType == DO_CHK_PATH_PERM ) {
420  std::string out_path;
421  irods::error ret = resc_mgr.validate_vault_path( fileOpenInp->fileName, rodsServerHost, out_path );
422  if ( ret.ok() ) {
423  /* a match */
424  return CANT_REG_IN_VAULT_FILE;
425  }
426  }
427  else {
429  // =-=-=-=-=-=-=-
430  }
431 
432  status = rsChkNVPathPermByHost( rsComm, fileOpenInp, rodsServerHost );
433 
434  return status;
435 }
436 
437 // =-=-=-=-=-=-=-
438 // JMC - backport 4766, 4869
439 /* isValidFilePath - check if it is a valid file path - should not contain
440  * "/../" or end with "/.."
441  */
442 int
443 isValidFilePath( const std::string& path ) {
444 
445  if ( path.find( "/../" ) != std::string::npos ||
446  path.compare( path.size() - 3, path.size(), "/.." ) == 0 ) {
447  /* "/../" or end with "/.." */
448  rodsLog( LOG_ERROR, "isValidFilePath: inp fileName %s contains /../ or ends with /..", path.c_str() );
449  return SYS_INVALID_FILE_PATH;
450  }
451 
452  return 0;
453 }
454 
455 /* matchCliVaultPath - if the input path is inside
456  * $(vaultPath)/home/userName, return 1.
457  * If it is in $(vaultPath) but not in $(vaultPath)/home/userName,
458  * return -1. If it is a non vault path, return 0.
459  */
461  rsComm_t* _comm,
462  const std::string& _path,
463  rodsServerHost_t* _svr_host ) {
464  // =-=-=-=-=-=-=-
465  // sanity check
466  if ( !_comm ) {
467  rodsLog( LOG_ERROR, "matchCliVaultPath :: null comm" );
469  }
470 
471  if ( _path.empty() ) {
472  rodsLog( LOG_ERROR, "matchCliVaultPath :: empty file path" );
474  }
475 
476  if ( !_svr_host ) {
477  rodsLog( LOG_ERROR, "matchCliVaultPath :: null server host" );
479  }
480 
481  // =-=-=-=-=-=-=-
482  // validate the vault path against a known host
483  std::string vault_path;
484  irods::error ret = resc_mgr.validate_vault_path( _path, _svr_host, vault_path );
485  if ( !ret.ok() || vault_path.empty() ) {
486  return 0;
487  }
488 
489  // =-=-=-=-=-=-=-
490  // get the substr of the file path, minus the vault path
491  std::string user_path = _path.substr( vault_path.size() );
492 
493  // =-=-=-=-=-=-=-
494  // if user_path starts with a / set the home pos accordingly
495  const size_t home_pos = ( user_path[0] == '/' ) ? 1 : 0;
496 
497  // =-=-=-=-=-=-=-
498  // verify that the first chars are home/
499  size_t pos = user_path.find( "home/" );
500  if ( home_pos != pos ) {
501  rodsLog( LOG_NOTICE, "matchCliVaultPath :: home/ is not found in the proper location for path [%s]",
502  user_path.c_str() );
503  return -1;
504  }
505 
506  // =-=-=-=-=-=-=-
507  // if user_path starts with a / set the home pos accordingly
508  const size_t user_pos = home_pos + 5;
509 
510  // =-=-=-=-=-=-=-
511  // verify that the user name follows 'home/'
512  pos = user_path.find( _comm->clientUser.userName );
513  if ( user_pos != pos ) {
514  rodsLog( LOG_NOTICE, "matchCliVaultPath :: [%s] is not found in the proper location for path [%s]",
515  _comm->clientUser.userName, user_path.c_str() );
516  return -1;
517  }
518 
519  // =-=-=-=-=-=-=-
520  // success
521  return 1;
522 
523 } // matchCliVaultPath
524 
525 /* filePathTypeInResc - the status of a filePath in a resource.
526  * return LOCAL_FILE_T, LOCAL_DIR_T, UNKNOWN_OBJ_T or error (-ive)
527  */
528 int
530  rsComm_t* rsComm,
531  const std::string& objPath,
532  const std::string& fileName,
533  const std::string& rescHier ) {
534  fileStatInp_t fileStatInp;
535  rodsStat_t *myStat = NULL;
536  int status;
537 
538  // =-=-=-=-=-=-=-
539  // get location of leaf in hier string
540  std::string location;
541  irods::error ret = irods::get_loc_for_hier_string( rescHier, location );
542  if ( !ret.ok() ) {
543  irods::log( PASSMSG( "failed in get_loc_for_hier_string", ret ) );
544  return -1;
545  }
546 
547  memset( &fileStatInp, 0, sizeof( fileStatInp ) );
548  rstrcpy( fileStatInp.fileName, fileName.c_str(), MAX_NAME_LEN );
549 
550  rodsLong_t resc_id;
551  resc_mgr.hier_to_leaf_id( rescHier, resc_id );
552 
553  rstrcpy( fileStatInp.objPath, objPath.c_str(), MAX_NAME_LEN );
554  rstrcpy( fileStatInp.rescHier, rescHier.c_str(), MAX_NAME_LEN );
555  rstrcpy( fileStatInp.addr.hostAddr, location.c_str(), NAME_LEN );
556  status = rsFileStat( rsComm, &fileStatInp, &myStat );
557 
558  if ( status < 0 || NULL == myStat ) {
559  return status; // JMC cppcheck - nullptr
560  }
561  if ( myStat->st_mode & S_IFREG ) {
562  free( myStat );
563  return LOCAL_FILE_T;
564  }
565  else if ( myStat->st_mode & S_IFDIR ) {
566  free( myStat );
567  return LOCAL_DIR_T;
568  }
569  else {
570  free( myStat );
571  return UNKNOWN_OBJ_T;
572  }
573 }
574 
575 int
577  int fileInx;
578 
580  fd, DEFAULT_FILE_MODE );
581 
582  return fileInx;
583 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
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
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
rodsServerHost::localFlag
int localFlag
Definition: rodsConnect.h:68
initFileDesc
int initFileDesc()
Definition: fileOpr.cpp:25
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
allocFileDesc
int allocFileDesc()
Definition: fileOpr.cpp:31
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
fileDesc_t::mode
int mode
Definition: fileOpr.hpp:30
UNKNOWN_OBJ_T
@ UNKNOWN_OBJ_T
Definition: rodsType.h:37
irods_file_object.hpp
irods_stacktrace.hpp
resc_mgr
irods::resource_manager resc_mgr
Definition: irods_resource_manager.cpp:31
chkEmptyDir
int chkEmptyDir(rsComm_t *rsComm, const std::string &cacheDir, const std::string &hier)
Definition: fileOpr.cpp:263
rodsDirent::d_name
char d_name[256]
Definition: rodsType.h:75
irods_collection_object.hpp
rsFileStat
int rsFileStat(rsComm_t *rsComm, fileStatInp_t *fileStatInp, rodsStat_t **fileStatOut)
Definition: rsFileStat.cpp:18
irods::collection_object_ptr
boost::shared_ptr< collection_object > collection_object_ptr
Definition: irods_collection_object.hpp:85
rsChkNVPathPermByHost
int rsChkNVPathPermByHost(rsComm_t *rsComm, fileOpenInp_t *chkNVPathPermInp, rodsServerHost_t *rodsServerHost)
Definition: rsChkNVPathPerm.cpp:42
isValidFilePath
int isValidFilePath(const std::string &path)
Definition: fileOpr.cpp:443
fileStatInp_t
Definition: fileStat.h:7
freeFileDesc
int freeFileDesc(int fileInx)
Definition: fileOpr.cpp:72
fileMkdir
irods::error fileMkdir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:270
irods_resource_backport.hpp
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
mkDirForFilePath
int mkDirForFilePath(rsComm_t *rsComm, size_t startDirLen, const std::string &filePath, const std::string &hier, int mode)
Definition: fileOpr.cpp:120
fileStat.h
rcGlobalExtern.h
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
fileOpenInp_t::fileName
char fileName[(1024+64)]
Definition: fileOpen.h:20
PATH_REG_NOT_ALLOWED
@ PATH_REG_NOT_ALLOWED
Definition: rodsErrorTable.h:194
fileDesc_t::rescHier
char * rescHier
Definition: fileOpr.hpp:28
SYS_BAD_FILE_DESCRIPTOR
@ SYS_BAD_FILE_DESCRIPTOR
Definition: rodsErrorTable.h:91
SYS_OUT_OF_FILE_DESC
@ SYS_OUT_OF_FILE_DESC
Definition: rodsErrorTable.h:86
DO_CHK_PATH_PERM
#define DO_CHK_PATH_PERM
Definition: objInfo.h:247
irods_resource_plugin.hpp
fileDesc_t::inuseFlag
int inuseFlag
Definition: fileOpr.hpp:25
rsGlobalExtern.hpp
rsFileStat.hpp
allocAndFillFileDesc
int allocAndFillFileDesc(rodsServerHost_t *rodsServerHost, const std::string &objPath, const std::string &fileName, const std::string &rescHier, int fd, int mode)
Definition: fileOpr.cpp:48
irods::error::code
long long code() const
Definition: irods_error.cpp:194
rodsStat
Definition: rodsType.h:52
bindStreamToIRods
int bindStreamToIRods(rodsServerHost_t *rodsServerHost, int fd)
Definition: fileOpr.cpp:576
fileStatInp_t::rescHier
char rescHier[(1024+64)]
Definition: fileStat.h:10
matchCliVaultPath
int matchCliVaultPath(rsComm_t *_comm, const std::string &_path, rodsServerHost_t *_svr_host)
Definition: fileOpr.cpp:460
fileStatInp_t::objPath
char objPath[(1024+64)]
Definition: fileStat.h:11
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
fileOpendir
irods::error fileOpendir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:362
NO_CHK_PATH_PERM
#define NO_CHK_PATH_PERM
Definition: objInfo.h:246
fileStatInp_t::addr
rodsHostAddr_t addr
Definition: fileStat.h:8
fileDesc_t::objPath
char * objPath
Definition: fileOpr.hpp:29
getServerHostByFileInx
int getServerHostByFileInx(int fileInx, rodsServerHost_t **rodsServerHost)
Definition: fileOpr.cpp:99
FD_FREE
#define FD_FREE
Definition: fileOpr.hpp:20
chkFilePathPerm
int chkFilePathPerm(rsComm_t *rsComm, fileOpenInp_t *fileOpenInp, rodsServerHost_t *rodsServerHost, int chkType)
Definition: fileOpr.cpp:381
fileDesc_t::rodsServerHost
rodsServerHost_t * rodsServerHost
Definition: fileOpr.hpp:26
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
irods::resource_manager::validate_vault_path
error validate_vault_path(std::string, rodsServerHost_t *, std::string &)
Definition: irods_resource_manager.cpp:132
getErrno
int getErrno(int errCode)
Definition: rcMisc.cpp:3261
fileRmdir
irods::error fileRmdir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:332
filePathTypeInResc
int filePathTypeInResc(rsComm_t *rsComm, const std::string &objPath, const std::string &fileName, const std::string &rescHier)
Definition: fileOpr.cpp:529
irods::collection_object
Definition: irods_collection_object.hpp:14
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
collection.hpp
splitPathByKey
int splitPathByKey(const char *srcPath, char *dir, size_t maxDirLen, char *file, size_t maxFileLen, char key)
Definition: stringOpr.cpp:222
irods::log
void log(const error &)
Definition: irods_log.cpp:13
rodsDirent
Definition: rodsType.h:70
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
irods::error
Definition: irods_error.hpp:23
getLocalZoneName
char * getLocalZoneName()
Definition: rodsConnect.cpp:685
SYS_INVALID_FILE_PATH
@ SYS_INVALID_FILE_PATH
Definition: rodsErrorTable.h:99
fileStat
irods::error fileStat(rsComm_t *, irods::first_class_object_ptr, struct stat *)
Definition: fileDriver.cpp:207
FD_INUSE
#define FD_INUSE
Definition: fileOpr.hpp:21
FileDesc
fileDesc_t FileDesc[1026]
Definition: irods_server_globals.cpp:28
fileOpenInp_t
Definition: fileOpen.h:14
STREAM_FILE_NAME
#define STREAM_FILE_NAME
Definition: fileOpr.hpp:23
fileClosedir
irods::error fileClosedir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:392
irods::resource_manager::hier_to_leaf_id
error hier_to_leaf_id(const std::string &, rodsLong_t &)
Definition: irods_resource_manager.cpp:1082
CANT_REG_IN_VAULT_FILE
@ CANT_REG_IN_VAULT_FILE
Definition: rodsErrorTable.h:193
fileOpr.hpp
rodsServerHost
Definition: rodsConnect.h:62
fileStatInp_t::fileName
char fileName[(1024+64)]
Definition: fileStat.h:9
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
fileDesc_t::fd
int fd
Definition: fileOpr.hpp:32
LOCAL_DIR_T
@ LOCAL_DIR_T
Definition: rodsType.h:42
SYS_DIR_IN_VAULT_NOT_EMPTY
@ SYS_DIR_IN_VAULT_NOT_EMPTY
Definition: rodsErrorTable.h:149
irods_resource_manager.hpp
CHK_NON_VAULT_PATH_PERM
#define CHK_NON_VAULT_PATH_PERM
Definition: objInfo.h:248
NUM_FILE_DESC
#define NUM_FILE_DESC
Definition: fileOpr.hpp:16
rsChkNVPathPerm.hpp
DISALLOW_PATH_REG
#define DISALLOW_PATH_REG
Definition: objInfo.h:245
irods.paths.irods_directory
def irods_directory()
Definition: paths.py:9
fileReaddir
irods::error fileReaddir(rsComm_t *, irods::first_class_object_ptr, struct rodsDirent **)
Definition: fileDriver.cpp:422
mode
int mode
Definition: filesystem.cpp:104
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
LOCAL_FILE_T
@ LOCAL_FILE_T
Definition: rodsType.h:41
mkFileDirR
int mkFileDirR(rsComm_t *rsComm, size_t startDirLen, const std::string &destDir, const std::string &hier, int mode)
Definition: fileOpr.cpp:147
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
SYS_FILE_DESC_OUT_OF_RANGE
@ SYS_FILE_DESC_OUT_OF_RANGE
Definition: rodsErrorTable.h:87
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
fileDesc_t
Definition: fileOpr.hpp:24
irods::error::result
std::string result() const
Definition: irods_error.cpp:201
fileDesc_t::fileName
char * fileName
Definition: fileOpr.hpp:27
irods_log.hpp
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32