[cpp-sp] branch master updated: MSVC conformance mode, numerous string literal fixes.
Scott Cantor
cantor.2 at osu.edu
Mon May 21 21:47:04 EDT 2018
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=5c00353b9719cd16ffa5c7119e7701cb5240615b
The following commit(s) were added to refs/heads/master by this push:
new 5c00353 MSVC conformance mode, numerous string literal fixes.
5c00353 is described below
commit 5c00353b9719cd16ffa5c7119e7701cb5240615b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon May 21 21:46:58 2018 -0400
MSVC conformance mode, numerous string literal fixes.
---
Projects/vc15/UnitTests/UnitTests.vcxproj | 4 +
Projects/vc15/adfs/adfs-lite.vcxproj | 4 +
Projects/vc15/adfs/adfs.vcxproj | 4 +
Projects/vc15/apache/mod_shib22.vcxproj | 4 +
Projects/vc15/apache/mod_shib24.vcxproj | 4 +
Projects/vc15/isapi_shib/isapi_shib.vcxproj | 4 +
.../vc15/memcache-store/memcache-store.vcxproj | 4 +
Projects/vc15/nsapi_shib/nsapi_shib.vcxproj | 4 +
Projects/vc15/odbc-store/odbc-store.vcxproj | 4 +
Projects/vc15/plugins/plugins-lite.vcxproj | 4 +
Projects/vc15/plugins/plugins.vcxproj | 4 +
Projects/vc15/shibd/shibd.vcxproj | 4 +
Projects/vc15/shibsp/shibsp-lite.vcxproj | 4 +
Projects/vc15/shibsp/shibsp.vcxproj | 4 +
Projects/vc15/util/mdquery.vcxproj | 4 +
Projects/vc15/util/resolvertest.vcxproj | 4 +
apache/mod_shib.cpp | 14 ++-
iis7_shib/ShibUser.cpp | 3 +-
isapi_shib/isapi_shib.cpp | 135 ++++++++++++++-------
nsapi_shib/nsapi_shib.cpp | 53 +++++---
shibd/shibd_win32.cpp | 4 +-
util/mdquery.cpp | 16 ++-
util/resolvertest.cpp | 4 +-
23 files changed, 213 insertions(+), 80 deletions(-)
diff --git a/Projects/vc15/UnitTests/UnitTests.vcxproj b/Projects/vc15/UnitTests/UnitTests.vcxproj
index 9e5c29f..416a6a5 100644
--- a/Projects/vc15/UnitTests/UnitTests.vcxproj
+++ b/Projects/vc15/UnitTests/UnitTests.vcxproj
@@ -93,6 +93,7 @@
<AdditionalIncludeDirectories>$(solutionDir)\..\..\..\;$(solutionDir)\..\..\;$(solutionDir)\..\..\..\cpp-opensaml;$(solutionDir)\..\..\..\cpp-xmltooling;$(OutDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>shibsp3D.lib;log4shib1D.lib;xmltooling3D.lib;saml3D.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -107,6 +108,7 @@
<AdditionalIncludeDirectories>$(solutionDir)\..\..\..\;$(solutionDir)\..\..\;$(solutionDir)\..\..\..\cpp-opensaml;$(solutionDir)\..\..\..\cpp-xmltooling;$(OutDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>shibsp3D.lib;log4shib1D.lib;xmltooling3D.lib;saml3D.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -122,6 +124,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(solutionDir)\..\..\..\;$(solutionDir)\..\..\;$(solutionDir)\..\..\..\cpp-opensaml;$(solutionDir)\..\..\..\cpp-xmltooling;$(OutDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -139,6 +142,7 @@
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(solutionDir)\..\..\..\;$(solutionDir)\..\..\;$(solutionDir)\..\..\..\cpp-opensaml;$(solutionDir)\..\..\..\cpp-xmltooling;$(OutDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
diff --git a/Projects/vc15/adfs/adfs-lite.vcxproj b/Projects/vc15/adfs/adfs-lite.vcxproj
index 659f548..c4c543c 100644
--- a/Projects/vc15/adfs/adfs-lite.vcxproj
+++ b/Projects/vc15/adfs/adfs-lite.vcxproj
@@ -106,6 +106,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>SHIBSP_LITE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -132,6 +133,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>SHIBSP_LITE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -152,6 +154,7 @@
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -177,6 +180,7 @@
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/adfs/adfs.vcxproj b/Projects/vc15/adfs/adfs.vcxproj
index bfaf7a4..e2f14a7 100644
--- a/Projects/vc15/adfs/adfs.vcxproj
+++ b/Projects/vc15/adfs/adfs.vcxproj
@@ -111,6 +111,7 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -138,6 +139,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -159,6 +161,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;saml3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -182,6 +185,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;saml3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/apache/mod_shib22.vcxproj b/Projects/vc15/apache/mod_shib22.vcxproj
index fc26470..05e9e69 100644
--- a/Projects/vc15/apache/mod_shib22.vcxproj
+++ b/Projects/vc15/apache/mod_shib22.vcxproj
@@ -119,6 +119,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -155,6 +156,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -190,6 +192,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -225,6 +228,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/apache/mod_shib24.vcxproj b/Projects/vc15/apache/mod_shib24.vcxproj
index ff071b9..855cd06 100644
--- a/Projects/vc15/apache/mod_shib24.vcxproj
+++ b/Projects/vc15/apache/mod_shib24.vcxproj
@@ -110,6 +110,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -137,6 +138,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -163,6 +165,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -189,6 +192,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/isapi_shib/isapi_shib.vcxproj b/Projects/vc15/isapi_shib/isapi_shib.vcxproj
index eb647d9..ca2acf4 100644
--- a/Projects/vc15/isapi_shib/isapi_shib.vcxproj
+++ b/Projects/vc15/isapi_shib/isapi_shib.vcxproj
@@ -116,6 +116,7 @@
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -151,6 +152,7 @@
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -184,6 +186,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -217,6 +220,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/memcache-store/memcache-store.vcxproj b/Projects/vc15/memcache-store/memcache-store.vcxproj
index a696278..484725a 100644
--- a/Projects/vc15/memcache-store/memcache-store.vcxproj
+++ b/Projects/vc15/memcache-store/memcache-store.vcxproj
@@ -108,6 +108,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -132,6 +133,7 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -150,6 +152,7 @@
<AdditionalIncludeDirectories>.;..;..\..\..\..\cpp-xmltooling;$(BuildRoot)\libmemcached;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xmltooling3.lib;memcached.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -170,6 +173,7 @@
<AdditionalIncludeDirectories>..\..\..\..\cpp-xmltooling;..\..\..\libmemcached\visualc\toolset;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/nsapi_shib/nsapi_shib.vcxproj b/Projects/vc15/nsapi_shib/nsapi_shib.vcxproj
index 7f61faa..32c7031 100644
--- a/Projects/vc15/nsapi_shib/nsapi_shib.vcxproj
+++ b/Projects/vc15/nsapi_shib/nsapi_shib.vcxproj
@@ -117,6 +117,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<CompileAs>Default</CompileAs>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -149,6 +150,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel>
<CompileAs>Default</CompileAs>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -180,6 +182,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -211,6 +214,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/odbc-store/odbc-store.vcxproj b/Projects/vc15/odbc-store/odbc-store.vcxproj
index 808385f..a2d9ade 100644
--- a/Projects/vc15/odbc-store/odbc-store.vcxproj
+++ b/Projects/vc15/odbc-store/odbc-store.vcxproj
@@ -109,6 +109,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -134,6 +135,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -153,6 +155,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -174,6 +177,7 @@
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/plugins/plugins-lite.vcxproj b/Projects/vc15/plugins/plugins-lite.vcxproj
index 28f249e..98096db 100644
--- a/Projects/vc15/plugins/plugins-lite.vcxproj
+++ b/Projects/vc15/plugins/plugins-lite.vcxproj
@@ -108,6 +108,7 @@
<AdditionalIncludeDirectories>..\..\..\plugins\;..\..\..\;..\..\..\..\cpp-xmltooling;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -133,6 +134,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -157,6 +159,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\plugins\;..\..\..\;..\..\..\..\cpp-xmltooling;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -178,6 +181,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xmltooling-lite3.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/plugins/plugins.vcxproj b/Projects/vc15/plugins/plugins.vcxproj
index 7e238da..7c28c51 100644
--- a/Projects/vc15/plugins/plugins.vcxproj
+++ b/Projects/vc15/plugins/plugins.vcxproj
@@ -112,6 +112,7 @@
<AdditionalIncludeDirectories>..\..\..\plugins\;..\..\..\;..\..\..\..\cpp-opensaml;..\..\..\..\cpp-xmltooling;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MinimalRebuild>false</MinimalRebuild>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -137,6 +138,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -161,6 +163,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\plugins\;..\..\..\;..\..\..\..\cpp-opensaml;..\..\..\..\cpp-xmltooling;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -182,6 +185,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;saml3.lib;xmltooling3.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/shibd/shibd.vcxproj b/Projects/vc15/shibd/shibd.vcxproj
index 9cf82bc..6169054 100644
--- a/Projects/vc15/shibd/shibd.vcxproj
+++ b/Projects/vc15/shibd/shibd.vcxproj
@@ -110,6 +110,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -140,6 +141,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -168,6 +170,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -197,6 +200,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/shibsp/shibsp-lite.vcxproj b/Projects/vc15/shibsp/shibsp-lite.vcxproj
index f71a007..5c95f10 100644
--- a/Projects/vc15/shibsp/shibsp-lite.vcxproj
+++ b/Projects/vc15/shibsp/shibsp-lite.vcxproj
@@ -105,6 +105,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;SHIBSP_LITE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -131,6 +132,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;SHIBSP_LITE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -151,6 +153,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -176,6 +179,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;SHIBSP_LITE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/shibsp/shibsp.vcxproj b/Projects/vc15/shibsp/shibsp.vcxproj
index a79f5a8..29a1294 100644
--- a/Projects/vc15/shibsp/shibsp.vcxproj
+++ b/Projects/vc15/shibsp/shibsp.vcxproj
@@ -109,6 +109,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -135,6 +136,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_UNICODE;UNICODE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -155,6 +157,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xsec_2.lib;saml3.lib;xmltooling3.lib;wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -177,6 +180,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<AdditionalDependencies>log4shib1.lib;xerces-c_3.lib;xsec_2.lib;saml3.lib;xmltooling3.lib;wsock32.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
diff --git a/Projects/vc15/util/mdquery.vcxproj b/Projects/vc15/util/mdquery.vcxproj
index 3a284da..6efbc74 100644
--- a/Projects/vc15/util/mdquery.vcxproj
+++ b/Projects/vc15/util/mdquery.vcxproj
@@ -109,6 +109,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -138,6 +139,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -166,6 +168,7 @@
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -195,6 +198,7 @@
<BrowseInformation>false</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/Projects/vc15/util/resolvertest.vcxproj b/Projects/vc15/util/resolvertest.vcxproj
index a48cb22..0f7c59c 100644
--- a/Projects/vc15/util/resolvertest.vcxproj
+++ b/Projects/vc15/util/resolvertest.vcxproj
@@ -112,6 +112,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -142,6 +143,7 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -171,6 +173,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -201,6 +204,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4275</DisableSpecificWarnings>
+ <ConformanceMode>true</ConformanceMode>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
diff --git a/apache/mod_shib.cpp b/apache/mod_shib.cpp
index fac5fd3..39bff53 100644
--- a/apache/mod_shib.cpp
+++ b/apache/mod_shib.cpp
@@ -27,10 +27,11 @@
#define SHIBSP_LITE
#ifdef SOLARIS2
-#undef _XOPEN_SOURCE // causes gethostname conflict in unistd.h
+# undef _XOPEN_SOURCE // causes gethostname conflict in unistd.h
#endif
#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
# define _CRT_NONSTDC_NO_DEPRECATE 1
# define _CRT_SECURE_NO_DEPRECATE 1
#endif
@@ -115,7 +116,8 @@ namespace {
bool g_checkSpoofing = true;
bool g_catchAll = false;
#ifndef SHIB_APACHE_13
- char* g_szGSSContextKey = "mod_auth_gssapi:gss_ctx";
+ static char _defaultGSSKey[] = "mod_auth_gssapi:gss_ctx";
+ char* g_szGSSContextKey = _defaultGSSKey;
#endif
static const char* g_UserDataKey = "urn:mace:shibboleth:Apache:shib_check_user";
}
@@ -772,6 +774,8 @@ static int shib_post_read(request_rec *r)
// SP handler requests if it detects a handler URL.
extern "C" int shib_check_user(request_rec* r)
{
+ static char _emptystr[] = "";
+
// Short-circuit entirely?
if (((shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib))->bOff == 1)
return DECLINED;
@@ -813,7 +817,7 @@ extern "C" int shib_check_user(request_rec* r)
// for an empty string. If this turns out to cause trouble, there's no solution except
// to set a dummy ID any time it's not set.
if (res.second == OK && !r->user)
- r->user = "";
+ r->user = _emptystr;
#endif
return res.second;
}
@@ -824,7 +828,7 @@ extern "C" int shib_check_user(request_rec* r)
#ifdef SHIB_APACHE_24
// See above for explanation of this hack.
if (res.second == OK && !r->user)
- r->user = "";
+ r->user = _emptystr;
#endif
return res.second;
}
@@ -832,7 +836,7 @@ extern "C" int shib_check_user(request_rec* r)
#ifdef SHIB_APACHE_24
// See above for explanation of this hack.
if (!r->user)
- r->user = "";
+ r->user = _emptystr;
#endif
return OK;
}
diff --git a/iis7_shib/ShibUser.cpp b/iis7_shib/ShibUser.cpp
index 783784a..1b43d7a 100644
--- a/iis7_shib/ShibUser.cpp
+++ b/iis7_shib/ShibUser.cpp
@@ -105,6 +105,7 @@ ShibUser::IsInRole(_In_ PCWSTR pszRoleName, _Out_ BOOL * pfInRole)
PVOID
ShibUser::GetUserVariable(_In_ PCSTR pszVariableName)
{
- return "";
+ static char empty[] = "";
+ return empty;
}
diff --git a/isapi_shib/isapi_shib.cpp b/isapi_shib/isapi_shib.cpp
index 289d34e..a2f716c 100644
--- a/isapi_shib/isapi_shib.cpp
+++ b/isapi_shib/isapi_shib.cpp
@@ -350,14 +350,19 @@ public:
ShibTargetIsapiF(PHTTP_FILTER_CONTEXT pfc, PHTTP_FILTER_PREPROC_HEADERS pn, const site_t& site)
: AbstractSPRequest(SHIBSP_LOGCAT ".ISAPI"), m_pfc(pfc), m_pn(pn), m_allhttp(4096), m_firsttime(true) {
+ static char _url[] = "url";
+ static char _SERVER_PORT[] = "SERVER_PORT";
+ static char _SERVER_NAME[] = "SERVER_NAME";
+ static char _ShibSpoofCheck[] = "ShibSpoofCheck:";
+
// URL path always come from IIS.
dynabuf var(256);
- GetHeader("url",var,256,false);
+ GetHeader(_url,var,256,false);
setRequestURI(var);
// Port may come from IIS or from site def.
if (!g_bNormalizeRequest || (pfc->fIsSecurePort && site.m_sslport.empty()) || (!pfc->fIsSecurePort && site.m_port.empty())) {
- GetServerVariable("SERVER_PORT",var,10);
+ GetServerVariable(_SERVER_PORT,var,10);
if (var.empty()) {
m_port = pfc->fIsSecurePort ? 443 : 80;
}
@@ -377,7 +382,7 @@ public:
if (m_scheme.empty() || !g_bNormalizeRequest)
m_scheme=pfc->fIsSecurePort ? "https" : "http";
- GetServerVariable("SERVER_NAME",var,32);
+ GetServerVariable(_SERVER_NAME,var,32);
// Make sure SERVER_NAME is "authorized" for use on this site. If not, or empty, set to canonical name.
if (var.empty()) {
@@ -390,7 +395,7 @@ public:
}
if (!g_spoofKey.empty()) {
- GetHeader("ShibSpoofCheck:", var, 32, false);
+ GetHeader(_ShibSpoofCheck, var, 32, false);
if (!var.empty() && g_spoofKey == (char*)var)
m_firsttime = false;
}
@@ -415,28 +420,31 @@ public:
return uri ? (uri + 1) : nullptr;
}
const char* getMethod() const {
+ static char _HTTP_METHOD[] = "HTTP_METHOD";
if (m_method.empty()) {
dynabuf var(5);
- GetServerVariable("HTTP_METHOD",var,5,false);
+ GetServerVariable(_HTTP_METHOD,var,5,false);
if (!var.empty())
m_method = var;
}
return m_method.c_str();
}
string getContentType() const {
+ static char _HTTP_CONTENT_TYPE[] = "HTTP_CONTENT_TYPE";
if (m_content_type.empty()) {
dynabuf var(32);
- GetServerVariable("HTTP_CONTENT_TYPE",var,32,false);
+ GetServerVariable(_HTTP_CONTENT_TYPE,var,32,false);
if (!var.empty())
m_content_type = var;
}
return m_content_type;
}
string getRemoteAddr() const {
+ static char _REMOTE_ADDR[] = "REMOTE_ADDR";
m_remote_addr = AbstractSPRequest::getRemoteAddr();
if (m_remote_addr.empty()) {
dynabuf var(16);
- GetServerVariable("REMOTE_ADDR",var,16,false);
+ GetServerVariable(_REMOTE_ADDR,var,16,false);
if (!var.empty())
m_remote_addr = var;
}
@@ -456,9 +464,12 @@ public:
return (hdr + ':');
}
void clearHeader(const char* rawname, const char* cginame) {
+ static char _ALL_HTTP[] = "ALL_HTTP";
+ static char _REMOTE_USER[] = "remote-user:";
+
if (g_checkSpoofing && m_firsttime) {
if (m_allhttp.empty())
- GetServerVariable( "ALL_HTTP", m_allhttp, 4096, false);
+ GetServerVariable(_ALL_HTTP, m_allhttp, 4096, false);
if (!m_allhttp.empty()) {
string hdr = g_bSafeHeaderNames ? ("HTTP_" + makeSafeHeader(cginame + 5)) : (string(cginame) + ':');
if (strstr(m_allhttp, hdr.c_str()))
@@ -470,8 +481,8 @@ public:
m_pn->SetHeader(m_pfc, const_cast<char*>(hdr.c_str()), const_cast<char*>(g_unsetHeaderValue.c_str()));
}
else if (!strcmp(rawname,"REMOTE_USER")) {
- m_pn->SetHeader(m_pfc, "remote-user:", const_cast<char*>(g_unsetHeaderValue.c_str()));
- m_pn->SetHeader(m_pfc, "remote_user:", const_cast<char*>(g_unsetHeaderValue.c_str()));
+ m_pn->SetHeader(m_pfc, _REMOTE_USER, const_cast<char*>(g_unsetHeaderValue.c_str()));
+ m_pn->SetHeader(m_pfc, _REMOTE_USER, const_cast<char*>(g_unsetHeaderValue.c_str()));
}
else {
string hdr = string(rawname) + ':';
@@ -486,14 +497,14 @@ public:
string hdr = g_bSafeHeaderNames ? makeSafeHeader(name) : (string(name) + ':');
dynabuf buf(256);
GetHeader(const_cast<char*>(hdr.c_str()), buf, 256, false);
- return string(buf.empty() ? "" : buf);
+ return string(buf.empty() ? "" : static_cast<char*>(buf));
}
string getHeader(const char* name) const {
string hdr(name);
hdr += ':';
dynabuf buf(256);
GetHeader(const_cast<char*>(hdr.c_str()), buf, 256, false);
- return string(buf.empty() ? "" : buf);
+ return string(buf.empty() ? "" : static_cast<char*>(buf));
}
void setRemoteUser(const char* user) {
setHeader("remote-user", user);
@@ -538,6 +549,7 @@ public:
return SF_STATUS_REQ_FINISHED;
}
long sendRedirect(const char* url) {
+ static char _status[] = "302 Please Wait";
HTTPResponse::sendRedirect(url);
string hdr=string("Location: ") + url + "\r\n"
"Content-Type: text/html\r\n"
@@ -547,7 +559,7 @@ public:
for (multimap<string,string>::const_iterator i = m_headers.begin(); i != m_headers.end(); ++i)
hdr += i->first + ": " + i->second + "\r\n";
hdr += "\r\n";
- m_pfc->ServerSupportFunction(m_pfc, SF_REQ_SEND_RESPONSE_HEADER, "302 Please Wait", (ULONG_PTR)hdr.c_str(), 0);
+ m_pfc->ServerSupportFunction(m_pfc, SF_REQ_SEND_RESPONSE_HEADER, _status, (ULONG_PTR)hdr.c_str(), 0);
static const char* redmsg="<HTML><BODY>Redirecting...</BODY></HTML>";
DWORD resplen=40;
m_pfc->WriteClient(m_pfc, (LPVOID)redmsg, &resplen, 0);
@@ -605,19 +617,21 @@ public:
DWORD WriteClientError(PHTTP_FILTER_CONTEXT pfc, const char* msg, DWORD eventID=SHIB_ISAPI_CLIENT_ERROR)
{
+ static char _status[] = "200 OK";
+
if (eventID)
LogEvent(EVENTLOG_ERROR_TYPE, eventID, Priority::ERROR, msg);
- static const char* ctype="Connection: close\r\nContent-Type: text/html\r\n\r\n";
- pfc->ServerSupportFunction(pfc,SF_REQ_SEND_RESPONSE_HEADER,"200 OK",(ULONG_PTR)ctype,0);
- static const char* xmsg="<HTML><HEAD><TITLE>Shibboleth Filter Error</TITLE></HEAD><BODY>"
+ static char ctype[] = "Connection: close\r\nContent-Type: text/html\r\n\r\n";
+ pfc->ServerSupportFunction(pfc,SF_REQ_SEND_RESPONSE_HEADER,_status,(ULONG_PTR)ctype,0);
+ static char xmsg[] = "<HTML><HEAD><TITLE>Shibboleth Filter Error</TITLE></HEAD><BODY>"
"<H1>Shibboleth Filter Error</H1>";
DWORD resplen=strlen(xmsg);
- pfc->WriteClient(pfc,(LPVOID)xmsg,&resplen,0);
+ pfc->WriteClient(pfc,xmsg,&resplen,0);
resplen=strlen(msg);
- pfc->WriteClient(pfc,(LPVOID)msg,&resplen,0);
- static const char* xmsg2="</BODY></HTML>";
+ pfc->WriteClient(pfc,const_cast<char*>(msg),&resplen,0);
+ static char xmsg2[] = "</BODY></HTML>";
resplen=strlen(xmsg2);
- pfc->WriteClient(pfc,(LPVOID)xmsg2,&resplen,0);
+ pfc->WriteClient(pfc,xmsg2,&resplen,0);
return SF_STATUS_REQ_FINISHED;
}
@@ -643,6 +657,9 @@ void GetServerVariable(PHTTP_FILTER_CONTEXT pfc, LPSTR lpszVariable, dynabuf& s,
extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification)
{
+ static char _INSTANCE_ID[] = "INSTANCE_ID";
+ static char _ShibSpoofCheck[] = "ShibSpoofCheck:";
+
// Is this a log notification?
if (notificationType == SF_NOTIFY_LOG) {
if (pfc->pFilterContext)
@@ -654,7 +671,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
try {
// Determine web site number. This can't really fail, I don't think.
dynabuf buf(128);
- GetServerVariable(pfc,"INSTANCE_ID",buf,10);
+ GetServerVariable(pfc,_INSTANCE_ID,buf,10);
if (buf.empty())
return WriteClientError(pfc, "Shibboleth Filter failed to obtain INSTANCE_ID server variable.");
@@ -671,7 +688,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
pair<bool,long> res = stf.getServiceProvider().doAuthentication(stf);
if (!g_spoofKey.empty())
- pn->SetHeader(pfc, "ShibSpoofCheck:", const_cast<char*>(g_spoofKey.c_str()));
+ pn->SetHeader(pfc, _ShibSpoofCheck, const_cast<char*>(g_spoofKey.c_str()));
if (res.first) return res.second;
res = stf.getServiceProvider().doExport(stf);
@@ -710,18 +727,20 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
DWORD WriteClientError(LPEXTENSION_CONTROL_BLOCK lpECB, const char* msg, DWORD eventID=SHIB_ISAPI_CLIENT_ERROR)
{
+ static char _status[] = "200 OK";
+
if (eventID)
LogEvent(EVENTLOG_ERROR_TYPE, eventID, Priority::ERROR, msg);
- static const char* ctype="Connection: close\r\nContent-Type: text/html\r\n\r\n";
- lpECB->ServerSupportFunction(lpECB->ConnID,HSE_REQ_SEND_RESPONSE_HEADER,"200 OK",0,(LPDWORD)ctype);
- static const char* xmsg="<HTML><HEAD><TITLE>Shibboleth Error</TITLE></HEAD><BODY><H1>Shibboleth Error</H1>";
+ static char ctype[] = "Connection: close\r\nContent-Type: text/html\r\n\r\n";
+ lpECB->ServerSupportFunction(lpECB->ConnID,HSE_REQ_SEND_RESPONSE_HEADER,_status,0,(LPDWORD)ctype);
+ static char xmsg[] = "<HTML><HEAD><TITLE>Shibboleth Error</TITLE></HEAD><BODY><H1>Shibboleth Error</H1>";
DWORD resplen=strlen(xmsg);
- lpECB->WriteClient(lpECB->ConnID,(LPVOID)xmsg,&resplen,HSE_IO_SYNC);
+ lpECB->WriteClient(lpECB->ConnID,xmsg,&resplen,HSE_IO_SYNC);
resplen=strlen(msg);
- lpECB->WriteClient(lpECB->ConnID,(LPVOID)msg,&resplen,HSE_IO_SYNC);
- static const char* xmsg2="</BODY></HTML>";
+ lpECB->WriteClient(lpECB->ConnID,const_cast<char*>(msg),&resplen,HSE_IO_SYNC);
+ static char xmsg2[] = "</BODY></HTML>";
resplen=strlen(xmsg2);
- lpECB->WriteClient(lpECB->ConnID,(LPVOID)xmsg2,&resplen,HSE_IO_SYNC);
+ lpECB->WriteClient(lpECB->ConnID,xmsg2,&resplen,HSE_IO_SYNC);
return HSE_STATUS_SUCCESS;
}
@@ -740,8 +759,13 @@ class ShibTargetIsapiE : public AbstractSPRequest
public:
ShibTargetIsapiE(LPEXTENSION_CONTROL_BLOCK lpECB, const site_t& site)
: AbstractSPRequest(SHIBSP_LOGCAT ".ISAPI"), m_lpECB(lpECB), m_gotBody(false) {
+ static char _HTTPS[] = "HTTPS";
+ static char _URL[] = "URL";
+ static char _SERVER_PORT[] = "SERVER_PORT";
+ static char _SERVER_NAME[] = "SERVER_NAME";
+
dynabuf ssl(5);
- GetServerVariable("HTTPS",ssl,5);
+ GetServerVariable(_HTTPS,ssl,5);
bool SSL=(ssl=="on" || ssl=="ON");
// Scheme may come from site def or be derived from IIS.
@@ -751,12 +775,12 @@ public:
// URL path always come from IIS.
dynabuf url(256);
- GetServerVariable("URL",url,255);
+ GetServerVariable(_URL,url,255);
// Port may come from IIS or from site def.
if (!g_bNormalizeRequest || (SSL && site.m_sslport.empty()) || (!SSL && site.m_port.empty())) {
dynabuf port(11);
- GetServerVariable("SERVER_PORT",port,10);
+ GetServerVariable(_SERVER_PORT,port,10);
if (port.empty()) {
m_port = SSL ? 443 : 80;
}
@@ -772,7 +796,7 @@ public:
}
dynabuf var(32);
- GetServerVariable("SERVER_NAME", var, 32);
+ GetServerVariable(_SERVER_NAME, var, 32);
if (var.empty()) {
m_hostname = site.m_name;
}
@@ -846,19 +870,21 @@ public:
return m_lpECB->cbTotalBytes;
}
string getRemoteUser() const {
+ static char _REMOTE_USER[] = "REMOTE_USER";
if (m_remote_user.empty()) {
dynabuf var(16);
- GetServerVariable("REMOTE_USER", var, 32, false);
+ GetServerVariable(_REMOTE_USER, var, 32, false);
if (!var.empty())
m_remote_user = var;
}
return m_remote_user;
}
string getRemoteAddr() const {
+ static char _REMOTE_ADDR[] = "REMOTE_ADDR";
m_remote_addr = AbstractSPRequest::getRemoteAddr();
if (m_remote_addr.empty()) {
dynabuf var(16);
- GetServerVariable("REMOTE_ADDR", var, 16, false);
+ GetServerVariable(_REMOTE_ADDR, var, 16, false);
if (!var.empty())
m_remote_addr = var;
}
@@ -879,7 +905,7 @@ public:
}
dynabuf buf(128);
GetServerVariable(const_cast<char*>(hdr.c_str()), buf, 128, false);
- return buf.empty() ? "" : buf;
+ return buf.empty() ? "" : static_cast<char*>(buf);
}
void setResponseHeader(const char* name, const char* value, bool replace = false) {
HTTPResponse::setResponseHeader(name, value, replace);
@@ -932,15 +958,26 @@ public:
for (multimap<string,string>::const_iterator i = m_headers.begin(); i != m_headers.end(); ++i)
hdr += i->first + ": " + i->second + "\r\n";
hdr += "\r\n";
- const char* codestr="200 OK";
+
+ static char okstr[] = "200 OK";
+ static char notmodstr[] = "304 Not Modified";
+ static char authzstr[] = "401 Authorization Required";
+ static char forbiddenstr[] = "403 Forbidden";
+ static char notfoundstr[] = "404 Not Found";
+ static char errorstr[] = "500 Server Error";
+
+ char* str = nullptr;
+
switch (status) {
- case XMLTOOLING_HTTP_STATUS_NOTMODIFIED: codestr="304 Not Modified"; break;
- case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: codestr="401 Authorization Required"; break;
- case XMLTOOLING_HTTP_STATUS_FORBIDDEN: codestr="403 Forbidden"; break;
- case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="404 Not Found"; break;
- case XMLTOOLING_HTTP_STATUS_ERROR: codestr="500 Server Error"; break;
+ case XMLTOOLING_HTTP_STATUS_NOTMODIFIED: str = notmodstr; break;
+ case XMLTOOLING_HTTP_STATUS_UNAUTHORIZED: str = authzstr; break;
+ case XMLTOOLING_HTTP_STATUS_FORBIDDEN: str = forbiddenstr; break;
+ case XMLTOOLING_HTTP_STATUS_NOTFOUND: str = notfoundstr; break;
+ case XMLTOOLING_HTTP_STATUS_ERROR: str = errorstr; break;
+
+ default: str = okstr;
}
- m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, (void*)codestr, 0, (LPDWORD)hdr.c_str());
+ m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, str, 0, (LPDWORD)hdr.c_str());
char buf[1024];
while (in) {
in.read(buf,1024);
@@ -950,6 +987,8 @@ public:
return HSE_STATUS_SUCCESS;
}
long sendRedirect(const char* url) {
+ static char _status[] = "302 Moved";
+
HTTPResponse::sendRedirect(url);
string hdr=string("Location: ") + url + "\r\n"
"Content-Type: text/html\r\n"
@@ -959,10 +998,10 @@ public:
for (multimap<string,string>::const_iterator i = m_headers.begin(); i != m_headers.end(); ++i)
hdr += i->first + ": " + i->second + "\r\n";
hdr += "\r\n";
- m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, "302 Moved", 0, (LPDWORD)hdr.c_str());
- static const char* redmsg="<HTML><BODY>Redirecting...</BODY></HTML>";
+ m_lpECB->ServerSupportFunction(m_lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, _status, 0, (LPDWORD)hdr.c_str());
+ static char redmsg[] = "<HTML><BODY>Redirecting...</BODY></HTML>";
DWORD resplen=40;
- m_lpECB->WriteClient(m_lpECB->ConnID, (LPVOID)redmsg, &resplen, HSE_IO_SYNC);
+ m_lpECB->WriteClient(m_lpECB->ConnID, redmsg, &resplen, HSE_IO_SYNC);
return HSE_STATUS_SUCCESS;
}
// Decline happens in the POST processor if this isn't the handler url
@@ -1042,6 +1081,8 @@ void GetServerVariable(LPEXTENSION_CONTROL_BLOCK lpECB, LPSTR lpszVariable, dyna
extern "C" DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
{
+ static char _INSTANCE_ID[] = "INSTANCE_ID";
+
try {
string threadid("[");
threadid += lexical_cast<string>(getpid()) + "] isapi_shib_extension";
@@ -1049,7 +1090,7 @@ extern "C" DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
// Determine web site number. This can't really fail, I don't think.
dynabuf buf(128);
- GetServerVariable(lpECB,"INSTANCE_ID",buf,10);
+ GetServerVariable(lpECB,_INSTANCE_ID,buf,10);
if (buf.empty())
return WriteClientError(lpECB, "Shibboleth Extension failed to obtain INSTANCE_ID server variable.");
diff --git a/nsapi_shib/nsapi_shib.cpp b/nsapi_shib/nsapi_shib.cpp
index 7ada5f1..d512c77 100644
--- a/nsapi_shib/nsapi_shib.cpp
+++ b/nsapi_shib/nsapi_shib.cpp
@@ -57,6 +57,7 @@
#include <xercesc/util/XMLUniDefs.hpp>
#ifdef WIN32
+# define WIN32_LEAN_AND_MEAN
# include <process.h>
# define XP_WIN32
#else
@@ -113,6 +114,8 @@ extern "C" NSAPI_PUBLIC void nsapi_shib_exit(void*)
extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, ::Session* sn, Request* rq)
{
+ static char _funcname[] = "nsapi_shib_init";
+
// Save off a default hostname for this virtual server.
char* name=pblock_findval("server-name",pb);
if (name)
@@ -134,7 +137,8 @@ extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, ::Session* sn, Request*
}
}
- log_error(LOG_INFORM,"nsapi_shib_init",sn,rq,"nsapi_shib loaded for host (%s)",g_ServerName.c_str());
+ static char _logmsg[] = "nsapi_shib loaded for host (%s)";
+ log_error(LOG_INFORM,_funcname,sn,rq,_logmsg,g_ServerName.c_str());
const char* schemadir=pblock_findval("shib-schemas",pb);
const char* prefix=pblock_findval("shib-prefix",pb);
@@ -297,16 +301,18 @@ public:
return pblock_findval("method", m_rq->reqpb);
}
string getContentType() const {
+ static char _contenttype[] = "content-type";
char* content_type = nullptr;
- if (request_header("content-type", &content_type, m_sn, m_rq) != REQ_PROCEED)
+ if (request_header(_contenttype, &content_type, m_sn, m_rq) != REQ_PROCEED)
return "";
return content_type ? content_type : "";
}
long getContentLength() const {
+ static char _contentlen[] = "content-length";
if (m_gotBody)
return m_body.length();
char* content_length=nullptr;
- if (request_header("content-length", &content_length, m_sn, m_rq) != REQ_PROCEED)
+ if (request_header(_contentlen, &content_length, m_sn, m_rq) != REQ_PROCEED)
return 0;
return content_length ? atoi(content_length) : 0;
}
@@ -315,18 +321,20 @@ public:
return ret.empty() ? pblock_findval("ip", m_sn->client) : ret;
}
void log(SPLogLevel level, const string& msg) const {
+ static char _module[] = "nsapi_shib";
AbstractSPRequest::log(level,msg);
if (level>=SPError)
- log_error(LOG_FAILURE, "nsapi_shib", m_sn, m_rq, const_cast<char*>(msg.c_str()));
+ log_error(LOG_FAILURE, _module, m_sn, m_rq, const_cast<char*>(msg.c_str()));
}
const char* getQueryString() const {
return pblock_findval("query", m_rq->reqpb);
}
const char* getRequestBody() const {
+ static char _contentlen[] = "content-length";
if (m_gotBody)
return m_body.c_str();
char* content_length=nullptr;
- if (request_header("content-length", &content_length, m_sn, m_rq) != REQ_PROCEED || !content_length) {
+ if (request_header(_contentlen, &content_length, m_sn, m_rq) != REQ_PROCEED || !content_length) {
m_gotBody = true;
return nullptr;
}
@@ -482,10 +490,10 @@ int WriteClientError(::Session* sn, Request* rq, char* func, char* msg)
return REQ_ABORTED;
}
-#undef FUNC
-#define FUNC "shibboleth"
extern "C" NSAPI_PUBLIC int nsapi_shib(pblock* pb, ::Session* sn, Request* rq)
{
+ static char _func[] = "nsapi_shib";
+
string threadid("[");
threadid += lexical_cast<string>(getpid()) + "] nsapi_shib";
xmltooling::NDC ndc(threadid.c_str());
@@ -515,23 +523,25 @@ extern "C" NSAPI_PUBLIC int nsapi_shib(pblock* pb, ::Session* sn, Request* rq)
// this user is ok.
return REQ_PROCEED;
}
- catch (std::exception& e) {
- 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.");
+ catch (const std::exception& e) {
+ log_error(LOG_FAILURE,_func,sn,rq,const_cast<char*>(e.what()));
+ static char _errmsg[] = "Shibboleth module threw an exception, see web server log for error.";
+ return WriteClientError(sn, rq, _func, _errmsg);
}
catch (...) {
- log_error(LOG_FAILURE,FUNC,sn,rq,const_cast<char*>("Shibboleth module threw an unknown exception."));
+ static char _errmsg2[] = "Shibboleth module threw an unknown exception.";
+ log_error(LOG_FAILURE,_func,sn,rq,_errmsg2);
if (g_catchAll)
- return WriteClientError(sn, rq, FUNC, "Shibboleth module threw an unknown exception.");
+ return WriteClientError(sn, rq, _func, _errmsg2);
throw;
}
}
-#undef FUNC
-#define FUNC "shib_handler"
extern "C" NSAPI_PUBLIC int shib_handler(pblock* pb, ::Session* sn, Request* rq)
{
+ static char _func[] = "shib_handler";
+
string threadid("[");
threadid += lexical_cast<string>(getpid()) + "] shib_handler";
xmltooling::NDC ndc(threadid.c_str());
@@ -542,16 +552,19 @@ extern "C" NSAPI_PUBLIC int shib_handler(pblock* pb, ::Session* sn, Request* rq)
pair<bool,long> res = stn.getServiceProvider().doHandler(stn);
if (res.first) return (int)res.second;
- return WriteClientError(sn, rq, FUNC, "Shibboleth handler did not do anything.");
+ static char _errmsg[] = "Shibboleth handler did not do anything.";
+ return WriteClientError(sn, rq, _func, _errmsg);
}
- catch (std::exception& e) {
- 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.");
+ catch (const std::exception& e) {
+ static char _errmsg2[] = "Shibboleth handler threw an exception, see web server log for error.";
+ log_error(LOG_FAILURE,_func,sn,rq,const_cast<char*>(e.what()));
+ return WriteClientError(sn, rq, _func, _errmsg2);
}
catch (...) {
- log_error(LOG_FAILURE,FUNC,sn,rq,"unknown exception caught in Shibboleth handler");
+ static char _errmsg3[] = "Shibboleth handler threw an unknown exception.";
+ log_error(LOG_FAILURE,_func,sn,rq,_errmsg3);
if (g_catchAll)
- return WriteClientError(sn, rq, FUNC, "Shibboleth handler threw an unknown exception.");
+ return WriteClientError(sn, rq, _func, _errmsg3);
throw;
}
}
diff --git a/shibd/shibd_win32.cpp b/shibd/shibd_win32.cpp
index 820336e..9478474 100644
--- a/shibd/shibd_win32.cpp
+++ b/shibd/shibd_win32.cpp
@@ -197,9 +197,11 @@ int main(int argc, char *argv[])
printf("\t-catalogs <catalog1:catalog2> to specify schema catalogs\n");
printf("\nService starting.\nThis may take several seconds. Please wait.\n" );
+ static char svcname[] = "SHIBD";
+
SERVICE_TABLE_ENTRY dispatchTable[] =
{
- { "SHIBD", (LPSERVICE_MAIN_FUNCTION)service_main },
+ { svcname, (LPSERVICE_MAIN_FUNCTION)service_main },
{ nullptr, nullptr }
};
diff --git a/util/mdquery.cpp b/util/mdquery.cpp
index 56f988e..2042469 100644
--- a/util/mdquery.cpp
+++ b/util/mdquery.cpp
@@ -61,8 +61,14 @@ void usage()
int main(int argc,char* argv[])
{
+ static char _default[] = "default";
+ static char _idprole[] = "IDPSSODescriptor";
+ static char _aarole[] = "AttributeAuthorityDescriptor";
+ static char _pdprole[] = "PDPDescriptor";
+ static char _sprole[] = "SPSSODescriptor";
+
char* entityID = nullptr;
- char* appID = "default";
+ char* appID = _default;
bool strict = true;
char* prot = nullptr;
const XMLCh* protocol = nullptr;
@@ -87,13 +93,13 @@ int main(int argc,char* argv[])
else if (!strcmp(argv[i],"-saml2"))
protocol=samlconstants::SAML20P_NS;
else if (!strcmp(argv[i],"-idp"))
- rname="IDPSSODescriptor";
+ rname=_idprole;
else if (!strcmp(argv[i],"-aa"))
- rname="AttributeAuthorityDescriptor";
+ rname=_aarole;
else if (!strcmp(argv[i],"-pdp"))
- rname="PDPDescriptor";
+ rname=_pdprole;
else if (!strcmp(argv[i],"-sp"))
- rname="SPSSODescriptor";
+ rname=_sprole;
else if (!strcmp(argv[i],"-nostrict"))
strict = false;
}
diff --git a/util/resolvertest.cpp b/util/resolvertest.cpp
index de8e318..aeb57b2 100644
--- a/util/resolvertest.cpp
+++ b/util/resolvertest.cpp
@@ -117,6 +117,8 @@ void usage()
int main(int argc,char* argv[])
{
+ static char _default[] = "default";
+
char* a_param=nullptr;
char* n_param=nullptr;
char* f_param=nullptr;
@@ -149,7 +151,7 @@ int main(int argc,char* argv[])
}
if (!a_param)
- a_param="default";
+ a_param=_default;
if (n_param) {
if (!protocol) {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list