예제 #1
0
파일: test_chl.c 프로젝트: UPPMAX/irods
int testModColl(rsComm_t *rsComm, char *name, char *type, 
		       char *info1, char *info2) {
   int status;
   collInfo_t collInp;

   rsComm->clientUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;
   rsComm->proxyUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;

   memset(&collInp,0,sizeof(collInp));

   if (name!=NULL && strlen(name)>0) {
      strncpy(collInp.collName, name, sizeof collInp.collName);
   }
   if (type!=NULL && strlen(type)>0) {
      strncpy(collInp.collType, type, sizeof collInp.collType);
   }
   if (info1!=NULL && strlen(info1)>0) {
      strncpy(collInp.collInfo1, info1, sizeof collInp.collInfo1);
   }
   if (info2!=NULL && strlen(info2)>0) {
      strncpy(collInp.collInfo2, info2, sizeof collInp.collInfo2);
   }

   status = chlModColl(rsComm, &collInp);

   if (status != 0)  return(status);

   status = chlCommit(rsComm);
   return(status);
}
예제 #2
0
파일: test_chl.c 프로젝트: UPPMAX/irods
int testRename(rsComm_t *rsComm, char *id, char *newName) {
   rodsLong_t intId;
   int status;
   rsComm->clientUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;
   rsComm->proxyUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;
   intId = strtoll(id, 0, 0);
   status = chlRenameObject(rsComm, intId, newName);
   if (status) return(status);
   return(chlCommit(rsComm));
}
예제 #3
0
파일: rsRmColl.cpp 프로젝트: bpow/irods
int
svrUnregColl( rsComm_t *rsComm, collInp_t *rmCollInp ) {
    int status;
#ifdef RODS_CAT
    collInfo_t collInfo;
#endif
    rodsServerHost_t *rodsServerHost = NULL;

    status = getAndConnRcatHost(
                 rsComm,
                 MASTER_RCAT,
                 ( const char* )rmCollInp->collName,
                 &rodsServerHost );
    if ( status < 0 || NULL == rodsServerHost ) { // JMC cppcheck - nullptr
        return status;
    }

    if ( rodsServerHost->localFlag == LOCAL_HOST ) {
#ifdef RODS_CAT
        memset( &collInfo, 0, sizeof( collInfo ) );
        rstrcpy( collInfo.collName, rmCollInp->collName, MAX_NAME_LEN );
        if ( getValByKey( &rmCollInp->condInput, ADMIN_RMTRASH_KW )
                != NULL ) {
            status = chlDelCollByAdmin( rsComm, &collInfo );
            if ( status >= 0 ) {
                chlCommit( rsComm );
            }
        }
        else {
            status = chlDelColl( rsComm, &collInfo );
        }

#else
        status = SYS_NO_RCAT_SERVER_ERR;
#endif
    }
    else {
        collOprStat_t *collOprStat = NULL;;
        addKeyVal( &rmCollInp->condInput, UNREG_COLL_KW, "" );
        status = _rcRmColl( rodsServerHost->conn, rmCollInp, &collOprStat );
        if ( collOprStat != NULL ) {
            free( collOprStat );
        }
    }

    return status;
}
예제 #4
0
파일: test_chl.c 프로젝트: UPPMAX/irods
int testModResourceFreeSpace(rsComm_t *rsComm, char *rescName, 
		       char *numberString, char *option) {
   int number, status;
   if (*numberString=='\\') numberString++;
   number = atoi(numberString);
   rsComm->clientUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;
   rsComm->proxyUser.authInfo.authFlag = LOCAL_PRIV_USER_AUTH;
   status = chlModRescFreeSpace(rsComm, rescName, number);
   if (status != 0)  return(status);
   if (option != NULL && strcmp(option, "rollback")==0 ) {
      status = chlRollback(rsComm);
   }
   if (option != NULL && strcmp(option, "close")==0 ) {
      status = chlClose();
      return(status);
   }
   status = chlCommit(rsComm);
   return(status);
}
예제 #5
0
int
_rsEndTransaction( rsComm_t *rsComm, endTransactionInp_t *endTransactionInp ) {
    int status;

    rodsLog( LOG_DEBUG,
             "_rsEndTransaction arg0=%s",
             endTransactionInp->arg0 );

    if ( strcmp( endTransactionInp->arg0, "commit" ) == 0 ) {
        status = chlCommit( rsComm );
        return status;
    }

    if ( strcmp( endTransactionInp->arg0, "rollback" ) == 0 ) {
        status = chlRollback( rsComm );
        return status;
    }

    return CAT_INVALID_ARGUMENT;
}
예제 #6
0
/**
 * \fn msiCommit (ruleExecInfo_t *rei)
 *
 * \brief This microservice commits pending database transactions,
 * registering the new state information into the iCAT.
 *
 * \module core
 *
 * \since pre-2.1
 *
 * \note This is used to commit changes (in any) into the iCAT
 * database as part of a rule and microservice chain.  See core.re
 * for examples.  In other cases, iCAT updates and inserts are
 * automatically committed into the iCAT Database as part of the
 * normal operations (in the 'C' code).
 *
 * \usage See clients/icommands/test/rules/
 *
 * \param[in,out] rei - The RuleExecInfo structure that is automatically
 *    handled by the rule engine. The user does not include rei as a
 *    parameter in the rule invocation.
 *
 * \DolVarDependence none
 * \DolVarModified  none
 * \iCatAttrDependence commits pending updates (if any)
 * \iCatAttrModified pending updates (if any) are committed into the iCAT db
 * \sideeffect none
 *
 * \return integer
 * \retval (status)
 * \pre none
 * \post none
 * \sa none
**/
int
msiCommit( ruleExecInfo_t *rei ) {
    int status;

    /**** This is Just a Test Stub  ****/
    if ( reTestFlag > 0 ) {
        if ( reTestFlag == LOG_TEST_1 ) {
            rodsLog( LOG_NOTICE, "   Calling msiCommit\n" );
        }
        if ( reLoopBackFlag > 0 ) {
            return 0;
        }
    }
    /**** This is Just a Test Stub  ****/
#ifdef RODS_CAT
    status = chlCommit( rei->rsComm );
#else
    status =  SYS_NO_RCAT_SERVER_ERR;
#endif
    return status;
}
예제 #7
0
파일: test_chl.c 프로젝트: UPPMAX/irods
/*
 Do multiple data registrations.  If you comment out the commit in
 chlRegDataObj and then build this, it can add phony data-objects at
 about 8 times the speed of lots of iput's of small files.  This can
 come in handy for creating simulated large instances for DBMS
 performance testing and tuning.  In this source file, you might also
 want to change rodsLogLevel(LOG_NOTICE) to rodsLogLevel(LOG_ERROR)
 and comment out rodsLogSqlReq(1);.

name is the objPath (collection/dataObj)
objPath = /newZone/home/rods/ws/f3"
filePath is the physical path
filePath = "/home/schroeder/iRODS/Vault/home/rods/ws/f3"

Example:
bin/test_chl regmulti 1000 /newZone/home/rods/ws2/f1 generic /tmp/vault/f1
 */
int testRegDataMulti(rsComm_t *rsComm, char *count, 
		     char *nameBase,  char *dataType, char *filePath) {
   int status;
   int myCount=100;
   int i;
   char myName[MAX_NAME_LEN];

   myCount = atoi(count);
   if (myCount <=0) {
      printf("Invalid input: count\n");
      return(USER_INPUT_OPTION_ERR);
   }

   for (i=0;i<myCount;i++) {
      snprintf (myName, sizeof myName, "%s.%d", nameBase, i);
      status = testRegDataObj(rsComm, myName, dataType, filePath);
      if (status) return(status);
   }

   status = chlCommit(rsComm);
   return(status);
}
예제 #8
0
int
_rsModColl (rsComm_t *rsComm, collInp_t *modCollInp)
{
#ifdef RODS_CAT
    int status;
    collInfo_t collInfo;
    char *tmpStr;

    int i;
    ruleExecInfo_t rei2;

    memset ((char*)&rei2, 0, sizeof (ruleExecInfo_t));
    rei2.rsComm = rsComm;
    if (rsComm != NULL) {
      rei2.uoic = &rsComm->clientUser;
      rei2.uoip = &rsComm->proxyUser;
    }

    memset (&collInfo, 0, sizeof (collInfo));

    rstrcpy (collInfo.collName, modCollInp->collName, MAX_NAME_LEN);

    if ((tmpStr = getValByKey (&modCollInp->condInput,
      COLLECTION_TYPE_KW)) != NULL) {
        rstrcpy (collInfo.collType, tmpStr, NAME_LEN);
    }
    if ((tmpStr = getValByKey (&modCollInp->condInput,
      COLLECTION_INFO1_KW)) != NULL) {
        rstrcpy (collInfo.collInfo1, tmpStr, MAX_NAME_LEN);
    }
    if ((tmpStr = getValByKey (&modCollInp->condInput,
      COLLECTION_INFO2_KW)) != NULL) {
        rstrcpy (collInfo.collInfo2, tmpStr, MAX_NAME_LEN);
    }
    /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
    rei2.coi = &collInfo;
    i =  applyRule("acPreProcForModifyCollMeta",NULL, &rei2, NO_SAVE_REI);
    if (i < 0) {
      if (rei2.status < 0) {
	i = rei2.status;
      }
      rodsLog (LOG_ERROR,
	       "rsGeneralAdmin:acPreProcForModifyCollMeta error for %s,stat=%d",
	       modCollInp->collName, i);
      return i;
    }
    /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

    status = chlModColl (rsComm, &collInfo);

    /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
    if (status >= 0) {
      i =  applyRule("acPostProcForModifyCollMeta",NULL, &rei2, NO_SAVE_REI);
      if (i < 0) {
	if (rei2.status < 0) {
	  i = rei2.status;
	}
	rodsLog (LOG_ERROR,
		 "rsGeneralAdmin:acPostProcForModifyCollMeta error for %s,stat=%d",
		 modCollInp->collName, i);
	return i;
      }
    }
    /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

    /* XXXX need to commit */
    if (status >= 0) {
       status = chlCommit(rsComm);
    }
    else {
       int status1;
       status1 = chlRollback(rsComm);
    }

    return (status);
#else
    return (SYS_NO_RCAT_SERVER_ERR);
#endif
}
예제 #9
0
int
_rsGeneralAdmin(rsComm_t *rsComm, generalAdminInp_t *generalAdminInp )
{
    int status;
    userInfo_t userInfo;
    collInfo_t collInfo;
    rescInfo_t rescInfo;
    ruleExecInfo_t rei;
    char *args[MAX_NUM_OF_ARGS_IN_ACTION];
    int i, argc;
    ruleExecInfo_t rei2;

    memset ((char*)&rei2, 0, sizeof (ruleExecInfo_t));
    rei2.rsComm = rsComm;
    if (rsComm != NULL) {
      rei2.uoic = &rsComm->clientUser;
      rei2.uoip = &rsComm->proxyUser;
    }

    rodsLog (LOG_DEBUG,
	     "_rsGeneralAdmin arg0=%s", 
	     generalAdminInp->arg0);

    if (strcmp(generalAdminInp->arg0,"pvacuum")==0) {
       char *args[2];
       char argStr[100];    /* argument string */
       memset((char*)&rei,0,sizeof(rei));
       rei.rsComm = rsComm;
       rei.uoic = &rsComm->clientUser;
       rei.uoip = &rsComm->proxyUser;
       rstrcpy(argStr,"",sizeof argStr);
       if (atoi(generalAdminInp->arg1) > 0) {
	  snprintf(argStr,sizeof argStr,"<ET>%s</ET>",generalAdminInp->arg1);
       }
       if (atoi(generalAdminInp->arg2) > 0) {
	  strncat(argStr,"<EF>",100);
	  strncat(argStr,generalAdminInp->arg2,100);
	  strncat(argStr,"</EF>",100);
       }
       args[0]=argStr;
       status = applyRuleArg("acVacuum", args, 1, &rei, SAVE_REI);
       return(status);
    }

    if (strcmp(generalAdminInp->arg0,"add")==0) {
       if (strcmp(generalAdminInp->arg1,"user")==0) { 
	  /* run the acCreateUser rule */
	  char *args[2];
	  memset((char*)&rei,0,sizeof(rei));
	  rei.rsComm = rsComm;
	  strncpy(userInfo.userName, generalAdminInp->arg2, 
		  sizeof userInfo.userName);
	  strncpy(userInfo.userType, generalAdminInp->arg3, 
		  sizeof userInfo.userType);
	  strncpy(userInfo.rodsZone, generalAdminInp->arg4, 
		  sizeof userInfo.rodsZone);
	  strncpy(userInfo.authInfo.authStr, generalAdminInp->arg5, 
		  sizeof userInfo.authInfo.authStr);
	  rei.uoio = &userInfo;
	  rei.uoic = &rsComm->clientUser;
	  rei.uoip = &rsComm->proxyUser;
	  status = applyRuleArg("acCreateUser", args, 0, &rei, SAVE_REI);
	  if (status != 0) chlRollback(rsComm);
          return(status);
       }
       if (strcmp(generalAdminInp->arg1,"dir")==0) {
	  memset((char*)&collInfo,0,sizeof(collInfo));
	  strncpy(collInfo.collName, generalAdminInp->arg2, 
		  sizeof collInfo.collName);
	  if (strlen(generalAdminInp->arg3) > 0) {
	     strncpy(collInfo.collOwnerName, generalAdminInp->arg3,
		     sizeof collInfo.collOwnerName);
	     status = chlRegCollByAdmin(rsComm, &collInfo);
	     if (status == 0) {
		int status2;
		status2 = chlCommit(rsComm);
	     }
	  }
	  else {
	     status = chlRegColl(rsComm, &collInfo);
	  }
	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"zone")==0) {
	  status = chlRegZone(rsComm, generalAdminInp->arg2,
			      generalAdminInp->arg3, 
			      generalAdminInp->arg4,
			      generalAdminInp->arg5);
	  if (status == 0) {
	     if (strcmp(generalAdminInp->arg3,"remote")==0) {
		memset((char*)&collInfo,0,sizeof(collInfo));
		strncpy(collInfo.collName, "/", sizeof collInfo.collName);
		strncat(collInfo.collName, generalAdminInp->arg2,
			sizeof collInfo.collName);
		strncpy(collInfo.collOwnerName, rsComm->proxyUser.userName,
			sizeof collInfo.collOwnerName);
		status = chlRegCollByAdmin(rsComm, &collInfo);
		if (status == 0) {
		   chlCommit(rsComm);
		}
	     }
	  }
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"resource")==0) {
	  strncpy(rescInfo.rescName,  generalAdminInp->arg2, 
		  sizeof rescInfo.rescName);
	  strncpy(rescInfo.rescType,  generalAdminInp->arg3, 
		  sizeof rescInfo.rescType);
	  strncpy(rescInfo.rescClass, generalAdminInp->arg4, 
		  sizeof rescInfo.rescClass);
	  strncpy(rescInfo.rescLoc,   generalAdminInp->arg5, 
		  sizeof rescInfo.rescLoc);
	  strncpy(rescInfo.rescVaultPath, generalAdminInp->arg6, 
		  sizeof rescInfo.rescVaultPath);
	  strncpy(rescInfo.zoneName,  generalAdminInp->arg7, 
		  sizeof rescInfo.zoneName);
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  args[0] = rescInfo.rescName;
	  args[1] = rescInfo.rescType;
	  args[2] = rescInfo.rescClass;
	  args[3] = rescInfo.rescLoc;
	  args[4] = rescInfo.rescVaultPath;
	  args[5] = rescInfo.zoneName;
	  argc = 6;
	  i =  applyRuleArg("acPreProcForCreateResource", args, argc, &rei2, NO_SAVE_REI);
	  if (i < 0) {
	    if (rei2.status < 0) {
	      i = rei2.status;
	    }
	    rodsLog (LOG_ERROR,
		     "rsGeneralAdmin:acPreProcForCreateResource error for %s,stat=%d",
		     rescInfo.rescName,i);
	    return i;
	  }
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlRegResc(rsComm, &rescInfo);
	  if (status != 0) {
	    chlRollback(rsComm);
	    return(status);
	  }
	  
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  i =  applyRuleArg("acPostProcForCreateResource",args,argc, &rei2, NO_SAVE_REI);
	  if (i < 0) {
	    if (rei2.status < 0) {
	      i = rei2.status;
	    }
	    rodsLog (LOG_ERROR,
		     "rsGeneralAdmin:acPostProcForCreateResource error for %s,stat=%d",
                     rescInfo.rescName,i);
            return i;
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"token")==0) {
	 
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  args[0] = generalAdminInp->arg2;
	  args[1] = generalAdminInp->arg3;
	  args[2] = generalAdminInp->arg4;
	  args[3] = generalAdminInp->arg5;
	  args[4] = generalAdminInp->arg6;
	  args[5] = generalAdminInp->arg7;
	  argc = 6;
	  i =  applyRuleArg("acPreProcForCreateToken", args, argc, &rei2, NO_SAVE_REI);
	  if (i < 0) {
	    if (rei2.status < 0) {
	      i = rei2.status;
	    }
	    rodsLog (LOG_ERROR,
		     "rsGeneralAdmin:acPreProcForCreateToken error for %s.%s=%s,stat=%d",
		     args[0],args[1],args[2],i);
	    return i;
	  }
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlRegToken(rsComm, generalAdminInp->arg2,
			       generalAdminInp->arg3, 
			       generalAdminInp->arg4,
			       generalAdminInp->arg5,
			       generalAdminInp->arg6,
			       generalAdminInp->arg7);
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
 	  if (status == 0) {
	    i =  applyRuleArg("acPostProcForCreateToken", args, argc, &rei2, NO_SAVE_REI);
	    if (i < 0) {
	      if (rei2.status < 0) {
		i = rei2.status;
	      }
	      rodsLog (LOG_ERROR,
		       "rsGeneralAdmin:acPostProcForCreateToken error for %s.%s=%s,stat=%d",
		       args[0],args[1],args[2],i);
	      return i;
	    }
	  }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
 
	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"specificQuery")==0) {
	  status = chlAddSpecificQuery(rsComm, generalAdminInp->arg2,
				       generalAdminInp->arg3);
	  return(status);
       }
    }
    if (strcmp(generalAdminInp->arg0,"modify")==0) {
       if (strcmp(generalAdminInp->arg1,"user")==0) {
	 /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	 args[0] = generalAdminInp->arg2; /* username */
	 args[1] = generalAdminInp->arg3; /* option */
#if 0
	 args[2] = generalAdminInp->arg4; /* newValue */
#else
/* Since the obfuscated password might contain commas, single or
   double quotes, etc, it's hard to escape for processing (often
   causing a seg fault), so for now just pass in a dummy string.  
   It is also unlikely the microservice actually needs the obfuscated
   password. */
	 args[2] = "obfuscatedPw";
#endif
	 argc = 3;
	 i =  applyRuleArg("acPreProcForModifyUser",args,argc, &rei2, NO_SAVE_REI);
	 if (i < 0) {
	   if (rei2.status < 0) {
	     i = rei2.status;
	   }
	   rodsLog (LOG_ERROR,
		    "rsGeneralAdmin:acPreProcForModifyUser error for %s and option %s,stat=%d",
		    args[0],args[1], i);
	   return i;
	 }
	 /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlModUser(rsComm, generalAdminInp->arg2, 
			      generalAdminInp->arg3, generalAdminInp->arg4);

	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  if (status == 0) {
 	    i =  applyRuleArg("acPostProcForModifyUser",args,argc, &rei2, NO_SAVE_REI);
	    if (i < 0) {
	      if (rei2.status < 0) {
		i = rei2.status;
	      }
	      rodsLog (LOG_ERROR,
		       "rsGeneralAdmin:acPostProcForModifyUser error for %s and option %s,stat=%d",
		       args[0],args[1], i);
	      return i;
	    }
	  }
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"group")==0) {
    	   userInfo_t ui;
    	   memset(&ui, 0, sizeof(userInfo_t));
    	   rei2.uoio = &ui;
    	   rstrcpy(ui.userName, generalAdminInp->arg4, NAME_LEN);
    	   rstrcpy(ui.rodsZone, generalAdminInp->arg5, NAME_LEN);
         /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
         args[0] = generalAdminInp->arg2; /* groupname */
         args[1] = generalAdminInp->arg3; /* option */
         args[2] = generalAdminInp->arg4; /* username */
	 args[3] = generalAdminInp->arg5; /* zonename */
         argc = 4;
         i =  applyRuleArg("acPreProcForModifyUserGroup",args,argc, &rei2, NO_SAVE_REI);
         if (i < 0) {
           if (rei2.status < 0) {
             i = rei2.status;
           }
           rodsLog (LOG_ERROR,
                    "rsGeneralAdmin:acPreProcForModifyUserGroup error for %s and option %s,stat=%d",
                    args[0],args[1], i);
           return i;
         }
         /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlModGroup(rsComm, generalAdminInp->arg2, 
			       generalAdminInp->arg3, generalAdminInp->arg4,
			       generalAdminInp->arg5);
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
          if (status == 0) {
            i =  applyRuleArg("acPostProcForModifyUserGroup",args,argc, &rei2, NO_SAVE_REI);
            if (i < 0) {
              if (rei2.status < 0) {
                i = rei2.status;
              }
              rodsLog (LOG_ERROR,
                       "rsGeneralAdmin:acPostProcForModifyUserGroup error for %s and option %s,stat=%d",
                       args[0],args[1], i);
              return i;
            }
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"zone")==0) {
	  status = chlModZone(rsComm, generalAdminInp->arg2, 
			      generalAdminInp->arg3, generalAdminInp->arg4);
	  if (status != 0) chlRollback(rsComm);
	  if (status == 0 &&
	      strcmp(generalAdminInp->arg3, "name")==0) {
	     char oldName[MAX_NAME_LEN];
	     char newName[MAX_NAME_LEN];
	     strncpy(oldName, "/", sizeof oldName);
	     strncat(oldName, generalAdminInp->arg2, sizeof oldName);
	     strncpy(newName, generalAdminInp->arg4, sizeof newName);
	     status = chlRenameColl(rsComm, oldName, newName);
	     if (status==0) chlCommit(rsComm);
	  }
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"zonecollacl")==0) {
	  status = chlModZoneCollAcl(rsComm, generalAdminInp->arg2, 
			      generalAdminInp->arg3, generalAdminInp->arg4);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"localzonename")==0) {
	  /* run the acRenameLocalZone rule */
	  char *args[2];
	  memset((char*)&rei,0,sizeof(rei));
	  rei.rsComm = rsComm;
	  memset((char*)&rei,0,sizeof(rei));
	  rei.rsComm = rsComm;
	  rei.uoic = &rsComm->clientUser;
	  rei.uoip = &rsComm->proxyUser;
	  args[0]=generalAdminInp->arg2;
	  args[1]=generalAdminInp->arg3;
	  status = applyRuleArg("acRenameLocalZone", args, 2, &rei, 
				NO_SAVE_REI);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"resourcedatapaths")==0) {
	  status = chlModRescDataPaths(rsComm, generalAdminInp->arg2, 
		       generalAdminInp->arg3, generalAdminInp->arg4,
		       generalAdminInp->arg5);
				       
	  return(status);
       }

       if (strcmp(generalAdminInp->arg1,"resource")==0) {
         /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
         args[0] = generalAdminInp->arg2; /* rescname */
         args[1] = generalAdminInp->arg3; /* option */
         args[2] = generalAdminInp->arg4; /* newvalue */
         argc = 3;
         i =  applyRuleArg("acPreProcForModifyResource",args,argc, &rei2, NO_SAVE_REI);
         if (i < 0) {
           if (rei2.status < 0) {
             i = rei2.status;
           }
           rodsLog (LOG_ERROR,
                    "rsGeneralAdmin:acPreProcForModifyResource error for %s and option %s,stat=%d",
                    args[0],args[1], i);
           return i;
         }
         /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlModResc(rsComm, generalAdminInp->arg2, 
			      generalAdminInp->arg3, generalAdminInp->arg4);

	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
          if (status == 0) {
            i =  applyRuleArg("acPostProcForModifyResource",args,argc, &rei2, NO_SAVE_REI);
            if (i < 0) {
              if (rei2.status < 0) {
                i = rei2.status;
              }
              rodsLog (LOG_ERROR,
                       "rsGeneralAdmin:acPostProcForModifyResource error for %s and option %s,stat=%d",
                       args[0],args[1], i);
              return i;
            }
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"resourcegroup")==0) {
	 /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
         args[0] = generalAdminInp->arg2; /* rescgroupname */
         args[1] = generalAdminInp->arg3; /* option */
         args[2] = generalAdminInp->arg4; /* rescname */
         argc = 3;
         i =  applyRuleArg("acPreProcForModifyResourceGroup",args,argc, &rei2, NO_SAVE_REI);
         if (i < 0) {
           if (rei2.status < 0) {
             i = rei2.status;
           }
           rodsLog (LOG_ERROR,
                    "rsGeneralAdmin:acPreProcForModifyResourceGroup error for %s and option %s,stat=%d",
                    args[0],args[1], i);
           return i;
         }
         /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlModRescGroup(rsComm, generalAdminInp->arg2, 
			      generalAdminInp->arg3, generalAdminInp->arg4);

	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
          if (status == 0) {
            i =  applyRuleArg("acPostProcForModifyResourceGroup",args,argc, &rei2, NO_SAVE_REI);
            if (i < 0) {
              if (rei2.status < 0) {
                i = rei2.status;
              }
              rodsLog (LOG_ERROR,
                       "rsGeneralAdmin:acPostProcForModifyResourceGroup error for %s and option %s,stat=%d",
                       args[0],args[1], i);
              return i;
            }
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
    }
    if (strcmp(generalAdminInp->arg0,"rm")==0) {
       if (strcmp(generalAdminInp->arg1,"user")==0) { 
	  /* run the acDeleteUser rule */
	  char *args[2];
	  memset((char*)&rei,0,sizeof(rei));
	  rei.rsComm = rsComm;
	  strncpy(userInfo.userName, generalAdminInp->arg2, 
		  sizeof userInfo.userName);
	  strncpy(userInfo.rodsZone, generalAdminInp->arg3, 
		  sizeof userInfo.rodsZone);
	  rei.uoio = &userInfo;
	  rei.uoic = &rsComm->clientUser;
	  rei.uoip = &rsComm->proxyUser;
	  status = applyRuleArg("acDeleteUser", args, 0, &rei, SAVE_REI);
	  if (status != 0) chlRollback(rsComm);
          return(status);
       }
       if (strcmp(generalAdminInp->arg1,"dir")==0) {
	  memset((char*)&collInfo,0,sizeof(collInfo));
	  strncpy(collInfo.collName, generalAdminInp->arg2, 
		  sizeof collInfo.collName);
	  status = chlDelColl(rsComm, &collInfo);
	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"resource")==0) {
	  strncpy(rescInfo.rescName,  generalAdminInp->arg2, 
		  sizeof rescInfo.rescName);

	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	  args[0] = rescInfo.rescName;
	  argc = 1;
          i =  applyRuleArg("acPreProcForDeleteResource", args, argc, &rei2, NO_SAVE_REI);
          if (i < 0) {
            if (rei2.status < 0) {
              i = rei2.status;
            }
            rodsLog (LOG_ERROR,
                     "rsGeneralAdmin:acPreProcForDeleteResource error for %s,stat=%d",
                     rescInfo.rescName,i);
            return i;
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlDelResc(rsComm, &rescInfo);
	  if (status == 0) {
	    /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	    i =  applyRuleArg("acPostProcForDeleteResource",args,argc, &rei2, NO_SAVE_REI);
	    if (i < 0) {
	      if (rei2.status < 0) {
		i = rei2.status;
	      }
	      rodsLog (LOG_ERROR,
		       "rsGeneralAdmin:acPostProcForDeleteResource error for %s,stat=%d",
		       rescInfo.rescName,i);
	      return i;
	    }
	  }
	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  if (status != 0) chlRollback(rsComm);
	  return(status); 
       }
       if (strcmp(generalAdminInp->arg1,"zone")==0) {
	  status = chlDelZone(rsComm, generalAdminInp->arg2);
	  if (status == 0) {
	     memset((char*)&collInfo,0,sizeof(collInfo));
	     strncpy(collInfo.collName, "/", sizeof collInfo.collName);
	     strncat(collInfo.collName, generalAdminInp->arg2,
		     sizeof collInfo.collName);
	     status = chlDelCollByAdmin(rsComm, &collInfo);
	  }
	  if (status == 0) {
	     status = chlCommit(rsComm);
	  }
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"token")==0) {

	 /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
	 args[0] = generalAdminInp->arg2;
	 args[1] = generalAdminInp->arg3;
	 argc = 2;
	 i =  applyRuleArg("acPreProcForDeleteToken", args, argc, &rei2, NO_SAVE_REI);
	 if (i < 0) {
	   if (rei2.status < 0) {
	     i = rei2.status;
	   }
	   rodsLog (LOG_ERROR,
		    "rsGeneralAdmin:acPreProcForDeleteToken error for %s.%s,stat=%d",
		    args[0],args[1],i);
	   return i;
	 }
	 /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  status = chlDelToken(rsComm, generalAdminInp->arg2,
			       generalAdminInp->arg3);

	  /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/
          if (status == 0) {
            i =  applyRuleArg("acPostProcForDeleteToken", args, argc, &rei2, NO_SAVE_REI);
            if (i < 0) {
              if (rei2.status < 0) {
                i = rei2.status;
              }
              rodsLog (LOG_ERROR,
                       "rsGeneralAdmin:acPostProcForDeleteToken error for %s.%s,stat=%d",
                       args[0],args[1],i);
              return i;
            }
          }
          /** RAJA ADDED June 1 2009 for pre-post processing rule hooks **/

	  if (status != 0) chlRollback(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"unusedAVUs")==0) {
	  status = chlDelUnusedAVUs(rsComm);
	  return(status);
       }
       if (strcmp(generalAdminInp->arg1,"specificQuery")==0) {
	  status = chlDelSpecificQuery(rsComm, generalAdminInp->arg2);
	  return(status);
       }
    }
    if (strcmp(generalAdminInp->arg0,"calculate-usage")==0) {
       status = chlCalcUsageAndQuota(rsComm);
       return(status);
    }
    if (strcmp(generalAdminInp->arg0,"set-quota")==0) {
       status = chlSetQuota(rsComm,
			    generalAdminInp->arg1, 
			    generalAdminInp->arg2, 
			    generalAdminInp->arg3, 
			    generalAdminInp->arg4);

       return(status);
    }
    return(CAT_INVALID_ARGUMENT);
}