00001
00002
00003
00004
00005
00006
00007
00008 #include "phyPathReg.h"
00009 #include "rodsLog.h"
00010 #include "icatDefines.h"
00011 #include "objMetaOpr.h"
00012 #include "dataObjOpr.h"
00013 #include "collection.h"
00014 #include "specColl.h"
00015 #include "resource.h"
00016 #include "physPath.h"
00017 #include "rsGlobalExtern.h"
00018 #include "rcGlobalExtern.h"
00019 #include "reGlobalsExtern.h"
00020 #include "miscServerFunct.h"
00021 #include "apiHeaderAll.h"
00022
00023
00024
00025 #include "eirods_resource_backport.h"
00026 #include "eirods_resource_redirect.h"
00027 #include "eirods_hierarchy_parser.h"
00028
00029
00030
00031 #include <iostream>
00032
00033
00034
00035
00036 static pathnamePatterns_t *ExcludePatterns = NULL;
00037
00038
00039 pathnamePatterns_t *
00040 readPathnamePatternsFromFile(rsComm_t *rsComm, char *filename, char* );
00041
00042
00043
00044
00045
00046 int
00047 phyPathRegNoChkPerm (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00048 {
00049 int status;
00050
00051 addKeyVal (&phyPathRegInp->condInput, NO_CHK_FILE_PERM_KW, "");
00052
00053 status = irsPhyPathReg (rsComm, phyPathRegInp);
00054 return (status);
00055 }
00056
00057 int
00058 rsPhyPathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00059 {
00060 int status;
00061
00062 if (getValByKey (&phyPathRegInp->condInput, NO_CHK_FILE_PERM_KW) != NULL &&
00063 rsComm->proxyUser.authInfo.authFlag < LOCAL_PRIV_USER_AUTH) {
00064 return SYS_NO_API_PRIV;
00065 }
00066
00067 status = irsPhyPathReg (rsComm, phyPathRegInp);
00068 return (status);
00069 }
00070
00071 int
00072 irsPhyPathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00073 {
00074 int status;
00075 rescGrpInfo_t *rescGrpInfo = NULL;
00076 rodsServerHost_t *rodsServerHost = NULL;
00077 int remoteFlag;
00078
00079 rodsHostAddr_t addr;
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 char* coll_type = getValByKey( &phyPathRegInp->condInput, COLLECTION_TYPE_KW );
00091
00092 if( coll_type && strcmp( coll_type, UNMOUNT_STR ) == 0) {
00093 status = unmountFileDir (rsComm, phyPathRegInp);
00094 return (status);
00095
00096 } else if ( coll_type != NULL && strcmp ( coll_type, LINK_POINT_STR) == 0) {
00097 status = linkCollReg (rsComm, phyPathRegInp);
00098 return (status);
00099
00100 }
00101
00102
00103
00104
00105
00106 int local = LOCAL_HOST;
00107 rodsServerHost_t* host = 0;
00108 std::string hier;
00109 char* tmp_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00110 if( NULL == tmp_hier ) {
00111 eirods::error ret = eirods::resource_redirect( eirods::EIRODS_CREATE_OPERATION, rsComm,
00112 phyPathRegInp, hier, host, local );
00113 if( !ret.ok() ) {
00114 std::stringstream msg;
00115 msg << "failed in eirods::resource_redirect for [";
00116 msg << phyPathRegInp->objPath << "]";
00117 eirods::log( PASSMSG( msg.str(), ret ) );
00118 return ret.code();
00119 }
00120
00121
00122
00123 addKeyVal( &phyPathRegInp->condInput, RESC_HIER_STR_KW, hier.c_str() );
00124
00125 } else {
00126 hier = tmp_hier;
00127 }
00128
00129
00130
00131 if( coll_type && (strcmp( coll_type, HAAW_STRUCT_FILE_STR) == 0 ||
00132 strcmp ( coll_type, TAR_STRUCT_FILE_STR) == 0)) {
00133 status = structFileReg (rsComm, phyPathRegInp);
00134 return (status);
00135 }
00136
00137
00138
00139
00140 std::string resc_name;
00141 eirods::hierarchy_parser parser;
00142 parser.set_string( hier );
00143 parser.first_resc( resc_name );
00144
00145 rescGrpInfo = new rescGrpInfo_t;
00146 rescGrpInfo->rescInfo = new rescInfo_t;
00147 eirods::error err = eirods::get_resc_grp_info( resc_name, *rescGrpInfo );
00148 if( !err.ok() ) {
00149 eirods::log( PASS( err ) );
00150 delete rescGrpInfo->rescInfo;
00151 delete rescGrpInfo;
00152 return -1;
00153 }
00154
00155 std::string last_resc;
00156 parser.last_resc( last_resc );
00157
00158 std::string location;
00159 eirods::error ret = eirods::get_resource_property< std::string >( last_resc, "location", location );
00160 if( !ret.ok() ) {
00161 eirods::log( PASSMSG( "failed in get_resource_property", ret ) );
00162 delete rescGrpInfo->rescInfo;
00163 delete rescGrpInfo;
00164 return -1;
00165 }
00166
00167 memset (&addr, 0, sizeof (addr));
00168 rstrcpy (addr.hostAddr, location.c_str(), LONG_NAME_LEN);
00169 remoteFlag = resolveHost (&addr, &rodsServerHost);
00170
00171 if (remoteFlag == LOCAL_HOST) {
00172 status = _rsPhyPathReg (rsComm, phyPathRegInp, rescGrpInfo, rodsServerHost );
00173
00174 } else if (remoteFlag == REMOTE_HOST) {
00175 status = remotePhyPathReg (rsComm, phyPathRegInp, rodsServerHost);
00176
00177 } else {
00178 if (remoteFlag < 0) {
00179 delete rescGrpInfo->rescInfo;
00180 delete rescGrpInfo;
00181 return (remoteFlag);
00182 } else {
00183 rodsLog (LOG_ERROR,
00184 "rsPhyPathReg: resolveHost returned unrecognized value %d",
00185 remoteFlag);
00186 delete rescGrpInfo->rescInfo;
00187 delete rescGrpInfo;
00188 return (SYS_UNRECOGNIZED_REMOTE_FLAG);
00189 }
00190 }
00191
00192 delete rescGrpInfo->rescInfo;
00193 delete rescGrpInfo;
00194 return (status);
00195 }
00196
00197 int
00198 remotePhyPathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp,
00199 rodsServerHost_t *rodsServerHost)
00200 {
00201 int status;
00202
00203 if (rodsServerHost == NULL) {
00204 rodsLog (LOG_ERROR,
00205 "remotePhyPathReg: Invalid rodsServerHost");
00206 return SYS_INVALID_SERVER_HOST;
00207 }
00208
00209 if ((status = svrToSvrConnect (rsComm, rodsServerHost)) < 0) {
00210 return status;
00211 }
00212
00213 status = rcPhyPathReg (rodsServerHost->conn, phyPathRegInp);
00214
00215 if (status < 0) {
00216 rodsLog (LOG_ERROR,
00217 "remotePhyPathReg: rcPhyPathReg failed for %s",
00218 phyPathRegInp->objPath);
00219 }
00220
00221 return (status);
00222 }
00223
00224 int
00225 _rsPhyPathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp,
00226 rescGrpInfo_t *rescGrpInfo, rodsServerHost_t *rodsServerHost)
00227 {
00228 int status = 0;
00229 fileOpenInp_t chkNVPathPermInp;
00230 char *tmpFilePath = 0;
00231 char filePath[MAX_NAME_LEN];
00232 dataObjInfo_t dataObjInfo;
00233 char *tmpStr = NULL;
00234 int chkType = 0;
00235 char *excludePatternFile = 0;
00236
00237 if ((tmpFilePath = getValByKey (&phyPathRegInp->condInput, FILE_PATH_KW))== NULL) {
00238 rodsLog( LOG_ERROR,"_rsPhyPathReg: No filePath input for %s",
00239 phyPathRegInp->objPath );
00240 return (SYS_INVALID_FILE_PATH);
00241 } else {
00242
00243 rstrcpy (filePath, tmpFilePath, MAX_NAME_LEN);
00244 }
00245
00246
00247 memset (&dataObjInfo, 0, sizeof (dataObjInfo));
00248 rstrcpy (dataObjInfo.objPath, phyPathRegInp->objPath, MAX_NAME_LEN);
00249 rstrcpy (dataObjInfo.filePath, filePath, MAX_NAME_LEN);
00250 dataObjInfo.rescInfo = rescGrpInfo->rescInfo;
00251 rstrcpy (dataObjInfo.rescName, rescGrpInfo->rescInfo->rescName, NAME_LEN);
00252
00253 char* resc_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00254 if( resc_hier ) {
00255 rstrcpy (dataObjInfo.rescHier, resc_hier, MAX_NAME_LEN);
00256 } else {
00257 rodsLog( LOG_NOTICE, "_rsPhyPathReg :: RESC_HIER_STR_KW is NULL" );
00258 return -1;
00259 }
00260
00261 if( getValByKey (&phyPathRegInp->condInput, NO_CHK_FILE_PERM_KW) == NULL &&
00262 (chkType = getchkPathPerm (rsComm, phyPathRegInp, &dataObjInfo)) != NO_CHK_PATH_PERM) {
00263
00264 memset (&chkNVPathPermInp, 0, sizeof (chkNVPathPermInp));
00265
00266 rstrcpy (chkNVPathPermInp.fileName, filePath, MAX_NAME_LEN);
00267 chkNVPathPermInp.fileType = static_cast< fileDriverType_t>( -1 );
00268
00269
00270
00271 std::string location;
00272 eirods::error ret = eirods::get_loc_for_hier_string( resc_hier, location );
00273 if( !ret.ok() ) {
00274 eirods::log( PASSMSG( "failed in get_loc_for_hier_String", ret ) );
00275 return -1;
00276 }
00277
00278 rstrcpy (chkNVPathPermInp.addr.hostAddr, location.c_str(), NAME_LEN );
00279 status = chkFilePathPerm (rsComm, &chkNVPathPermInp, rodsServerHost,chkType);
00280
00281 if (status < 0) {
00282 rodsLog (LOG_ERROR,
00283 "_rsPhyPathReg: chkFilePathPerm error for %s",
00284 phyPathRegInp->objPath);
00285 return (SYS_NO_PATH_PERMISSION);
00286 }
00287 } else {
00288 status = 0;
00289 }
00290
00291 if (getValByKey (&phyPathRegInp->condInput, COLLECTION_KW) != NULL) {
00292 excludePatternFile = getValByKey(&phyPathRegInp->condInput, EXCLUDE_FILE_KW);
00293 if (excludePatternFile != NULL) {
00294 ExcludePatterns = readPathnamePatternsFromFile(rsComm,
00295 excludePatternFile,
00296 resc_hier);
00297 }
00298
00299 status = dirPathReg (rsComm, phyPathRegInp, filePath, rescGrpInfo->rescInfo);
00300 if (excludePatternFile != NULL) {
00301 freePathnamePatterns(ExcludePatterns);
00302 ExcludePatterns = NULL;
00303 }
00304
00305 } else if ((tmpStr = getValByKey (&phyPathRegInp->condInput, COLLECTION_TYPE_KW)) != NULL && strcmp (tmpStr, MOUNT_POINT_STR) == 0) {
00306
00307 status = mountFileDir (rsComm, phyPathRegInp, filePath, rescGrpInfo->rescInfo);
00308
00309 } else {
00310 if (getValByKey (&phyPathRegInp->condInput, REG_REPL_KW) != NULL) {
00311 status = filePathRegRepl (rsComm, phyPathRegInp, filePath, rescGrpInfo->rescInfo);
00312
00313 } else {
00314 status = filePathReg (rsComm, phyPathRegInp, filePath,rescGrpInfo->rescInfo);
00315 }
00316 }
00317
00318 return (status);
00319 }
00320
00321 int
00322 filePathRegRepl (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp, char *filePath,
00323 rescInfo_t *rescInfo)
00324 {
00325 dataObjInfo_t destDataObjInfo, *dataObjInfoHead = NULL;
00326 regReplica_t regReplicaInp;
00327 char *rescGroupName = NULL;
00328 int status;
00329
00330 status = getDataObjInfo (rsComm, phyPathRegInp, &dataObjInfoHead,
00331 ACCESS_READ_OBJECT, 0);
00332
00333 if (status < 0) {
00334 rodsLog (LOG_ERROR,
00335 "filePathRegRepl: getDataObjInfo for %s", phyPathRegInp->objPath);
00336 return (status);
00337 }
00338 status = sortObjInfoForOpen (rsComm, &dataObjInfoHead, NULL, 0);
00339 if (status < 0 || NULL == dataObjInfoHead ) return status;
00340
00341 destDataObjInfo = *dataObjInfoHead;
00342 rstrcpy (destDataObjInfo.filePath, filePath, MAX_NAME_LEN);
00343 destDataObjInfo.rescInfo = rescInfo;
00344 rstrcpy (destDataObjInfo.rescName, rescInfo->rescName, NAME_LEN);
00345 if ((rescGroupName = getValByKey (&phyPathRegInp->condInput,
00346 RESC_GROUP_NAME_KW)) != NULL) {
00347 rstrcpy (destDataObjInfo.rescGroupName, rescGroupName, NAME_LEN);
00348 }
00349 memset (®ReplicaInp, 0, sizeof (regReplicaInp));
00350 regReplicaInp.srcDataObjInfo = dataObjInfoHead;
00351 regReplicaInp.destDataObjInfo = &destDataObjInfo;
00352 if (getValByKey (&phyPathRegInp->condInput, SU_CLIENT_USER_KW) != NULL) {
00353 addKeyVal (®ReplicaInp.condInput, SU_CLIENT_USER_KW, "");
00354 addKeyVal (®ReplicaInp.condInput, IRODS_ADMIN_KW, "");
00355 } else if (getValByKey (&phyPathRegInp->condInput,
00356 IRODS_ADMIN_KW) != NULL) {
00357 addKeyVal (®ReplicaInp.condInput, IRODS_ADMIN_KW, "");
00358 }
00359 status = rsRegReplica (rsComm, ®ReplicaInp);
00360 clearKeyVal (®ReplicaInp.condInput);
00361 freeAllDataObjInfo (dataObjInfoHead);
00362
00363 return status;
00364 }
00365
00366 int
00367 filePathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp, char *filePath,
00368 rescInfo_t *rescInfo)
00369 {
00370 dataObjInfo_t dataObjInfo;
00371 int status;
00372 char *rescGroupName = NULL;
00373 char *chksum;
00374
00375 initDataObjInfoWithInp (&dataObjInfo, phyPathRegInp);
00376 if ((rescGroupName = getValByKey (&phyPathRegInp->condInput,
00377 RESC_GROUP_NAME_KW)) != NULL) {
00378 rstrcpy (dataObjInfo.rescGroupName, rescGroupName, NAME_LEN);
00379 }
00380 dataObjInfo.replStatus = NEWLY_CREATED_COPY;
00381 dataObjInfo.rescInfo = rescInfo;
00382 rstrcpy (dataObjInfo.rescName, rescInfo->rescName, NAME_LEN);
00383
00384 char* resc_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00385 if( !resc_hier ) {
00386 rodsLog( LOG_NOTICE, "filePathReg - RESC_HIER_STR_KW is NULL" );
00387 return -1;
00388 }
00389
00390 rstrcpy (dataObjInfo.rescHier, resc_hier, MAX_NAME_LEN);
00391
00392 if (dataObjInfo.dataSize <= 0 &&
00393 (dataObjInfo.dataSize = getSizeInVault (rsComm, &dataObjInfo)) < 0 &&
00394 dataObjInfo.dataSize != UNKNOWN_FILE_SZ) {
00395 status = (int) dataObjInfo.dataSize;
00396 rodsLog (LOG_ERROR,
00397 "filePathReg: getSizeInVault for %s failed, status = %d",
00398 dataObjInfo.objPath, status);
00399 return (status);
00400 }
00401
00402 if ((chksum = getValByKey (&phyPathRegInp->condInput,
00403 REG_CHKSUM_KW)) != NULL) {
00404 rstrcpy (dataObjInfo.chksum, chksum, NAME_LEN);
00405 }
00406 else if ((chksum = getValByKey (&phyPathRegInp->condInput,
00407 VERIFY_CHKSUM_KW)) != NULL) {
00408 status = _dataObjChksum (rsComm, &dataObjInfo, &chksum);
00409 if (status < 0) {
00410 rodsLog (LOG_ERROR,
00411 "rodsPathReg: _dataObjChksum for %s failed, status = %d",
00412 dataObjInfo.objPath, status);
00413 return (status);
00414 }
00415 rstrcpy (dataObjInfo.chksum, chksum, NAME_LEN);
00416 }
00417
00418 status = svrRegDataObj (rsComm, &dataObjInfo);
00419 if (status < 0) {
00420 rodsLog (LOG_ERROR,
00421 "filePathReg: rsRegDataObj for %s failed, status = %d",
00422 dataObjInfo.objPath, status);
00423 } else {
00424 ruleExecInfo_t rei;
00425 initReiWithDataObjInp (&rei, rsComm, phyPathRegInp);
00426 rei.doi = &dataObjInfo;
00427 rei.status = status;
00428 rei.status = applyRule ("acPostProcForFilePathReg", NULL, &rei,
00429 NO_SAVE_REI);
00430 }
00431
00432 return (status);
00433 }
00434
00435 int
00436 dirPathReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp, char *filePath,
00437 rescInfo_t *rescInfo )
00438 {
00439 collInp_t collCreateInp;
00440 fileOpendirInp_t fileOpendirInp;
00441 fileClosedirInp_t fileClosedirInp;
00442 int status;
00443 int dirFd;
00444 dataObjInp_t subPhyPathRegInp;
00445 fileReaddirInp_t fileReaddirInp;
00446 rodsDirent_t *rodsDirent = NULL;
00447 rodsObjStat_t *rodsObjStatOut = NULL;
00448 int forceFlag;
00449
00450 char* resc_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00451 if( !resc_hier ) {
00452 rodsLog( LOG_NOTICE, "dirPathReg - RESC_HIER_STR_KW is NULL" );
00453 return -1;
00454 }
00455
00456
00457
00458 std::string location;
00459 eirods::error ret = eirods::get_loc_for_hier_string( resc_hier, location );
00460 if( !ret.ok() ) {
00461 eirods::log( PASSMSG( "failed in get_loc_for_hier_String", ret ) );
00462 return -1;
00463 }
00464
00465 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
00466 if (status < 0 || NULL == rodsObjStatOut ) {
00467 memset (&collCreateInp, 0, sizeof (collCreateInp));
00468 rstrcpy (collCreateInp.collName, phyPathRegInp->objPath,
00469 MAX_NAME_LEN);
00470
00471
00472 addKeyVal (&collCreateInp.condInput, TRANSLATED_PATH_KW, "");
00473
00474
00475 status = rsCollCreate (rsComm, &collCreateInp);
00476 clearKeyVal (&collCreateInp.condInput);
00477 if (status < 0 ) return status;
00478 } else if (rodsObjStatOut->specColl != NULL) {
00479 freeRodsObjStat (rodsObjStatOut);
00480 rodsLog (LOG_ERROR,
00481 "mountFileDir: %s already mounted", phyPathRegInp->objPath);
00482 return (SYS_MOUNT_MOUNTED_COLL_ERR);
00483 }
00484 freeRodsObjStat (rodsObjStatOut);
00485
00486 memset (&fileOpendirInp, 0, sizeof (fileOpendirInp));
00487
00488 rstrcpy (fileOpendirInp.dirName, filePath, MAX_NAME_LEN);
00489 fileOpendirInp.fileType = static_cast< fileDriverType_t >( -1 );
00490 rstrcpy (fileOpendirInp.addr.hostAddr, location.c_str(), NAME_LEN);
00491 rstrcpy (fileOpendirInp.objPath, phyPathRegInp->objPath, MAX_NAME_LEN);
00492 rstrcpy (fileOpendirInp.resc_hier_, resc_hier, MAX_NAME_LEN);
00493
00494 dirFd = rsFileOpendir (rsComm, &fileOpendirInp);
00495 if (dirFd < 0) {
00496 rodsLog (LOG_ERROR,
00497 "dirPathReg: rsFileOpendir for %s error, status = %d",
00498 filePath, dirFd);
00499 return (dirFd);
00500 }
00501
00502 fileReaddirInp.fileInx = dirFd;
00503
00504 if (getValByKey (&phyPathRegInp->condInput, FORCE_FLAG_KW) != NULL) {
00505 forceFlag = 1;
00506 } else {
00507 forceFlag = 0;
00508 }
00509
00510 while ((status = rsFileReaddir (rsComm, &fileReaddirInp, &rodsDirent))>= 0) {
00511
00512 fileStatInp_t fileStatInp;
00513 rodsStat_t *myStat = NULL;
00514
00515 if (strlen (rodsDirent->d_name) == 0) break;
00516
00517 if (strcmp (rodsDirent->d_name, ".") == 0 ||
00518 strcmp (rodsDirent->d_name, "..") == 0) {
00519 free (rodsDirent);
00520 continue;
00521 }
00522
00523 subPhyPathRegInp = *phyPathRegInp;
00524 snprintf (subPhyPathRegInp.objPath, MAX_NAME_LEN, "%s/%s",
00525 phyPathRegInp->objPath, rodsDirent->d_name);
00526
00527 if (matchPathname(ExcludePatterns, rodsDirent->d_name, filePath)) {
00528 continue;
00529 }
00530
00531 memset (&fileStatInp, 0, sizeof (fileStatInp));
00532
00533 snprintf (fileStatInp.fileName, MAX_NAME_LEN, "%s/%s", filePath, rodsDirent->d_name);
00534 rstrcpy(fileStatInp.objPath, subPhyPathRegInp.objPath, MAX_NAME_LEN);
00535 fileStatInp.fileType = fileOpendirInp.fileType;
00536 fileStatInp.addr = fileOpendirInp.addr;
00537 rstrcpy (fileStatInp.rescHier, resc_hier, MAX_NAME_LEN);
00538
00539
00540 status = rsFileStat (rsComm, &fileStatInp, &myStat);
00541
00542 if (status != 0) {
00543 rodsLog (LOG_ERROR,
00544 "dirPathReg: rsFileStat failed for %s, status = %d",
00545 fileStatInp.fileName, status);
00546 free (rodsDirent);
00547 return (status);
00548 }
00549
00550 if ((myStat->st_mode & S_IFREG) != 0) {
00551 if (forceFlag > 0) {
00552
00553 if (isData (rsComm, subPhyPathRegInp.objPath, NULL) >= 0) {
00554 free (myStat);
00555 free (rodsDirent);
00556 continue;
00557 }
00558 }
00559 subPhyPathRegInp.dataSize = myStat->st_size;
00560 if (getValByKey (&phyPathRegInp->condInput, REG_REPL_KW) != NULL) {
00561 status = filePathRegRepl (rsComm, &subPhyPathRegInp,
00562 fileStatInp.fileName, rescInfo);
00563 } else {
00564 addKeyVal (&subPhyPathRegInp.condInput, FILE_PATH_KW,
00565 fileStatInp.fileName);
00566 status = filePathReg (rsComm, &subPhyPathRegInp,
00567 fileStatInp.fileName, rescInfo);
00568 }
00569 } else if ((myStat->st_mode & S_IFDIR) != 0) {
00570 status = dirPathReg (rsComm, &subPhyPathRegInp,
00571 fileStatInp.fileName, rescInfo);
00572 }
00573 free (myStat);
00574 free (rodsDirent);
00575 }
00576
00577 if (status == -1) {
00578 status = 0;
00579 }
00580
00581 fileClosedirInp.fileInx = dirFd;
00582 rsFileClosedir (rsComm, &fileClosedirInp);
00583
00584 return (status);
00585 }
00586
00587 int mountFileDir( rsComm_t* rsComm,
00588 dataObjInp_t* phyPathRegInp,
00589 char* filePath,
00590 rescInfo_t* rescInfo ) {
00591 collInp_t collCreateInp;
00592 int status;
00593 fileStatInp_t fileStatInp;
00594 rodsStat_t *myStat = NULL;
00595 rodsObjStat_t *rodsObjStatOut = NULL;
00596
00597 char* resc_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00598 if( !resc_hier ) {
00599 rodsLog( LOG_NOTICE, "mountFileDir - RESC_HIER_STR_KW is NULL" );
00600 return -1;
00601 }
00602
00603
00604
00605 std::string location;
00606 eirods::error ret = eirods::get_loc_for_hier_string( resc_hier, location );
00607 if( !ret.ok() ) {
00608 eirods::log( PASSMSG( "failed in get_loc_for_hier_String", ret ) );
00609 return -1;
00610 }
00611
00612 if (rsComm->clientUser.authInfo.authFlag < LOCAL_PRIV_USER_AUTH ) {
00613 rodsLog( LOG_NOTICE, "mountFileDir - insufficient privilege" );
00614 return(CAT_INSUFFICIENT_PRIVILEGE_LEVEL);
00615 }
00616
00617 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
00618 if (status < 0 || NULL == rodsObjStatOut ) {
00619 rodsLog( LOG_NOTICE, "mountFileDir collstat failed." );
00620 return status;
00621 }
00622
00623 if (rodsObjStatOut->specColl != NULL) {
00624 freeRodsObjStat (rodsObjStatOut);
00625 rodsLog (LOG_ERROR,
00626 "mountFileDir: %s already mounted", phyPathRegInp->objPath);
00627 return (SYS_MOUNT_MOUNTED_COLL_ERR);
00628 }
00629 freeRodsObjStat (rodsObjStatOut);
00630
00631 if (isCollEmpty (rsComm, phyPathRegInp->objPath) == False) {
00632 rodsLog (LOG_ERROR,
00633 "mountFileDir: collection %s not empty", phyPathRegInp->objPath);
00634 return (SYS_COLLECTION_NOT_EMPTY);
00635 }
00636
00637 memset (&fileStatInp, 0, sizeof (fileStatInp));
00638
00639 rstrcpy (fileStatInp.fileName, filePath, MAX_NAME_LEN);
00640 rstrcpy (fileStatInp.objPath, phyPathRegInp->objPath, MAX_NAME_LEN);
00641 fileStatInp.fileType = static_cast< fileDriverType_t >( -1 );
00642 rstrcpy (fileStatInp.addr.hostAddr, location.c_str(), NAME_LEN);
00643 rstrcpy (fileStatInp.rescHier, resc_hier, MAX_NAME_LEN);
00644
00645
00646 status = rsFileStat (rsComm, &fileStatInp, &myStat);
00647
00648 if (status < 0) {
00649 fileMkdirInp_t fileMkdirInp;
00650
00651 rodsLog (LOG_NOTICE,
00652 "mountFileDir: rsFileStat failed for %s, status = %d, create it",
00653 fileStatInp.fileName, status);
00654 memset (&fileMkdirInp, 0, sizeof (fileMkdirInp));
00655 rstrcpy (fileMkdirInp.dirName, filePath, MAX_NAME_LEN);
00656 rstrcpy (fileMkdirInp.rescHier, resc_hier, MAX_NAME_LEN);
00657 fileMkdirInp.fileType = static_cast<fileDriverType_t>(-1);
00658 fileMkdirInp.mode = getDefDirMode ();
00659 rstrcpy (fileMkdirInp.addr.hostAddr, location.c_str(), NAME_LEN);
00660 status = rsFileMkdir (rsComm, &fileMkdirInp);
00661 if (status < 0) {
00662 return (status);
00663 }
00664 } else if ((myStat->st_mode & S_IFDIR) == 0) {
00665 rodsLog (LOG_ERROR,
00666 "mountFileDir: phyPath %s is not a directory",
00667 fileStatInp.fileName);
00668 free (myStat);
00669 return (USER_FILE_DOES_NOT_EXIST);
00670 }
00671
00672 free (myStat);
00673
00674
00675 memset (&collCreateInp, 0, sizeof (collCreateInp));
00676 rstrcpy (collCreateInp.collName, phyPathRegInp->objPath, MAX_NAME_LEN);
00677 addKeyVal (&collCreateInp.condInput, COLLECTION_TYPE_KW, MOUNT_POINT_STR);
00678
00679 addKeyVal (&collCreateInp.condInput, COLLECTION_INFO1_KW, filePath);
00680 addKeyVal (&collCreateInp.condInput, COLLECTION_INFO2_KW, resc_hier);
00681
00682
00683
00684 status = rsModColl (rsComm, &collCreateInp);
00685
00686 if (status < 0) {
00687 rodsLog( LOG_NOTICE, "mountFileDir rsModColl < 0." );
00688 status = rsRegColl (rsComm, &collCreateInp);
00689 }
00690
00691 if (status >= 0) {
00692 rodsLog( LOG_NOTICE, "mountFileDir rsModColl > 0." );
00693
00694 char outLogPath[MAX_NAME_LEN];
00695 int status1;
00696
00697 if (getLogPathFromPhyPath (filePath, rescInfo, outLogPath) >= 0 &&
00698 strcmp (outLogPath, phyPathRegInp->objPath) != 0) {
00699
00700 if (isColl (rsComm, outLogPath, NULL) >= 0) {
00701 modAccessControlInp_t modAccessControl;
00702
00703
00704
00705 bzero (&modAccessControl, sizeof (modAccessControl));
00706 modAccessControl.accessLevel = "read";
00707 modAccessControl.userName = rsComm->clientUser.userName;
00708 modAccessControl.zone = rsComm->clientUser.rodsZone;
00709 modAccessControl.path = phyPathRegInp->objPath;
00710 status1 = rsModAccessControl(rsComm, &modAccessControl);
00711 if (status1 < 0) {
00712 rodsLog (LOG_NOTICE,
00713 "mountFileDir: rsModAccessControl err for %s, stat = %d",
00714 phyPathRegInp->objPath, status1);
00715 }
00716 }
00717 }
00718 }
00719
00720 rodsLog( LOG_NOTICE, "mountFileDir return status." );
00721 return (status);
00722 }
00723
00724 int
00725 unmountFileDir (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00726 {
00727 int status;
00728 collInp_t modCollInp;
00729 rodsObjStat_t *rodsObjStatOut = NULL;
00730
00731 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
00732 if (status < 0 || NULL == rodsObjStatOut ) {
00733 return status;
00734 } else if (rodsObjStatOut->specColl == NULL) {
00735 freeRodsObjStat (rodsObjStatOut);
00736 rodsLog (LOG_ERROR,
00737 "unmountFileDir: %s not mounted", phyPathRegInp->objPath);
00738 return (SYS_COLL_NOT_MOUNTED_ERR);
00739 }
00740
00741 if (getStructFileType (rodsObjStatOut->specColl) >= 0) {
00742
00743 status = _rsSyncMountedColl (rsComm, rodsObjStatOut->specColl,
00744 PURGE_STRUCT_FILE_CACHE);
00745 #if 0
00746 if (status < 0) {
00747 freeRodsObjStat (rodsObjStatOut);
00748 return (status);
00749 }
00750 #endif
00751 }
00752
00753 freeRodsObjStat (rodsObjStatOut);
00754
00755 memset (&modCollInp, 0, sizeof (modCollInp));
00756 rstrcpy (modCollInp.collName, phyPathRegInp->objPath, MAX_NAME_LEN);
00757 addKeyVal (&modCollInp.condInput, COLLECTION_TYPE_KW,
00758 "NULL_SPECIAL_VALUE");
00759 addKeyVal (&modCollInp.condInput, COLLECTION_INFO1_KW, "NULL_SPECIAL_VALUE");
00760 addKeyVal (&modCollInp.condInput, COLLECTION_INFO2_KW, "NULL_SPECIAL_VALUE");
00761
00762 status = rsModColl (rsComm, &modCollInp);
00763
00764 return (status);
00765 }
00766
00767 int
00768 structFileReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00769 {
00770 collInp_t collCreateInp;
00771 int status;
00772 dataObjInfo_t *dataObjInfo = NULL;
00773 char *structFilePath = NULL;
00774 dataObjInp_t dataObjInp;
00775 char *collType;
00776 int len;
00777 rodsObjStat_t *rodsObjStatOut = NULL;
00778 specCollCache_t *specCollCache = NULL;
00779 rescInfo_t *rescInfo = NULL;
00780 #if 0
00781
00782 if (rsComm->clientUser.authInfo.authFlag < LOCAL_PRIV_USER_AUTH)
00783 return(CAT_INSUFFICIENT_PRIVILEGE_LEVEL);
00784 #endif
00785 if ((structFilePath = getValByKey (&phyPathRegInp->condInput, FILE_PATH_KW))
00786 == NULL) {
00787 rodsLog (LOG_ERROR,
00788 "structFileReg: No structFilePath input for %s",
00789 phyPathRegInp->objPath);
00790 return (SYS_INVALID_FILE_PATH);
00791 }
00792
00793 collType = getValByKey (&phyPathRegInp->condInput, COLLECTION_TYPE_KW);
00794 if (collType == NULL) {
00795 rodsLog (LOG_ERROR,
00796 "structFileReg: Bad COLLECTION_TYPE_KW for structFilePath %s",
00797 dataObjInp.objPath);
00798 return (SYS_INTERNAL_NULL_INPUT_ERR);
00799 }
00800
00801 len = strlen (phyPathRegInp->objPath);
00802 if (strncmp (structFilePath, phyPathRegInp->objPath, len) == 0 &&
00803 (structFilePath[len] == '\0' || structFilePath[len] == '/')) {
00804 rodsLog (LOG_ERROR,
00805 "structFileReg: structFilePath %s inside collection %s",
00806 structFilePath, phyPathRegInp->objPath);
00807 return (SYS_STRUCT_FILE_INMOUNTED_COLL);
00808 }
00809
00810
00811
00812 if (getSpecCollCache (rsComm, structFilePath, 0, &specCollCache) >= 0) {
00813 rodsLog (LOG_ERROR,
00814 "structFileReg: structFilePath %s is in a mounted path",
00815 structFilePath);
00816 return (SYS_STRUCT_FILE_INMOUNTED_COLL);
00817 }
00818
00819 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
00820 if (status < 0 || NULL == rodsObjStatOut ) return status;
00821
00822 if (rodsObjStatOut->specColl != NULL) {
00823 freeRodsObjStat (rodsObjStatOut);
00824 rodsLog (LOG_ERROR,
00825 "structFileReg: %s already mounted", phyPathRegInp->objPath);
00826 return (SYS_MOUNT_MOUNTED_COLL_ERR);
00827 }
00828
00829 freeRodsObjStat (rodsObjStatOut);
00830
00831 if (isCollEmpty (rsComm, phyPathRegInp->objPath) == False) {
00832 rodsLog (LOG_ERROR,
00833 "structFileReg: collection %s not empty", phyPathRegInp->objPath);
00834 return (SYS_COLLECTION_NOT_EMPTY);
00835 }
00836
00837 memset (&dataObjInp, 0, sizeof (dataObjInp));
00838 rstrcpy (dataObjInp.objPath, structFilePath, sizeof (dataObjInp));
00839
00840 dataObjInp.openFlags = O_WRONLY;
00841 status = getDataObjInfoIncSpecColl (rsComm, &dataObjInp, &dataObjInfo);
00842 if (status < 0 || NULL == dataObjInfo) {
00843 int myStatus;
00844
00845 dataObjInp.condInput = phyPathRegInp->condInput;
00846
00847 rmKeyVal (&dataObjInp.condInput, FILE_PATH_KW);
00848 myStatus = rsDataObjCreate (rsComm, &dataObjInp);
00849 if (myStatus < 0 ) {
00850 rodsLog (LOG_ERROR,
00851 "structFileReg: Problem with open/create structFilePath %s, status = %d",
00852 dataObjInp.objPath, status);
00853 return (status);
00854 } else {
00855 openedDataObjInp_t dataObjCloseInp;
00856 bzero (&dataObjCloseInp, sizeof (dataObjCloseInp));
00857 rescInfo = L1desc[myStatus].dataObjInfo->rescInfo;
00858 dataObjCloseInp.l1descInx = myStatus;
00859 rsDataObjClose (rsComm, &dataObjCloseInp);
00860 }
00861 } else {
00862 rescInfo = dataObjInfo->rescInfo;
00863 }
00864
00865 char* tmp_hier = getValByKey( &phyPathRegInp->condInput, RESC_HIER_STR_KW );
00866 if( !tmp_hier ) {
00867 rodsLog( LOG_ERROR, "structFileReg - RESC_HIER_STR_KW is NULL" );
00868 return -1;
00869 }
00870 #if 0 // JMC - no longer necessary
00871 if (!structFileSupport (rsComm, phyPathRegInp->objPath,
00872 collType, tmp_hier)) {
00873 rodsLog (LOG_ERROR,
00874 "structFileReg: structFileDriver type %s does not exist for %s",
00875 collType, dataObjInp.objPath);
00876 return (SYS_NOT_SUPPORTED);
00877 }
00878 #endif // JMC - no longer necessary
00879
00880
00881
00882 memset (&collCreateInp, 0, sizeof (collCreateInp));
00883 rstrcpy (collCreateInp.collName, phyPathRegInp->objPath, MAX_NAME_LEN);
00884 addKeyVal (&collCreateInp.condInput, COLLECTION_TYPE_KW, collType);
00885
00886
00887 addKeyVal (&collCreateInp.condInput, COLLECTION_INFO1_KW,
00888 dataObjInp.objPath);
00889
00890
00891 status = rsModColl (rsComm, &collCreateInp);
00892
00893 if (status < 0) {
00894 status = rsRegColl (rsComm, &collCreateInp);
00895 }
00896
00897 return (status);
00898 }
00899
00900 int
00901 structFileSupport (rsComm_t *rsComm, char *collection, char *collType,
00902 char* resc_hier )
00903 {
00904 rodsStat_t *myStat = NULL;
00905 int status;
00906 subFile_t subFile;
00907 specColl_t specColl;
00908
00909 if (rsComm == NULL || collection == NULL || collType == NULL ||
00910 resc_hier == NULL) return 0;
00911
00912 memset (&subFile, 0, sizeof (subFile));
00913 memset (&specColl, 0, sizeof (specColl));
00914
00915 subFile.specColl = &specColl;
00916 rstrcpy (specColl.collection, collection, MAX_NAME_LEN);
00917 specColl.collClass = STRUCT_FILE_COLL;
00918 if (strcmp (collType, HAAW_STRUCT_FILE_STR) == 0) {
00919 specColl.type = HAAW_STRUCT_FILE_T;
00920 } else if (strcmp (collType, TAR_STRUCT_FILE_STR) == 0) {
00921 specColl.type = TAR_STRUCT_FILE_T;
00922 } else {
00923 return (0);
00924 }
00925
00926
00927
00928 std::string location;
00929 eirods::error ret = eirods::get_loc_for_hier_string( resc_hier, location );
00930 if( !ret.ok() ) {
00931 eirods::log( PASSMSG( "failed in get_loc_for_hier_String", ret ) );
00932 return -1;
00933 }
00934
00935 eirods::hierarchy_parser parser;
00936 parser.set_string( resc_hier );
00937 std::string first_resc;
00938 parser.first_resc( first_resc );
00939
00940 snprintf (specColl.objPath, MAX_NAME_LEN, "%s/myFakeFile",collection);
00941 rstrcpy (specColl.resource, first_resc.c_str(), NAME_LEN);
00942 rstrcpy (specColl.rescHier, resc_hier, NAME_LEN);
00943 rstrcpy (specColl.phyPath, "/fakeDir1/fakeDir2/myFakeStructFile", MAX_NAME_LEN );
00944 rstrcpy (subFile.subFilePath, "/fakeDir1/fakeDir2/myFakeFile", MAX_NAME_LEN);
00945 rstrcpy (subFile.addr.hostAddr, location.c_str(), NAME_LEN);
00946
00947 status = rsSubStructFileStat (rsComm, &subFile, &myStat);
00948
00949 if (status == SYS_NOT_SUPPORTED)
00950 return (0);
00951 else
00952 return (1);
00953 }
00954
00955 int
00956 linkCollReg (rsComm_t *rsComm, dataObjInp_t *phyPathRegInp)
00957 {
00958 collInp_t collCreateInp;
00959 int status;
00960 char *linkPath = NULL;
00961 char *collType;
00962 int len;
00963 rodsObjStat_t *rodsObjStatOut = NULL;
00964 specCollCache_t *specCollCache = NULL;
00965
00966 if ((linkPath = getValByKey (&phyPathRegInp->condInput, FILE_PATH_KW))
00967 == NULL) {
00968 rodsLog (LOG_ERROR,
00969 "linkCollReg: No linkPath input for %s",
00970 phyPathRegInp->objPath);
00971 return (SYS_INVALID_FILE_PATH);
00972 }
00973
00974 collType = getValByKey (&phyPathRegInp->condInput, COLLECTION_TYPE_KW);
00975 if (collType == NULL || strcmp (collType, LINK_POINT_STR) != 0) {
00976 rodsLog (LOG_ERROR,
00977 "linkCollReg: Bad COLLECTION_TYPE_KW for linkPath %s",
00978 phyPathRegInp->objPath);
00979 return (SYS_INTERNAL_NULL_INPUT_ERR);
00980 }
00981
00982 if (phyPathRegInp->objPath[0] != '/' || linkPath[0] != '/') {
00983 rodsLog (LOG_ERROR,
00984 "linkCollReg: linkPath %s or collection %s not absolute path",
00985 linkPath, phyPathRegInp->objPath);
00986 return (SYS_COLL_LINK_PATH_ERR);
00987 }
00988
00989 len = strlen (phyPathRegInp->objPath);
00990 if (strncmp (linkPath, phyPathRegInp->objPath, len) == 0 &&
00991 linkPath[len] == '/') {
00992 rodsLog (LOG_ERROR,
00993 "linkCollReg: linkPath %s inside collection %s",
00994 linkPath, phyPathRegInp->objPath);
00995 return (SYS_COLL_LINK_PATH_ERR);
00996 }
00997
00998 len = strlen (linkPath);
00999 if (strncmp (phyPathRegInp->objPath, linkPath, len) == 0 &&
01000 phyPathRegInp->objPath[len] == '/') {
01001 rodsLog (LOG_ERROR,
01002 "linkCollReg: collection %s inside linkPath %s",
01003 linkPath, phyPathRegInp->objPath);
01004 return (SYS_COLL_LINK_PATH_ERR);
01005 }
01006
01007 if (getSpecCollCache (rsComm, linkPath, 0, &specCollCache) >= 0 &&
01008 specCollCache->specColl.collClass != LINKED_COLL) {
01009 rodsLog (LOG_ERROR,
01010 "linkCollReg: linkPath %s is in a spec coll path",
01011 linkPath);
01012 return (SYS_COLL_LINK_PATH_ERR);
01013 }
01014
01015 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
01016 if (status < 0) {
01017
01018 collInp_t collCreateInp;
01019 memset (&collCreateInp, 0, sizeof (collCreateInp));
01020 rstrcpy (collCreateInp.collName, phyPathRegInp->objPath, MAX_NAME_LEN);
01021 status = rsRegColl (rsComm, &collCreateInp);
01022 if (status < 0) {
01023 rodsLog (LOG_ERROR,
01024 "linkCollReg: rsRegColl error for %s, status = %d",
01025 collCreateInp.collName, status);
01026 return status;
01027 }
01028 status = collStat (rsComm, phyPathRegInp, &rodsObjStatOut);
01029 if (status < 0 ) return status;
01030
01031 }
01032
01033 if ( rodsObjStatOut &&
01034 rodsObjStatOut->specColl != NULL &&
01035 rodsObjStatOut->specColl->collClass != LINKED_COLL) {
01036 freeRodsObjStat (rodsObjStatOut);
01037 rodsLog (LOG_ERROR,
01038 "linkCollReg: link collection %s in a spec coll path",
01039 phyPathRegInp->objPath);
01040 return (SYS_COLL_LINK_PATH_ERR);
01041 }
01042
01043 freeRodsObjStat (rodsObjStatOut);
01044
01045 if (isCollEmpty (rsComm, phyPathRegInp->objPath) == False) {
01046 rodsLog (LOG_ERROR,
01047 "linkCollReg: collection %s not empty", phyPathRegInp->objPath);
01048 return (SYS_COLLECTION_NOT_EMPTY);
01049 }
01050
01051
01052
01053 memset (&collCreateInp, 0, sizeof (collCreateInp));
01054 rstrcpy (collCreateInp.collName, phyPathRegInp->objPath, MAX_NAME_LEN);
01055 addKeyVal (&collCreateInp.condInput, COLLECTION_TYPE_KW, collType);
01056
01057
01058 addKeyVal (&collCreateInp.condInput, COLLECTION_INFO1_KW,
01059 linkPath);
01060
01061
01062 status = rsModColl (rsComm, &collCreateInp);
01063
01064 if (status < 0) {
01065 status = rsRegColl (rsComm, &collCreateInp);
01066 }
01067
01068 return (status);
01069 }
01070
01071 pathnamePatterns_t *
01072 readPathnamePatternsFromFile(rsComm_t *rsComm, char *filename, char* resc_hier )
01073 {
01074 int status;
01075 rodsStat_t *stbuf;
01076 fileStatInp_t fileStatInp;
01077 bytesBuf_t fileReadBuf;
01078 fileOpenInp_t fileOpenInp;
01079 fileReadInp_t fileReadInp;
01080 fileCloseInp_t fileCloseInp;
01081 int buf_len, fd;
01082 pathnamePatterns_t *pp;
01083
01084 if (rsComm == NULL || filename == NULL || resc_hier == NULL) {
01085 return NULL;
01086 }
01087
01088
01089
01090
01091 std::string location;
01092 eirods::error ret = eirods::get_loc_for_hier_string( resc_hier, location );
01093 if( !ret.ok() ) {
01094 eirods::log( PASSMSG( "failed in get_loc_for_hier_String", ret ) );
01095 return NULL;
01096 }
01097
01098 memset(&fileStatInp, 0, sizeof(fileStatInp));
01099 rstrcpy(fileStatInp.fileName, filename, MAX_NAME_LEN);
01100
01101 rstrcpy(fileStatInp.addr.hostAddr, location.c_str(), NAME_LEN);
01102 status = rsFileStat(rsComm, &fileStatInp, &stbuf);
01103 if (status != 0) {
01104 if (status != UNIX_FILE_STAT_ERR - ENOENT) {
01105 rodsLog(LOG_DEBUG, "readPathnamePatternsFromFile: can't stat %s. status = %d",
01106 fileStatInp.fileName, status);
01107 }
01108 return NULL;
01109 }
01110 buf_len = stbuf->st_size;
01111 free(stbuf);
01112
01113 memset(&fileOpenInp, 0, sizeof(fileOpenInp));
01114 rstrcpy(fileOpenInp.fileName, filename, MAX_NAME_LEN);
01115
01116 rstrcpy(fileOpenInp.addr.hostAddr, location.c_str(), NAME_LEN);
01117 fileOpenInp.flags = O_RDONLY;
01118 fd = rsFileOpen(rsComm, &fileOpenInp);
01119 if (fd < 0) {
01120 rodsLog(LOG_NOTICE,
01121 "readPathnamePatternsFromFile: can't open %s for reading. status = %d",
01122 fileOpenInp.fileName, fd);
01123 return NULL;
01124 }
01125
01126 memset(&fileReadBuf, 0, sizeof(fileReadBuf));
01127 fileReadBuf.buf = malloc(buf_len);
01128 if (fileReadBuf.buf == NULL) {
01129 rodsLog(LOG_NOTICE, "readPathnamePatternsFromFile: could not malloc buffer");
01130 return NULL;
01131 }
01132
01133 memset(&fileReadInp, 0, sizeof(fileReadInp));
01134 fileReadInp.fileInx = fd;
01135 fileReadInp.len = buf_len;
01136 status = rsFileRead(rsComm, &fileReadInp, &fileReadBuf);
01137
01138 memset(&fileCloseInp, 0, sizeof(fileCloseInp));
01139 fileCloseInp.fileInx = fd;
01140 rsFileClose(rsComm, &fileCloseInp);
01141
01142 if (status < 0) {
01143 rodsLog(LOG_NOTICE, "readPathnamePatternsFromFile: could not read %s. status = %d",
01144 fileOpenInp.fileName, status);
01145 free(fileReadBuf.buf);
01146 return NULL;
01147 }
01148
01149 pp = readPathnamePatterns((char*)fileReadBuf.buf, buf_len);
01150
01151 return pp;
01152 }
01153
01154