00001
00002
00003
00004
00005
00006
00007
00008 #include "rmCollOld.h"
00009 #include "collCreate.h"
00010 #include "icatHighLevelRoutines.h"
00011 #include "rodsLog.h"
00012 #include "icatDefines.h"
00013 #include "dataObjRename.h"
00014 #include "dataObjOpr.h"
00015 #include "objMetaOpr.h"
00016 #include "collection.h"
00017 #include "specColl.h"
00018 #include "fileRmdir.h"
00019 #include "subStructFileRmdir.h"
00020 #include "genQuery.h"
00021 #include "dataObjUnlink.h"
00022
00023 #include "eirods_resource_backport.h"
00024
00025 int
00026 rsRmCollOld (rsComm_t *rsComm, collInp_t *rmCollInp)
00027 {
00028 int status;
00029 rodsServerHost_t *rodsServerHost = NULL;
00030
00031
00032 status = getAndConnRcatHost (rsComm, MASTER_RCAT, rmCollInp->collName,
00033 &rodsServerHost);
00034 if (status < 0 || NULL == rodsServerHost ) {
00035 return(status);
00036 }
00037
00038 if (rodsServerHost->localFlag == LOCAL_HOST) {
00039 #ifdef RODS_CAT
00040 status = _rsRmCollOld (rsComm, rmCollInp);
00041 #else
00042 status = SYS_NO_RCAT_SERVER_ERR;
00043 #endif
00044 } else {
00045 status = rcRmCollOld (rodsServerHost->conn, rmCollInp);
00046 }
00047
00048 return (status);
00049 }
00050
00051 int
00052 _rsRmCollOld (rsComm_t *rsComm, collInp_t *rmCollInp)
00053 {
00054 int status;
00055 dataObjInfo_t *dataObjInfo = NULL;
00056
00057 status = resolvePathInSpecColl (rsComm, rmCollInp->collName,
00058 WRITE_COLL_PERM, 0, &dataObjInfo);
00059
00060
00061 if (status == COLL_OBJ_T && dataObjInfo->specColl != NULL) {
00062 status = svrRmSpecColl (rsComm, rmCollInp, dataObjInfo);
00063 } else {
00064 status = svrRmCollOld (rsComm, rmCollInp);
00065 }
00066
00067 return (0);
00068 }
00069
00070 int
00071 svrRmCollOld (rsComm_t *rsComm, collInp_t *rmCollInp)
00072 {
00073 int status;
00074 collInfo_t collInfo;
00075
00076 if (getValByKey (&rmCollInp->condInput, RECURSIVE_OPR__KW) != NULL) {
00077 status = _rsRmCollRecurOld (rsComm, rmCollInp);
00078 return (status);
00079 }
00080
00081 memset (&collInfo, 0, sizeof (collInfo));
00082
00083 rstrcpy (collInfo.collName, rmCollInp->collName, MAX_NAME_LEN);
00084 #ifdef RODS_CAT
00085 if (getValByKey (&rmCollInp->condInput, IRODS_ADMIN_RMTRASH_KW) != NULL) {
00086 status = chlDelCollByAdmin (rsComm, &collInfo);
00087 if (status >= 0) {
00088 chlCommit(rsComm);
00089 }
00090 } else {
00091 status = chlDelColl (rsComm, &collInfo);
00092 }
00093 return (status);
00094 #else
00095 return (SYS_NO_RCAT_SERVER_ERR);
00096 #endif
00097 }
00098
00099 int
00100 _rsRmCollRecurOld (rsComm_t *rsComm, collInp_t *rmCollInp)
00101 {
00102 int status;
00103 ruleExecInfo_t rei;
00104 int trashPolicy;
00105
00106 if (getValByKey (&rmCollInp->condInput, FORCE_FLAG_KW) != NULL) {
00107 status = rsPhyRmCollRecurOld (rsComm, rmCollInp);
00108 } else {
00109 initReiWithDataObjInp (&rei, rsComm, NULL);
00110 status = applyRule ("acTrashPolicy", NULL, &rei, NO_SAVE_REI);
00111 trashPolicy = rei.status;
00112
00113 if (trashPolicy != NO_TRASH_CAN) {
00114 status = rsMvCollToTrash (rsComm, rmCollInp);
00115 return status;
00116 } else {
00117 status = rsPhyRmCollRecurOld (rsComm, rmCollInp);
00118 }
00119 }
00120
00121 return (status);
00122 }
00123
00124 int
00125 rsPhyRmCollRecurOld (rsComm_t *rsComm, collInp_t *rmCollInp)
00126 {
00127 int status, i;
00128 int savedStatus = 0;
00129 genQueryInp_t genQueryInp;
00130 genQueryOut_t *genQueryOut = NULL;
00131 dataObjInp_t dataObjInp;
00132 int collLen;
00133 int continueInx;
00134 collInfo_t collInfo;
00135 collInp_t tmpCollInp;
00136 int rmtrashFlag;
00137
00138 memset (&dataObjInp, 0, sizeof (dataObjInp));
00139 memset (&tmpCollInp, 0, sizeof (tmpCollInp));
00140 addKeyVal (&tmpCollInp.condInput, FORCE_FLAG_KW, "");
00141 addKeyVal (&dataObjInp.condInput, FORCE_FLAG_KW, "");
00142
00143 if (getValByKey (&rmCollInp->condInput, IRODS_ADMIN_RMTRASH_KW) != NULL) {
00144 if (isTrashPath (rmCollInp->collName) == False) {
00145 return (SYS_INVALID_FILE_PATH);
00146 }
00147 if (rsComm->clientUser.authInfo.authFlag != LOCAL_PRIV_USER_AUTH) {
00148 return(CAT_INSUFFICIENT_PRIVILEGE_LEVEL);
00149 }
00150 addKeyVal (&tmpCollInp.condInput, IRODS_ADMIN_RMTRASH_KW, "");
00151 addKeyVal (&dataObjInp.condInput, IRODS_ADMIN_RMTRASH_KW, "");
00152 rmtrashFlag = 2;
00153
00154 } else if (getValByKey (&rmCollInp->condInput, IRODS_RMTRASH_KW) != NULL) {
00155 if (isTrashPath (rmCollInp->collName) == False) {
00156 return (SYS_INVALID_FILE_PATH);
00157 }
00158 addKeyVal (&tmpCollInp.condInput, IRODS_RMTRASH_KW, "");
00159 addKeyVal (&dataObjInp.condInput, IRODS_RMTRASH_KW, "");
00160 rmtrashFlag = 1;
00161 }
00162
00163 collLen = strlen (rmCollInp->collName);
00164
00165
00166
00167 memset (&genQueryInp, 0, sizeof (genQueryInp));
00168
00169 status = rsQueryDataObjInCollReCur (rsComm, rmCollInp->collName,
00170 &genQueryInp, &genQueryOut, NULL, 1);
00171
00172 if (status < 0 && status != CAT_NO_ROWS_FOUND) {
00173 rodsLog (LOG_ERROR,
00174 "rsPhyRmCollRecurOld: rsQueryDataObjInCollReCur error for %s, stat=%d",
00175 rmCollInp->collName, status);
00176 return (status);
00177 }
00178
00179 while (status >= 0) {
00180 sqlResult_t *subColl, *dataObj;
00181
00182 if ((subColl = getSqlResultByInx (genQueryOut, COL_COLL_NAME))
00183 == NULL) {
00184 rodsLog (LOG_ERROR,
00185 "rsPhyRmCollRecurOld: getSqlResultByInx for COL_COLL_NAME failed");
00186 return (UNMATCHED_KEY_OR_INDEX);
00187 }
00188
00189 if ((dataObj = getSqlResultByInx (genQueryOut, COL_DATA_NAME))
00190 == NULL) {
00191 rodsLog (LOG_ERROR,
00192 "rsPhyRmCollRecurOld: getSqlResultByInx for COL_DATA_NAME failed");
00193 return (UNMATCHED_KEY_OR_INDEX);
00194 }
00195
00196 for (i = 0; i < genQueryOut->rowCnt; i++) {
00197 char *tmpSubColl, *tmpDataName;
00198
00199 tmpSubColl = &subColl->value[subColl->len * i];
00200 tmpDataName = &dataObj->value[dataObj->len * i];
00201
00202 snprintf (dataObjInp.objPath, MAX_NAME_LEN, "%s/%s",
00203 tmpSubColl, tmpDataName);
00204 status = rsDataObjUnlink (rsComm, &dataObjInp);
00205 if (status < 0) {
00206 rodsLog (LOG_ERROR,
00207 "rsPhyRmCollRecurOld:rsDataObjUnlink failed for %s. stat = %d",
00208 dataObjInp.objPath, status);
00209
00210 savedStatus = status;
00211 }
00212 }
00213
00214 continueInx = genQueryOut->continueInx;
00215
00216 freeGenQueryOut (&genQueryOut);
00217
00218 if (continueInx > 0) {
00219
00220 genQueryInp.continueInx = continueInx;
00221 status = rsGenQuery (rsComm, &genQueryInp, &genQueryOut);
00222 } else {
00223 break;
00224 }
00225 }
00226
00227 clearKeyVal (&dataObjInp.condInput);
00228
00229
00230
00231
00232 status = rsQueryCollInColl (rsComm, rmCollInp->collName, &genQueryInp,
00233 &genQueryOut);
00234
00235 while (status >= 0) {
00236 sqlResult_t *subColl;
00237
00238 if ((subColl = getSqlResultByInx (genQueryOut, COL_COLL_NAME))
00239 == NULL) {
00240 rodsLog (LOG_ERROR,
00241 "rsPhyRmCollRecurOld: getSqlResultByInx for COL_COLL_NAME failed");
00242 return (UNMATCHED_KEY_OR_INDEX);
00243 }
00244
00245 for (i = 0; i < genQueryOut->rowCnt; i++) {
00246 char *tmpSubColl;
00247
00248 tmpSubColl = &subColl->value[subColl->len * i];
00249 if ((int) strlen (tmpSubColl) < collLen)
00250 continue;
00251
00252 rstrcpy (tmpCollInp.collName, tmpSubColl, MAX_NAME_LEN);
00253 status = rsPhyRmCollRecurOld (rsComm, &tmpCollInp);
00254 if (status < 0) {
00255 rodsLogError (LOG_ERROR, status,
00256 "rsPhyRmCollRecurOld: rsPhyRmCollRecurOld of %s failed, status = %d",
00257 tmpSubColl, status);
00258 savedStatus = status;
00259 }
00260 }
00261 continueInx = genQueryOut->continueInx;
00262
00263 freeGenQueryOut (&genQueryOut);
00264
00265 if (continueInx > 0) {
00266
00267 genQueryInp.continueInx = continueInx;
00268 status = rsGenQuery (rsComm, &genQueryInp, &genQueryOut);
00269 } else {
00270 break;
00271 }
00272 }
00273 clearKeyVal (&tmpCollInp.condInput);
00274
00275
00276 memset (&collInfo, 0, sizeof (collInfo));
00277
00278 rstrcpy (collInfo.collName, rmCollInp->collName, MAX_NAME_LEN);
00279 #ifdef RODS_CAT
00280 if (rmtrashFlag > 0 && isTrashHome (rmCollInp->collName) > 0) {
00281
00282 status = 0;
00283 } else {
00284 memset (&collInfo, 0, sizeof (collInfo));
00285 rstrcpy (collInfo.collName, rmCollInp->collName, MAX_NAME_LEN);
00286 if (rmtrashFlag == 2) {
00287 status = chlDelCollByAdmin (rsComm, &collInfo);
00288 if (status >= 0) {
00289 chlCommit(rsComm);
00290 }
00291 } else {
00292 status = chlDelColl (rsComm, &collInfo);
00293 }
00294 }
00295
00296 if (status < 0) {
00297 rodsLog (LOG_ERROR,
00298 "rsPhyRmCollRecurOld: chlDelColl of %s failed, status = %d",
00299 rmCollInp->collName, status);
00300 }
00301
00302 clearGenQueryInp (&genQueryInp);
00303
00304 if (savedStatus < 0) {
00305 return (savedStatus);
00306 } else if (status == CAT_NO_ROWS_FOUND) {
00307 return (0);
00308 } else {
00309 return (status);
00310 }
00311 #else
00312 return (SYS_NO_RCAT_SERVER_ERR);
00313 #endif
00314 }
00315
00316 int
00317 rsMvCollToTrash (rsComm_t *rsComm, collInp_t *rmCollInp)
00318 {
00319 int status;
00320 char trashPath[MAX_NAME_LEN];
00321 dataObjCopyInp_t dataObjRenameInp;
00322 genQueryInp_t genQueryInp;
00323 genQueryOut_t *genQueryOut = NULL;
00324 int continueInx;
00325 dataObjInfo_t dataObjInfo;
00326
00327
00328
00329 memset (&genQueryInp, 0, sizeof (genQueryInp));
00330 status = rsQueryDataObjInCollReCur (rsComm, rmCollInp->collName,
00331 &genQueryInp, &genQueryOut, ACCESS_DELETE_OBJECT, 0);
00332
00333 memset (&dataObjInfo, 0, sizeof (dataObjInfo));
00334 while (status >= 0) {
00335 sqlResult_t *subColl, *dataObj, *rescName;
00336 ruleExecInfo_t rei;
00337
00338
00339
00340 if ((subColl = getSqlResultByInx (genQueryOut, COL_COLL_NAME))
00341 == NULL) {
00342 rodsLog (LOG_ERROR,
00343 "rsMvCollToTrash: getSqlResultByInx for COL_COLL_NAME failed");
00344 return (UNMATCHED_KEY_OR_INDEX);
00345 }
00346
00347 if ((dataObj = getSqlResultByInx (genQueryOut, COL_DATA_NAME))
00348 == NULL) {
00349 rodsLog (LOG_ERROR,
00350 "rsMvCollToTrash: getSqlResultByInx for COL_DATA_NAME failed");
00351 return (UNMATCHED_KEY_OR_INDEX);
00352 }
00353
00354 if ((rescName = getSqlResultByInx (genQueryOut, COL_D_RESC_NAME))
00355 == NULL) {
00356 rodsLog (LOG_ERROR,
00357 "rsMvCollToTrash: getSqlResultByInx for COL_D_RESC_NAME failed");
00358 return (UNMATCHED_KEY_OR_INDEX);
00359 }
00360
00361 snprintf (dataObjInfo.objPath, MAX_NAME_LEN, "%s/%s",
00362 subColl->value, dataObj->value);
00363 rstrcpy (dataObjInfo.rescName, rescName->value, NAME_LEN);
00364
00365 initReiWithDataObjInp (&rei, rsComm, NULL);
00366 rei.doi = &dataObjInfo;
00367
00368 status = applyRule ("acDataDeletePolicy", NULL, &rei, NO_SAVE_REI);
00369
00370 if (status < 0 && status != NO_MORE_RULES_ERR &&
00371 status != SYS_DELETE_DISALLOWED) {
00372 rodsLog (LOG_NOTICE,
00373 "rsMvCollToTrash: acDataDeletePolicy error for %s. status = %d",
00374 dataObjInfo.objPath, status);
00375 return (status);
00376 }
00377
00378 if (rei.status == SYS_DELETE_DISALLOWED) {
00379 rodsLog (LOG_NOTICE,
00380 "rsMvCollToTrash:disallowed for %s via DataDeletePolicy,status=%d",
00381 dataObjInfo.objPath, rei.status);
00382 return (rei.status);
00383 }
00384
00385 continueInx = genQueryOut->continueInx;
00386
00387 freeGenQueryOut (&genQueryOut);
00388
00389 if (continueInx > 0) {
00390
00391 genQueryInp.continueInx = continueInx;
00392 status = rsGenQuery (rsComm, &genQueryInp, &genQueryOut);
00393 } else {
00394 break;
00395 }
00396 }
00397
00398 if (status < 0 && status != CAT_NO_ROWS_FOUND) {
00399 rodsLog (LOG_ERROR,
00400 "rsMvCollToTrash: rsQueryDataObjInCollReCur error for %s, stat=%d",
00401 rmCollInp->collName, status);
00402 return (status);
00403 }
00404
00405 status = rsMkTrashPath (rsComm, rmCollInp->collName, trashPath);
00406
00407 if (status < 0) {
00408 appendRandomToPath (trashPath);
00409 status = rsMkTrashPath (rsComm, rmCollInp->collName, trashPath);
00410 if (status < 0) {
00411 return (status);
00412 }
00413 }
00414
00415 memset (&dataObjRenameInp, 0, sizeof (dataObjRenameInp));
00416
00417 dataObjRenameInp.srcDataObjInp.oprType =
00418 dataObjRenameInp.destDataObjInp.oprType = RENAME_COLL;
00419
00420 rstrcpy (dataObjRenameInp.destDataObjInp.objPath, trashPath, MAX_NAME_LEN);
00421 rstrcpy (dataObjRenameInp.srcDataObjInp.objPath, rmCollInp->collName,
00422 MAX_NAME_LEN);
00423
00424 status = rsDataObjRename (rsComm, &dataObjRenameInp);
00425
00426 while (status == CAT_NAME_EXISTS_AS_COLLECTION) {
00427 appendRandomToPath (dataObjRenameInp.destDataObjInp.objPath);
00428 status = rsDataObjRename (rsComm, &dataObjRenameInp);
00429 }
00430
00431 if (status < 0) {
00432 rodsLog (LOG_ERROR,
00433 "mvCollToTrash: rcDataObjRename error for %s, status = %d",
00434 dataObjRenameInp.destDataObjInp.objPath, status);
00435 return (status);
00436 }
00437
00438 return (status);
00439 }
00440
00441 int
00442 rsMkTrashPath (rsComm_t *rsComm, char *objPath, char *trashPath)
00443 {
00444 int status;
00445 char *tmpStr;
00446 char startTrashPath[MAX_NAME_LEN];
00447 char destTrashColl[MAX_NAME_LEN], myFile[MAX_NAME_LEN];
00448 char *trashPathPtr;
00449
00450 trashPathPtr = trashPath;
00451 *trashPathPtr = '/';
00452 trashPathPtr++;
00453 tmpStr = objPath + 1;
00454
00455 while (*tmpStr != '\0') {
00456 *trashPathPtr = *tmpStr;
00457 trashPathPtr ++;
00458 if (*tmpStr == '/') {
00459 tmpStr ++;
00460 break;
00461 }
00462 tmpStr ++;
00463 }
00464
00465 if (*tmpStr == '\0') {
00466 rodsLog (LOG_ERROR,
00467 "rsMkTrashPath: input path %s too short", objPath);
00468 return (USER_INPUT_PATH_ERR);
00469 }
00470
00471
00472
00473 if (strncmp (tmpStr, "home/", 5) == 0) {
00474 int nameLen;
00475 tmpStr += 5;
00476 nameLen = strlen (rsComm->clientUser.userName);
00477 if (strncmp (tmpStr, rsComm->clientUser.userName, nameLen) == 0 &&
00478 (*(tmpStr + nameLen) == '/' || *(tmpStr + nameLen) == '#')) {
00479
00480 tmpStr = strchr (tmpStr, '/') + 1;
00481 }
00482 }
00483
00484
00485
00486 *trashPathPtr = '\0';
00487 snprintf (startTrashPath, MAX_NAME_LEN, "%strash/home", trashPath);
00488
00489
00490
00491 if (rsComm->clientUser.authInfo.authFlag == REMOTE_USER_AUTH ||
00492 rsComm->clientUser.authInfo.authFlag == REMOTE_PRIV_USER_AUTH) {
00493
00494 snprintf (trashPathPtr, MAX_NAME_LEN, "trash/home/%s#%s/%s",
00495 rsComm->clientUser.userName, rsComm->clientUser.rodsZone, tmpStr);
00496 } else {
00497 snprintf (trashPathPtr, MAX_NAME_LEN, "trash/home/%s/%s",
00498 rsComm->clientUser.userName, tmpStr);
00499 }
00500
00501 if ((status = splitPathByKey (trashPath, destTrashColl, myFile, '/')) < 0) {
00502 rodsLog (LOG_ERROR,
00503 "rsMkTrashPath: splitPathByKey error for %s ", trashPath);
00504 return (USER_INPUT_PATH_ERR);
00505 }
00506
00507 status = rsMkCollR (rsComm, startTrashPath, destTrashColl);
00508
00509 if (status < 0) {
00510 rodsLog (LOG_ERROR,
00511 "rsMkTrashPath: rsMkCollR error for startPath %s, destPath %s ",
00512 startTrashPath, destTrashColl);
00513 }
00514
00515 return (status);
00516 }
00517
00518 int
00519 svrRmSpecColl (rsComm_t *rsComm, collInp_t *rmCollInp,
00520 dataObjInfo_t *dataObjInfo)
00521 {
00522 int status;
00523
00524 if (getValByKey (&rmCollInp->condInput, RECURSIVE_OPR__KW) != NULL) {
00525
00526 status = svrRmSpecCollRecur (rsComm, dataObjInfo);
00527 } else {
00528
00529 status = l3Rmdir (rsComm, dataObjInfo);
00530 }
00531 return (status);
00532 }
00533
00534 int
00535 l3Rmdir (rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
00536 {
00537 fileRmdirInp_t fileRmdirInp;
00538 int status;
00539
00540
00541
00542 std::string location;
00543 eirods::error ret = eirods::get_loc_for_hier_string( dataObjInfo->rescHier, location );
00544 if( !ret.ok() ) {
00545 eirods::log( PASSMSG( "l3Rmdir - failed in get_loc_for_hier_string", ret ) );
00546 return -1;
00547 }
00548
00549 if (getStructFileType (dataObjInfo->specColl) >= 0) {
00550 subFile_t subFile;
00551 memset (&subFile, 0, sizeof (subFile));
00552 rstrcpy (subFile.subFilePath, dataObjInfo->subPath, MAX_NAME_LEN );
00553 rstrcpy (subFile.addr.hostAddr, location.c_str(), NAME_LEN );
00554 subFile.specColl = dataObjInfo->specColl;
00555 status = rsSubStructFileRmdir (rsComm, &subFile);
00556 } else {
00557 memset (&fileRmdirInp, 0, sizeof (fileRmdirInp));
00558 fileRmdirInp.fileType = static_cast<fileDriverType_t>(-1);
00559 rstrcpy (fileRmdirInp.dirName, dataObjInfo->filePath, MAX_NAME_LEN);
00560 rstrcpy (fileRmdirInp.addr.hostAddr, location.c_str(), NAME_LEN);
00561 rstrcpy (fileRmdirInp.rescHier, dataObjInfo->rescHier, MAX_NAME_LEN);
00562 status = rsFileRmdir (rsComm, &fileRmdirInp);
00563 }
00564 return (status);
00565 }
00566
00567 int
00568 svrRmSpecCollRecur (rsComm_t *rsComm, dataObjInfo_t *dataObjInfo)
00569 {
00570 int status, i;
00571 dataObjInfo_t myDataObjInfo;
00572 genQueryOut_t *genQueryOut = NULL;
00573 dataObjInp_t dataObjInp;
00574 int continueInx;
00575 int savedStatus = 0;
00576
00577 myDataObjInfo = *dataObjInfo;
00578 memset (&dataObjInp, 0, sizeof (dataObjInp));
00579 rstrcpy (dataObjInp.objPath, dataObjInfo->objPath, MAX_NAME_LEN);
00580 status = rsQuerySpecColl (rsComm, &dataObjInp, &genQueryOut);
00581
00582 while (status >= 0) {
00583 sqlResult_t *subColl, *dataObj;
00584
00585 if ((subColl = getSqlResultByInx (genQueryOut, COL_COLL_NAME))
00586 == NULL) {
00587 rodsLog (LOG_ERROR,
00588 "svrRmSpecCollRecur:getSqlResultByInx COL_COLL_NAME failed");
00589 return (UNMATCHED_KEY_OR_INDEX);
00590 }
00591
00592 if ((dataObj = getSqlResultByInx (genQueryOut, COL_DATA_NAME))
00593 == NULL) {
00594 rodsLog (LOG_ERROR,
00595 "svrRmSpecCollRecur: getSqlResultByInx COL_DATA_NAME failed");
00596 return (UNMATCHED_KEY_OR_INDEX);
00597 }
00598
00599 for (i = 0; i < genQueryOut->rowCnt; i++) {
00600 char *tmpSubColl, *tmpDataName;
00601
00602 tmpSubColl = &subColl->value[subColl->len * i];
00603 tmpDataName = &dataObj->value[dataObj->len * i];
00604
00605 snprintf (myDataObjInfo.objPath, MAX_NAME_LEN, "%s/%s",
00606 tmpSubColl, tmpDataName);
00607
00608 status = getMountedSubPhyPath (dataObjInfo->objPath,
00609 dataObjInfo->filePath, myDataObjInfo.objPath,
00610 myDataObjInfo.filePath);
00611 if (status < 0) {
00612 rodsLog (LOG_ERROR,
00613 "svrRmSpecCollRecur:getMountedSubPhyPat err for %s,stat=%d",
00614 myDataObjInfo.filePath, status);
00615 savedStatus = status;
00616 }
00617
00618 if (strlen (tmpDataName) > 0) {
00619 status = l3Unlink (rsComm, &myDataObjInfo);
00620 } else {
00621 status = svrRmSpecCollRecur (rsComm, &myDataObjInfo);
00622 }
00623
00624 if (status < 0) {
00625 rodsLog (LOG_NOTICE,
00626 "svrRmSpecCollRecur: l3Unlink error for %s. status = %d",
00627 myDataObjInfo.objPath, status);
00628 savedStatus = status;
00629 }
00630 }
00631 continueInx = genQueryOut->continueInx;
00632
00633 freeGenQueryOut (&genQueryOut);
00634
00635 if (continueInx > 0) {
00636
00637 dataObjInp.openFlags = continueInx;
00638 status = rsQuerySpecColl (rsComm, &dataObjInp, &genQueryOut);
00639 } else {
00640 break;
00641 }
00642 }
00643
00644 status = l3Rmdir (rsComm, dataObjInfo);
00645 if (status < 0) savedStatus = status;
00646
00647 return (savedStatus);
00648 }
00649
00650 #ifdef COMPAT_201
00651 int
00652 rsRmCollOld201 (rsComm_t *rsComm, collInp201_t *rmCollInp)
00653 {
00654 collInp_t collInp;
00655 int status;
00656
00657 collInp201ToCollInp (rmCollInp, &collInp);
00658
00659 status = rsRmCollOld (rsComm, &collInp);
00660
00661 return status;
00662 }
00663
00664 #endif