Fixed some 64bit platform issues.

This commit is contained in:
Juan Carlos Luciani 2007-04-02 23:28:47 +00:00
parent 1dd90307b7
commit 53d06963fc
3 changed files with 71 additions and 39 deletions

View File

@ -125,7 +125,7 @@ CasaStatus SSCS_CALL
AuthTokenIf_GetAuthToken( AuthTokenIf_GetAuthToken(
IN const void *pIfInstance, IN const void *pIfInstance,
IN const char *pContext, IN const char *pContext,
IN char *pMechInfo, IN const char *pMechInfo,
IN const char *pHostName, IN const char *pHostName,
IN void *pCredStoreScope, IN void *pCredStoreScope,
INOUT char *pTokenBuf, INOUT char *pTokenBuf,
@ -213,31 +213,52 @@ AuthTokenIf_GetAuthToken(
// Process any mechanism information that may have been provided // Process any mechanism information that may have been provided
if (pMechInfo) if (pMechInfo)
{ {
// Mechanism information has been provided. Mechanism information // Allocate a buffer to hold the mech info so that we can manipulate it
// consists of semicolon delimited settings. The settings are formated char *pMechInfoInt = malloc(strlen(pMechInfo) + 1);
// using the format settingName=settingvalue. No white space is allowed if (pMechInfoInt)
// as part of the mechanism information.
char *pNextSettingToken;
char *pSettingValueToken = strtok_r(pMechInfo, ";", &pNextSettingToken);
while (pSettingValueToken != NULL)
{ {
char *pNextToken; char *pNextSettingToken;
char *pSettingName = strtok_r(pSettingValueToken, "=", &pNextToken); char *pSettingValueToken;
char *pSettingValue = strtok_r(NULL, "=", &pNextToken);
if (pSettingValue) // 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 char *pNextToken;
if (strcasecmp(pSettingName, "SVC_PRINCIPAL") == 0) 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
else {
{ DbgTrace(0, "-AuthTokenIf_GetAuthToken- Bad setting\n", 0);
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;
} }
} }

View File

@ -122,16 +122,16 @@ AuthTokenIf_GetAuthToken(
// Process any mechanism information that may have been provided // Process any mechanism information that may have been provided
if (pMechInfo) if (pMechInfo)
{ {
// Allocate a buffer to hold the mech info so that we can manipulate it // Allocate a buffer to hold the mech info so that we can manipulate it
char *pMechInfoInt = malloc(strlen(pMechInfo) + 1); char *pMechInfoInt = malloc(strlen(pMechInfo) + 1);
if (pMechInfoInt) if (pMechInfoInt)
{ {
char *pNextSettingToken; char *pNextSettingToken;
char *pSettingValueToken; char *pSettingValueToken;
// Copy the mechanism info to our work buffer // Copy the mechanism info to our work buffer
strcpy(pMechInfoInt, pMechInfo); strcpy(pMechInfoInt, pMechInfo);
// Mechanism information has been provided. Mechanism information // Mechanism information has been provided. Mechanism information
// consists of semicolon delimited settings. The settings are formated // consists of semicolon delimited settings. The settings are formated
// using the format settingName=settingvalue. No white space is allowed // using the format settingName=settingvalue. No white space is allowed
@ -157,18 +157,18 @@ AuthTokenIf_GetAuthToken(
pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken); pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken);
} }
// Free the buffer that we allocated // Free the buffer that we allocated
free(pMechInfoInt); free(pMechInfoInt);
} }
else else
{ {
DbgTrace(0, "-AuthTokenIf_GetAuthToken- Buffer allocation failure\n", 0); DbgTrace(0, "-AuthTokenIf_GetAuthToken- Buffer allocation failure\n", 0);
retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR, retStatus = CasaStatusBuild(CASA_SEVERITY_ERROR,
CASA_FACILITY_PWTOKEN, CASA_FACILITY_PWTOKEN,
CASA_STATUS_INVALID_PARAMETER); CASA_STATUS_INVALID_PARAMETER);
goto exit; goto exit;
} }
} }
// Check if we need to construct the service name // Check if we need to construct the service name

View File

@ -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 Wed Mar 21 17:16:22 MDT 2007 - jluciani@novell.com