#include "cgiparse.h"
-__declspec(thread) char* pch=NULL;
-
/* Parsing routines modified from NCSA source. */
char *makeword(char *line, char stop)
{
return word;
}
-char *fmakeword(char stop, int *cl)
+char *fmakeword(char stop, int *cl, char** ppch)
{
int wsize;
char *word;
while(1)
{
- word[ll] = *(pch++);
+ word[ll] = *((*ppch)++);
if(ll==wsize-1)
{
word[ll+1] = '\0';
HQUERY ParseQuery(LPEXTENSION_CONTROL_BLOCK lpECB)
{
int cl;
+ char* pch;
HQUERY hQuery=NULL;
HQUERY hLast=NULL;
}
/* hLast is now the current block to use. */
- hLast->value=fmakeword('&',&cl);
+ hLast->value=fmakeword('&',&cl,&pch);
plustospace(hLast->value);
unescape_url(hLast->value);
hLast->name=makeword(hLast->value,'=');
try
{
+ ShibTargetConfig::preinit();
g_Config = &(ShibTargetConfig::init(SHIBTARGET_SHIRE, getenv("SHIBCONFIG")));
ShibINI& ini = g_Config->getINI();
"Filter startup failed with SAML exception, check shire log for help.");
return FALSE;
}
- catch (...)
+ catch (runtime_error& e)
{
- LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL,
- "Filter startup failed with unexpected exception, check shire log for help.");
+ LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what());
return FALSE;
}
{
string assertion;
RM::serialize(*(assertions[0]), assertion);
-// string::size_type lfeed;
-// while ((lfeed=exp.find('\n'))!=string::npos)
-// exp.erase(lfeed,1);
+ string::size_type lfeed;
+ while ((lfeed=assertion.find('\n'))!=string::npos)
+ assertion.erase(lfeed,1);
pn->SetHeader(pfc,"Shib-Attributes:",const_cast<char*>(assertion.c_str()));
}
else
header=header + ';' + value;
}
- pn->SetHeader(pfc,const_cast<char*>(hname),const_cast<char*>(header.c_str()));
+ string hname2=string(hname) + ':';
+ pn->SetHeader(pfc,const_cast<char*>(hname2.c_str()),const_cast<char*>(header.c_str()));
}
}
}
if (e==ERROR_NO_DATA)
return WriteClientError(pfc,"A required variable or header was empty.");
else
- WriteClientError(pfc,"Server detected unexpected IIS error.");
+ return WriteClientError(pfc,"Server detected unexpected IIS error.");
}
catch(...)
{
- WriteClientError(pfc,"Server caught an unknown exception.");
+ return WriteClientError(pfc,"Server caught an unknown exception.");
}
return WriteClientError(pfc,"Server reached unreachable code!");
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 log4cpp.lib xerces-c_2.lib xsec_lib_02.lib advapi32.lib kernel32.lib saml.lib /nologo /dll /machine:I386 /libpath:"C:\log4cpp\lib" /libpath:"C:\xerces-c\lib" /libpath:"..\..\..\opensaml\c\saml\Release" /export:TerminateFilter /export:HttpFilterProc /export:GetFilterVersion
+# ADD LINK32 log4cpp.lib xerces-c_2.lib xsec_lib_02.lib advapi32.lib kernel32.lib saml.lib /nologo /dll /machine:I386 /libpath:"C:\log4cpp\lib" /libpath:"C:\xerces-c\lib" /libpath:"..\..\..\opensaml\c\saml\Release" /export:GetExtensionVersion /export:GetFilterVersion /export:TerminateExtension /export:TerminateFilter /export:HttpFilterProc /export:HttpExtensionProc
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "isapi_shib - Win32 Debug"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 log4cppD.lib xerces-c_2D.lib xsec_lib_02D.lib advapi32.lib kernel32.lib saml.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"C:\debug\log4cpp\lib" /libpath:"C:\debug\xerces-c\lib" /libpath:"..\..\..\opensaml\c\saml\Debug" /export:TerminateFilter /export:HttpFilterProc /export:GetFilterVersion
+# ADD LINK32 log4cppD.lib xerces-c_2D.lib xsec_lib_02D.lib advapi32.lib kernel32.lib saml.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"C:\debug\log4cpp\lib" /libpath:"C:\debug\xerces-c\lib" /libpath:"..\..\..\opensaml\c\saml\Debug" /export:GetExtensionVersion /export:GetFilterVersion /export:TerminateExtension /export:TerminateFilter /export:HttpFilterProc /export:HttpExtensionProc
# SUBTRACT LINK32 /pdb:none
!ENDIF