From 53d06963fcd9de8040b12dcb0b9c39b5108007b8 Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Mon, 2 Apr 2007 23:28:47 +0000 Subject: [PATCH] Fixed some 64bit platform issues. --- .../library/mechanisms/krb5/linux/get.c | 61 +++++++++++++------ .../library/mechanisms/krb5/windows/get.c | 38 ++++++------ .../linux/CASA_auth_token_client.changes | 11 ++++ 3 files changed, 71 insertions(+), 39 deletions(-) diff --git a/CASA-auth-token/client/library/mechanisms/krb5/linux/get.c b/CASA-auth-token/client/library/mechanisms/krb5/linux/get.c index cebc1b8f..6a6c3484 100644 --- a/CASA-auth-token/client/library/mechanisms/krb5/linux/get.c +++ b/CASA-auth-token/client/library/mechanisms/krb5/linux/get.c @@ -125,7 +125,7 @@ CasaStatus SSCS_CALL AuthTokenIf_GetAuthToken( IN const void *pIfInstance, IN const char *pContext, - IN char *pMechInfo, + IN const char *pMechInfo, IN const char *pHostName, IN void *pCredStoreScope, INOUT char *pTokenBuf, @@ -213,31 +213,52 @@ AuthTokenIf_GetAuthToken( // Process any mechanism information that may have been provided if (pMechInfo) { - // Mechanism information has been provided. Mechanism information - // consists of semicolon delimited settings. The settings are formated - // using the format settingName=settingvalue. No white space is allowed - // as part of the mechanism information. - char *pNextSettingToken; - char *pSettingValueToken = strtok_r(pMechInfo, ";", &pNextSettingToken); - while (pSettingValueToken != NULL) + // Allocate a buffer to hold the mech info so that we can manipulate it + char *pMechInfoInt = malloc(strlen(pMechInfo) + 1); + if (pMechInfoInt) { - char *pNextToken; - char *pSettingName = strtok_r(pSettingValueToken, "=", &pNextToken); - char *pSettingValue = strtok_r(NULL, "=", &pNextToken); - if (pSettingValue) + char *pNextSettingToken; + char *pSettingValueToken; + + // Copy the mechanism info to our work buffer + strcpy(pMechInfoInt, pMechInfo); + + // Mechanism information has been provided. Mechanism information + // consists of semicolon delimited settings. The settings are formated + // using the format settingName=settingvalue. No white space is allowed + // as part of the mechanism information. + pSettingValueToken = strtok_r(pMechInfoInt, ";", &pNextSettingToken); + while (pSettingValueToken != NULL) { - // Process the setting - if (strcasecmp(pSettingName, "SVC_PRINCIPAL") == 0) + char *pNextToken; + char *pSettingName = strtok_r(pSettingValueToken, "=", &pNextToken); + char *pSettingValue = strtok_r(NULL, "=", &pNextToken); + if (pSettingValue) { - pKrbServiceName = pSettingValue; + // Process the setting + if (strcasecmp(pSettingName, "SVC_PRINCIPAL") == 0) + { + pKrbServiceName = pSettingValue; + } } - } - else - { - DbgTrace(0, "-AuthTokenIf_GetAuthToken- Bad setting\n", 0); + else + { + DbgTrace(0, "-AuthTokenIf_GetAuthToken- Bad setting\n", 0); + } + + pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken); } - pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken); + // Free the buffer that we allocated + free(pMechInfoInt); + } + else + { + DbgTrace(0, "-AuthTokenIf_GetAuthToken- Buffer allocation failure\n", 0); + retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, + CASA_FACILITY_PWTOKEN, + CASA_STATUS_INVALID_PARAMETER); + goto exit; } } diff --git a/CASA-auth-token/client/library/mechanisms/krb5/windows/get.c b/CASA-auth-token/client/library/mechanisms/krb5/windows/get.c index 790c65d4..0bec09c3 100644 --- a/CASA-auth-token/client/library/mechanisms/krb5/windows/get.c +++ b/CASA-auth-token/client/library/mechanisms/krb5/windows/get.c @@ -122,16 +122,16 @@ AuthTokenIf_GetAuthToken( // Process any mechanism information that may have been provided if (pMechInfo) { - // Allocate a buffer to hold the mech info so that we can manipulate it - char *pMechInfoInt = malloc(strlen(pMechInfo) + 1); - if (pMechInfoInt) - { + // Allocate a buffer to hold the mech info so that we can manipulate it + char *pMechInfoInt = malloc(strlen(pMechInfo) + 1); + if (pMechInfoInt) + { char *pNextSettingToken; char *pSettingValueToken; - // Copy the mechanism info to our work buffer - strcpy(pMechInfoInt, pMechInfo); - + // Copy the mechanism info to our work buffer + strcpy(pMechInfoInt, pMechInfo); + // Mechanism information has been provided. Mechanism information // consists of semicolon delimited settings. The settings are formated // using the format settingName=settingvalue. No white space is allowed @@ -157,18 +157,18 @@ AuthTokenIf_GetAuthToken( pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken); } - - // Free the buffer that we allocated - free(pMechInfoInt); - } - else - { - DbgTrace(0, "-AuthTokenIf_GetAuthToken- Buffer allocation failure\n", 0); - retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, - CASA_FACILITY_PWTOKEN, - CASA_STATUS_INVALID_PARAMETER); - goto exit; - } + + // Free the buffer that we allocated + free(pMechInfoInt); + } + else + { + DbgTrace(0, "-AuthTokenIf_GetAuthToken- Buffer allocation failure\n", 0); + retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, + CASA_FACILITY_PWTOKEN, + CASA_STATUS_INVALID_PARAMETER); + goto exit; + } } // Check if we need to construct the service name diff --git a/CASA-auth-token/client/package/linux/CASA_auth_token_client.changes b/CASA-auth-token/client/package/linux/CASA_auth_token_client.changes index ef943974..e25c6cdd 100644 --- a/CASA-auth-token/client/package/linux/CASA_auth_token_client.changes +++ b/CASA-auth-token/client/package/linux/CASA_auth_token_client.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Apr 2 17:13:28 MDT 2007 - jluciani@novell.com + +- Cleaned up 64bit platform issues. + +- Fixed BUG245588 which dealt with the devel package windows + install. + +- Fixed BUG258123 which dealt with recovery from errors in a + multi-ATS environment using the same REALMS. + ------------------------------------------------------------------- Wed Mar 21 17:16:22 MDT 2007 - jluciani@novell.com