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

View File

@@ -119,36 +119,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 (strcmpi(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

View File

@@ -316,9 +316,9 @@ AuthTokenIf_GetAuthToken(
if (pSettingValue)
{
// Process the setting
if (strcmpi(pSettingName, "REALM_CREDENTIALS_ONLY") == 0)
if (strcasecmp(pSettingName, "REALM_CREDENTIALS_ONLY") == 0)
{
if (strcmpi(pSettingValue, "true") == 0)
if (strcasecmp(pSettingValue, "true") == 0)
{
realm_credentials_only = true;
}
@@ -326,7 +326,7 @@ AuthTokenIf_GetAuthToken(
}
else
{
printf("Bad setting\n");
DbgTrace(0, "-AuthTokenIf_GetAuthToken- Bad setting\n", 0);
}
pSettingValueToken = strtok_r(NULL, ";", &pNextSettingToken);

View File

@@ -79,6 +79,7 @@ FILE *pDebugFile; \
#define true TRUE
#define false FALSE
#define strtok_r strtok_s
#define strcasecmp strcmpi
//===[ Inlines functions ]===============================================