From 3f35a10763acc6e88cfe569d9ec13b6ddc6035e6 Mon Sep 17 00:00:00 2001 From: Jim Norman Date: Wed, 27 Jun 2007 15:23:08 +0000 Subject: [PATCH] Bug 287768. Added option to use session{USER} keychain to cli. --- CASA/CASA.changes | 5 +++++ CASA/cli/casacli.c | 23 +++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CASA/CASA.changes b/CASA/CASA.changes index 72b11662..ff664309 100644 --- a/CASA/CASA.changes +++ b/CASA/CASA.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 27 09:15:14 MDT 2007 - jnorman@novell.com + +- Bug 287768. Added option to use session(User) keychain to cli + ------------------------------------------------------------------- Fri May 18 16:15:21 MDT 2007 - jnorman@novell.com diff --git a/CASA/cli/casacli.c b/CASA/cli/casacli.c index ac6cc4ec..b678b55a 100644 --- a/CASA/cli/casacli.c +++ b/CASA/cli/casacli.c @@ -52,6 +52,7 @@ char *keyName = NULL; char *uid = NULL; int iAction = 0; +int iUseSessionKeyChain = 0; #define BADCHAR (int)'?' @@ -94,8 +95,16 @@ void* OpenStore(SSCS_KEYCHAIN_ID_T *kc) return NULL; // NSSCS_E_SYSTEM_FAILURE; } - sscs_Utf8Strcpy(kc->keychainID, SSCS_SERVER_KEY_CHAIN_ID); - kc->len = SSCS_S_KC_ID_SERVER_CHARS; + if (iUseSessionKeyChain) + { + sscs_Utf8Strcpy(kc->keychainID, SSCS_SESSION_KEY_CHAIN_ID); + kc->len = SSCS_S_KC_ID_CHARS; + } + else + { + sscs_Utf8Strcpy(kc->keychainID, SSCS_SERVER_KEY_CHAIN_ID); + kc->len = SSCS_S_KC_ID_SERVER_CHARS; + } return context; @@ -493,7 +502,7 @@ int main return 0; } - while ((c = sss_GetOpt(argc, argv, "lLhHsSgGdDrRn=N=k=K=u=U=")) != -1) + while ((c = sss_GetOpt(argc, argv, "lLoOhHsSgGdDrRn=N=k=K=u=U=")) != -1) { //printf("processing arg \r\n"); switch(c) @@ -504,6 +513,11 @@ int main //ListCredentials(); break; + case 'o': + case 'O': + iUseSessionKeyChain = 1; + break; + case 'r': case 'R': iAction = REMOVECREDS; @@ -563,7 +577,8 @@ int main printf(" -n [name] Specify the credential name\r\n"); printf(" -k [key] Specify the key name to set\r\n"); printf(" -u [uid] Specify the UID of the process\r\n"); - + printf("\r\n"); + printf(" -o Override services keychain and use current user(UID) keychain for operation\r\n"); printf("\r\n");