Changeset 2459

Show
Ignore:
Timestamp:
09/18/08 09:44:49 (4 months ago)
Author:
ahodgkinson
Message:

digitalme: Added client support for non-interactive mode.

Location:
trunk/digitalme/ui
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/digitalme/ui/cmdline/src/cbiscl.cpp

    r2437 r2459  
    2727 
    2828/**************************************************************************** 
    29 Desc: Command-line parameters 
    30 ****************************************************************************/ 
    31  
    32 #define DM_TEST_ARG_STR                                         "test" 
    33 #define DM_GET_TOKEN_ARG_STR                            "gettoken" 
    34 #define DM_TRUSTED_ISSUER_URIS_ARG_STR  "issuers" 
    35 #define DM_RECIPIENT_ARG_STR                            "recipient" 
    36 #define DM_REQUIRED_CLAIMS_ARG_STR              "reqclaims" 
    37 #define DM_OPTIONAL_CLAIMS_ARG_STR              "optclaims" 
    38 #define DM_TOKEN_TYPE_ARG_STR                           "tokentype" 
    39 #define DM_PRIVACY_POLICY_FILE_ARG_STR  "privfile" 
    40 #define DM_CERT_FILE_ARG_STR                            "certfile" 
    41 #define DM_TOKEN_OUTPUT_FILE_ARG_STR    "tokenfile" 
    42 #define DM_VERSION_ARG_STR                                      "version" 
    43 #define DM_ISSUER_POLICY_ARG_STR                        "issuerpolicy" 
    44 #define DM_SERVER_ARG_STR                                       "server" 
    45 #define DM_CARD_ID_ARG_STR                                      "cardid" 
    46 #define DM_USERNAME_ARG_STR                             "username" 
    47 #define DM_PASSWORD_ARG_STR                             "password" 
    48  
    49 /**************************************************************************** 
    5029Desc: 
    5130****************************************************************************/ 
     
    6342        int                                                     iErr = 0; 
    6443        FTKUINT                                         uiLoop; 
    65         const char *                            pszRecipient = NULL; 
    66         const char *                            pszTokenType = NULL; 
    67         const char *                            pszTokenOutputFile = NULL; 
    68         const char *                            pszPrivacyPolicyFile = NULL; 
    69         const char *                            pszCertFile = NULL; 
    70         const char *                            pszUsername = NULL; 
    71         const char *                            pszPassword = NULL; 
    72         const char *                            pszCardId = NULL; 
    73         IF_List *                                       pRequiredClaims = NULL; 
    74         IF_List *                                       pOptionalClaims = NULL; 
    75         IF_List *                                       pIssuerList = NULL; 
    76         IF_List *                                       pCertList = NULL; 
    77         IF_CardStore *                          pCardStore = NULL; 
    78         IF_CardIssuer *                 pCardIssuer = NULL; 
    79         IF_RelyingParty *                       pRecipient = NULL; 
    80         IF_PersistentCard *             pPersistentCard = NULL; 
    81         IF_RSTTemplate *                        pRSTTemplate = NULL; 
    82         IF_CredentialClient *   pCredentialClient = NULL; 
    83         IF_ICard *                                      pCard = NULL;    
    84         IF_URI *                                                pUri = NULL; 
    85         IF_ArgSet *                                     pArgSet = NULL; 
    8644        FTKBOOL                                         bToolkitInitialized = FALSE; 
    8745        FTKBOOL                                         bIssInitialized = FALSE; 
     46        IF_ArgSet *                                     pArgSet = NULL; 
    8847         
    8948        // Initialize the toolkit 
     
    10968        } 
    11069         
    111         // Parse the command line 
    112          
    113         if( RC_BAD( rc = FtkAllocArgSet( &pArgSet))) 
    114         { 
    115                 goto Exit; 
    116         } 
    117          
    118         if( RC_BAD( rc = pArgSet->addArg( FTK_LOG_LEVEL_ARG_STR,  
    119                 "logging level (none, fatal, error, warn, info, debug)",  
    120                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_ALLOWED_STRING_SET,  
    121                 FTK_LOG_LEVEL_NONE, FTK_LOG_LEVEL_FATAL, FTK_LOG_LEVEL_ERROR, 
    122                 FTK_LOG_LEVEL_WARN, FTK_LOG_LEVEL_INFO, FTK_LOG_LEVEL_DEBUG, 0))) 
    123         { 
    124                 goto Exit; 
    125         } 
    126          
    127         if( RC_BAD( rc = pArgSet->addArg( FTK_LOG_FILE_ARG_STR, 
    128                 "log file", 
    129                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    130         { 
    131                 goto Exit; 
    132         } 
    133          
    134         if( RC_BAD( rc = pArgSet->addArg( DM_TEST_ARG_STR,  
    135                 "run a self-test",  
    136                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_NONE))) 
    137         { 
    138                 goto Exit; 
    139         } 
    140          
    141         if( RC_BAD( rc = pArgSet->addArg( DM_GET_TOKEN_ARG_STR,  
    142                 "request a security token",  
    143                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_NONE))) 
    144         { 
    145                 goto Exit; 
    146         } 
    147          
    148         if( RC_BAD( rc = pArgSet->addArg( DM_TRUSTED_ISSUER_URIS_ARG_STR,  
    149                 "trusted token issuer URIs",  
    150                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    151         { 
    152                 goto Exit; 
    153         } 
    154          
    155         if( RC_BAD( rc = pArgSet->addArg( DM_RECIPIENT_ARG_STR,  
    156                 "token recipient",  
    157                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    158         { 
    159                 goto Exit; 
    160         } 
    161          
    162         if( RC_BAD( rc = pArgSet->addArg( DM_REQUIRED_CLAIMS_ARG_STR,  
    163                 "required claims",  
    164                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    165         { 
    166                 goto Exit; 
    167         } 
    168          
    169         if( RC_BAD( rc = pArgSet->addArg( DM_OPTIONAL_CLAIMS_ARG_STR,  
    170                 "optional claims",  
    171                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    172         { 
    173                 goto Exit; 
    174         } 
    175  
    176         if( RC_BAD( rc = pArgSet->addArg( DM_TOKEN_TYPE_ARG_STR,  
    177                 "token type",  
    178                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    179         { 
    180                 goto Exit; 
    181         } 
    182  
    183         if( RC_BAD( rc = pArgSet->addArg( DM_PRIVACY_POLICY_FILE_ARG_STR,  
    184                 "privacy policy file",  
    185                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    186         { 
    187                 goto Exit; 
    188         } 
    189          
    190         if( RC_BAD( rc = pArgSet->addArg( DM_CERT_FILE_ARG_STR,  
    191                 "certificate file",  
    192                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    193         { 
    194                 goto Exit; 
    195         } 
    196          
    197         if( RC_BAD( rc = pArgSet->addArg( DM_TOKEN_OUTPUT_FILE_ARG_STR,  
    198                 "token output file",  
    199                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    200         { 
    201                 goto Exit; 
    202         } 
    203          
    204         if( RC_BAD( rc = pArgSet->addArg( DM_VERSION_ARG_STR, 
    205                 "display product version", 
    206                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_NONE))) 
    207         { 
    208                 goto Exit; 
    209         } 
    210          
    211         if( RC_BAD( rc = pArgSet->addArg( DM_ISSUER_POLICY_ARG_STR, 
    212                 "issuer policy url", 
    213                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    214         { 
    215                 goto Exit; 
    216         } 
    217          
    218         if( RC_BAD( rc = pArgSet->addArg( DM_CARD_ID_ARG_STR, 
    219                 "card ID", 
    220                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    221         { 
    222                 goto Exit; 
    223         } 
    224          
    225         if( RC_BAD( rc = pArgSet->addArg( DM_USERNAME_ARG_STR, 
    226                 "username", 
    227                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    228         { 
    229                 goto Exit; 
    230         } 
    231          
    232         if( RC_BAD( rc = pArgSet->addArg( DM_PASSWORD_ARG_STR, 
    233                 "password", 
    234                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    235         { 
    236                 goto Exit; 
    237         } 
    238          
    239         if( RC_BAD( rc = pArgSet->addArg( DM_SERVER_ARG_STR,  
    240                 "run a simple identity server",  
    241                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_NONE))) 
    242         { 
    243                 goto Exit; 
    244         } 
    245          
    246         if( RC_BAD( rc = FtkGetArgs( pArgSet, TRUE))) 
    247         { 
    248                 goto Exit; 
    249         } 
    250          
    25170        // Initialize the ISS 
    25271         
    253         if( RC_BAD( rc = issInit( pArgSet))) 
     72        if( RC_BAD( rc = issInit( &pArgSet))) 
    25473        { 
    25574                goto Exit; 
     
    25877        bIssInitialized = TRUE; 
    25978         
    260         // Dump the argument list to the log 
    261          
    262         for( uiLoop = 0; uiLoop < (FTKUINT)iArgC; uiLoop++) 
    263         { 
    264                 F_StackDynaBuf<128>             argBuf; 
    265                  
    266                 if( RC_OK( pArgSet->getRawArg( uiLoop, &argBuf))) 
    267                 { 
    268                         f_logPrintf( F_DEBUG_MESSAGE, "Arg %u = %s\n",  
    269                                 uiLoop, f_toccp( &argBuf)); 
    270                 } 
    271         } 
    272          
    27379        // Determine the selector mode based on command-line parameters 
    27480         
    275         if( pArgSet->argIsPresent( DM_VERSION_ARG_STR)) 
     81        if( pArgSet->argIsPresent( ISS_VERSION_ARG_STR)) 
    27682        { 
    27783                F_StackDynaBuf<64>              verBuf; 
     
    28591                goto Exit; 
    28692        } 
    287         else if( pArgSet->argIsPresent( DM_TEST_ARG_STR)) 
     93        else if( pArgSet->argIsPresent( ISS_TEST_ARG_STR)) 
    28894        { 
    28995                if( RC_BAD( rc = issSelfTest())) 
     
    29298                } 
    29399        } 
    294         else if( pArgSet->argIsPresent( DM_SERVER_ARG_STR)) 
     100        else if( pArgSet->argIsPresent( ISS_SERVER_ARG_STR)) 
    295101        { 
    296102                cbisServer(); 
    297103        } 
    298         else if( pArgSet->argIsPresent( DM_GET_TOKEN_ARG_STR)) 
    299         { 
    300                 const char *                    pszRequiredClaims = NULL; 
    301                 const char *                    pszOptionalClaims = NULL; 
    302                 const char *                    pszIssuerList = NULL; 
    303                 F_DynaBuf                               tokenBuf;        
    304                  
    305                 if( pArgSet->argIsPresent( DM_TRUSTED_ISSUER_URIS_ARG_STR)) 
    306                 { 
    307                         pszIssuerList = pArgSet->getString(  
    308                                 DM_TRUSTED_ISSUER_URIS_ARG_STR); 
    309                 } 
    310                  
    311                 if( pArgSet->argIsPresent( DM_RECIPIENT_ARG_STR)) 
    312                 { 
    313                         pszRecipient = pArgSet->getString( DM_RECIPIENT_ARG_STR); 
    314                 } 
    315                 else 
    316                 { 
    317                         FtkPushErrorInfo( "No recipient specified."); 
    318                         rc = RC_SET( NE_FTK_MISSING_COMMAND_LINE_ARG); 
    319                         goto Exit; 
    320                 } 
    321                  
    322                 if( pArgSet->argIsPresent( DM_REQUIRED_CLAIMS_ARG_STR)) 
    323                 { 
    324                         pszRequiredClaims = pArgSet->getString(  
    325                                 DM_REQUIRED_CLAIMS_ARG_STR); 
    326                 } 
    327                  
    328                 if( pArgSet->argIsPresent( DM_OPTIONAL_CLAIMS_ARG_STR)) 
    329                 { 
    330                         pszOptionalClaims = pArgSet->getString(  
    331                                 DM_OPTIONAL_CLAIMS_ARG_STR); 
    332                 } 
    333                  
    334                 if( pArgSet->argIsPresent( DM_TOKEN_TYPE_ARG_STR)) 
    335                 { 
    336                         pszTokenType = pArgSet->getString(  
    337                                 DM_TOKEN_TYPE_ARG_STR); 
    338                 } 
    339                  
    340                 if( pArgSet->argIsPresent( DM_PRIVACY_POLICY_FILE_ARG_STR)) 
    341                 { 
    342                         pszPrivacyPolicyFile = pArgSet->getString(  
    343                                 DM_PRIVACY_POLICY_FILE_ARG_STR); 
    344                 } 
    345                  
    346                 if( pArgSet->argIsPresent( DM_CERT_FILE_ARG_STR)) 
    347                 { 
    348                         pszCertFile = pArgSet->getString(  
    349                                 DM_CERT_FILE_ARG_STR); 
    350                 } 
    351                  
    352                 if( pArgSet->argIsPresent( DM_TOKEN_OUTPUT_FILE_ARG_STR)) 
    353                 { 
    354                         pszTokenOutputFile = pArgSet->getString(  
    355                                 DM_TOKEN_OUTPUT_FILE_ARG_STR); 
    356                 } 
    357                  
    358                 if( pArgSet->argIsPresent( DM_CARD_ID_ARG_STR)) 
    359                 { 
    360                         pszCardId = pArgSet->getString(  
    361                                 DM_CARD_ID_ARG_STR); 
    362                 } 
    363                  
    364                 if( pArgSet->argIsPresent( DM_USERNAME_ARG_STR)) 
    365                 { 
    366                         pszUsername = pArgSet->getString(  
    367                                 DM_USERNAME_ARG_STR); 
    368                 } 
    369                  
    370                 if( pArgSet->argIsPresent( DM_PASSWORD_ARG_STR)) 
    371                 { 
    372                         pszPassword = pArgSet->getString(  
    373                                 DM_PASSWORD_ARG_STR); 
    374                 } 
    375                  
    376                 // Configure the relying party 
    377                          
    378                 if( RC_BAD( rc = issAllocRelyingParty( &pRecipient))) 
     104        else if( pArgSet->argIsPresent( ISS_GET_TOKEN_ARG_STR)) 
     105        { 
     106                if( RC_BAD( rc = issGetTokenNonInteractive( NULL, NULL,  
     107                        NULL, NULL))) 
    379108                { 
    380109                        goto Exit; 
    381110                } 
    382                  
    383                 if( f_isURI( pszRecipient)) 
    384                 { 
    385                         if( RC_BAD( rc = FtkAllocURI( &pUri))) 
    386                         { 
    387                                 goto Exit; 
    388                         } 
    389                          
    390                         if( RC_BAD( rc = pUri->parseURI( pszRecipient))) 
    391                         { 
    392                                 goto Exit; 
    393                         } 
    394                          
    395                         if( !pUri->getServer()) 
    396                         { 
    397                                 rc = RC_SET( NE_FTK_INVALID_URI); 
    398                                 goto Exit; 
    399                         } 
    400                                  
    401                         if( RC_BAD( rc = pRecipient->setURI( pUri))) 
    402                         { 
    403                                 goto Exit; 
    404                         } 
    405                          
    406                         f_logPrintf( F_DEBUG_MESSAGE,  
    407                                         "Recipient server = %s\n", pUri->getServer()); 
    408                                  
    409                         pUri->Release(); 
    410                         pUri = NULL; 
    411                 } 
    412                 else 
    413                 { 
    414                         if( !pszCertFile) 
    415                         { 
    416                                 f_logPrintf( F_DEBUG_MESSAGE, "No certificate file specified.\n"); 
    417                                 rc = RC_SET( NE_FTK_FAILURE); 
    418                                 goto Exit; 
    419                         } 
    420                          
    421                         if( RC_BAD( rc = pRecipient->setSubjectName( pszRecipient))) 
    422                         { 
    423                                 goto Exit; 
    424                         } 
    425                 } 
    426                  
    427                 // Load certificates (intermediate and leaf) 
    428                          
    429                 if( pszCertFile) 
    430                 { 
    431                         f_logPrintf( F_DEBUG_MESSAGE,  
    432                                 "Loading RP certificate file = %s\n", pszCertFile); 
    433                          
    434                         if( RC_BAD( rc = FtkLoadX509CertsFromFile( pszCertFile, &pCertList))) 
    435                         { 
    436                                 goto Exit; 
    437                         } 
    438                          
    439                         f_logPrintf( F_DEBUG_MESSAGE,  
    440                                 "RP certificate file contains %u certificates.\n", 
    441                                 pCertList->size()); 
    442                          
    443                         if( RC_BAD( rc = pRecipient->setCertificateList( pCertList))) 
    444                         { 
    445                                 goto Exit; 
    446                         } 
    447                 } 
    448                  
    449                 // Configure the list of issuers 
    450                  
    451                 if( RC_BAD( issBuildIssuerList( pszIssuerList, &pIssuerList))) 
    452                 { 
    453                         goto Exit; 
    454                 } 
    455                  
    456                 // Import required claims 
    457                  
    458                 if( RC_BAD( rc = FtkImportClaimList( pszRequiredClaims,  
    459                         &pRequiredClaims))) 
    460                 { 
    461                         goto Exit; 
    462                 } 
    463                  
    464                 // Open the card store 
    465                  
    466                 if( RC_BAD( rc = issOpenPrivateStore( &pCardStore))) 
    467                 { 
    468                         goto Exit; 
    469                 } 
    470                  
    471                 // Locate the card 
    472                  
    473                 if( RC_BAD( rc = issFindCardInStore( pCardStore, NULL,  
    474                         pszCardId, &pPersistentCard))) 
    475                 { 
    476                         goto Exit; 
    477                 } 
    478                  
    479                 // Import the card 
    480                  
    481                 if( RC_BAD( rc = issImportCard( pPersistentCard, &pCard))) 
    482                 { 
    483                         goto Exit; 
    484                 } 
    485                  
    486                 // Allocate and configure an RST template 
    487                  
    488                 if( RC_BAD( rc = FtkAllocRSTTemplate( &pRSTTemplate))) 
    489                 { 
    490                         goto Exit; 
    491                 } 
    492                  
    493                 if( RC_BAD( rc = pRSTTemplate->setTokenType( pszTokenType))) 
    494                 { 
    495                         goto Exit; 
    496                 } 
    497                  
    498                 if( RC_BAD( rc = pRSTTemplate->setRequiredClaims( pRequiredClaims))) 
    499                 { 
    500                         goto Exit; 
    501                 } 
    502                  
    503                 // Allocate and configure the credential client 
    504                  
    505                 if( RC_BAD( rc = FtkAllocUnamePwordCC( pszUsername, pszPassword, 
    506                         &pCredentialClient))) 
    507                 { 
    508                         goto Exit; 
    509                 } 
    510                  
    511                 // Get a token 
    512                  
    513                 if( RC_BAD( rc = issGetSecurityToken( NULL, NULL, pRSTTemplate, pCard,  
    514                         pRecipient, pCredentialClient, 0, &tokenBuf, NULL))) 
    515                 { 
    516                         goto Exit; 
    517                 } 
    518          
    519                 // Output the token 
    520                  
    521                 if( !f_strempty( pszTokenOutputFile)) 
    522                 { 
    523                         // Write the token to the specified file                         
    524                          
    525                         if( RC_BAD( rc = f_bufToFile( tokenBuf.getBufferPtr(),  
    526                                 tokenBuf.getDataLength() - 1, pszTokenOutputFile,  
    527                                 FTK_AF_FILE_DEFAULT, FALSE))) 
    528                         { 
    529                                 goto Exit; 
    530                         } 
    531                 } 
    532                 else 
    533                 { 
    534                         // Write the token to stdout 
    535                          
    536                         f_printf( "%s", f_toccp( &tokenBuf)); 
    537                 } 
    538111        } 
    539112 
     
    546119        } 
    547120         
    548         f_release( pCertList); 
    549         f_release( pRequiredClaims); 
    550         f_release( pOptionalClaims); 
    551         f_release( pRecipient); 
    552         f_release( pCardIssuer); 
    553         f_release( pIssuerList); 
    554         f_release( pCard); 
    555         f_release( pPersistentCard); 
    556         f_release( pCardStore); 
    557         f_release( pCredentialClient); 
    558         f_release( pRSTTemplate); 
    559         f_release( pUri); 
    560121        f_release( pArgSet); 
    561  
     122         
    562123        if( bIssInitialized) 
    563124        { 
  • trunk/digitalme/ui/cocoa/xcode/selector/src/main.mm

    r1985 r2459  
    4545        CFURLRef                        pBundleUrl = NULL; 
    4646        CFURLRef                        pExeUrl = NULL; 
     47        IF_ArgSet *             pArgSet = NULL; 
    4748          
    4849        atexit( fnExit); 
     
    9394        } 
    9495         
    95         if( RC_BAD( rc = issInit( argc, argv))) 
     96        if( RC_BAD( rc = issInit( argc, argv, &pArgSet))) 
    9697        { 
    9798                goto Exit; 
     
    140141                        szBundleExe, argExe.getConstCharPtr());  
    141142        } 
    142  
    143         NSApplicationMain( argc, argv); 
     143         
     144        if( pArgSet->argIsPresent( ISS_NON_INTERACTIVE_ARG_STR)) 
     145        { 
     146                if( pArgSet->argIsPresent( ISS_GET_TOKEN_ARG_STR)) 
     147                { 
     148                        if( RC_BAD( rc = issGetTokenNonInteractive( NULL, NULL,  
     149                                NULL, NULL))) 
     150                        { 
     151                                goto Exit; 
     152                        } 
     153                } 
     154        } 
     155        else 
     156        { 
     157                NSApplicationMain( argc, argv); 
     158        } 
    144159           
    145160Exit: 
     161 
     162        if( pArgSet) 
     163        { 
     164                f_release( pArgSet); 
     165        } 
    146166 
    147167        if( pBundleUrl) 
  • trunk/digitalme/ui/gtk/src/gtkcsmain.cpp

    r2394 r2459  
    2525****************************************************************************/ 
    2626 
    27 #define ISS_APP_NAME                                                    "DigitalMe" 
    28  
    29 /**************************************************************************** 
    30 Desc: Command-line parameters 
    31 ****************************************************************************/ 
    32  
    33 #define DM_GET_TOKEN_ARG_STR                            "gettoken" 
    34 #define DM_TRUSTED_ISSUER_URIS_ARG_STR  "issuers" 
    35 #define DM_RECIPIENT_ARG_STR                            "recipient" 
    36 #define DM_REQUIRED_CLAIMS_ARG_STR              "reqclaims" 
    37 #define DM_OPTIONAL_CLAIMS_ARG_STR              "optclaims" 
    38 #define DM_TOKEN_TYPE_ARG_STR                           "tokentype" 
    39 #define DM_PRIVACY_URL_ARG_STR                  "privacyurl" 
    40 #define DM_CERT_FILE_ARG_STR                            "certfile" 
    41 #define DM_TOKEN_OUTPUT_FILE_ARG_STR    "tokenfile" 
    42 #define DM_NON_SECURE_DESKTOP_ARG_STR   "nonsecure" 
    43 #define DM_VERSION_ARG_STR                                      "version" 
    44 #define DM_ISSUER_POLICY_ARG_STR                        "issuerpolicy" 
    45 #define DM_SETUID_ARG_STR                                       "setuid" 
    46 #define DM_MAPTOSIMPLE_ARG_STR                  "maptosimple" 
     27#define ISS_APP_NAME                    "DigitalMe" 
    4728 
    4829/**************************************************************************** 
     
    9576        } 
    9677         
    97         // Parse the command line 
    98          
    99         if( RC_BAD( rc = FtkAllocArgSet( &pArgSet))) 
    100         { 
    101                 goto Exit; 
    102         } 
    103          
    104         if( RC_BAD( rc = pArgSet->addArg( FTK_LOG_LEVEL_ARG_STR,  
    105                 "logging level (none, fatal, error, warn, info, debug)",  
    106                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_ALLOWED_STRING_SET,  
    107                 FTK_LOG_LEVEL_NONE, FTK_LOG_LEVEL_FATAL, FTK_LOG_LEVEL_ERROR, 
    108                 FTK_LOG_LEVEL_WARN, FTK_LOG_LEVEL_INFO, FTK_LOG_LEVEL_DEBUG, 0))) 
    109         { 
    110                 goto Exit; 
    111         } 
    112  
    113         if( RC_BAD( rc = pArgSet->addArg( FTK_LOG_FILE_ARG_STR, 
    114                 "log file", 
    115                 TRUE, F_ARG_OPTION, F_ARG_CONTENT_STRING))) 
    116         { 
    117                 goto Exit; 
    118         } 
    119  
    120         if( RC_BAD( rc = pArgSet->addArg( DM_GET_TOKEN_ARG_STR,  
    121           &nb