Made the following changes:
- Use host name specified in ObtainAuthToken call instead of the
normalized host name to connect to the ATS to avoid problems
when the host name obtained through a reverse DNS lookup fails
to resolve via a forward DNS lookup.
- Added the capability log debug messages to a file.
- Added method to the ConfigIf to free memory returned by calls to
getEntryValue to avoid issues related to freeing memory allocated
with a heap different than the one owned by the library freeing
the memory.
This commit is contained in:
@@ -128,12 +128,20 @@ AuthTokenIf_ReleaseReference(
|
||||
CasaStatus SSCS_CALL
|
||||
GET_AUTH_TOKEN_INTERFACE_RTN(
|
||||
IN const ConfigIf *pModuleConfigIf,
|
||||
IN const int debugLevel,
|
||||
IN const char *pDebugFilePath,
|
||||
INOUT AuthTokenIf **ppAuthTokenIf)
|
||||
//
|
||||
// Arguments:
|
||||
// pModuleConfigIf -
|
||||
// Pointer to configuration interface instance for the module.
|
||||
//
|
||||
// debugLevel -
|
||||
// Level to utilize for debugging, 0 being lowest.
|
||||
//
|
||||
// pDebugFilePath -
|
||||
// Path to debug log file. Can be NULL.
|
||||
//
|
||||
// ppAuthTokenIf -
|
||||
// Pointer to variable that will receive pointer to AuthTokenIf
|
||||
// instance.
|
||||
@@ -150,6 +158,7 @@ GET_AUTH_TOKEN_INTERFACE_RTN(
|
||||
CasaStatus retStatus;
|
||||
AuthTokenIfInstance *pAuthTokenIfInstance;
|
||||
char *pDebugLevelSetting;
|
||||
char *pDebugLogFolderPathSetting;
|
||||
|
||||
DbgTrace(1, "-GetAuthTokenInterface- Start\n", 0);
|
||||
|
||||
@@ -165,17 +174,20 @@ GET_AUTH_TOKEN_INTERFACE_RTN(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// Check if a DebugLevel has been configured
|
||||
pDebugLevelSetting = pModuleConfigIf->getEntryValue(pModuleConfigIf, "DebugLevel");
|
||||
if (pDebugLevelSetting != NULL)
|
||||
// Save debug parameters
|
||||
KrbMechDebugLevel = debugLevel;
|
||||
if (pDebugFilePath)
|
||||
{
|
||||
DbgTrace(0, "-GetAuthTokenInterface- DebugLevel configured = %s\n", pDebugLevelSetting);
|
||||
|
||||
// Convert the number to hex
|
||||
DebugLevel = (int) dtoul(pDebugLevelSetting, strlen(pDebugLevelSetting));
|
||||
|
||||
// Free the buffer holding the debug level
|
||||
free(pDebugLevelSetting);
|
||||
// Use the setting to come up with the path to the debug log file
|
||||
pKrbMechDebugLogFilePath = malloc(strlen(pDebugFilePath) + 1);
|
||||
if (pKrbMechDebugLogFilePath)
|
||||
{
|
||||
strcpy(pKrbMechDebugLogFilePath, pDebugFilePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DbgTrace(0, "-GetAuthTokenInterface- Failed to allocate buffer for debug file path\n", 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Allocate space for the interface instance
|
||||
|
||||
Reference in New Issue
Block a user