コード例 #1
0
ファイル: mailMS.cpp プロジェクト: dthain/irods
/**
 * \fn msiSendStdoutAsEmail(msParam_t* xtoAddr, msParam_t* xsubjectLine, ruleExecInfo_t *rei)
 *
 * \brief Sends the current buffer content in rei->ruleExecOut->stdoutBuf.buf as email.
 *
 * \module core
 *
 * \since pre-2.1
 *
 * \author  Arcot Rajasekar
 * \date    2008-05
 *
 * \note   This microservice sends contents of the buffer rei->ruleExecOut->stdoutBuf.buf as email.
 *
 * \usage See clients/icommands/test/rules3.0/
 *
 * \param[in] xtoAddr - a msParam of type STR_MS_T which is the address of the receiver.
 * \param[in] xsubjectLine - a msParam of type STR_MS_T which is the subject of the message.
 * \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 none
 * \iCatAttrModified none
 * \sideeffect none
 *
 * \return integer
 * \retval 0 on success
 * \pre none
 * \post none
 * \sa writeLine, writeString
**/
int msiSendStdoutAsEmail( msParam_t* xtoAddr, msParam_t* xsubjectLine, ruleExecInfo_t *rei ) {
    int i;
    msParam_t *mP;
    char tmpVarName[MAX_ACTION_SIZE];
    execCmdOut_t *myExecCmdOut;
    if ( ( mP = getMsParamByLabel( rei->msParamArray, "ruleExecOut" ) ) == NULL ) {
        return NO_VALUES_FOUND;
    }
    myExecCmdOut = ( execCmdOut_t* )mP->inOutStruct;
    getNewVarName( tmpVarName, rei->msParamArray );
    addMsParam( rei->msParamArray, tmpVarName,  STR_MS_T, myExecCmdOut->stdoutBuf.buf , NULL );
    mP = getMsParamByLabel( rei->msParamArray, tmpVarName );
    i = msiSendMail( xtoAddr, xsubjectLine, mP, rei );
    rmMsParamByLabel( rei->msParamArray, tmpVarName, 1 );
    return i;

}
コード例 #2
0
ファイル: irule.cpp プロジェクト: PlantandFoodResearch/irods
void appendOutputToInput( msParamArray_t *inpParamArray, char **inpParamNames, int inpParamN, char **outParamNames, int outParamN ) {
    int i, k, repeat = 0;
    for ( i = 0; i < outParamN; i++ ) {
        if ( strcmp( outParamNames[i], "ruleExecOut" ) != 0 ) {
            repeat = 0;
            for ( k = 0; k < inpParamN; k++ ) {
                if ( strcmp( outParamNames[i], inpParamNames[k] ) == 0 ) {
                    repeat = 1;
                    break;
                }
            }
            if ( !repeat ) {
                addMsParam( inpParamArray, outParamNames[i], STR_MS_T, strdup( "unspeced" ), NULL );
            }
        }

    }

}
コード例 #3
0
ファイル: mailMS.cpp プロジェクト: jrandall/irods
/**
 * \fn msiSendStdoutAsEmail(msParam_t* xtoAddr, msParam_t* xsubjectLine, ruleExecInfo_t *rei)
 *
 * \brief Sends the current buffer content in rei->ruleExecOut->stdoutBuf.buf as email.
 *
 * \module core
 *
 * \since pre-2.1
 *
 *
 * \note   This microservice sends contents of the buffer rei->ruleExecOut->stdoutBuf.buf as email.
 *
 * \usage See clients/icommands/test/rules3.0/
 *
 * \param[in] xtoAddr - a msParam of type STR_MS_T which is the address of the receiver.
 * \param[in] xsubjectLine - a msParam of type STR_MS_T which is the subject of the message.
 * \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 none
 * \iCatAttrModified none
 * \sideeffect none
 *
 * \return integer
 * \retval 0 on success
 * \pre none
 * \post none
 * \sa writeLine, writeString
**/
int msiSendStdoutAsEmail( msParam_t* xtoAddr, msParam_t* xsubjectLine, ruleExecInfo_t *rei ) {
    msParam_t *mP;
    if ( ( mP = getMsParamByLabel( rei->msParamArray, "ruleExecOut" ) ) == NULL ) {
        return NO_VALUES_FOUND;
    }
    execCmdOut_t *myExecCmdOut = ( execCmdOut_t* )mP->inOutStruct;
    char tmpVarName[MAX_ACTION_SIZE];
    getNewVarName( tmpVarName, rei->msParamArray );
    addMsParam( rei->msParamArray, tmpVarName,  STR_MS_T, myExecCmdOut->stdoutBuf.buf , NULL );
    mP = getMsParamByLabel( rei->msParamArray, tmpVarName );
    int status;
    if ( NULL != mP ) {
        status = msiSendMail( xtoAddr, xsubjectLine, mP, rei );
    }
    else {
        status = SYS_INTERNAL_NULL_INPUT_ERR;
    }
    rmMsParamByLabel( rei->msParamArray, tmpVarName, 1 );
    return status;

}
コード例 #4
0
int
parseParameters( boost::program_options::variables_map _vm, int ruleGen, execMyRuleInp_t *execMyRuleInp, char *inBuf ) {
    strArray_t strArray;
    int status, i, j;
    char *value;
    char line[MAX_NAME_LEN];
    int promptF = 0;
    int labelF = 0;

    if ( inBuf == NULL || strcmp( inBuf, "null" ) == 0 ) {
        execMyRuleInp->inpParamArray = NULL;
        return 0;
    }

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

    status = splitMultiStr( inBuf, &strArray );

    if ( status < 0 ) {
        rodsLog( LOG_ERROR,
                 "parseMsInputParam: parseMultiStr error, status = %d", status );
        execMyRuleInp->inpParamArray = NULL;
        return status;
    }

    status = 0;

    resizeStrArray( &strArray, MAX_NAME_LEN );
    value = strArray.value;

    if ( _vm.count( "file" ) ) {
        if ( _vm.count( "parameters" ) ) {
            std::vector< std::string > parameters;
            try {
                parameters = _vm["parameters"].as< std::vector< std::string > >();
            } catch ( boost::bad_any_cast& e ) {
                std::cerr << "Bad parameter list provided to parseParameters\n";
                std::cerr << "Use -h or --help for help\n";
                return -1;
            }

            for ( size_t inx = 0; inx < parameters.size(); ++inx ) {
                std::string param = parameters.at(inx);
                /* using the values from the input line following -F <filename> */
                /* each string is supposed to have to format label=value */

                if ( param == "prompt" ) {
                    promptF = 1;
                    break;
                }

                if ( param == "default" || param.length() == 0 ) {
                    continue;
                }
                else if ( param.at(0) == '*' ) {
                    size_t eqInx;
                    std::string tmpStr;
                    if ( inx > 0 && labelF == 0 ) {
                        return CAT_INVALID_ARGUMENT;
                    }
                    labelF = 1;
                    if ( ( eqInx = param.find( "=" ) ) == std::string::npos ) {
                        return CAT_INVALID_ARGUMENT;
                    }

                    tmpStr = param.substr( 0, eqInx );
                    for ( j = 0; j < strArray.len; j++ ) {
                        if ( strstr( &value[j * strArray.size], tmpStr.c_str() ) == &value[j * strArray.size] ) {
                            char *val = quoteString( param.c_str(), _vm.count( "string" ), 1 );
                            rstrcpy( &value[j * strArray.size], val, strArray.size );
                            free( val );
                            break;
                        }
                    }
                    if ( j == strArray.len ) {
                        printf( "Ignoring Argument \"%s\"\n", param.c_str() );
                    }
                } else {
                    char *valPtr = &value[inx * strArray.size];
                    char *tmpPtr;

                    if ( labelF == 1 ) {
                        return CAT_INVALID_ARGUMENT;
                    }
                    if ( ( tmpPtr = strstr( valPtr, "=" ) ) != NULL ) {
                        tmpPtr++;
                        char *val = quoteString( param.c_str(), _vm.count( "string" ), 0 );
                        rstrcpy( tmpPtr, val,
                                strArray.size - ( tmpPtr - valPtr + 1 ) );
                        free( val );
                    }
                }
            }
        }
    }

    for ( i = 0; i < strArray.len; i++ ) {
        char *valPtr = &value[i * strArray.size];
        char *tmpPtr;

        if ( ( tmpPtr = strstr( valPtr, "=" ) ) != NULL ) {
            *tmpPtr = '\0';
            tmpPtr++;
            if ( *tmpPtr == '$' ) {
                /* If $ is used as a value in the input file for label=value then
                 the remaining command line arguments are taken as values.
                 If no command line arguments are given then the user is prompted
                 for the input value
                 */
                printf( "Default %s=%s\n    New %s=", valPtr, tmpPtr + 1, valPtr );
                if ( fgets( line, MAX_NAME_LEN, stdin ) == NULL ) {
                    return CAT_INVALID_ARGUMENT;
                }
                size_t line_len = strlen( line );
                if ( line_len > 0 && '\n' == line[line_len - 1] ) {
                    line[line_len - 1] = '\0';
                    line_len--;
                }
                char *val = line_len > 0 ?
                            quoteString( line, _vm.count( "string" ) && ruleGen, 0 ) :
                            strdup( tmpPtr + 1 );
                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            val, NULL );
            }
            else if ( promptF == 1 ) {
                /* the user has asked for prompting */
                printf( "Current %s=%s\n    New %s=", valPtr, tmpPtr, valPtr );
                if ( fgets( line, MAX_NAME_LEN, stdin ) == NULL ) {
                    return CAT_INVALID_ARGUMENT;
                }
                size_t line_len = strlen( line );
                if ( line_len > 0 && '\n' == line[line_len - 1] ) {
                    line[line_len - 1] = '\0';
                    line_len--;
                }
                char *val = line_len > 0 ?
                            quoteString( line, _vm.count( "string" ) && ruleGen, 0 ) :
                            strdup( tmpPtr );
                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            val, NULL );
            }
            else if ( *tmpPtr == '\\' ) {
                /* first '\'  is skipped.
                 If you need to use '\' in the first letter add an additional '\'
                 if you have to use '$' in the first letter add a '\'  before that
                 */
                tmpPtr++;
                char *param = quoteString( tmpPtr, _vm.count( "string" ) && ruleGen, 0 );
                if ( !ruleGen ) {
                    trimQuotes( param );
                }

                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            param, NULL );
            }
            else {
                char *param = quoteString( tmpPtr, _vm.count( "string" ) && ruleGen, 0 );
                if ( !ruleGen ) {
                    trimQuotes( param );
                }

                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            param, NULL );
            }
        }
        else {
            rodsLog( LOG_ERROR,
                     "parseMsInputParam: inpParam %s format error", valPtr );
            status = CAT_INVALID_ARGUMENT;
        }
    }

    return status;
}
コード例 #5
0
ファイル: printMS.cpp プロジェクト: hurngchunlee/irods
int _writeString( char *writeId, char *writeStr, ruleExecInfo_t *rei ) {

    // =-=-=-=-=-=-=-
    // JMC - backport 4619
    dataObjInp_t dataObjInp;
    openedDataObjInp_t openedDataObjInp;
    bytesBuf_t tmpBBuf;
    int fd, i;
    // =-=-=-=-=-=-=-

    if ( writeId != NULL && strcmp( writeId, "serverLog" ) == 0 ) {
        rodsLog( LOG_NOTICE, "writeString: inString = %s", writeStr );
        return 0;
    }

    // =-=-=-=-=-=-=-
    // JMC - backport 4619
    if ( writeId != NULL && writeId[0] == '/' ) {
        /* writing to an existing iRODS file */

        if ( rei == NULL || rei->rsComm == NULL ) {
            rodsLog( LOG_ERROR, "_writeString: input rei or rsComm is NULL" );
            return SYS_INTERNAL_NULL_INPUT_ERR;
        }

        bzero( &dataObjInp, sizeof( dataObjInp ) );
        dataObjInp.openFlags = O_RDWR;
        snprintf( dataObjInp.objPath, MAX_NAME_LEN, "%s", writeId );
        fd = rsDataObjOpen( rei->rsComm, &dataObjInp );
        if ( fd < 0 ) {
            rodsLog( LOG_ERROR, "_writeString: rsDataObjOpen failed. status = %d", fd );
            return fd;
        }

        bzero( &openedDataObjInp, sizeof( openedDataObjInp ) );
        openedDataObjInp.l1descInx = fd;
        openedDataObjInp.offset = 0;
        openedDataObjInp.whence = SEEK_END;
        fileLseekOut_t *dataObjLseekOut = NULL;
        i = rsDataObjLseek( rei->rsComm, &openedDataObjInp, &dataObjLseekOut );
        free( dataObjLseekOut );
        if ( i < 0 ) {
            rodsLog( LOG_ERROR, "_writeString: rsDataObjLseek failed. status = %d", i );
            return i;
        }

        bzero( &openedDataObjInp, sizeof( openedDataObjInp ) );
        openedDataObjInp.l1descInx = fd;
        tmpBBuf.len = openedDataObjInp.len = strlen( writeStr ) + 1;
        tmpBBuf.buf =  writeStr;
        i = rsDataObjWrite( rei->rsComm, &openedDataObjInp, &tmpBBuf );
        if ( i < 0 ) {
            rodsLog( LOG_ERROR, "_writeString: rsDataObjWrite failed. status = %d", i );
            return i;
        }

        bzero( &openedDataObjInp, sizeof( openedDataObjInp ) );
        openedDataObjInp.l1descInx = fd;
        i = rsDataObjClose( rei->rsComm, &openedDataObjInp );
        return i;
    }

    // =-=-=-=-=-=-=-

    msParam_t * mP = NULL;
    msParamArray_t * inMsParamArray = rei->msParamArray;
    execCmdOut_t *myExecCmdOut;
    if ( ( ( mP = getMsParamByLabel( inMsParamArray, "ruleExecOut" ) ) != NULL ) &&
            ( mP->inOutStruct != NULL ) ) {
        if ( !strcmp( mP->type, STR_MS_T ) ) {
            myExecCmdOut = ( execCmdOut_t* )malloc( sizeof( execCmdOut_t ) );
            memset( myExecCmdOut, 0, sizeof( execCmdOut_t ) );
            mP->inOutStruct = myExecCmdOut;
            mP->type = strdup( ExecCmdOut_MS_T );
        }
        else {
            myExecCmdOut = ( execCmdOut_t* )mP->inOutStruct;
        }
    }
    else {
        myExecCmdOut = ( execCmdOut_t* )malloc( sizeof( execCmdOut_t ) );
        memset( myExecCmdOut, 0, sizeof( execCmdOut_t ) );
        if ( mP == NULL ) {
            addMsParam( inMsParamArray, "ruleExecOut", ExecCmdOut_MS_T, myExecCmdOut, NULL );
        }
        else {
            mP->inOutStruct = myExecCmdOut;
            mP->type = strdup( ExecCmdOut_MS_T );
        }
    }

    /***** Jun 27, 2007
           i  = replaceVariablesAndMsParams("",writeStr, rei->msParamArray, rei);
           if (i < 0)
           return i;
    ****/

    if ( writeId != NULL ) {
        if ( !strcmp( writeId, "stdout" ) ) {
            appendToByteBuf( &( myExecCmdOut->stdoutBuf ), ( char * ) writeStr );
        }
        else if ( !strcmp( writeId, "stderr" ) ) {
            appendToByteBuf( &( myExecCmdOut->stderrBuf ), ( char * ) writeStr );
        }
    }

    return 0;
}
コード例 #6
0
ファイル: testrule.c プロジェクト: DICE-UNC/iRODS-FUSE-Mod
int
main(int argc, char **argv)
{
    rcComm_t *conn;
    rodsEnv myRodsEnv;
    rErrMsg_t errMsg;
    int status;
    msParamArray_t msParamArray;
    dataObjInp_t dataObjOpenInp, dataObjCreateInp, dataObjCopyInp;
    execMyRuleInp_t execMyRuleInp;
    msParamArray_t *outParamArray = NULL;


    if (argc != 4) {
        fprintf(stderr, "Usage: %s rods_dataObj1, rods_dataObj2\n",argv[0]);
        exit(1);
    }

    status = getRodsEnv (&myRodsEnv);

    if (status < 0) {
	fprintf (stderr, "getRodsEnv error, status = %d\n", status);
	exit (1);
    }

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

    memset (&dataObjOpenInp, 0, sizeof (dataObjOpenInp));
    snprintf (dataObjOpenInp.objPath, MAX_NAME_LEN, "%s/%s",
      myRodsEnv.rodsCwd, argv[1]);

    memset (&dataObjCreateInp, 0, sizeof (dataObjCreateInp));
    snprintf (dataObjCreateInp.objPath, MAX_NAME_LEN, "%s/%s",
      myRodsEnv.rodsCwd, argv[2]);

    memset (&dataObjCopyInp, 0, sizeof (dataObjCopyInp));
    snprintf (dataObjCopyInp.objPath, MAX_NAME_LEN, "%s/%s",
      myRodsEnv.rodsCwd, argv[3]);

    addMsParam (&msParamArray, "*A", "DataObjInp_PI", &dataObjOpenInp, NULL);
    addMsParam (&msParamArray, "*B", "DataObjInp_PI", &dataObjCreateInp, NULL);
    addMsParam (&msParamArray, "*C", "DataObjInp_PI", &dataObjCopyInp, NULL);

#if 0
    memset (&dataObjLseekInp, 0, sizeof (dataObjLseekInp));
    dataObjLseekInp.fileInx = 101;
    dataObjLseekInp.offset = 1000;
    dataObjLseekInp.whence = SEEK_SET;
    addMsParam (&msParamArray, "C", "fileLseekInp_PI", 
      &dataObjLseekInp, NULL);
#endif

    memset (&errMsg, 0, sizeof (rErrMsg_t));

    conn = rcConnect (myRodsEnv.rodsHost, myRodsEnv.rodsPort, USER_NAME,
      RODS_ZONE, 0, &errMsg);

    if (conn == NULL) {
        fprintf (stderr, "rcConnect error\n");
        exit (1);
    }

    status = clientLogin(conn);
    if (status != 0) {
        rcDisconnect(conn);
        exit (7);
    }

    memset (&execMyRuleInp, 0, sizeof (execMyRuleInp));
#if 0
    rstrcpy (execMyRuleInp.myRule, "myTestRule||msiDataObjOpen(*A,*X)##|msiDataObjLseek(*X,*B,*Y)##msiDataObjClose(*C,*Z)", META_STR_LEN);
    rstrcpy (execMyRuleInp.myRule, "myTestRule||msiDataObjOpen(*A,*X)##msiDataObjCreate(*B,null,*Y)##msiDataObjClose(*X,*Z1)##msiDataObjClose(*Y,*Z2)", META_STR_LEN);
    rstrcpy (execMyRuleInp.outParamDesc, "*X%*Y%*Z1%*Z2", LONG_NAME_LEN);
#endif
    rstrcpy (execMyRuleInp.myRule, "myTestRule||msiDataObjOpen(*A,*S_FD)##msiDataObjCreate(*B,null,*D_FD)##msiDataObjLseek(*S_FD,10,SEEK_SET,*junk1)##msiDataObjRead(*S_FD,10000,*R_BUF)##msiDataObjWrite(*D_FD,*R_BUF,*W_LEN)##msiDataObjClose(*S_FD,*junk2)##msiDataObjClose(*D_FD,*junk3)##msiDataObjCopy(*B,*C,null,*junk4)##delayExec(msiDataObjRepl(*C,demoResc8,*junk5),<A></A>)##msiDataObjUnlink(*B,*junk6)", META_STR_LEN);
    rstrcpy (execMyRuleInp.outParamDesc, "*R_BUF%*W_LEN", LONG_NAME_LEN);

    execMyRuleInp.inpParamArray = &msParamArray;  
    status = rcExecMyRule (conn, &execMyRuleInp, &outParamArray);

    if (status < 0) {
        rError_t *err;
        rErrMsg_t *errMsg;
	int i, len;

	printf ("rcExecMyRule error, status = %d\n", status);
        if ((err = conn->rError) != NULL) {
            len = err->len;
            for (i=0;i<len;i++) {
                errMsg = err->errMsg[i];
                printf("Level %d: %s\n",i, errMsg->msg);
	    }
        }
    } else {
	 printf ("rcExecMyRule success\n");
    }
    rcDisconnect (conn);
} 
コード例 #7
0
ファイル: rsDataObjRsync.c プロジェクト: UPPMAX/irods
int
rsRsyncFileToData (rsComm_t *rsComm, dataObjInp_t *dataObjInp)
{
    int status;
    char *fileChksumStr = NULL;
     char *dataObjChksumStr = NULL;
    dataObjInfo_t *dataObjInfoHead = NULL;

    fileChksumStr = getValByKey (&dataObjInp->condInput, RSYNC_CHKSUM_KW);

    if (fileChksumStr == NULL) {
        rodsLog (LOG_ERROR,
          "rsRsyncFileToData: RSYNC_CHKSUM_KW input is missing");
        return (CHKSUM_EMPTY_IN_STRUCT_ERR);
    }

    status = _rsDataObjChksum (rsComm, dataObjInp, &dataObjChksumStr,
      &dataObjInfoHead);

    if (status < 0 && status != CAT_NO_ACCESS_PERMISSION && 
      status != CAT_NO_ROWS_FOUND) {
        /* XXXXX CAT_NO_ACCESS_PERMISSION mean the chksum was calculated but
         * cannot be registered. But the chksum value is OK.
         */
        rodsLog (LOG_ERROR,
          "rsRsyncFileToData: _rsDataObjChksum of %s error. status = %d",
          dataObjInp->objPath, status);
    }

    freeAllDataObjInfo (dataObjInfoHead);

    if (dataObjChksumStr != NULL &&
      strcmp (dataObjChksumStr, fileChksumStr) == 0) {
	free (dataObjChksumStr);
	return (0);
    }
    return SYS_SVR_TO_CLI_PUT_ACTION;
#if 0
    msParamArray_t *myMsParamArray;
    dataObjInp_t *myDataObjInp;

    myMsParamArray = malloc (sizeof (msParamArray_t));
    memset (myMsParamArray, 0, sizeof (msParamArray_t));
    /* have to get its own dataObjInp_t */
    myDataObjInp = malloc (sizeof (dataObjInp_t));
    replDataObjInp (dataObjInp, myDataObjInp);
    addKeyVal (&myDataObjInp->condInput, REG_CHKSUM_KW, fileChksumStr);

    status = addMsParam (myMsParamArray, CL_PUT_ACTION, DataObjInp_MS_T,
      (void *) myDataObjInp, NULL);

    if (status < 0) {
        rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, status,
          "rsRsyncDataToFile: addMsParam error. status = %d", status);
        return (status);
    }

    /* tell the client to do the put */
    status = sendAndRecvBranchMsg (rsComm, rsComm->apiInx,
     SYS_SVR_TO_CLI_MSI_REQUEST, (void *) myMsParamArray, NULL);

    return (status);
#endif
}
コード例 #8
0
ファイル: irule.cpp プロジェクト: PlantandFoodResearch/irods
int
parseMsInputParam( int argc, char **argv, int optInd, int ruleGen, int string,
                   execMyRuleInp_t *execMyRuleInp, char *inBuf ) {
    strArray_t strArray;
    int status, i, j;
    char *value;
    int nInput;
    char line[MAX_NAME_LEN];
    int promptF = 0;
    int labelF = 0;
    if ( inBuf == NULL || strcmp( inBuf, "null" ) == 0 ) {
        execMyRuleInp->inpParamArray = NULL;
        return ( 0 );
    }

    nInput = argc - optInd;
    memset( &strArray, 0, sizeof( strArray ) );

    status = splitMultiStr( inBuf, &strArray );
    if ( status < 0 ) {
        rodsLog( LOG_ERROR,
                 "parseMsInputParam: parseMultiStr error, status = %d", status );
        execMyRuleInp->inpParamArray = NULL;
        return ( status );
    }

    resizeStrArray( &strArray, MAX_NAME_LEN );
    value = strArray.value;

    /* each string is supposed to have to format label=value */
    for ( i = 0; i < nInput; i++ ) {
        /* using the values from the input line following -F <filename> */
        if ( !strcmp( argv[optInd + i], "prompt" ) ) {
            promptF = 1;
            break;
        }
        if ( !strcmp( argv[optInd + i], "default" ) || strlen( argv[optInd + i] ) == 0 ) {
            continue;
        }
        else if ( *argv[optInd + i] == '*' ) {
            char *tmpPtr;
            if ( i > 0 && labelF == 0 ) {
                return( CAT_INVALID_ARGUMENT );
            }
            labelF = 1;
            if ( ( tmpPtr = strstr( argv[optInd + i], "=" ) ) == NULL ) {
                return( CAT_INVALID_ARGUMENT );
            }
            *tmpPtr = '\0';
            for ( j = 0; j < strArray.len; j++ ) {
                if ( strstr( &value[j * strArray.size], argv[optInd + i] ) == &value[j * strArray.size] ) {
                    *tmpPtr = '=';
                    char *val = quoteString( argv[optInd + i], string, 1 );
                    rstrcpy( &value[j * strArray.size], val, strArray.size );
                    free( val );
                    break;
                }
            }
            if ( j == strArray.len ) {
                printf( "Ignoring Argument \"%s\"", argv[optInd + i] );
            }
        }
        else {
            char *valPtr = &value[i * strArray.size];
            char *tmpPtr;
            if ( labelF == 1 ) {
                return( CAT_INVALID_ARGUMENT );
            }
            if ( ( tmpPtr = strstr( valPtr, "=" ) ) != NULL ) {
                tmpPtr++;
                char *val = quoteString( argv[optInd + i], string, 0 );
                rstrcpy( tmpPtr, val,
                         strArray.size - ( tmpPtr - valPtr + 1 ) );
                free( val );
            }
        }
    }

    for ( i = 0; i < strArray.len; i++ ) {
        char *valPtr = &value[i * strArray.size];
        char *tmpPtr;

        if ( ( tmpPtr = strstr( valPtr, "=" ) ) != NULL ) {
            *tmpPtr = '\0';
            tmpPtr++;
            /** RAJA Jul 12 2007 changed it so that it can take input values from terminal
            addMsParam (execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                    strdup (tmpPtr), NULL);
             ** RAJA Jul 12 2007 changed it so that it can take input values from terminal **/
            if ( *tmpPtr == '$' ) {
                /* If $ is used as a value in the input file for label=value then
                 the remaining command line arguments are taken as values.
                 If no command line arguments are given then the user is prompted
                 for the input value
                 */
                printf( "Default %s=%s\n    New %s=", valPtr, tmpPtr + 1, valPtr );
                if ( fgets( line, MAX_NAME_LEN, stdin ) == NULL ) {
                    return( CAT_INVALID_ARGUMENT );
                }
                if ( ( line[strlen( line ) - 1] = '\n' ) ) {
                    line[strlen( line ) - 1] = '\0';
                }
                char *val;
                if ( strlen( line ) == 0 ) {
                    val = strdup( tmpPtr + 1 );
                }
                else {
                    val = quoteString( line, string && ruleGen, 0 );
                }
                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            val, NULL );
            }
            else if ( promptF == 1 ) {
                /* the user has asked for prompting */
                printf( "Current %s=%s\n    New %s=", valPtr, tmpPtr, valPtr );
                if ( fgets( line, MAX_NAME_LEN, stdin ) == NULL ) {
                    return( CAT_INVALID_ARGUMENT );
                }
                if ( ( line[strlen( line ) - 1] = '\n' ) ) {
                    line[strlen( line ) - 1] = '\0';
                }
                char *val;
                if ( strlen( line ) == 0 ) {
                    val = strdup( tmpPtr );
                }
                else {
                    val = quoteString( line, string && ruleGen, 0 );
                }
                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            val, NULL );
            }
            else if ( *tmpPtr == '\\' ) {
                /* first '\'  is skipped.
                 If you need to use '\' in the first letter add an additional '\'
                 if you have to use '$' in the first letter add a '\'  before that
                 */
                tmpPtr++;
                char *param = quoteString( tmpPtr, string && ruleGen, 0 );
                if ( !ruleGen ) {
                    trimQuotes( param );
                }

                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            param, NULL );
            }
            else {
                char *param = quoteString( tmpPtr, string && ruleGen, 0 );
                if ( !ruleGen ) {
                    trimQuotes( param );
                }

                addMsParam( execMyRuleInp->inpParamArray, valPtr, STR_MS_T,
                            param, NULL );
            }
        }
        else {
            rodsLog( LOG_ERROR,
                     "parseMsInputParam: inpParam %s format error", valPtr );
        }
    }

    return ( 0 );
}