SPConfig* g_Config = NULL;
string g_unsetHeaderValue;
bool g_checkSpoofing = true;
+ bool g_catchAll = false;
static const char* g_UserDataKey = "_shib_check_user_";
static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);
static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an exception: %s", e.what());
return SERVER_ERROR;
}
-#ifndef _DEBUG
catch (...) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an uncaught exception!");
- return SERVER_ERROR;
+ if (g_catchAll) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_check_user threw an uncaught exception!");
+ return SERVER_ERROR;
+ }
+ throw;
}
-#endif
}
extern "C" int shib_handler(request_rec* r)
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an exception: %s", e.what());
return SERVER_ERROR;
}
-#ifndef _DEBUG
catch (...) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an uncaught exception!");
- return SERVER_ERROR;
+ if (g_catchAll) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_handler threw an uncaught exception!");
+ return SERVER_ERROR;
+ }
+ throw;
}
-#endif
}
/*
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an exception: %s", e.what());
return SERVER_ERROR;
}
-#ifndef _DEBUG
catch (...) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an uncaught exception!");
- return SERVER_ERROR;
+ if (g_catchAll) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, SH_AP_R(r), "shib_auth_checker threw an uncaught exception!");
+ return SERVER_ERROR;
+ }
+ throw;
}
-#endif
}
// Access control plugin that enforces htaccess rules
pair<bool,const char*> unsetValue=props->getString("unsetHeaderValue");
if (unsetValue.first)
g_unsetHeaderValue = unsetValue.second;
- pair<bool,bool> checkSpoofing=props->getBool("checkSpoofing");
- if (checkSpoofing.first && !checkSpoofing.second)
- g_checkSpoofing = false;
+ pair<bool,bool> flag=props->getBool("checkSpoofing");
+ g_checkSpoofing = !flag.first || flag.second;
+ flag=props->getBool("catchAll");
+ g_catchAll = flag.first && flag.second;
}
// Set the cleanup handler
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Release/mod_shib13.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Debug/mod_shib13.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\mod_shib20___Win32_Release/mod_shib20.pch"
- AssemblerListingLocation=".\mod_shib20___Win32_Release/"
- ObjectFile=".\mod_shib20___Win32_Release/"
- ProgramDataBaseFileName=".\mod_shib20___Win32_Release/"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\mod_shib20___Win32_Debug/mod_shib20.pch"
- AssemblerListingLocation=".\mod_shib20___Win32_Debug/"
- ObjectFile=".\mod_shib20___Win32_Debug/"
- ProgramDataBaseFileName=".\mod_shib20___Win32_Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
RuntimeLibrary="2"\r
EnableFunctionLevelLinking="true"\r
RuntimeTypeInfo="true"\r
- PrecompiledHeaderFile=".\mod_shib22___Win32_Release/mod_shib22.pch"\r
- AssemblerListingLocation=".\mod_shib22___Win32_Release/"\r
- ObjectFile=".\mod_shib22___Win32_Release/"\r
- ProgramDataBaseFileName=".\mod_shib22___Win32_Release/"\r
WarningLevel="3"\r
SuppressStartupBanner="true"\r
Detect64BitPortabilityProblems="true"\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="3"\r
RuntimeTypeInfo="true"\r
- PrecompiledHeaderFile=".\mod_shib22___Win32_Debug/mod_shib22.pch"\r
- AssemblerListingLocation=".\mod_shib22___Win32_Debug/"\r
- ObjectFile=".\mod_shib22___Win32_Debug/"\r
- ProgramDataBaseFileName=".\mod_shib22___Win32_Debug/"\r
BrowseInformation="1"\r
WarningLevel="3"\r
SuppressStartupBanner="true"\r
// globals
namespace {
static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);
- static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
+ static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
static const XMLCh name[] = UNICODE_LITERAL_4(n,a,m,e);
static const XMLCh port[] = UNICODE_LITERAL_4(p,o,r,t);
static const XMLCh sslport[] = UNICODE_LITERAL_7(s,s,l,p,o,r,t);
bool g_bNormalizeRequest = true;
string g_unsetHeaderValue;
bool g_checkSpoofing = true;
+ bool g_catchAll = false;
vector<string> g_NoCerts;
}
pair<bool,const char*> unsetValue=props->getString("unsetHeaderValue");
if (unsetValue.first)
g_unsetHeaderValue = unsetValue.second;
- pair<bool,bool> checkSpoofing=props->getBool("checkSpoofing");
- if (checkSpoofing.first && !checkSpoofing.second)
- g_checkSpoofing = false;
+ pair<bool,bool> flag=props->getBool("checkSpoofing");
+ g_checkSpoofing = !flag.first || flag.second;
+ flag=props->getBool("catchAll");
+ g_catchAll = flag.first && flag.second;
+
const DOMElement* impl=XMLHelper::getFirstChildElement(props->getElement(),Implementation);
if (impl && (impl=XMLHelper::getFirstChildElement(impl,ISAPI))) {
const XMLCh* flag=impl->getAttributeNS(NULL,normalizeRequest);
LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what());
return WriteClientError(pfc,"Shibboleth Filter caught an exception, check Event Log for details.");
}
-#ifndef _DEBUG
catch(...) {
- return WriteClientError(pfc,"Shibboleth Filter caught an unknown exception.");
+ if (g_catchAll)
+ return WriteClientError(pfc,"Shibboleth Filter caught an unknown exception.");
+ throw;
}
-#endif
return WriteClientError(pfc,"Shibboleth Filter reached unreachable code, save my walrus!");
}
LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL, e.what());
return WriteClientError(lpECB,"Shibboleth Extension caught an exception, check Event Log for details.");
}
-#ifndef _DEBUG
catch(...) {
- return WriteClientError(lpECB,"Shibboleth Extension caught an unknown exception.");
+ if (g_catchAll)
+ return WriteClientError(lpECB,"Shibboleth Extension caught an unknown exception.");
+ throw;
}
-#endif
// If we get here we've got an error.
return HSE_STATUS_ERROR;
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Release/isapi_shib.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Debug/isapi_shib.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
string g_ServerScheme;
string g_unsetHeaderValue;
bool g_checkSpoofing = true;
+ bool g_catchAll = false;
static const XMLCh path[] = UNICODE_LITERAL_4(p,a,t,h);
static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);
pair<bool,const char*> unsetValue=props->getString("unsetHeaderValue");
if (unsetValue.first)
g_unsetHeaderValue = unsetValue.second;
- pair<bool,bool> checkSpoofing=props->getBool("checkSpoofing");
- if (checkSpoofing.first && !checkSpoofing.second)
- g_checkSpoofing = false;
+ pair<bool,bool> flag=props->getBool("checkSpoofing");
+ g_checkSpoofing = !flag.first || flag.second;
+ flag=props->getBool("catchAll");
+ g_catchAll = flag.first && flag.second;
}
return REQ_PROCEED;
}
log_error(LOG_FAILURE,FUNC,sn,rq,const_cast<char*>(e.what()));
return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an exception, see web server log for error.");
}
-#ifndef _DEBUG
catch (...) {
- return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an uncaught exception.");
+ if (g_catchAll)
+ return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an uncaught exception.");
+ throw;
}
-#endif
}
log_error(LOG_FAILURE,FUNC,sn,rq,const_cast<char*>(e.what()));
return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an exception, see web server log for error.");
}
-#ifndef _DEBUG
catch (...) {
- return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an unknown exception.");
+ if (g_catchAll)
+ return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an unknown exception.");
+ throw;
}
-#endif
}
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Release/nsapi_shib.pch"
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
RuntimeTypeInfo="true"
- PrecompiledHeaderFile=".\Debug/nsapi_shib.pch"
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
<attribute name="logger" type="anyURI"/>\r
<attribute name="unsetHeaderValue" type="string"/>\r
<attribute name="checkSpoofing" type="boolean"/>\r
+ <attribute name="catchAll" type="boolean"/>\r
<anyAttribute namespace="##other" processContents="lax"/>\r
</complexType>\r
</element>\r