Fixed issues found when testing the auth.policy mechanism_info changes

for the Krb5 and the Pwd mechanisms using a linux client.
This commit is contained in:
Juan Carlos Luciani
2007-03-26 21:45:10 +00:00
parent ee997dee89
commit 5ba91c92a6
7 changed files with 87 additions and 86 deletions

View File

@@ -210,36 +210,36 @@ AuthTokenIf_GetAuthToken(
goto exit;
}
// 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)
{
char *pNextToken;
char *pSettingName = strtok_r(pSettingValueToken, "=", &pNextToken);
char *pSettingValue = strtok_r(NULL, "=", &pNextToken);
if (pSettingValue)
{
// Process the setting
if (strcmpi(pSettingName, "SVC_PRINCIPAL") == 0)
{
pKrbServiceName = pSettingValue;
}
}
else
{
printf("Bad setting\n");
}
pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken);
}
}
// 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)
{
char *pNextToken;
char *pSettingName = strtok_r(pSettingValueToken, "=", &pNextToken);
char *pSettingValue = strtok_r(NULL, "=", &pNextToken);
if (pSettingValue)
{
// Process the setting
if (strcasecmp(pSettingName, "SVC_PRINCIPAL") == 0)
{
pKrbServiceName = pSettingValue;
}
}
else
{
DbgTrace(0, "-AuthTokenIf_GetAuthToken- Bad setting\n", 0);
}
pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken);
}
}
// Check if we need to construct the service name
if (pKrbServiceName == NULL