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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -79,6 +79,7 @@ FILE *pDebugFile; \
|
||||
#define true TRUE
|
||||
#define false FALSE
|
||||
#define strtok_r strtok_s
|
||||
#define strcasecmp strcmpi
|
||||
|
||||
//===[ Inlines functions ]===============================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user