[cpp-sp] 04/47: Imported Upstream version 2.1.dfsg1
Scott Cantor
cantor.2 at osu.edu
Thu Dec 20 19:41:32 EST 2018
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to annotated tag debian/2.1.dfsg1-1
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=8cfb88bff921f1830d05045bf266b88f8d49abd7
commit 8cfb88bff921f1830d05045bf266b88f8d49abd7
Author: Russ Allbery <rra at debian.org>
AuthorDate: Sat Aug 23 16:10:04 2008 -0700
Imported Upstream version 2.1.dfsg1
---
Makefile.am | 6 +-
Makefile.in | 15 +-
Shibboleth.sln | 66 ++
adfs/Makefile.in | 7 +-
adfs/adfs-lite.vcproj | 167 ++++-
adfs/adfs.cpp | 132 +++-
adfs/adfs.rc | 14 +-
adfs/adfs.vcproj | 166 ++++-
apache/Makefile.in | 7 +-
apache/mod_apache.cpp | 40 +-
apache/mod_shib13.vcproj | 204 +++++-
apache/mod_shib20.vcproj | 210 +++++-
apache/mod_shib22.vcproj | 213 +++++-
apache/mod_shib_13.rc | 12 +-
apache/mod_shib_20.rc | 12 +-
apache/mod_shib_22.rc | 12 +-
config.guess | 614 +++++++++--------
config.sub | 185 ++++--
configs/Makefile.in | 7 +-
configs/attribute-map.xml | 16 +-
configs/attribute-policy.xml | 1 +
configs/keygen.sh | 1 +
configs/shibboleth2.xml | 10 +-
configure | 299 +++++++--
configure.ac | 42 +-
depcomp | 103 ++-
depend | 4 +-
doc/Makefile.in | 7 +-
doc/README.txt | 9 +-
doc/RELEASE.txt | 11 +-
fastcgi/Makefile.in | 7 +-
fastcgi/shibauthorizer.cpp | 79 ++-
fastcgi/shibauthorizer.rc | 12 +-
fastcgi/shibauthorizer.vcproj | 201 +++++-
fastcgi/shibresponder.cpp | 37 +-
fastcgi/shibresponder.rc | 12 +-
fastcgi/shibresponder.vcproj | 201 +++++-
install-sh | 477 ++++++-------
isapi_shib/isapi_shib.cpp | 61 +-
isapi_shib/isapi_shib.rc | 12 +-
isapi_shib/isapi_shib.vcproj | 189 +++++-
memcache-store/Makefile.am | 20 +
{odbc-store => memcache-store}/Makefile.in | 47 +-
memcache-store/memcache-store.cpp | 738 +++++++++++++++++++++
.../memcache-store.rc | 20 +-
memcache-store/memcache-store.vcproj | 357 ++++++++++
memcache-store/resource.h | 14 +
missing | 142 ++--
mkinstalldirs | 111 ----
nsapi_shib/Makefile.in | 7 +-
nsapi_shib/nsapi_shib.cpp | 27 +-
nsapi_shib/nsapi_shib.rc | 12 +-
nsapi_shib/nsapi_shib.vcproj | 186 +++++-
odbc-store/Makefile.in | 7 +-
odbc-store/odbc-store.cpp | 10 +-
odbc-store/odbc-store.rc | 20 +-
odbc-store/odbc-store.vcproj | 164 ++++-
pkginfo | 2 +-
schemas/Makefile.in | 7 +-
schemas/shibboleth-2.0-afp-mf-basic.xsd | 17 +-
schemas/shibboleth-2.0-afp-mf-saml.xsd | 6 +-
schemas/shibboleth-2.0-afp.xsd | 62 +-
schemas/shibboleth-2.0-attribute-map.xsd | 40 +-
schemas/shibboleth-2.0-native-sp-config.xsd | 37 +-
selinux/Makefile.in | 7 +-
shibboleth.spec | 83 ++-
shibboleth.spec.in | 81 ++-
shibd/Makefile.in | 7 +-
shibd/shibd.cpp | 50 +-
shibd/shibd.rc | 12 +-
shibd/shibd.vcproj | 176 +++++
shibsp/AbstractSPRequest.cpp | 22 +-
shibsp/AbstractSPRequest.h | 2 +-
shibsp/Application.cpp | 17 +-
shibsp/Application.h | 11 +-
shibsp/Makefile.am | 9 +-
shibsp/Makefile.in | 47 +-
shibsp/SPConfig.cpp | 77 ++-
shibsp/SPConfig.h | 52 +-
shibsp/SPRequest.h | 2 +-
shibsp/ServiceProvider.cpp | 26 +-
shibsp/SessionCache.h | 97 ++-
shibsp/attribute/Attribute.cpp | 14 +-
shibsp/attribute/AttributeDecoder.h | 17 +-
shibsp/attribute/NameIDAttributeDecoder.cpp | 32 +-
...er.cpp => NameIDFromScopedAttributeDecoder.cpp} | 132 ++--
shibsp/attribute/ScopedAttributeDecoder.cpp | 18 +-
shibsp/attribute/StringAttributeDecoder.cpp | 6 +-
.../impl/AttributeIssuerStringFunctor.cpp | 11 +-
.../impl/AttributeRequesterStringFunctor.cpp | 11 +-
.../filtering/impl/AttributeScopeStringFunctor.cpp | 44 +-
.../filtering/impl/AttributeValueStringFunctor.cpp | 24 +-
.../impl/AuthenticationMethodStringFunctor.cpp | 15 +-
.../filtering/impl/XMLAttributeFilter.cpp | 297 +++++----
.../resolver/impl/ChainingAttributeExtractor.cpp | 10 +-
.../resolver/impl/ChainingAttributeResolver.cpp | 10 +-
.../resolver/impl/QueryAttributeResolver.cpp | 23 +-
.../resolver/impl/XMLAttributeExtractor.cpp | 22 +-
shibsp/binding/impl/SOAPClient.cpp | 2 +
shibsp/handler/impl/AbstractHandler.cpp | 77 ++-
shibsp/handler/impl/AssertionConsumerService.cpp | 37 +-
shibsp/handler/impl/LogoutHandler.cpp | 4 +-
shibsp/handler/impl/MetadataGenerator.cpp | 8 +-
shibsp/handler/impl/SAML2Logout.cpp | 3 +-
shibsp/handler/impl/SAML2LogoutInitiator.cpp | 30 +-
shibsp/handler/impl/SAML2SessionInitiator.cpp | 18 +-
shibsp/handler/impl/SessionHandler.cpp | 2 +-
shibsp/handler/impl/Shib1SessionInitiator.cpp | 3 +-
shibsp/handler/impl/StatusHandler.cpp | 5 +-
shibsp/handler/impl/TransformSessionInitiator.cpp | 3 +-
shibsp/impl/StorageServiceSessionCache.cpp | 233 ++++---
shibsp/impl/XMLServiceProvider.cpp | 26 +-
shibsp/internal.h | 1 +
shibsp/metadata/DynamicMetadataProvider.cpp | 277 ++++++++
shibsp/metadata/MetadataExtSchemaValidators.cpp | 7 +
shibsp/metadata/MetadataProviderCriteria.h | 80 +++
shibsp/remoting/impl/SocketListener.cpp | 15 +-
shibsp/shibsp-lite.vcproj | 175 ++++-
shibsp/shibsp.rc | 28 +-
shibsp/shibsp.vcproj | 202 +++++-
shibsp/version.h | 2 +-
util/Makefile.in | 7 +-
util/mdquery.cpp | 5 +-
util/mdquery.vcproj | 176 +++++
util/resolvertest.cpp | 5 +-
util/resolvertest.vcproj | 177 +++++
126 files changed, 7071 insertions(+), 1934 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index e6172ac..28448cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,7 @@ WANT_SUBDIRS = @WANT_SUBDIRS@
SUBDIRS = $(WANT_SUBDIRS)
-DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store selinux
+DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store memcache-store selinux
if DX_COND_doc
all-local: shibboleth.spec pkginfo doxygen-doc
@@ -29,13 +29,13 @@ dist-hook:
shibboleth.spec: shibboleth.spec.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
pkginfo: pkginfo.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
diff --git a/Makefile.in b/Makefile.in
index cc1f613..7f86166 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -68,7 +68,7 @@ host_triplet = @host@
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/doxygen.am $(top_srcdir)/configure config.guess \
- config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
+ config.sub depcomp install-sh ltmain.sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
@@ -78,7 +78,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ -130,6 +130,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -215,6 +217,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
@@ -322,7 +327,7 @@ ACLOCAL_AMFLAGS = -I .
MOSTLYCLEANFILES = $(DX_CLEANFILES)
SUBDIRS = $(WANT_SUBDIRS)
-DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store selinux
+DIST_SUBDIRS = doc schemas configs shibsp shibd adfs util apache nsapi_shib fastcgi odbc-store memcache-store selinux
@DX_COND_doc_TRUE at APIDOCS = doc/api
EXTRA_DIST = $(DX_CONFIG) \
$(APIDOCS) \
@@ -844,13 +849,13 @@ dist-hook:
shibboleth.spec: shibboleth.spec.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
pkginfo: pkginfo.in Makefile
rm -f $@.tmp
- sed < $< > $@.tmp \
+ sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:'
mv $@.tmp $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Shibboleth.sln b/Shibboleth.sln
index c4616c3..8988b06 100644
--- a/Shibboleth.sln
+++ b/Shibboleth.sln
@@ -150,72 +150,137 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibresponder", "fastcgi\sh
{81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcache-store", "memcache-store\memcache-store.vcproj", "{666A63A7-983F-4C19-8411-207F24305198}"
+ ProjectSection(WebsiteProperties) = preProject
+ Debug.AspNetCompiler.Debug = "True"
+ Release.AspNetCompiler.Debug = "False"
+ EndProjectSection
+ ProjectSection(ProjectDependencies) = postProject
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|Win32.ActiveCfg = Debug|Win32
{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|Win32.Build.0 = Debug|Win32
+ {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|x64.ActiveCfg = Debug|x64
+ {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Debug|x64.Build.0 = Debug|x64
{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|Win32.ActiveCfg = Release|Win32
{87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|Win32.Build.0 = Release|Win32
+ {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|x64.ActiveCfg = Release|x64
+ {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3}.Release|x64.Build.0 = Release|x64
{D243B43E-728E-4F32-BDFF-B3A897037C6D}.Debug|Win32.ActiveCfg = Debug|Win32
{D243B43E-728E-4F32-BDFF-B3A897037C6D}.Debug|Win32.Build.0 = Debug|Win32
+ {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Debug|x64.ActiveCfg = Debug|x64
{D243B43E-728E-4F32-BDFF-B3A897037C6D}.Release|Win32.ActiveCfg = Release|Win32
{D243B43E-728E-4F32-BDFF-B3A897037C6D}.Release|Win32.Build.0 = Release|Win32
+ {D243B43E-728E-4F32-BDFF-B3A897037C6D}.Release|x64.ActiveCfg = Release|x64
{68E9568B-476C-4289-B93C-893432378ADC}.Debug|Win32.ActiveCfg = Debug|Win32
{68E9568B-476C-4289-B93C-893432378ADC}.Debug|Win32.Build.0 = Debug|Win32
+ {68E9568B-476C-4289-B93C-893432378ADC}.Debug|x64.ActiveCfg = Debug|x64
{68E9568B-476C-4289-B93C-893432378ADC}.Release|Win32.ActiveCfg = Release|Win32
{68E9568B-476C-4289-B93C-893432378ADC}.Release|Win32.Build.0 = Release|Win32
+ {68E9568B-476C-4289-B93C-893432378ADC}.Release|x64.ActiveCfg = Release|x64
{1396D80A-8672-4224-9B02-95F3F4207CDB}.Debug|Win32.ActiveCfg = Debug|Win32
{1396D80A-8672-4224-9B02-95F3F4207CDB}.Debug|Win32.Build.0 = Debug|Win32
+ {1396D80A-8672-4224-9B02-95F3F4207CDB}.Debug|x64.ActiveCfg = Debug|x64
{1396D80A-8672-4224-9B02-95F3F4207CDB}.Release|Win32.ActiveCfg = Release|Win32
{1396D80A-8672-4224-9B02-95F3F4207CDB}.Release|Win32.Build.0 = Release|Win32
+ {1396D80A-8672-4224-9B02-95F3F4207CDB}.Release|x64.ActiveCfg = Release|x64
{B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|Win32.ActiveCfg = Debug|Win32
{B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|Win32.Build.0 = Debug|Win32
+ {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|x64.ActiveCfg = Debug|x64
+ {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Debug|x64.Build.0 = Debug|x64
{B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|Win32.ActiveCfg = Release|Win32
{B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|Win32.Build.0 = Release|Win32
+ {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|x64.ActiveCfg = Release|x64
+ {B44C0852-83B8-4FB2-A86E-097C9C8256D0}.Release|x64.Build.0 = Release|x64
{666A63A7-983F-4C19-8411-207F24305197}.Debug|Win32.ActiveCfg = Debug|Win32
{666A63A7-983F-4C19-8411-207F24305197}.Debug|Win32.Build.0 = Debug|Win32
+ {666A63A7-983F-4C19-8411-207F24305197}.Debug|x64.ActiveCfg = Debug|x64
+ {666A63A7-983F-4C19-8411-207F24305197}.Debug|x64.Build.0 = Debug|x64
{666A63A7-983F-4C19-8411-207F24305197}.Release|Win32.ActiveCfg = Release|Win32
{666A63A7-983F-4C19-8411-207F24305197}.Release|Win32.Build.0 = Release|Win32
+ {666A63A7-983F-4C19-8411-207F24305197}.Release|x64.ActiveCfg = Release|x64
+ {666A63A7-983F-4C19-8411-207F24305197}.Release|x64.Build.0 = Release|x64
{81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|Win32.ActiveCfg = Debug|Win32
{81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|Win32.Build.0 = Debug|Win32
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|x64.ActiveCfg = Debug|x64
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Debug|x64.Build.0 = Debug|x64
{81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|Win32.ActiveCfg = Release|Win32
{81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|Win32.Build.0 = Release|Win32
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|x64.ActiveCfg = Release|x64
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}.Release|x64.Build.0 = Release|x64
{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.ActiveCfg = Debug|Win32
{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.Build.0 = Debug|Win32
+ {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|x64.ActiveCfg = Debug|x64
+ {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|x64.Build.0 = Debug|x64
{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.ActiveCfg = Release|Win32
{F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.Build.0 = Release|Win32
+ {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|x64.ActiveCfg = Release|x64
+ {F13141B5-6C87-40BB-8D4E-5CC56EBB4C59}.Release|x64.Build.0 = Release|x64
{81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|Win32.ActiveCfg = Debug|Win32
{81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|Win32.Build.0 = Debug|Win32
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|x64.ActiveCfg = Debug|x64
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Debug|x64.Build.0 = Debug|x64
{81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|Win32.ActiveCfg = Release|Win32
{81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|Win32.Build.0 = Release|Win32
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|x64.ActiveCfg = Release|x64
+ {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}.Release|x64.Build.0 = Release|x64
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|Win32.ActiveCfg = Debug|Win32
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|Win32.Build.0 = Debug|Win32
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|x64.ActiveCfg = Debug|x64
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Debug|x64.Build.0 = Debug|x64
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|Win32.ActiveCfg = Release|Win32
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|Win32.Build.0 = Release|Win32
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|x64.ActiveCfg = Release|x64
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A}.Release|x64.Build.0 = Release|x64
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|Win32.ActiveCfg = Debug|Win32
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|Win32.Build.0 = Debug|Win32
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|x64.ActiveCfg = Debug|x64
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Debug|x64.Build.0 = Debug|x64
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.ActiveCfg = Release|Win32
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|Win32.Build.0 = Release|Win32
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|x64.ActiveCfg = Release|x64
+ {26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B}.Release|x64.Build.0 = Release|x64
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.ActiveCfg = Debug|Win32
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|Win32.Build.0 = Debug|Win32
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|x64.ActiveCfg = Debug|x64
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Debug|x64.Build.0 = Debug|x64
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.ActiveCfg = Release|Win32
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|Win32.Build.0 = Release|Win32
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|x64.ActiveCfg = Release|x64
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A}.Release|x64.Build.0 = Release|x64
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.ActiveCfg = Debug|Win32
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.Build.0 = Debug|Win32
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|x64.ActiveCfg = Debug|x64
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|x64.Build.0 = Debug|x64
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.ActiveCfg = Release|Win32
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.Build.0 = Release|Win32
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|x64.ActiveCfg = Release|x64
+ {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|x64.Build.0 = Release|x64
{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Debug|Win32.ActiveCfg = Debug|Win32
{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Debug|Win32.Build.0 = Debug|Win32
+ {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Debug|x64.ActiveCfg = Debug|x64
{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|Win32.ActiveCfg = Release|Win32
{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|Win32.Build.0 = Release|Win32
+ {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|x64.ActiveCfg = Release|x64
{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Debug|Win32.ActiveCfg = Debug|Win32
{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Debug|Win32.Build.0 = Debug|Win32
+ {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Debug|x64.ActiveCfg = Debug|x64
{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|Win32.ActiveCfg = Release|Win32
{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|Win32.Build.0 = Release|Win32
+ {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|x64.ActiveCfg = Release|x64
+ {666A63A7-983F-4C19-8411-207F24305198}.Debug|Win32.ActiveCfg = Debug|Win32
+ {666A63A7-983F-4C19-8411-207F24305198}.Debug|x64.ActiveCfg = Debug|x64
+ {666A63A7-983F-4C19-8411-207F24305198}.Release|Win32.ActiveCfg = Release|Win32
+ {666A63A7-983F-4C19-8411-207F24305198}.Release|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -230,6 +295,7 @@ Global
{666A63A7-983F-4C19-8411-207F24305197} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83A} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}
{26D4FABF-ACDE-4947-9C4A-7AE1B50CD83B} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}
+ {666A63A7-983F-4C19-8411-207F24305198} = {96AE4FC9-45EF-4C18-9F3B-EDA439E26E4C}
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C5A} = {FED80230-119E-4B2F-9F53-D2660A5F022B}
{F13141B6-6C87-40BB-8D4E-5CC56EBB4C59} = {FED80230-119E-4B2F-9F53-D2660A5F022B}
{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0} = {8E1AF2CF-24E1-4983-8681-394D89DF9AD2}
diff --git a/adfs/Makefile.in b/adfs/Makefile.in
index 0335f39..602bba9 100644
--- a/adfs/Makefile.in
+++ b/adfs/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -106,6 +106,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -191,6 +193,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/adfs/adfs-lite.vcproj b/adfs/adfs-lite.vcproj
index 175e433..cbc2a53 100644
--- a/adfs/adfs-lite.vcproj
+++ b/adfs/adfs-lite.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -145,7 +148,6 @@
OutputFile="$(OutDir)\$(ProjectName).so"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
- GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -176,6 +178,169 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;SHIBSP_LITE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="SHIBSP_LITE;_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling-lite1D.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;SHIBSP_LITE"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="SHIBSP_LITE"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling-lite1.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/adfs/adfs.cpp b/adfs/adfs.cpp
index b900bdc..0dd273b 100644
--- a/adfs/adfs.cpp
+++ b/adfs/adfs.cpp
@@ -34,6 +34,8 @@
# define ADFS_EXPORTS
#endif
+#include <memory>
+
#include <shibsp/base.h>
#include <shibsp/exceptions.h>
#include <shibsp/Application.h>
@@ -51,6 +53,7 @@
#ifndef SHIBSP_LITE
# include <shibsp/attribute/resolver/ResolutionContext.h>
+# include <shibsp/metadata/MetadataProviderCriteria.h>
# include <saml/SAMLConfig.h>
# include <saml/saml1/core/Assertions.h>
# include <saml/saml1/profile/AssertionValidator.h>
@@ -178,7 +181,7 @@ namespace {
#endif
};
- class SHIBSP_DLLLOCAL ADFSLogoutInitiator : public AbstractHandler, public RemotedHandler
+ class SHIBSP_DLLLOCAL ADFSLogoutInitiator : public AbstractHandler, public LogoutHandler
{
public:
ADFSLogoutInitiator(const DOMElement* e, const char* appId)
@@ -214,7 +217,7 @@ namespace {
#endif
private:
- pair<bool,long> doRequest(const Application& application, const char* entityID, HTTPResponse& httpResponse) const;
+ pair<bool,long> doRequest(const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse, Session* session) const;
string m_appId;
auto_ptr_XMLCh m_binding;
@@ -453,7 +456,7 @@ pair<bool,long> ADFSSessionInitiator::doRequest(
// Use metadata to invoke the SSO service directly.
MetadataProvider* m=app.getMetadataProvider();
Locker locker(m);
- MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get());
+ MetadataProviderCriteria mc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get());
pair<const EntityDescriptor*,const RoleDescriptor*> entity=m->getEntityDescriptor(mc);
if (!entity.first) {
m_log.warn("unable to locate metadata for provider (%s)", entityID);
@@ -540,8 +543,10 @@ XMLObject* ADFSDecoder::decode(string& relayState, const GenericRequest& generic
auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
janitor.release();
- if (!XMLHelper::isNodeNamed(xmlObject->getDOM(), m_ns.get(), RequestSecurityTokenResponse))
+ if (!XMLString::equals(xmlObject->getElementQName().getLocalPart(), RequestSecurityTokenResponse)) {
+ log.error("unrecognized root element on message: %s", xmlObject->getElementQName().toString().c_str());
throw BindingException("Decoded message was not of the appropriate type.");
+ }
if (!policy.getValidating())
SchemaValidators.validate(xmlObject.get());
@@ -569,13 +574,21 @@ void ADFSConsumer::implementProtocol(
const ElementProxy* response = dynamic_cast<const ElementProxy*>(&xmlObject);
if (!response || !response->hasChildren())
throw FatalProfileException("Incoming message was not of the proper type or contains no security token.");
- response = dynamic_cast<const ElementProxy*>(response->getUnknownXMLObjects().front());
- if (!response || !response->hasChildren())
- throw FatalProfileException("Token wrapper element did not contain a security token.");
- const Assertion* token = dynamic_cast<const Assertion*>(response->getUnknownXMLObjects().front());
- if (!token || !token->getSignature())
- throw FatalProfileException("Incoming message did not contain a signed SAML assertion.");
-
+
+ const Assertion* token = NULL;
+ for (vector<XMLObject*>::const_iterator xo = response->getUnknownXMLObjects().begin(); xo != response->getUnknownXMLObjects().end(); ++xo) {
+ // Look for the RequestedSecurityToken element.
+ if (XMLString::equals((*xo)->getElementQName().getLocalPart(), RequestedSecurityToken)) {
+ response = dynamic_cast<const ElementProxy*>(*xo);
+ if (!response || !response->hasChildren())
+ throw FatalProfileException("Token wrapper element did not contain a security token.");
+ token = dynamic_cast<const Assertion*>(response->getUnknownXMLObjects().front());
+ if (!token || !token->getSignature())
+ throw FatalProfileException("Incoming message did not contain a signed SAML assertion.");
+ break;
+ }
+ }
+
// Extract message and issuer details from assertion.
extractMessageDetails(*token, m_protocol.get(), policy);
@@ -761,15 +774,14 @@ pair<bool,long> ADFSLogoutInitiator::run(SPRequest& request, bool isHandler) con
if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
// When out of process, we run natively.
- return doRequest(request.getApplication(), entityID.c_str(), request);
+ return doRequest(request.getApplication(), request, request, session);
}
else {
// When not out of process, we remote the request.
- Locker locker(session, false);
- DDF out,in(m_address.c_str());
+ session->unlock();
+ vector<string> headers(1,"Cookie");
+ DDF out,in = wrap(request,&headers);
DDFJanitor jin(in), jout(out);
- in.addmember("application_id").string(request.getApplication().getId());
- in.addmember("entity_id").string(entityID.c_str());
out=request.getServiceProvider().getListenerService()->send(in);
return unwrap(request, out);
}
@@ -778,6 +790,10 @@ pair<bool,long> ADFSLogoutInitiator::run(SPRequest& request, bool isHandler) con
void ADFSLogoutInitiator::receive(DDF& in, ostream& out)
{
#ifndef SHIBSP_LITE
+ // Defer to base class for notifications
+ if (in["notify"].integer() == 1)
+ return LogoutHandler::receive(in, out);
+
// Find application.
const char* aid=in["application_id"].string();
const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL;
@@ -787,59 +803,103 @@ void ADFSLogoutInitiator::receive(DDF& in, ostream& out)
throw ConfigurationException("Unable to locate application for logout, deleted?");
}
+ // Unpack the request.
+ auto_ptr<HTTPRequest> req(getRequest(in));
+
// Set up a response shim.
DDF ret(NULL);
DDFJanitor jout(ret);
auto_ptr<HTTPResponse> resp(getResponse(ret));
- // Since we're remoted, the result should either be a throw, which we pass on,
- // a false/0 return, which we just return as an empty structure, or a response/redirect,
- // which we capture in the facade and send back.
- doRequest(*app, in["entity_id"].string(), *resp.get());
+ Session* session = NULL;
+ try {
+ session = app->getServiceProvider().getSessionCache()->find(*app, *req.get(), NULL, NULL);
+ }
+ catch (exception& ex) {
+ m_log.error("error accessing current session: %s", ex.what());
+ }
+ // With no session, we just skip the request and let it fall through to an empty struct return.
+ if (session) {
+ if (session->getEntityID()) {
+ // Since we're remoted, the result should either be a throw, which we pass on,
+ // a false/0 return, which we just return as an empty structure, or a response/redirect,
+ // which we capture in the facade and send back.
+ doRequest(*app, *req.get(), *resp.get(), session);
+ }
+ else {
+ m_log.error("no issuing entityID found in session");
+ session->unlock();
+ app->getServiceProvider().getSessionCache()->remove(*app, *req.get(), resp.get());
+ }
+ }
out << ret;
#else
throw ConfigurationException("Cannot perform logout using lite version of shibsp library.");
#endif
}
-pair<bool,long> ADFSLogoutInitiator::doRequest(const Application& application, const char* entityID, HTTPResponse& response) const
+pair<bool,long> ADFSLogoutInitiator::doRequest(
+ const Application& application, const HTTPRequest& httpRequest, HTTPResponse& httpResponse, Session* session
+ ) const
{
+ // Do back channel notification.
+ vector<string> sessions(1, session->getID());
+ if (!notifyBackChannel(application, httpRequest.getRequestURL(), sessions, false)) {
+ session->unlock();
+ application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse);
+ return sendLogoutPage(application, httpRequest, httpResponse, true, "Partial logout failure.");
+ }
+
#ifndef SHIBSP_LITE
- try {
- if (!entityID)
- throw ConfigurationException("Missing entityID parameter.");
+ pair<bool,long> ret = make_pair(false,0L);
+ try {
// With a session in hand, we can create a request message, if we can find a compatible endpoint.
MetadataProvider* m=application.getMetadataProvider();
- Locker locker(m);
- MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get());
+ Locker metadataLocker(m);
+ MetadataProviderCriteria mc(application, session->getEntityID(), &IDPSSODescriptor::ELEMENT_QNAME, m_binding.get());
pair<const EntityDescriptor*,const RoleDescriptor*> entity=m->getEntityDescriptor(mc);
- if (!entity.first)
- throw MetadataException("Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", entityID));
- else if (!entity.second)
- throw MetadataException("Unable to locate ADFS IdP role for identity provider ($entityID).", namedparams(1, "entityID", entityID));
-
+ if (!entity.first) {
+ throw MetadataException(
+ "Unable to locate metadata for identity provider ($entityID)", namedparams(1, "entityID", session->getEntityID())
+ );
+ }
+ else if (!entity.second) {
+ throw MetadataException(
+ "Unable to locate ADFS IdP role for identity provider ($entityID).", namedparams(1, "entityID", session->getEntityID())
+ );
+ }
+
const EndpointType* ep = EndpointManager<SingleLogoutService>(
dynamic_cast<const IDPSSODescriptor*>(entity.second)->getSingleLogoutServices()
).getByBinding(m_binding.get());
if (!ep) {
throw MetadataException(
- "Unable to locate ADFS single logout service for identity provider ($entityID).",
- namedparams(1, "entityID", entityID)
+ "Unable to locate ADFS single logout service for identity provider ($entityID).", namedparams(1, "entityID", session->getEntityID())
);
}
+ const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
+ const char* returnloc = httpRequest.getParameter("return");
auto_ptr_char dest(ep->getLocation());
-
string req=string(dest.get()) + (strchr(dest.get(),'?') ? '&' : '?') + "wa=wsignout1.0";
- return make_pair(true,response.sendRedirect(req.c_str()));
+ if (returnloc)
+ req += "&wreply=" + urlenc->encode(returnloc);
+ ret.second = httpResponse.sendRedirect(req.c_str());
+ ret.first = true;
}
catch (exception& ex) {
m_log.error("error issuing ADFS logout request: %s", ex.what());
}
- return make_pair(false,0L);
+ if (session) {
+ session->unlock();
+ session = NULL;
+ application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse);
+ }
+
+ return ret;
#else
throw ConfigurationException("Cannot perform logout using lite version of shibsp library.");
#endif
diff --git a/adfs/adfs.rc b/adfs/adfs.rc
index 11fc309..7cd4e1b 100644
--- a/adfs/adfs.rc
+++ b/adfs/adfs.rc
@@ -54,8 +54,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -72,14 +72,14 @@ BEGIN
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
- VALUE "FileDescription", "Shibboleth 2.0 ADFSv1 Plugin\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileDescription", "Shibboleth ADFSv1 Plugin\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
#ifdef SHIBSP_LITE
VALUE "InternalName", "adfs-lite\0"
#else
VALUE "InternalName", "adfs\0"
#endif
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
#ifdef SHIBSP_LITE
VALUE "OriginalFilename", "adfs-lite.so\0"
@@ -87,8 +87,8 @@ BEGIN
VALUE "OriginalFilename", "adfs.so\0"
#endif
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/adfs/adfs.vcproj b/adfs/adfs.vcproj
index ab677ff..efb995f 100644
--- a/adfs/adfs.vcproj
+++ b/adfs/adfs.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -144,7 +147,6 @@
OutputFile="$(OutDir)\$(ProjectName).so"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(ConfigurationName);..\..\cpp-xmltooling\$(ConfigurationName)"
- GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -175,6 +177,168 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib saml2D.lib xmltooling1D.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib saml2.lib xmltooling1.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/apache/Makefile.in b/apache/Makefile.in
index ca5a2ed..8d3aece 100644
--- a/apache/Makefile.in
+++ b/apache/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -128,6 +128,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -213,6 +215,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/apache/mod_apache.cpp b/apache/mod_apache.cpp
index cbc0dbf..4fd81e8 100644
--- a/apache/mod_apache.cpp
+++ b/apache/mod_apache.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* mod_apache.cpp
- *
+ *
* Apache module implementation
*/
@@ -69,8 +69,10 @@
#include <apr_pools.h>
#endif
+#include <memory>
#include <fstream>
#include <sstream>
+#include <stdexcept>
#ifdef HAVE_UNISTD_H
#include <unistd.h> // for getpid()
@@ -544,7 +546,7 @@ extern "C" int shib_check_user(request_rec* r)
// Short-circuit entirely?
if (((shib_dir_config*)ap_get_module_config(r->per_dir_config, &mod_shib))->bOff==1)
return DECLINED;
-
+
ap_log_rerror(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,SH_AP_R(r), "shib_check_user(%d): ENTER", (int)getpid());
ostringstream threadid;
@@ -687,7 +689,7 @@ public:
Lockable* lock() { return m_mapper->lock(); }
void unlock() { m_staKey->setData(NULL); m_propsKey->setData(NULL); m_mapper->unlock(); }
Settings getSettings(const HTTPRequest& request) const;
-
+
const PropertySet* getParent() const { return NULL; }
void setParent(const PropertySet*) {}
pair<bool,bool> getBool(const char* name, const char* ns=NULL) const;
@@ -943,7 +945,7 @@ AccessControl::aclresult_t htAccessControl::authorized(const SPRequest& request,
int m=sta->m_req->method_number;
bool method_restricted=false;
const char *t, *w;
-
+
const array_header* reqs_arr=ap_requires(sta->m_req);
if (!reqs_arr)
return shib_acl_indeterminate; // should never happen
@@ -1027,7 +1029,7 @@ AccessControl::aclresult_t htAccessControl::authorized(const SPRequest& request,
request.log(SPRequest::SPDebug,string("htaccess plugin using groups file: ") + sta->m_dc->szAuthGrpFile);
grpstatus=groups_for_user(sta->m_req,remote_user.c_str(),sta->m_dc->szAuthGrpFile);
}
-
+
bool negate=false;
while (*t) {
w=ap_getword_conf(sta->m_req->pool,&t);
@@ -1112,7 +1114,7 @@ AccessControl::aclresult_t htAccessControl::authorized(const SPRequest& request,
auto_ptr<xercesc::RegularExpression> temp(new xercesc::RegularExpression(trans.get()));
re=temp;
}
-
+
for (; !status && attrs.first!=attrs.second; ++attrs.first) {
if (checkAttribute(request, attrs.first->second, w, regexp ? re.get() : NULL)) {
status = true;
@@ -1235,7 +1237,7 @@ extern "C" apr_status_t shib_exit(void* data)
}
#endif
-/*
+/*
* shire_child_init()
* Things to do when the child process is initialized.
* (or after the configs are read in apache-2)
@@ -1271,21 +1273,9 @@ extern "C" void shib_child_init(apr_pool_t* p, server_rec* s)
g_Config->AccessControlManager.registerFactory(HT_ACCESS_CONTROL,&htAccessFactory);
g_Config->RequestMapperManager.registerFactory(NATIVE_REQUEST_MAPPER,&ApacheRequestMapFactory);
- if (!g_szSHIBConfig)
- g_szSHIBConfig=getenv("SHIBSP_CONFIG");
- if (!g_szSHIBConfig)
- g_szSHIBConfig=SHIBSP_CONFIG;
-
try {
- xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
- xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(g_szSHIBConfig);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- g_Config->getServiceProvider()->init();
+ if (!g_Config->instantiate(g_szSHIBConfig, true))
+ throw runtime_error("unknown error");
}
catch (exception& ex) {
ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO,SH_AP_R(s),ex.what());
@@ -1382,13 +1372,11 @@ static command_rec shire_cmds[] = {
RSRC_CONF, TAKE1, "Path to shibboleth.xml config file"},
{"ShibCatalogs", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir,
RSRC_CONF, TAKE1, "Paths of XML schema catalogs"},
- {"ShibSchemaDir", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir,
- RSRC_CONF, TAKE1, "Paths of XML schema catalogs (deprecated in favor of ShibCatalogs)"},
{"ShibURLScheme", (config_fn_t)shib_set_server_string_slot,
(void *) XtOffsetOf (shib_server_config, szScheme),
RSRC_CONF, TAKE1, "URL scheme to force into generated URLs for a vhost"},
-
+
{"ShibRequestSetting", (config_fn_t)shib_table_set, NULL,
OR_AUTHCFG, TAKE2, "Set arbitrary Shibboleth request property for content"},
@@ -1488,8 +1476,6 @@ static command_rec shib_cmds[] = {
RSRC_CONF, "Path to shibboleth.xml config file"),
AP_INIT_TAKE1("ShibCatalogs", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir,
RSRC_CONF, "Paths of XML schema catalogs"),
- AP_INIT_TAKE1("ShibSchemaDir", (config_fn_t)ap_set_global_string_slot, &g_szSchemaDir,
- RSRC_CONF, "Paths of XML schema catalogs (deprecated in favor of ShibCatalogs)"),
AP_INIT_TAKE1("ShibURLScheme", (config_fn_t)shib_set_server_string_slot,
(void *) offsetof (shib_server_config, szScheme),
diff --git a/apache/mod_shib13.vcproj b/apache/mod_shib13.vcproj
index c259b88..5f207f4 100644
--- a/apache/mod_shib13.vcproj
+++ b/apache/mod_shib13.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -76,8 +79,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache\libexec"
- ProgramDatabaseFile=".\Release/mod_shib_13.pdb"
- ImportLibrary=".\Release/mod_shib_13.lib"
TargetMachine="1"
/>
<Tool
@@ -169,7 +170,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache\libexec"
GenerateDebugInformation="true"
- ImportLibrary=".\Debug/mod_shib_13.lib"
TargetMachine="1"
/>
<Tool
@@ -197,6 +197,188 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/mod_shib13.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..;\Apache\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;EAPI"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib ApacheCore.lib xmltooling-lite1.lib"
+ OutputFile="$(OutDir)\mod_shib_13.so"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";\Apache\libexec"
+ ProgramDatabaseFile=".\Release/mod_shib_13.pdb"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/mod_shib13.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..;\Apache\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_WINDOWS;EAPI;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib ApacheCore.lib xmltooling-lite1D.lib"
+ OutputFile="$(OutDir)\mod_shib_13.so"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";\Apache\libexec"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -220,6 +402,22 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="mod_shib_13.cpp"
diff --git a/apache/mod_shib20.vcproj b/apache/mod_shib20.vcproj
index 149615d..237bd70 100644
--- a/apache/mod_shib20.vcproj
+++ b/apache/mod_shib20.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +19,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\mod_shib20___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -77,8 +80,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache2\lib"
- ProgramDatabaseFile=".\mod_shib20___Win32_Release/mod_shib_20.pdb"
- ImportLibrary=".\mod_shib20___Win32_Release/mod_shib_20.lib"
TargetMachine="1"
/>
<Tool
@@ -109,7 +110,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\mod_shib20___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
@@ -171,7 +172,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache2\lib"
GenerateDebugInformation="true"
- ImportLibrary=".\mod_shib20___Win32_Debug/mod_shib_20.lib"
TargetMachine="1"
/>
<Tool
@@ -199,6 +199,190 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mod_shib20___Win32_Release/mod_shib20.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..;\Apache2\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib libapr.lib libaprutil.lib libhttpd.lib xmltooling-lite1.lib"
+ OutputFile="$(OutDir)\mod_shib_20.so"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";\Apache2\lib"
+ ProgramDatabaseFile=".\mod_shib20___Win32_Release/mod_shib_20.pdb"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mod_shib20___Win32_Debug/mod_shib20.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..;\Apache2\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib libapr.lib libaprutil.lib libhttpd.lib xmltooling-lite1D.lib"
+ OutputFile="$(OutDir)\mod_shib_20.so"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";\Apache2\lib"
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -222,6 +406,22 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="mod_shib_20.cpp"
diff --git a/apache/mod_shib22.vcproj b/apache/mod_shib22.vcproj
index c08f802..81ed0da 100644
--- a/apache/mod_shib22.vcproj
+++ b/apache/mod_shib22.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +19,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\mod_shib22___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -76,8 +79,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache2.2\lib"
- ProgramDatabaseFile=".\mod_shib22___Win32_Release/mod_shib_22.pdb"
- ImportLibrary=".\mod_shib22___Win32_Release/mod_shib_22.lib"
TargetMachine="1"
/>
<Tool
@@ -92,7 +93,6 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
- OutputFile=".\mod_shib22___Win32_Release/mod_shib22.bsc"
/>
<Tool
Name="VCFxCopTool"
@@ -110,7 +110,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\mod_shib22___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -172,8 +172,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)";\Apache2.2\lib"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\mod_shib22___Win32_Debug/mod_shib_22.pdb"
- ImportLibrary=".\mod_shib22___Win32_Debug/mod_shib_22.lib"
TargetMachine="1"
/>
<Tool
@@ -188,7 +186,190 @@
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
- OutputFile=".\mod_shib22___Win32_Debug/mod_shib22.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mod_shib22___Win32_Release/mod_shib22.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..;\Apache2.2\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib xmltooling-lite1.lib libapr-1.lib libaprutil-1.lib libhttpd.lib"
+ OutputFile="$(OutDir)\mod_shib_22.so"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";"C:\httpd-2.2-x64\lib""
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\mod_shib22___Win32_Debug/mod_shib22.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..;\Apache2.2\include;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib xmltooling-lite1D.lib libapr-1.lib libaprutil-1.lib libhttpd.lib"
+ OutputFile="$(OutDir)\mod_shib_22.so"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)";"C:\httpd-2.2-x64\lib""
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
/>
<Tool
Name="VCFxCopTool"
@@ -226,6 +407,22 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="mod_shib_22.cpp"
diff --git a/apache/mod_shib_13.rc b/apache/mod_shib_13.rc
index a352d58..e6939bb 100644
--- a/apache/mod_shib_13.rc
+++ b/apache/mod_shib_13.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth Apache 1.3 Module\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "mod_shib_13\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "mod_shib_13.so\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/apache/mod_shib_20.rc b/apache/mod_shib_20.rc
index ead4cdf..108338c 100644
--- a/apache/mod_shib_20.rc
+++ b/apache/mod_shib_20.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth Apache 2.0 Module\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "mod_shib_20\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "mod_shib_20.so\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/apache/mod_shib_22.rc b/apache/mod_shib_22.rc
index c8c44cd..ede13f4 100644
--- a/apache/mod_shib_22.rc
+++ b/apache/mod_shib_22.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth Apache 2.2 Module\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "mod_shib_22\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "mod_shib_22.so\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/config.guess b/config.guess
index 2fc3acc..917bbc5 100755
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2003-06-17'
+timestamp='2005-07-08'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -17,13 +17,15 @@ timestamp='2003-06-17'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Originally written by Per Bothner <per at bothner.com>.
# Please send patches to <config-patches at gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
@@ -53,7 +55,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -66,11 +68,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi at noc.rutgers.edu 1994-08-24)
@@ -136,13 +138,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-## for Red Hat Linux
-if test -f /etc/redhat-release ; then
- VENDOR=redhat ;
-else
- VENDOR= ;
-fi
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -203,50 +198,29 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
+ case $UNAME_RELEASE in
+ *4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -284,42 +258,49 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
+ # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit 0 ;;
+ exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit 0 ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit 0 ;;
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
+ exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -327,32 +308,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
else
echo pyramid-pyramid-bsd
fi
- exit 0 ;;
+ exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit 0 ;;
+ exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
@@ -361,10 +342,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
+ exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -376,10 +357,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -390,37 +371,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -444,32 +428,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit 0 ;;
+ exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit 0 ;;
+ exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit 0 ;;
+ exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit 0 ;;
+ exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -485,29 +470,29 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit 0 ;;
+ exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit 0 ;;
+ exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit 0 ;;
+ exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
@@ -515,7 +500,7 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
@@ -530,14 +515,18 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit 0 ;;
+ exit ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -551,28 +540,28 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit 0 ;;
+ exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit 0 ;;
+ exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit 0 ;;
+ exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit 0 ;;
+ exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
@@ -634,9 +623,19 @@ EOF
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
@@ -644,11 +643,11 @@ EOF
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -676,150 +675,166 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
+ exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit 0 ;;
+ exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit 0 ;;
+ exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit 0 ;;
+ exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit 0 ;;
+ exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit 0 ;;
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit 0 ;;
+ exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
+ exit ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
+ exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
+ exit ;;
x86:Interix*:[34]*)
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
- exit 0 ;;
+ exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
+ exit ;;
+ amd64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit 0 ;;
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
*:GNU:*:*)
+ # the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
+ exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit 0 ;;
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
- exit 0 ;;
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -837,7 +852,7 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
@@ -856,14 +871,14 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
ppc:Linux:*:*)
- echo powerpc-${VENDOR:-unknown}-linux-gnu
- exit 0 ;;
+ echo powerpc-unknown-linux-gnu
+ exit ;;
ppc64:Linux:*:*)
- echo powerpc64-${VENDOR:-unknown}-linux-gnu
- exit 0 ;;
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -877,7 +892,7 @@ EOF
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -885,25 +900,25 @@ EOF
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit 0 ;;
+ exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
- exit 0 ;;
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
x86_64:Linux:*:*)
- echo x86_64-${VENDOR:-unknown}-linux-gnu
- exit 0 ;;
+ echo x86_64-unknown-linux-gnu
+ exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -921,15 +936,15 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
+ exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
+ exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -952,17 +967,23 @@ EOF
LIBC=gnuaout
#endif
#endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit 0 ;;
+ exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -970,24 +991,27 @@ EOF
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
+ exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
+ exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -995,15 +1019,16 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit 0 ;;
- i*86:*:5:[78]*)
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1021,73 +1046,73 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit 0 ;;
+ exit ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit 0 ;;
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit 0 ;;
+ exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit 0 ;;
+ exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
+ && { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1095,68 +1120,73 @@ EOF
else
echo ns32k-sni-sysv
fi
- exit 0 ;;
+ exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel at ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes at openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit 0 ;;
+ exit ;;
*:*:*:FTX*)
# From seanf at swdc.stratus.com.
echo i860-stratus-sysv4
- exit 0 ;;
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
*:VOS:*:*)
# From Paul.Green at stratus.com.
echo hppa1.1-stratus-vos
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit 0 ;;
+ exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit 0 ;;
+ exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit 0 ;;
+ exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit 0 ;;
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Darwin:*:*)
- case `uname -p` in
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
*86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1164,22 +1194,25 @@ EOF
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit 0 ;;
+ exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1190,28 +1223,44 @@ EOF
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit 0 ;;
+ exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit 0 ;;
+ exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit 0 ;;
+ exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit 0 ;;
+ exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit 0 ;;
+ exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit 0 ;;
+ exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1243,7 +1292,7 @@ main ()
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
+ printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
@@ -1332,11 +1381,12 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
@@ -1345,22 +1395,22 @@ then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
c34*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
c38*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
c4*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
esac
fi
@@ -1371,7 +1421,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- ftp://ftp.gnu.org/pub/gnu/config/
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/config.sub b/config.sub
index 6b2ff9f..1c366df 100755
--- a/config.sub
+++ b/config.sub
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2003-06-18'
+timestamp='2005-07-08'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2003-06-18'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Please send patches to <config-patches at gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@@ -70,7 +71,7 @@ Report bugs and patches to <config-patches at gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
- exit 0;;
+ exit ;;
* )
break ;;
@@ -118,7 +119,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
+ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -144,7 +146,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
@@ -228,14 +230,16 @@ case $basic_machine in
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
- | ip2k \
- | m32r | m68000 | m68k | m88k | mcore \
+ | ip2k | iq2000 \
+ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -244,31 +248,37 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | ms1 \
| msp430 \
| ns16k | ns32k \
- | openrisc | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | s390 | s390x \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
+ m32c)
+ basic_machine=$basic_machine-unknown
+ ;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@@ -296,19 +306,19 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* \
- | bs2000-* \
+ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* \
- | m32r-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -317,34 +327,40 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | ms1-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | s390-* | s390x-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
+ m32c-*)
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -361,6 +377,9 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -378,6 +397,9 @@ case $basic_machine in
amd64)
basic_machine=x86_64-pc
;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -437,12 +459,27 @@ case $basic_machine in
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -465,6 +502,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -643,10 +684,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -727,10 +764,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -738,9 +771,12 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
- or32 | or32-*)
+ openrisc | openrisc-*)
basic_machine=or32-unknown
- os=-coff
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
@@ -833,6 +869,12 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
sa29200)
basic_machine=a29k-amd
os=-udi
@@ -956,6 +998,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -999,6 +1045,10 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1029,6 +1079,9 @@ case $basic_machine in
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1045,12 +1098,9 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
@@ -1124,19 +1174,21 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1154,12 +1206,15 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
@@ -1172,6 +1227,9 @@ case $os in
-opened*)
os=-openedition
;;
+ -os400*)
+ os=-os400
+ ;;
-wince*)
os=-wince
;;
@@ -1193,6 +1251,9 @@ case $os in
-atheos*)
os=-atheos
;;
+ -syllable*)
+ os=-syllable
+ ;;
-386bsd)
os=-bsd
;;
@@ -1215,6 +1276,9 @@ case $os in
-sinix*)
os=-sysv4
;;
+ -tpf*)
+ os=-tpf
+ ;;
-triton*)
os=-sysv3
;;
@@ -1251,6 +1315,9 @@ case $os in
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
-none)
;;
*)
@@ -1282,9 +1349,9 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@@ -1328,9 +1395,15 @@ case $basic_machine in
*-be)
os=-beos
;;
+ *-haiku)
+ os=-haiku
+ ;;
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
@@ -1463,9 +1536,15 @@ case $basic_machine in
-mvs* | -opened*)
vendor=ibm
;;
+ -os400*)
+ vendor=ibm
+ ;;
-ptx*)
vendor=sequent
;;
+ -tpf*)
+ vendor=ibm
+ ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
@@ -1490,7 +1569,7 @@ case $basic_machine in
esac
echo $basic_machine$os
-exit 0
+exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/configs/Makefile.in b/configs/Makefile.in
index 6e48ffb..6a9a049 100644
--- a/configs/Makefile.in
+++ b/configs/Makefile.in
@@ -43,7 +43,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ -87,6 +87,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -172,6 +174,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/configs/attribute-map.xml b/configs/attribute-map.xml
index 090f804..4f7477c 100644
--- a/configs/attribute-map.xml
+++ b/configs/attribute-map.xml
@@ -28,17 +28,25 @@
<!-- A persistent id attribute that supports personalized anonymous access. -->
- <!-- First, the deprecated version: -->
+ <!-- First, the deprecated version, decoded as a scoped string: -->
<Attribute name="urn:mace:dir:attribute-def:eduPersonTargetedID" id="targeted-id">
<AttributeDecoder xsi:type="ScopedAttributeDecoder"/>
+ <!-- <AttributeDecoder xsi:type="NameIDFromScopedAttributeDecoder" formatter="$NameQualifier!$SPNameQualifier!$Name"/> -->
</Attribute>
-
- <!-- Second, the new version (note the OID-style name): -->
+
+ <!-- Second, an alternate decoder that will turn the deprecated form into the newer form. -->
+ <!--
+ <Attribute name="urn:mace:dir:attribute-def:eduPersonTargetedID" id="persistent-id">
+ <AttributeDecoder xsi:type="NameIDFromScopedAttributeDecoder" formatter="$NameQualifier!$SPNameQualifier!$Name"/>
+ </Attribute>
+ -->
+
+ <!-- Third, the new version (note the OID-style name): -->
<Attribute name="urn:oid:1.3.6.1.4.1.5923.1.1.1.10" id="persistent-id">
<AttributeDecoder xsi:type="NameIDAttributeDecoder" formatter="$NameQualifier!$SPNameQualifier!$Name"/>
</Attribute>
- <!-- Third, the SAML 2.0 NameID Format: -->
+ <!-- Fourth, the SAML 2.0 NameID Format: -->
<Attribute name="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" id="persistent-id">
<AttributeDecoder xsi:type="NameIDAttributeDecoder" formatter="$NameQualifier!$SPNameQualifier!$Name"/>
</Attribute>
diff --git a/configs/attribute-policy.xml b/configs/attribute-policy.xml
index c19ed16..22ae662 100644
--- a/configs/attribute-policy.xml
+++ b/configs/attribute-policy.xml
@@ -13,6 +13,7 @@
<Rule xsi:type="AttributeValueString" value="member"/>
<Rule xsi:type="AttributeValueString" value="affiliate"/>
<Rule xsi:type="AttributeValueString" value="employee"/>
+ <Rule xsi:type="AttributeValueString" value="library-walk-in"/>
</afp:PermitValueRule>
<!--
diff --git a/configs/keygen.sh b/configs/keygen.sh
index aa47b68..0729fe3 100755
--- a/configs/keygen.sh
+++ b/configs/keygen.sh
@@ -66,4 +66,5 @@ else
openssl req -config sp-cert.cnf -new -x509 -days $DAYS -keyout sp-key.pem -out sp-cert.pem 2> /dev/null
fi
+chmod 600 sp-key.pem
rm sp-cert.cnf
diff --git a/configs/shibboleth2.xml b/configs/shibboleth2.xml
index fa230c5..afe286d 100644
--- a/configs/shibboleth2.xml
+++ b/configs/shibboleth2.xml
@@ -92,7 +92,7 @@
-->
<Sessions lifetime="28800" timeout="3600" checkAddress="false"
handlerURL="/Shibboleth.sso" handlerSSL="false"
- exportLocation="http://localhost/Shibboleth.sso/GetAssertion"
+ exportLocation="http://localhost/Shibboleth.sso/GetAssertion" exportACL="127.0.0.1"
idpHistory="false" idpHistoryDays="7">
<!--
@@ -104,20 +104,20 @@
<!-- Default example directs to a specific IdP's SSO service (favoring SAML 2 over Shib 1). -->
<SessionInitiator type="Chaining" Location="/Login" isDefault="true" id="Intranet"
relayState="cookie" entityID="https://idp.example.org/shibboleth">
- <SessionInitiator type="SAML2" defaultACSIndex="1" template="bindingTemplate.html"/>
+ <SessionInitiator type="SAML2" defaultACSIndex="1" acsByIndex="false" template="bindingTemplate.html"/>
<SessionInitiator type="Shib1" defaultACSIndex="5"/>
</SessionInitiator>
<!-- An example using an old-style WAYF, which means Shib 1 only unless an entityID is provided. -->
<SessionInitiator type="Chaining" Location="/WAYF" id="WAYF" relayState="cookie">
- <SessionInitiator type="SAML2" defaultACSIndex="1" template="bindingTemplate.html"/>
+ <SessionInitiator type="SAML2" defaultACSIndex="1" acsByIndex="false" template="bindingTemplate.html"/>
<SessionInitiator type="Shib1" defaultACSIndex="5"/>
<SessionInitiator type="WAYF" defaultACSIndex="5" URL="https://wayf.example.org/WAYF"/>
</SessionInitiator>
<!-- An example supporting the new-style of discovery service. -->
<SessionInitiator type="Chaining" Location="/DS" id="DS" relayState="cookie">
- <SessionInitiator type="SAML2" defaultACSIndex="1" template="bindingTemplate.html"/>
+ <SessionInitiator type="SAML2" defaultACSIndex="1" acsByIndex="false" template="bindingTemplate.html"/>
<SessionInitiator type="Shib1" defaultACSIndex="5"/>
<SessionInitiator type="SAMLDS" URL="https://ds.example.org/DS"/>
</SessionInitiator>
@@ -181,7 +181,7 @@
<Handler type="Status" Location="/Status" acl="127.0.0.1"/>
<!-- Session diagnostic service. -->
- <Handler type="Session" Location="/Session"/>
+ <Handler type="Session" Location="/Session" showAttributeValues="false"/>
</Sessions>
diff --git a/configure b/configure
index f1d3931..e3cf3b9 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for shibboleth 2.0.
+# Generated by GNU Autoconf 2.59 for shibboleth 2.1.
#
# Report bugs to <shibboleth-users at internet2.edu>.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='shibboleth'
PACKAGE_TARNAME='shibboleth'
-PACKAGE_VERSION='2.0'
-PACKAGE_STRING='shibboleth 2.0'
+PACKAGE_VERSION='2.1'
+PACKAGE_STRING='shibboleth 2.1'
PACKAGE_BUGREPORT='shibboleth-users at internet2.edu'
# Factoring default headers for most tests.
@@ -464,7 +464,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INS [...]
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INS [...]
ac_subst_files=''
# Initialize some variables set by options.
@@ -957,7 +957,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures shibboleth 2.0 to adapt to many kinds of systems.
+\`configure' configures shibboleth 2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1023,7 +1023,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of shibboleth 2.0:";;
+ short | recursive ) echo "Configuration of shibboleth 2.1:";;
esac
cat <<\_ACEOF
@@ -1074,6 +1074,7 @@ Optional Packages:
--with-saml=PATH where saml is installed
--with-nsapi=DIR Build NSAPI module for Netscape/iPlanet/SunONE
--with-fastcgi=DIR Build FastCGI support
+ --with-memcached=DIR Build Memcached support
--with-apxs=FILE Specifies where to find the Apache 1.3 apxs script.
--with-apxs2=FILE Specifies where to find the Apache 2.0 apxs script.
--with-apr=PATH where apr-config is installed
@@ -1196,7 +1197,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-shibboleth configure 2.0
+shibboleth configure 2.1
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1210,7 +1211,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by shibboleth $as_me 2.0, which was
+It was created by shibboleth $as_me 2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1855,7 +1856,7 @@ fi
# Define the identity of the package.
PACKAGE=shibboleth
- VERSION=2.0
+ VERSION=2.1
cat >>confdefs.h <<_ACEOF
@@ -5534,7 +5535,10 @@ else
if test "$CXX" = "CC" ; then
CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
fi
- ;;
+ ;;
+ *osf*)
+ CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
+ ;;
esac
fi
@@ -6093,7 +6097,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6096 "configure"' > conftest.$ac_ext
+ echo '#line 6100 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7201,7 +7205,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:7204:" \
+echo "$as_me:7208:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -8239,11 +8243,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8242: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8246: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8246: \$? = $ac_status" >&5
+ echo "$as_me:8250: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -8472,11 +8476,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8475: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8479: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8479: \$? = $ac_status" >&5
+ echo "$as_me:8483: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -8532,11 +8536,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8535: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8539: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8539: \$? = $ac_status" >&5
+ echo "$as_me:8543: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -9866,7 +9870,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 9869 "configure"' > conftest.$ac_ext
+ echo '#line 9873 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -10737,7 +10741,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10740 "configure"
+#line 10744 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10835,7 +10839,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10838 "configure"
+#line 10842 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13018,11 +13022,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13021: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13025: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13025: \$? = $ac_status" >&5
+ echo "$as_me:13029: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -13078,11 +13082,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13081: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13085: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13085: \$? = $ac_status" >&5
+ echo "$as_me:13089: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13589,7 +13593,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 13592 "configure"' > conftest.$ac_ext
+ echo '#line 13596 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -14460,7 +14464,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14463 "configure"
+#line 14467 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -14558,7 +14562,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 14561 "configure"
+#line 14565 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -15385,11 +15389,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15388: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15392: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15392: \$? = $ac_status" >&5
+ echo "$as_me:15396: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -15445,11 +15449,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15448: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15452: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15452: \$? = $ac_status" >&5
+ echo "$as_me:15456: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16759,7 +16763,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 16762 "configure"' > conftest.$ac_ext
+ echo '#line 16766 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -17504,11 +17508,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17507: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17511: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17511: \$? = $ac_status" >&5
+ echo "$as_me:17515: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -17737,11 +17741,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17740: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17744: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17744: \$? = $ac_status" >&5
+ echo "$as_me:17748: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -17797,11 +17801,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17800: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17804: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17804: \$? = $ac_status" >&5
+ echo "$as_me:17808: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -19131,7 +19135,7 @@ linux*)
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 19134 "configure"' > conftest.$ac_ext
+ echo '#line 19138 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -20002,7 +20006,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 20005 "configure"
+#line 20009 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20100,7 +20104,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 20103 "configure"
+#line 20107 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -24860,6 +24864,200 @@ if test ! "$WANT_FASTCGI" = "no" ; then
WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
fi
+#
+# Build Memcached support?
+#
+echo "$as_me:$LINENO: checking for Memcached support" >&5
+echo $ECHO_N "checking for Memcached support... $ECHO_C" >&6
+
+# Check whether --with-memcached or --without-memcached was given.
+if test "${with_memcached+set}" = set; then
+ withval="$with_memcached"
+ WANT_MEMCACHED=$withval
+else
+ WANT_MEMCACHED=no
+fi;
+echo "$as_me:$LINENO: result: $WANT_MEMCACHED" >&5
+echo "${ECHO_T}$WANT_MEMCACHED" >&6
+
+if test "$WANT_MEMCACHED" != "no"; then
+ if test "$WANT_MEMCACHED" != "yes"; then
+ if test x_$WANT_MEMCACHED != x_/usr; then
+ MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
+ MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
+ fi
+ fi
+ if test "${ac_cv_header_libmemcached_memcached_h+set}" = set; then
+ echo "$as_me:$LINENO: checking for libmemcached/memcached.h" >&5
+echo $ECHO_N "checking for libmemcached/memcached.h... $ECHO_C" >&6
+if test "${ac_cv_header_libmemcached_memcached_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libmemcached_memcached_h" >&5
+echo "${ECHO_T}$ac_cv_header_libmemcached_memcached_h" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking libmemcached/memcached.h usability" >&5
+echo $ECHO_N "checking libmemcached/memcached.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <libmemcached/memcached.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking libmemcached/memcached.h presence" >&5
+echo $ECHO_N "checking libmemcached/memcached.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libmemcached/memcached.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: libmemcached/memcached.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: libmemcached/memcached.h: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## --------------------------------------------- ##
+## Report this to shibboleth-users at internet2.edu ##
+## --------------------------------------------- ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for libmemcached/memcached.h" >&5
+echo $ECHO_N "checking for libmemcached/memcached.h... $ECHO_C" >&6
+if test "${ac_cv_header_libmemcached_memcached_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_header_libmemcached_memcached_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_libmemcached_memcached_h" >&5
+echo "${ECHO_T}$ac_cv_header_libmemcached_memcached_h" >&6
+
+fi
+if test $ac_cv_header_libmemcached_memcached_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: unable to find Memcached header files" >&5
+echo "$as_me: error: unable to find Memcached header files" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+ MEMCACHED_LIBS="-lmemcached"
+fi
+
+
+
+
+
+# always output the Makefile, even if you don't use it
+ ac_config_files="$ac_config_files memcache-store/Makefile"
+
+
+
+if test ! "$WANT_MEMCACHED" = "no"; then
+ BUILD_MEMCACHED_TRUE=
+ BUILD_MEMCACHED_FALSE='#'
+else
+ BUILD_MEMCACHED_TRUE='#'
+ BUILD_MEMCACHED_FALSE=
+fi
+
+
+if test ! "$WANT_MEMCACHED" = "no" ; then
+ WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
+fi
+
#
# If no --enable-apache-xx specified
@@ -26268,6 +26466,13 @@ echo "$as_me: error: conditional \"BUILD_FASTCGI\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${BUILD_MEMCACHED_TRUE}" && test -z "${BUILD_MEMCACHED_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"BUILD_MEMCACHED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_MEMCACHED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
if test -z "${BUILD_AP13_TRUE}" && test -z "${BUILD_AP13_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"BUILD_AP13\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@@ -26560,7 +26765,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by shibboleth $as_me 2.0, which was
+This file was extended by shibboleth $as_me 2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -26623,7 +26828,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-shibboleth config.status 2.0
+shibboleth config.status 2.1
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -26744,6 +26949,7 @@ do
"adfs/Makefile" ) CONFIG_FILES="$CONFIG_FILES adfs/Makefile" ;;
"nsapi_shib/Makefile" ) CONFIG_FILES="$CONFIG_FILES nsapi_shib/Makefile" ;;
"fastcgi/Makefile" ) CONFIG_FILES="$CONFIG_FILES fastcgi/Makefile" ;;
+ "memcache-store/Makefile" ) CONFIG_FILES="$CONFIG_FILES memcache-store/Makefile" ;;
"apache/Makefile" ) CONFIG_FILES="$CONFIG_FILES apache/Makefile" ;;
"odbc-store/Makefile" ) CONFIG_FILES="$CONFIG_FILES odbc-store/Makefile" ;;
"depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
@@ -26993,6 +27199,11 @@ s, at FASTCGI_LDFLAGS@,$FASTCGI_LDFLAGS,;t t
s, at FASTCGI_LIBS@,$FASTCGI_LIBS,;t t
s, at BUILD_FASTCGI_TRUE@,$BUILD_FASTCGI_TRUE,;t t
s, at BUILD_FASTCGI_FALSE@,$BUILD_FASTCGI_FALSE,;t t
+s, at MEMCACHED_INCLUDE@,$MEMCACHED_INCLUDE,;t t
+s, at MEMCACHED_LDFLAGS@,$MEMCACHED_LDFLAGS,;t t
+s, at MEMCACHED_LIBS@,$MEMCACHED_LIBS,;t t
+s, at BUILD_MEMCACHED_TRUE@,$BUILD_MEMCACHED_TRUE,;t t
+s, at BUILD_MEMCACHED_FALSE@,$BUILD_MEMCACHED_FALSE,;t t
s, at xs@,$xs,;t t
s, at APXS@,$APXS,;t t
s, at APXS_CFLAGS@,$APXS_CFLAGS,;t t
diff --git a/configure.ac b/configure.ac
index ef10e95..effa6af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
AC_PREREQ([2.50])
-AC_INIT([shibboleth], [2.0], [shibboleth-users at internet2.edu], [shibboleth])
+AC_INIT([shibboleth], [2.1], [shibboleth-users at internet2.edu], [shibboleth])
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE([shibboleth],[2.0])
+AM_INIT_AUTOMAKE([shibboleth],[2.1])
sinclude(doxygen.m4)
sinclude(acx_pthread.m4)
@@ -52,7 +52,10 @@ else
if test "$CXX" = "CC" ; then
CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
fi
- ;;
+ ;;
+ *osf*)
+ CXXFLAGS="$CXXFLAGS -D_POSIX_PII_SOCKET"
+ ;;
esac
fi
@@ -436,6 +439,39 @@ if test ! "$WANT_FASTCGI" = "no" ; then
WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
fi
+#
+# Build Memcached support?
+#
+AC_MSG_CHECKING(for Memcached support)
+AC_ARG_WITH(memcached,
+ AC_HELP_STRING([--with-memcached=DIR], [Build Memcached support]),
+ [WANT_MEMCACHED=$withval],[WANT_MEMCACHED=no])
+AC_MSG_RESULT($WANT_MEMCACHED)
+
+if test "$WANT_MEMCACHED" != "no"; then
+ if test "$WANT_MEMCACHED" != "yes"; then
+ if test x_$WANT_MEMCACHED != x_/usr; then
+ MEMCACHED_INCLUDE="-I$WANT_MEMCACHED/include"
+ MEMCACHED_LDFLAGS="-L$WANT_MEMCACHED/lib"
+ fi
+ fi
+ AC_CHECK_HEADER([libmemcached/memcached.h],,
+ AC_MSG_ERROR([unable to find Memcached header files]))
+ MEMCACHED_LIBS="-lmemcached"
+fi
+
+AC_SUBST(MEMCACHED_INCLUDE)
+AC_SUBST(MEMCACHED_LDFLAGS)
+AC_SUBST(MEMCACHED_LIBS)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([memcache-store/Makefile])
+AM_CONDITIONAL(BUILD_MEMCACHED,test ! "$WANT_MEMCACHED" = "no")
+
+if test ! "$WANT_MEMCACHED" = "no" ; then
+ WANT_SUBDIRS="$WANT_SUBDIRS memcache-store"
+fi
+
#
# If no --enable-apache-xx specified
diff --git a/depcomp b/depcomp
index edb5d38..04701da 100755
--- a/depcomp
+++ b/depcomp
@@ -1,7 +1,9 @@
#! /bin/sh
-
# depcomp - compile a program generating dependencies as side-effects
-# Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,8 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -25,22 +27,45 @@
# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
-# `libtool' can also be set to `yes' or `no'.
-
-if test -z "$depfile"; then
- base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
- dir=`echo "$object" | sed 's,/.*$,/,'`
- if test "$dir" = "$object"; then
- dir=
- fi
- # FIXME: should be _deps on DOS.
- depfile="$dir.deps/$base"
-fi
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
@@ -262,27 +287,43 @@ tru64)
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
- tmpdepfile1="$dir.libs/$base.lo.d"
- tmpdepfile2="$dir.libs/$base.d"
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mecanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
- tmpdepfile1="$dir$base.o.d"
- tmpdepfile2="$dir$base.d"
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- else
- tmpdepfile="$tmpdepfile2"
- fi
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
@@ -426,7 +467,8 @@ cpp)
done
"$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
@@ -477,3 +519,12 @@ none)
esac
exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/depend b/depend
index 1e7190a..5cd3481 100644
--- a/depend
+++ b/depend
@@ -5,8 +5,8 @@ P SHIBxerces xerces-c
P SHIBxmlsec xml-security-c
1.4.0
P SHIBxmltool xmltooling-c
- 1.0
+ 1.1
P SHIBosaml opensaml-c
- 2.0
+ 2.1
P SHIBlog4shib log4shib
1.0
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 7cf7828..7e4107e 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ -87,6 +87,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -172,6 +174,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/doc/README.txt b/doc/README.txt
index 620c3ad..7b15351 100644
--- a/doc/README.txt
+++ b/doc/README.txt
@@ -1,5 +1,5 @@
-March 17, 2008
-Version 2.0
+August 8, 2008
+Version 2.1
Welcome to Internet2's Shibboleth
@@ -23,6 +23,5 @@ site. Mailing lists and a bug database (https://bugs.internet2.edu/) are also
available. Not all of the lists are open, but a general support list is
available and is open.
-For basic information on installing binaries and deploying Shibboleth, refer
-to the web site and Wiki for the latest documentation. For source build assistance,
-see the INSTALL.txt file and the Wiki.
+For basic information on building from source, installing binaries, and deploying
+Shibboleth, refer to the web site and Wiki for the latest documentation.
diff --git a/doc/RELEASE.txt b/doc/RELEASE.txt
index 4c1370a..3efe64b 100644
--- a/doc/RELEASE.txt
+++ b/doc/RELEASE.txt
@@ -1,13 +1,14 @@
Release Notes
Shibboleth Native SP
-2.0
-3/17/2008
+2.1
+8/8/2008
NOTE: The shibboleth2.xml configuration format in this release
-is compatible with the RC1 release. Upgrading from earlier
-releases is NOT supported without replacing the configuration
-file and reapplying changes.
+is fully compatible with the 2.0 release.
+
+List of issues addressed by this release:
+https://bugs.internet2.edu/jira/secure/IssueNavigator.jspa?reset=true&&pid=10011&fixfor=10129&status=5&status=6&sorter/field=issuekey&sorter/order=ASC
Fully Supported
diff --git a/fastcgi/Makefile.in b/fastcgi/Makefile.in
index edb6b30..a9af072 100644
--- a/fastcgi/Makefile.in
+++ b/fastcgi/Makefile.in
@@ -46,7 +46,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(fastcgidir)"
@@ -109,6 +109,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -194,6 +196,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/fastcgi/shibauthorizer.cpp b/fastcgi/shibauthorizer.cpp
index 65fc832..282dad9 100644
--- a/fastcgi/shibauthorizer.cpp
+++ b/fastcgi/shibauthorizer.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -124,7 +124,7 @@ public:
cerr << "shib: " << msg;
}
void clearHeader(const char* rawname, const char* cginame) {
- // no need, since request headers turn into actual environment variables
+ // No need, since we use environment variables.
}
void setHeader(const char* name, const char* value) {
if (value)
@@ -132,12 +132,28 @@ public:
else
m_request_headers.erase(name);
}
- virtual string getHeader(const char* name) const {
+ string getHeader(const char* name) const {
+ // Look in the local map first.
map<string,string>::const_iterator i = m_request_headers.find(name);
if (i != m_request_headers.end())
return i->second;
- else
- return "";
+ // Nothing set locally and this isn't a "secure" call, so check the request.
+ string hdr("HTTP_");
+ for (; *name; ++name) {
+ if (*name=='-')
+ hdr += '_';
+ else
+ hdr += toupper(*name);
+ }
+ char* s = FCGX_GetParam(hdr.c_str(), m_req->envp);
+ return s ? s : "";
+ }
+ string getSecureHeader(const char* name) const {
+ // Look in the local map only.
+ map<string,string>::const_iterator i = m_request_headers.find(name);
+ if (i != m_request_headers.end())
+ return i->second;
+ return "";
}
void setRemoteUser(const char* user) {
if (user)
@@ -169,7 +185,7 @@ public:
const char* getRequestBody() const {
throw runtime_error("getRequestBody not implemented by FastCGI authorizer.");
}
-
+
long sendResponse(istream& in, long status) {
string hdr = string("Connection: close\r\n");
for (multimap<string,string>::const_iterator i=m_response_headers.begin(); i!=m_response_headers.end(); ++i)
@@ -206,7 +222,7 @@ public:
return SHIB_RETURN_DONE;
}
- long returnDecline() {
+ long returnDecline() {
return SHIB_RETURN_KO;
}
@@ -250,20 +266,9 @@ int main(void)
exit(1);
}
- const char* config=getenv("SHIBSP_CONFIG");
- if (!config)
- config=SHIBSP_CONFIG;
-
try {
- DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<DOMDocument> docjanitor(dummydoc);
- DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- g_Config->getServiceProvider()->init();
+ if (!g_Config->instantiate(NULL, true))
+ throw runtime_error("unknown error");
}
catch (exception& ex) {
g_Config->term();
@@ -293,7 +298,7 @@ int main(void)
FCGX_Init();
FCGX_InitRequest(&request, 0, 0);
-
+
cout << "Shibboleth initialization complete. Starting request loop." << endl;
while (FCGX_Accept_r(&request) == 0)
{
@@ -309,48 +314,44 @@ int main(void)
try {
xmltooling::NDC ndc("FastCGI shibauthorizer");
ShibTargetFCGIAuth sta(&request, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);
-
+
pair<bool,long> res = sta.getServiceProvider().doAuthentication(sta);
if (res.first) {
-#ifdef _DEBUG
- cerr << "shib: doAuthentication handled the request" << endl;
-#endif
+ sta.log(SPRequest::SPDebug, "shib: doAuthentication handled the request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
continue;
-
+
case SHIB_RETURN_KO:
print_ok(sta.m_request_headers);
continue;
case SHIB_RETURN_DONE:
continue;
-
+
default:
cerr << "shib: doAuthentication returned an unexpected result: " << res.second << endl;
print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");
continue;
}
}
-
+
res = sta.getServiceProvider().doExport(sta);
if (res.first) {
-#ifdef _DEBUG
- cerr << "shib: doExport handled request" << endl;
-#endif
+ sta.log(SPRequest::SPDebug, "shib: doExport handled request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
continue;
-
+
case SHIB_RETURN_KO:
print_ok(sta.m_request_headers);
continue;
case SHIB_RETURN_DONE:
continue;
-
+
default:
cerr << "shib: doExport returned an unexpected result: " << res.second << endl;
print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");
@@ -360,21 +361,19 @@ int main(void)
res = sta.getServiceProvider().doAuthorization(sta);
if (res.first) {
-#ifdef _DEBUG
- cerr << "shib: doAuthorization handled request" << endl;
-#endif
+ sta.log(SPRequest::SPDebug, "shib: doAuthorization handled request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok(sta.m_request_headers);
continue;
-
+
case SHIB_RETURN_KO:
print_ok(sta.m_request_headers);
continue;
case SHIB_RETURN_DONE:
continue;
-
+
default:
cerr << "shib: doAuthorization returned an unexpected result: " << res.second << endl;
print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");
@@ -383,7 +382,7 @@ int main(void)
}
print_ok(sta.m_request_headers);
-
+
}
catch (exception& e) {
cerr << "shib: FastCGI authorizer caught an exception: " << e.what() << endl;
@@ -402,6 +401,6 @@ int main(void)
if (g_Config)
g_Config->term();
-
+
return 0;
}
diff --git a/fastcgi/shibauthorizer.rc b/fastcgi/shibauthorizer.rc
index ef47610..4a2069a 100644
--- a/fastcgi/shibauthorizer.rc
+++ b/fastcgi/shibauthorizer.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth FastCGI Authorizer\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "shibauthorizer\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "shibauthorizer.exe\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/fastcgi/shibauthorizer.vcproj b/fastcgi/shibauthorizer.vcproj
index 8bf4121..e8f395a 100644
--- a/fastcgi/shibauthorizer.vcproj
+++ b/fastcgi/shibauthorizer.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +19,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\shibauthorizer___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -69,7 +72,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
- ProgramDatabaseFile=".\shibauthorizer___Win32_Release/shibauthorizer.pdb"
SubSystem="1"
TargetMachine="1"
/>
@@ -101,7 +103,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\shibauthorizer___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -156,7 +158,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\shibauthorizer___Win32_Debug/shibauthorizer.pdb"
SubSystem="1"
TargetMachine="1"
/>
@@ -185,6 +186,180 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\shibauthorizer___Win32_Release/shibauthorizer.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib xmltooling1.lib libfcgi.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
+ ProgramDatabaseFile=".\shibauthorizer___Win32_Release/shibauthorizer.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\shibauthorizer___Win32_Debug/shibauthorizer.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib xmltooling1D.lib libfcgi.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\shibauthorizer___Win32_Debug/shibauthorizer.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -214,6 +389,24 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\shibauthorizer.rc"
diff --git a/fastcgi/shibresponder.cpp b/fastcgi/shibresponder.cpp
index f40a2e7..3582833 100644
--- a/fastcgi/shibresponder.cpp
+++ b/fastcgi/shibresponder.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -209,7 +209,7 @@ public:
virtual void clearHeader(const char* rawname, const char* cginame) {
throw runtime_error("clearHeader not implemented by FastCGI responder.");
}
-
+
virtual void setHeader(const char* name, const char* value) {
throw runtime_error("setHeader not implemented by FastCGI responder.");
}
@@ -283,20 +283,9 @@ int main(void)
exit(1);
}
- const char* config=getenv("SHIBSP_CONFIG");
- if (!config)
- config=SHIBSP_CONFIG;
-
try {
- DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<DOMDocument> docjanitor(dummydoc);
- DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- g_Config->getServiceProvider()->init();
+ if (!g_Config->instantiate(NULL, true))
+ throw runtime_error("unknown error");
}
catch (exception& ex) {
g_Config->term();
@@ -327,7 +316,7 @@ int main(void)
FCGX_Init();
FCGX_InitRequest(&request, 0, 0);
-
+
cout << "Shibboleth initialization complete. Starting request loop." << endl;
while (FCGX_Accept_r(&request) == 0) {
// Note that the default bufsize (0) will cause the use of iostream
@@ -350,17 +339,15 @@ int main(void)
try {
xmltooling::NDC ndc("FastCGI shibresponder");
ShibTargetFCGI stf(&request, content, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);
-
+
pair<bool,long> res = stf.getServiceProvider().doHandler(stf);
if (res.first) {
-#ifdef _DEBUG
- cerr << "shib: doHandler handled the request" << endl;
-#endif
+ stf.log(SPRequest::SPDebug, "shib: doHandler handled the request");
switch(res.second) {
case SHIB_RETURN_OK:
print_ok();
break;
-
+
case SHIB_RETURN_KO:
cerr << "shib: doHandler failed to handle the request" << endl;
print_error("<html><body>FastCGI Shibboleth responder should only be used for Shibboleth protocol requests.</body></html>");
@@ -369,7 +356,7 @@ int main(void)
case SHIB_RETURN_DONE:
// response already handled
break;
-
+
default:
cerr << "shib: doHandler returned an unexpected result: " << res.second << endl;
print_error("<html><body>FastCGI Shibboleth responder returned an unexpected result.</body></html>");
@@ -379,8 +366,8 @@ int main(void)
else {
cerr << "shib: doHandler failed to handle request." << endl;
print_error("<html><body>FastCGI Shibboleth responder failed to process request.</body></html>");
- }
-
+ }
+
}
catch (exception& e) {
cerr << "shib: FastCGI responder caught an exception: " << e.what() << endl;
@@ -403,6 +390,6 @@ int main(void)
if (g_Config)
g_Config->term();
-
+
return 0;
}
diff --git a/fastcgi/shibresponder.rc b/fastcgi/shibresponder.rc
index 0f0311a..c8bded3 100644
--- a/fastcgi/shibresponder.rc
+++ b/fastcgi/shibresponder.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth FastCGI Responder\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "shibresponder\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "shibresponder.exe\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/fastcgi/shibresponder.vcproj b/fastcgi/shibresponder.vcproj
index c62262b..0d6518f 100644
--- a/fastcgi/shibresponder.vcproj
+++ b/fastcgi/shibresponder.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -16,7 +19,7 @@
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\shibresponder___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -69,7 +72,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
- ProgramDatabaseFile=".\shibresponder___Win32_Release/shibresponder.pdb"
SubSystem="1"
TargetMachine="1"
/>
@@ -101,7 +103,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory=".\shibresponder___Win32_$(ConfigurationName)"
+ IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@@ -156,7 +158,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
GenerateDebugInformation="true"
- ProgramDatabaseFile=".\shibresponder___Win32_Debug/shibresponder.pdb"
SubSystem="1"
TargetMachine="1"
/>
@@ -185,6 +186,180 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\shibresponder___Win32_Release/shibresponder.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib xmltooling1.lib libfcgi.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
+ ProgramDatabaseFile=".\shibresponder___Win32_Release/shibresponder.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ TypeLibraryName=".\shibresponder___Win32_Debug/shibresponder.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib xmltooling1D.lib libfcgi.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)",\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\shibresponder___Win32_Debug/shibresponder.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -214,6 +389,24 @@
PreprocessorDefinitions=""
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\shibresponder.rc"
diff --git a/install-sh b/install-sh
index 6ce63b9..4d4a951 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,8 @@
#!/bin/sh
-#
# install - install a program, script, or datafile
-#
+
+scriptversion=2005-05-14.22
+
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
@@ -41,13 +42,11 @@
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
-
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
-
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
@@ -59,236 +58,266 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+chowncmd=
+chgrpcmd=
+stripcmd=
rmcmd="$rmprog -f"
mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd=$cpprog
- shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
-
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "$0: no input file specified" >&2
- exit 1
-else
- :
-fi
-
-if [ x"$dir_arg" != x ]; then
- dst=$src
- src=""
-
- if [ -d "$dst" ]; then
- instcmd=:
- chmodcmd=""
- else
- instcmd=$mkdirprog
- fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad
-# if $src (and thus $dsttmp) contains '*'.
-
- if [ -f "$src" ] || [ -d "$src" ]
- then
- :
- else
- echo "$0: $src does not exist" >&2
- exit 1
- fi
-
- if [ x"$dst" = x ]
- then
- echo "$0: no destination specified" >&2
- exit 1
- else
- :
- fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
- if [ -d "$dst" ]
- then
- dst=$dst/`basename "$src"`
- else
- :
- fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-# this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='
- '
-IFS="${IFS-$defaultIFS}"
-
-oIFS=$IFS
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS=$oIFS
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
- pathcomp=$pathcomp$1
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
shift
+ shift
+ continue;;
- if [ ! -d "$pathcomp" ] ;
- then
- $mkdirprog "$pathcomp"
- else
- :
- fi
-
- pathcomp=$pathcomp/
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
done
-fi
-
-if [ x"$dir_arg" != x ]
-then
- $doit $instcmd "$dst" &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
- if [ x"$transformarg" = x ]
- then
- dstfile=`basename "$dst"`
- else
- dstfile=`basename "$dst" $transformbasename |
- sed $transformarg`$transformbasename
- fi
-
-# don't allow the sed command to completely eliminate the filename
-
- if [ x"$dstfile" = x ]
- then
- dstfile=`basename "$dst"`
- else
- :
- fi
-
-# Make a couple of temp file names in the proper directory.
-
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
-# Trap to clean up temp files at exit.
-
- trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
-
-# Move or copy the file name to the temp name
-
- $doit $instcmd "$src" "$dsttmp" &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing. If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
- if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
-
-# Now remove or move aside any old file at destination location. We try this
-# two ways since rm can't unlink itself on some systems and the destination
-# file might be busy for other reasons. In this case, the final cleanup
-# might fail but the new file should still install successfully.
-
-{
- if [ -f "$dstdir/$dstfile" ]
- then
- $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
- $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
- {
- echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
- (exit 1); exit
- }
- else
- :
- fi
-} &&
-
-# Now rename the file to the real destination.
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
-fi &&
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
# The final little trick to "correctly" pass the exit status to the exit trap.
-
{
- (exit 0); exit
+ (exit 0); exit 0
}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/isapi_shib/isapi_shib.cpp b/isapi_shib/isapi_shib.cpp
index 1f01f44..38ea0c2 100644
--- a/isapi_shib/isapi_shib.cpp
+++ b/isapi_shib/isapi_shib.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* isapi_shib.cpp
- *
+ *
* Shibboleth ISAPI filter
*/
@@ -40,6 +40,7 @@
#include <set>
#include <sstream>
#include <fstream>
+#include <stdexcept>
#include <process.h>
#include <windows.h>
@@ -60,9 +61,7 @@ namespace {
static const XMLCh sslport[] = UNICODE_LITERAL_7(s,s,l,p,o,r,t);
static const XMLCh scheme[] = UNICODE_LITERAL_6(s,c,h,e,m,e);
static const XMLCh id[] = UNICODE_LITERAL_2(i,d);
- static const XMLCh ISAPI[] = UNICODE_LITERAL_5(I,S,A,P,I);
static const XMLCh Alias[] = UNICODE_LITERAL_5(A,l,i,a,s);
- static const XMLCh normalizeRequest[] = UNICODE_LITERAL_16(n,o,r,m,a,l,i,z,e,R,e,q,u,e,s,t);
static const XMLCh Site[] = UNICODE_LITERAL_4(S,i,t,e);
struct site_t {
@@ -93,7 +92,7 @@ namespace {
char* m_user;
bool m_checked;
};
-
+
HINSTANCE g_hinstDLL;
SPConfig* g_Config = NULL;
map<string,site_t> g_Sites;
@@ -112,7 +111,7 @@ BOOL LogEvent(
LPCSTR message)
{
LPCSTR messages[] = {message, NULL};
-
+
HANDLE hElog = RegisterEventSource(lpUNCServerName, "Shibboleth ISAPI Filter");
BOOL res = ReportEvent(hElog, wType, 0, dwEventID, lpUserSid, 1, 0, messages, NULL);
return (DeregisterEventSource(hElog) && res);
@@ -129,7 +128,7 @@ extern "C" BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO* pVer)
{
if (!pVer)
return FALSE;
-
+
if (!g_Config) {
LogEvent(NULL, EVENTLOG_ERROR_TYPE, 2100, NULL,
"Extension mode startup not possible, is the DLL loaded as a filter?");
@@ -172,20 +171,9 @@ extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer)
return FALSE;
}
- LPCSTR config=getenv("SHIBSP_CONFIG");
- if (!config)
- config=SHIBSP_CONFIG;
-
try {
- DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<DOMDocument> docjanitor(dummydoc);
- DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- g_Config->getServiceProvider()->init();
+ if (!g_Config->instantiate(NULL, true))
+ throw runtime_error("unknown error");
}
catch (exception& ex) {
g_Config->term();
@@ -195,7 +183,7 @@ extern "C" BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer)
"Filter startup failed to load configuration, check native log for details.");
return FALSE;
}
-
+
// Access implementation-specifics and site mappings.
ServiceProvider* sp=g_Config->getServiceProvider();
Locker locker(sp);
@@ -381,7 +369,7 @@ public:
else {
m_port = atoi(site.m_port.c_str());
}
-
+
// Scheme may come from site def or be derived from IIS.
m_scheme=site.m_scheme;
if (m_scheme.empty() || !g_bNormalizeRequest)
@@ -393,14 +381,14 @@ public:
m_hostname = var;
if (site.m_name!=m_hostname && site.m_aliases.find(m_hostname)==site.m_aliases.end())
m_hostname=site.m_name;
-
+
if (!pfc->pFilterContext) {
pfc->pFilterContext = pfc->AllocMem(pfc, sizeof(context_t), NULL);
if (static_cast<context_t*>(pfc->pFilterContext)) {
static_cast<context_t*>(pfc->pFilterContext)->m_user = NULL;
static_cast<context_t*>(pfc->pFilterContext)->m_checked = false;
}
- }
+ }
}
~ShibTargetIsapiF() { }
@@ -537,7 +525,7 @@ public:
const vector<string>& getClientCertificates() const {
return g_NoCerts;
}
-
+
// The filter never processes the POST, so stub these methods.
const char* getQueryString() const { throw IOException("getQueryString not implemented"); }
const char* getRequestBody() const { throw IOException("getRequestBody not implemented"); }
@@ -563,9 +551,8 @@ DWORD WriteClientError(PHTTP_FILTER_CONTEXT pfc, const char* msg)
extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificationType, LPVOID pvNotification)
{
// Is this a log notification?
- if (notificationType==SF_NOTIFY_LOG)
- {
- if (pfc->pFilterContext)
+ if (notificationType==SF_NOTIFY_LOG) {
+ if (pfc->pFilterContext && static_cast<context_t*>(pfc->pFilterContext)->m_user)
((PHTTP_FILTER_LOG)pvNotification)->pszClientUserName=static_cast<context_t*>(pfc->pFilterContext)->m_user;
return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
@@ -581,7 +568,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
map<string,site_t>::const_iterator map_i=g_Sites.find(static_cast<char*>(buf));
if (map_i==g_Sites.end())
return SF_STATUS_REQ_NEXT_NOTIFICATION;
-
+
ostringstream threadid;
threadid << "[" << getpid() << "] isapi_shib" << '\0';
xmltooling::NDC ndc(threadid.str().c_str());
@@ -625,7 +612,7 @@ extern "C" DWORD WINAPI HttpFilterProc(PHTTP_FILTER_CONTEXT pfc, DWORD notificat
return WriteClientError(pfc,"Shibboleth Filter reached unreachable code, save my walrus!");
}
-
+
/****************************************************************************/
// ISAPI Extension
@@ -657,7 +644,7 @@ class ShibTargetIsapiE : public AbstractSPRequest
int m_port;
string m_scheme,m_hostname,m_uri;
mutable string m_remote_addr,m_remote_user;
-
+
public:
ShibTargetIsapiE(LPEXTENSION_CONTROL_BLOCK lpECB, const site_t& site)
: AbstractSPRequest(SHIBSP_LOGCAT".ISAPI"), m_lpECB(lpECB), m_gotBody(false) {
@@ -701,18 +688,18 @@ public:
* the server is set up for proper PATH_INFO handling, or "IIS sucks rabid weasels mode",
* which is the default. No perfect way to tell, but we can take a good guess by checking
* whether the URL is a substring of the PATH_INFO:
- *
+ *
* e.g. for /Shibboleth.sso/SAML/POST
- *
+ *
* Bad mode (default):
* URL: /Shibboleth.sso
* PathInfo: /Shibboleth.sso/SAML/POST
- *
+ *
* Good mode:
* URL: /Shibboleth.sso
* PathInfo: /SAML/POST
*/
-
+
string uri;
// Clearly we're only in bad mode if path info exists at all.
@@ -728,7 +715,7 @@ public:
else {
uri = url;
}
-
+
// For consistency with Apache, let's add the query string.
if (lpECB->lpszQueryString && *(lpECB->lpszQueryString)) {
uri += '?';
@@ -920,7 +907,7 @@ extern "C" DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
ShibTargetIsapiE ste(lpECB, map_i->second);
pair<bool,long> res = ste.getServiceProvider().doHandler(ste);
if (res.first) return res.second;
-
+
return WriteClientError(lpECB, "Shibboleth Extension failed to process request");
}
diff --git a/isapi_shib/isapi_shib.rc b/isapi_shib/isapi_shib.rc
index 6ae70f3..26733a8 100644
--- a/isapi_shib/isapi_shib.rc
+++ b/isapi_shib/isapi_shib.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth ISAPI Filter / Extension\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "isapi_shib\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "isapi_shib.dll\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/isapi_shib/isapi_shib.vcproj b/isapi_shib/isapi_shib.vcproj
index 216a23c..3f1bad4 100644
--- a/isapi_shib/isapi_shib.vcproj
+++ b/isapi_shib/isapi_shib.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -77,8 +80,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)""
- ProgramDatabaseFile=".\Release/isapi_shib.pdb"
- ImportLibrary=".\Release/isapi_shib.lib"
TargetMachine="1"
/>
<Tool
@@ -170,7 +171,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)""
GenerateDebugInformation="true"
- ImportLibrary=".\Debug/isapi_shib.lib"
TargetMachine="1"
/>
<Tool
@@ -198,6 +198,189 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/isapi_shib.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0400"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/export:GetExtensionVersion /export:GetFilterVersion /export:TerminateExtension /export:TerminateFilter /export:HttpFilterProc /export:HttpExtensionProc"
+ AdditionalDependencies="xerces-c_2.lib xmltooling-lite1.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)""
+ ProgramDatabaseFile=".\Release/isapi_shib.pdb"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/isapi_shib.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0400"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/export:GetExtensionVersion /export:GetFilterVersion /export:TerminateExtension /export:TerminateFilter /export:HttpFilterProc /export:HttpExtensionProc"
+ AdditionalDependencies="xerces-c_2D.lib xmltooling-lite1D.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)""
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/memcache-store/Makefile.am b/memcache-store/Makefile.am
new file mode 100644
index 0000000..9d46119
--- /dev/null
+++ b/memcache-store/Makefile.am
@@ -0,0 +1,20 @@
+AUTOMAKE_OPTIONS = foreign
+
+plugindir = $(libdir)/@PACKAGE@
+plugin_LTLIBRARIES = memcache-store.la
+
+AM_CFLAGS = $(MEMCACHED_CFLAGS)
+AM_CXXFLAGS = $(MEMCACHED_CFLAGS)
+
+memcache_store_la_LIBADD = \
+ $(MEMCACHED_LIBS)
+
+memcache_store_la_SOURCES = \
+ memcache-store.cpp
+
+memcache_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS)
+
+install-exec-hook:
+ for la in $(plugin_LTLIBRARIES) ; do rm -f $(DESTDIR)$(plugindir)/$$la ; done
+
+EXTRA_DIST = memcache-store.vcproj memcache-store.rc resource.h
diff --git a/odbc-store/Makefile.in b/memcache-store/Makefile.in
similarity index 93%
copy from odbc-store/Makefile.in
copy to memcache-store/Makefile.in
index c61af5f..105883a 100644
--- a/odbc-store/Makefile.in
+++ b/memcache-store/Makefile.in
@@ -36,7 +36,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-subdir = odbc-store
+subdir = memcache-store
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -57,9 +57,9 @@ am__installdirs = "$(DESTDIR)$(plugindir)"
pluginLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(plugin_LTLIBRARIES)
am__DEPENDENCIES_1 =
-odbc_store_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am_odbc_store_la_OBJECTS = odbc-store.lo
-odbc_store_la_OBJECTS = $(am_odbc_store_la_OBJECTS)
+memcache_store_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_memcache_store_la_OBJECTS = memcache-store.lo
+memcache_store_la_OBJECTS = $(am_memcache_store_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -71,8 +71,8 @@ LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(odbc_store_la_SOURCES)
-DIST_SOURCES = $(odbc_store_la_SOURCES)
+SOURCES = $(memcache_store_la_SOURCES)
+DIST_SOURCES = $(memcache_store_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -104,6 +104,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -189,6 +191,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
@@ -270,17 +275,17 @@ target_alias = @target_alias@
xs = @xs@
AUTOMAKE_OPTIONS = foreign
plugindir = $(libdir)/@PACKAGE@
-plugin_LTLIBRARIES = odbc-store.la
-AM_CFLAGS = $(ODBC_CFLAGS)
-AM_CXXFLAGS = $(ODBC_CFLAGS)
-odbc_store_la_LIBADD = \
- $(ODBC_LIBS)
+plugin_LTLIBRARIES = memcache-store.la
+AM_CFLAGS = $(MEMCACHED_CFLAGS)
+AM_CXXFLAGS = $(MEMCACHED_CFLAGS)
+memcache_store_la_LIBADD = \
+ $(MEMCACHED_LIBS)
-odbc_store_la_SOURCES = \
- odbc-store.cpp
+memcache_store_la_SOURCES = \
+ memcache-store.cpp
-odbc_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS)
-EXTRA_DIST = odbc-store.vcproj odbc-store.rc resource.h
+memcache_store_la_LDFLAGS = -module -avoid-version $(XMLSEC_LIBS)
+EXTRA_DIST = memcache-store.vcproj memcache-store.rc resource.h
all: all-am
.SUFFIXES:
@@ -294,9 +299,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign odbc-store/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign memcache-store/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign odbc-store/Makefile
+ $(AUTOMAKE) --foreign memcache-store/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -341,8 +346,8 @@ clean-pluginLTLIBRARIES:
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
-odbc-store.la: $(odbc_store_la_OBJECTS) $(odbc_store_la_DEPENDENCIES)
- $(CXXLINK) -rpath $(plugindir) $(odbc_store_la_LDFLAGS) $(odbc_store_la_OBJECTS) $(odbc_store_la_LIBADD) $(LIBS)
+memcache-store.la: $(memcache_store_la_OBJECTS) $(memcache_store_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(plugindir) $(memcache_store_la_LDFLAGS) $(memcache_store_la_OBJECTS) $(memcache_store_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -350,7 +355,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/odbc-store.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/memcache-store.Plo at am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff --git a/memcache-store/memcache-store.cpp b/memcache-store/memcache-store.cpp
new file mode 100644
index 0000000..d1fb373
--- /dev/null
+++ b/memcache-store/memcache-store.cpp
@@ -0,0 +1,738 @@
+/*
+ * Copyright 2001-2008 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * memcache-store.cpp
+ *
+ * Storage Service using memcache (pre memcache tags)
+ */
+
+#if defined (_MSC_VER) || defined(__BORLANDC__)
+# include "config_win32.h"
+#else
+# include "config.h"
+#endif
+
+#include <xercesc/util/XMLUniDefs.hpp>
+
+#include <xmltooling/logging.h>
+
+#include <xmltooling/XMLToolingConfig.h>
+#include <xmltooling/util/NDC.h>
+#include <xmltooling/util/StorageService.h>
+#include <xmltooling/util/XMLHelper.h>
+
+#include <libmemcached/memcached.h>
+
+using namespace xmltooling::logging;
+using namespace xmltooling;
+using namespace xercesc;
+using namespace std;
+
+namespace xmltooling {
+ static const XMLCh Hosts[] = UNICODE_LITERAL_5(H,o,s,t,s);
+ static const XMLCh prefix[] = UNICODE_LITERAL_6(p,r,e,f,i,x);
+ static const XMLCh buildMap[] = UNICODE_LITERAL_8(b,u,i,l,d,M,a,p);
+
+ class mc_record {
+ public:
+ string value;
+ time_t expiration;
+ mc_record(){};
+ mc_record(string _v, time_t _e) :
+ value(_v), expiration(_e)
+ {}
+ };
+
+ class MemcacheBase {
+ public:
+ MemcacheBase(const DOMElement* e);
+ ~MemcacheBase();
+
+ bool addMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix = true);
+ bool setMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix = true);
+ bool replaceMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix = true);
+ bool getMemcache(const char *key,
+ string &dest,
+ uint32_t *flags,
+ bool use_prefix = true);
+ bool deleteMemcache(const char *key,
+ time_t timeout,
+ bool use_prefix = true);
+
+ void serialize(mc_record &source, string &dest);
+ void serialize(list<string> &source, string &dest);
+ void deserialize(string &source, mc_record &dest);
+ void deserialize(string &source, list<string> &dest);
+
+ bool addSessionToUser(string &key, string &user);
+ bool addLock(string what, bool use_prefix = true);
+ void deleteLock(string what, bool use_prefix = true);
+
+ protected:
+ const DOMElement* m_root; // can only use this during initialization
+ Category& log;
+ memcached_st *memc;
+ string m_memcacheHosts;
+ string m_prefix;
+
+ };
+
+ class MemcacheStorageService : public StorageService, public MemcacheBase {
+
+ public:
+ MemcacheStorageService(const DOMElement* e);
+ ~MemcacheStorageService();
+
+ bool createString(const char* context, const char* key, const char* value, time_t expiration);
+ int readString(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0);
+ int updateString(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0);
+ bool deleteString(const char* context, const char* key);
+
+ bool createText(const char* context, const char* key, const char* value, time_t expiration) {
+ return createString(context, key, value, expiration);
+ }
+ int readText(const char* context, const char* key, string* pvalue=NULL, time_t* pexpiration=NULL, int version=0) {
+ return readString(context, key, pvalue, pexpiration, version);
+ }
+ int updateText(const char* context, const char* key, const char* value=NULL, time_t expiration=0, int version=0) {
+ return updateString(context, key, value, expiration, version);
+ }
+ bool deleteText(const char* context, const char* key) {
+ return deleteString(context, key);
+ }
+
+ void reap(const char* context) {}
+
+ void updateContext(const char* context, time_t expiration);
+ void deleteContext(const char* context);
+
+ private:
+
+ Category& m_log;
+ bool m_buildMap;
+
+
+ };
+
+ StorageService* MemcacheStorageServiceFactory(const DOMElement* const & e) {
+ return new MemcacheStorageService(e);
+ }
+
+};
+
+bool MemcacheBase::addLock(string what, bool use_prefix) {
+ string lock_name = what + ":LOCK";
+ string set_val = "1";
+ unsigned tries = 5;
+ while (!addMemcache(lock_name.c_str(), set_val, 5, 0, use_prefix)) {
+ if (tries-- < 0) {
+ log.debug("Unable to get lock %s... FAILED.", lock_name.c_str());
+ return false;
+ }
+ log.debug("Unable to get lock %s... Retrying.", lock_name.c_str());
+
+ // sleep 100ms
+ struct timeval tv = { 0, 100000 };
+ select(0, 0, 0, 0, &tv);
+ }
+ return true;
+}
+
+void MemcacheBase::deleteLock(string what, bool use_prefix) {
+
+ string lock_name = what + ":LOCK";
+ deleteMemcache(lock_name.c_str(), 0, use_prefix);
+ return;
+
+}
+
+void MemcacheBase::deserialize(string &source, mc_record &dest) {
+ istringstream is(source, stringstream::in | stringstream::out);
+ is >> dest.expiration;
+ is.ignore(1); // ignore delimiter
+ dest.value = is.str().c_str() + is.tellg();
+}
+
+void MemcacheBase::deserialize(string &source, list<string> &dest) {
+ istringstream is(source, stringstream::in | stringstream::out);
+ while (!is.eof()) {
+ string s;
+ is >> s;
+ dest.push_back(s);
+ }
+}
+
+void MemcacheBase::serialize(mc_record &source, string &dest) {
+ ostringstream os(stringstream::in | stringstream::out);
+ os << source.expiration;
+ os << "-"; // delimiter
+ os << source.value;
+ dest = os.str();
+}
+
+void MemcacheBase::serialize(list<string> &source, string &dest) {
+ ostringstream os(stringstream::in | stringstream::out);
+ for(list<string>::iterator iter = source.begin(); iter != source.end(); iter++) {
+ if (iter != source.begin()) {
+ os << endl;
+ }
+ os << *iter;
+ }
+ dest = os.str();
+}
+
+bool MemcacheBase::addSessionToUser(string &key, string &user) {
+
+ if (! addLock(user, false)) {
+ return false;
+ }
+
+ // Aquired lock
+
+ string sessid = m_prefix + key; // add specific prefix to session
+ string delimiter = ";";
+ string user_key = "UDATA:";
+ user_key += user;
+ string user_val;
+ uint32_t flags;
+ bool result = getMemcache(user_key.c_str(), user_val, &flags, false);
+
+ if (result) {
+ bool already_there = false;
+ // skip delimiters at beginning.
+ string::size_type lastPos = user_val.find_first_not_of(delimiter, 0);
+
+ // find first "non-delimiter".
+ string::size_type pos = user_val.find_first_of(delimiter, lastPos);
+
+ while (string::npos != pos || string::npos != lastPos) {
+ // found a token, add it to the vector.
+ string session = user_val.substr(lastPos, pos - lastPos);
+ if (strcmp(session.c_str(), sessid.c_str()) == 0) {
+ already_there = true;
+ break;
+ }
+
+ // skip delimiters. Note the "not_of"
+ lastPos = user_val.find_first_not_of(delimiter, pos);
+
+ // find next "non-delimiter"
+ pos = user_val.find_first_of(delimiter, lastPos);
+ }
+
+ if (!already_there) {
+ user_val += delimiter + sessid;
+ replaceMemcache(user_key.c_str(), user_val, 0, 0, false);
+ }
+ } else {
+ addMemcache(user_key.c_str(), sessid, 0, 0, false);
+ }
+
+ deleteLock(user, false);
+ return true;
+
+}
+
+bool MemcacheBase::deleteMemcache(const char *key,
+ time_t timeout,
+ bool use_prefix) {
+ memcached_return rv;
+ string final_key;
+ memcached_st clone;
+ bool success;
+
+ if (use_prefix) {
+ final_key = m_prefix + key;
+ } else {
+ final_key = key;
+ }
+
+ if (memcached_clone(&clone, memc) == NULL) {
+ throw IOException("MemcacheBase::deleteMemcache(): memcached_clone() failed");
+ }
+
+ rv = memcached_delete(&clone, (char *)final_key.c_str(), final_key.length(), timeout);
+ if (rv == MEMCACHED_SUCCESS) {
+ success = true;
+ } else if (rv == MEMCACHED_NOTFOUND) {
+ // Key wasn't there... No biggie.
+ success = false;
+ } else {
+ log.error(string("Memcache::deleteMemcache() Problems: ") + memcached_strerror(&clone, rv));
+ // shouldn't be here
+ success = false;
+ }
+
+ memcached_free(&clone);
+ return success;
+}
+
+bool MemcacheBase::getMemcache(const char *key,
+ string &dest,
+ uint32_t *flags,
+ bool use_prefix) {
+ memcached_return rv;
+ size_t len;
+ char *result;
+ string final_key;
+ memcached_st clone;
+ bool success;
+
+ if (use_prefix) {
+ final_key = m_prefix + key;
+ } else {
+ final_key = key;
+ }
+
+ if (memcached_clone(&clone, memc) == NULL) {
+ throw IOException("MemcacheBase::getMemcache(): memcached_clone() failed");
+ }
+
+ result = memcached_get(&clone, (char *)final_key.c_str(), final_key.length(), &len, flags, &rv);
+ if (rv == MEMCACHED_SUCCESS) {
+ dest = result;
+ free(result);
+ success = true;
+ } else if (rv == MEMCACHED_NOTFOUND) {
+ log.debug("Key %s not found in memcache...", key);
+ success = false;
+ } else {
+ log.error(string("Memcache::getMemcache() Problems: ") + memcached_strerror(&clone, rv));
+ success = false;
+ }
+
+ memcached_free(&clone);
+ return success;
+}
+
+bool MemcacheBase::addMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix) {
+
+ memcached_return rv;
+ string final_key;
+ memcached_st clone;
+ bool success;
+
+ if (use_prefix) {
+ final_key = m_prefix + key;
+ } else {
+ final_key = key;
+ }
+
+ if (memcached_clone(&clone, memc) == NULL) {
+ throw IOException("MemcacheBase::addMemcache(): memcached_clone() failed");
+ }
+
+ rv = memcached_add(&clone, (char *)final_key.c_str(), final_key.length(), (char *)value.c_str(), value.length(), timeout, flags);
+ if (rv == MEMCACHED_SUCCESS) {
+ success = true;
+ } else if (rv == MEMCACHED_NOTSTORED) {
+ // already there
+ success = false;
+ } else {
+ // shouldn't be here
+ log.error(string("Memcache::addMemcache() Problems: ") + memcached_strerror(&clone, rv));
+ success = false;
+ }
+
+ memcached_free(&clone);
+ return success;
+}
+
+bool MemcacheBase::setMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix) {
+
+ memcached_return rv;
+ string final_key;
+ memcached_st clone;
+ bool success;
+
+ if (use_prefix) {
+ final_key = m_prefix + key;
+ } else {
+ final_key = key;
+ }
+
+ if (memcached_clone(&clone, memc) == NULL) {
+ throw IOException("MemcacheBase::setMemcache(): memcached_clone() failed");
+ }
+
+ rv = memcached_set(&clone, (char *)final_key.c_str(), final_key.length(), (char *)value.c_str(), value.length(), timeout, flags);
+ if (rv == MEMCACHED_SUCCESS) {
+ success = true;
+ } else {
+ // shouldn't be here
+ log.error(string("Memcache::setMemcache() Problems: ") + memcached_strerror(&clone, rv));
+ success = false;
+ }
+
+ memcached_free(&clone);
+ return success;
+}
+
+bool MemcacheBase::replaceMemcache(const char *key,
+ string &value,
+ time_t timeout,
+ uint32_t flags,
+ bool use_prefix) {
+
+ memcached_return rv;
+ string final_key;
+ memcached_st clone;
+ bool success;
+
+ if (use_prefix) {
+ final_key = m_prefix + key;
+ } else {
+ final_key = key;
+ }
+
+ if (memcached_clone(&clone, memc) == NULL) {
+ throw IOException("MemcacheBase::replaceMemcache(): memcached_clone() failed");
+ }
+
+ rv = memcached_replace(&clone, (char *)final_key.c_str(), final_key.length(), (char *)value.c_str(), value.length(), timeout, flags);
+ if (rv == MEMCACHED_SUCCESS) {
+ success = true;
+ } else if (rv == MEMCACHED_NOTSTORED) {
+ // not there
+ success = false;
+ } else {
+ // shouldn't be here
+ log.error(string("Memcache::replaceMemcache() Problems: ") + memcached_strerror(&clone, rv));
+ success = false;
+ }
+
+ memcached_free(&clone);
+ return success;
+}
+
+MemcacheBase::MemcacheBase(const DOMElement* e) : m_root(e), log(Category::getInstance("XMLTooling.MemcacheBase")), m_memcacheHosts(""), m_prefix("") {
+
+ auto_ptr_char p(e ? e->getAttributeNS(NULL,prefix) : NULL);
+ if (p.get() && *p.get()) {
+ log.debug("INIT: GOT key prefix: %s", p.get());
+ m_prefix = p.get();
+ }
+
+ // Grab hosts from the configuration.
+ e = e ? XMLHelper::getFirstChildElement(e,Hosts) : NULL;
+ if (!e || !e->hasChildNodes()) {
+ throw XMLToolingException("Memcache StorageService requires Hosts element in configuration.");
+ }
+ auto_ptr_char h(e->getFirstChild()->getNodeValue());
+ log.debug("INIT: GOT Hosts: %s", h.get());
+ m_memcacheHosts = h.get();
+
+ memc = memcached_create(NULL);
+ if (memc == NULL) {
+ throw XMLToolingException("MemcacheBase::Memcache(): memcached_create() failed");
+ }
+
+ log.debug("Memcache created");
+
+ unsigned int set = MEMCACHED_HASH_CRC;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, set);
+ log.debug("CRC hash set");
+
+ memcached_server_st *servers;
+ servers = memcached_servers_parse((char *)m_memcacheHosts.c_str());
+ log.debug("Got %u hosts.", memcached_server_list_count(servers));
+ if (memcached_server_push(memc, servers) != MEMCACHED_SUCCESS) {
+ throw IOException("MemcacheBase::Memcache(): memcached_server_push() failed");
+ }
+ memcached_server_list_free(servers);
+
+ log.debug("Memcache object initialized");
+}
+
+MemcacheBase::~MemcacheBase() {
+ memcached_free(memc);
+ log.debug("Base object destroyed");
+}
+
+MemcacheStorageService::MemcacheStorageService(const DOMElement* e)
+ : MemcacheBase(e), m_log(Category::getInstance("XMLTooling.MemcacheStorageService")), m_buildMap(false) {
+
+ const XMLCh* tag=e ? e->getAttributeNS(NULL,buildMap) : NULL;
+ if (tag && *tag && XMLString::parseInt(tag) != 0) {
+ m_buildMap = true;
+ m_log.debug("Cache built with buildMap ON");
+ }
+
+}
+
+MemcacheStorageService::~MemcacheStorageService() {
+
+
+}
+
+bool MemcacheStorageService::createString(const char* context, const char* key, const char* value, time_t expiration) {
+
+ log.debug("createString ctx: %s - key: %s", context, key);
+
+ string final_key = string(context) + ":" + string(key);
+
+ mc_record rec(value, expiration);
+ string final_value;
+ serialize(rec, final_value);
+
+ bool result = addMemcache(final_key.c_str(), final_value, expiration, 1); // the flag will be the version
+
+ if (result && m_buildMap) {
+ log.debug("Got result, updating map");
+
+ string map_name = context;
+ // we need to update the context map
+ if (! addLock(map_name)) {
+ log.error("Unable to get lock for context %s!", context);
+ deleteMemcache(final_key.c_str(), 0);
+ return false;
+ }
+
+ string ser_arr;
+ uint32_t flags;
+ bool result = getMemcache(map_name.c_str(), ser_arr, &flags);
+
+ list<string> contents;
+ if (result) {
+ log.debug("Match found. Parsing...");
+
+ deserialize(ser_arr, contents);
+
+ log.debug("Iterating retrieved session map...");
+ list<string>::iterator iter;
+ for(iter = contents.begin();
+ iter != contents.end();
+ iter++) {
+ log.debug("value = " + *iter);
+ }
+
+ } else {
+ log.debug("New context: %s", map_name.c_str());
+
+ }
+
+ contents.push_back(key);
+ serialize(contents, ser_arr);
+ setMemcache(map_name.c_str(), ser_arr, expiration, 0);
+
+ deleteLock(map_name);
+ }
+
+ return result;
+
+}
+
+int MemcacheStorageService::readString(const char* context, const char* key, string* pvalue, time_t* pexpiration, int version) {
+
+ log.debug("readString ctx: %s - key: %s", context, key);
+
+ string final_key = string(context) + ":" + string(key);
+ uint32_t rec_version;
+ string value;
+
+ bool found = getMemcache(final_key.c_str(), value, &rec_version);
+ if (!found) {
+ return 0;
+ }
+
+ if (version && rec_version <= (uint32_t)version) {
+ return version;
+ }
+
+ if (pexpiration || pvalue) {
+ mc_record rec;
+ deserialize(value, rec);
+
+ if (pexpiration) {
+ *pexpiration = rec.expiration;
+ }
+
+ if (pvalue) {
+ *pvalue = rec.value;
+ }
+ }
+
+ return rec_version;
+
+}
+
+int MemcacheStorageService::updateString(const char* context, const char* key, const char* value, time_t expiration, int version) {
+
+ log.debug("updateString ctx: %s - key: %s", context, key);
+
+ time_t final_exp = expiration;
+ time_t *want_expiration = NULL;
+ if (! final_exp) {
+ want_expiration = &final_exp;
+ }
+
+ int read_res = readString(context, key, NULL, want_expiration, version);
+
+ if (!read_res) {
+ // not found
+ return read_res;
+ }
+
+ if (version && version != read_res) {
+ // version incorrect
+ return -1;
+ }
+
+ // Proceding with update
+ string final_key = string(context) + ":" + string(key);
+ mc_record rec(value, final_exp);
+ string final_value;
+ serialize(rec, final_value);
+
+ replaceMemcache(final_key.c_str(), final_value, final_exp, ++version);
+ return version;
+
+}
+
+bool MemcacheStorageService::deleteString(const char* context, const char* key) {
+
+ log.debug("deleteString ctx: %s - key: %s", context, key);
+
+ string final_key = string(context) + ":" + string(key);
+
+ // Not updating context map, if there is one. There is no need.
+
+ return deleteMemcache(final_key.c_str(), 0);
+
+}
+
+void MemcacheStorageService::updateContext(const char* context, time_t expiration) {
+
+ log.debug("updateContext ctx: %s", context);
+
+ if (!m_buildMap) {
+ log.error("updateContext invoked on a Storage with no context map built!");
+ return;
+ }
+
+ string map_name = context;
+
+ if (! addLock(map_name)) {
+ log.error("Unable to get lock for context %s!", context);
+ return;
+ }
+
+ string ser_arr;
+ uint32_t flags;
+ bool result = getMemcache(map_name.c_str(), ser_arr, &flags);
+
+ list<string> contents;
+ if (result) {
+ log.debug("Match found. Parsing...");
+
+ deserialize(ser_arr, contents);
+
+ log.debug("Iterating retrieved session map...");
+ list<string>::iterator iter;
+ for(iter = contents.begin();
+ iter != contents.end();
+ iter++) {
+
+ // Update expiration times
+ string value;
+ int read_res = readString(context, iter->c_str(), &value, NULL, 0);
+
+ if (!read_res) {
+ // not found
+ continue;
+ }
+
+ updateString(context, iter->c_str(), value.c_str(), expiration, read_res);
+ }
+ replaceMemcache(map_name.c_str(), ser_arr, expiration, flags);
+ }
+
+ deleteLock(map_name);
+
+}
+
+void MemcacheStorageService::deleteContext(const char* context) {
+
+ log.debug("deleteContext ctx: %s", context);
+
+ if (!m_buildMap) {
+ log.error("deleteContext invoked on a Storage with no context map built!");
+ return;
+ }
+
+ string map_name = context;
+
+ if (! addLock(map_name)) {
+ log.error("Unable to get lock for context %s!", context);
+ return;
+ }
+
+ string ser_arr;
+ uint32_t flags;
+ bool result = getMemcache(map_name.c_str(), ser_arr, &flags);
+
+ list<string> contents;
+ if (result) {
+ log.debug("Match found. Parsing...");
+
+ deserialize(ser_arr, contents);
+
+ log.debug("Iterating retrieved session map...");
+ list<string>::iterator iter;
+ for(iter = contents.begin();
+ iter != contents.end();
+ iter++) {
+ string final_key = map_name + *iter;
+ deleteMemcache(final_key.c_str(), 0);
+ }
+
+ deleteMemcache(map_name.c_str(), 0);
+ }
+
+ deleteLock(map_name);
+
+}
+
+extern "C" int xmltooling_extension_init(void*) {
+ // Register this SS type
+ XMLToolingConfig::getConfig().StorageServiceManager.registerFactory("MEMCACHE", MemcacheStorageServiceFactory);
+ return 0;
+}
+
+extern "C" void xmltooling_extension_term() {
+ XMLToolingConfig::getConfig().StorageServiceManager.deregisterFactory("MEMCACHE");
+}
diff --git a/odbc-store/odbc-store.rc b/memcache-store/memcache-store.rc
similarity index 76%
copy from odbc-store/odbc-store.rc
copy to memcache-store/memcache-store.rc
index 1a64b78..ee39660 100644
--- a/odbc-store/odbc-store.rc
+++ b/memcache-store/memcache-store.rc
@@ -53,8 +53,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -69,14 +69,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "CompanyName", "Internet2"
- VALUE "FileDescription", "Shibboleth ODBC Storage Service Plugin"
- VALUE "FileVersion", "2, 0, 0, 0"
- VALUE "InternalName", "odbc-store"
- VALUE "LegalCopyright", "Copyright (C) 2007 Internet2"
- VALUE "OriginalFilename", "odbc-store.so"
- VALUE "ProductName", "Shibboleth 2.0"
- VALUE "ProductVersion", "2, 0, 0, 0"
+ VALUE "CompanyName", "Internet2\0"
+ VALUE "FileDescription", "Shibboleth Memcache Storage Service Plugin\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
+ VALUE "InternalName", "memcache-store\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
+ VALUE "OriginalFilename", "memcache-store.so\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/memcache-store/memcache-store.vcproj b/memcache-store/memcache-store.vcproj
new file mode 100644
index 0000000..854aad3
--- /dev/null
+++ b/memcache-store/memcache-store.vcproj
@@ -0,0 +1,357 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="memcache-store"
+ ProjectGUID="{666A63A7-983F-4C19-8411-207F24305198}"
+ RootNamespace="memcachestore"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling1D.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling1.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling1D.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling1.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\memcache-store.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\memcache-store.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/memcache-store/resource.h b/memcache-store/resource.h
new file mode 100644
index 0000000..42c4d44
--- /dev/null
+++ b/memcache-store/resource.h
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by memcache-store.rc
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/missing b/missing
index fc54c64..894e786 100755
--- a/missing
+++ b/missing
@@ -1,6 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -15,8 +19,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -38,18 +42,24 @@ else
configure_ac=configure.in
fi
+msg="missing on your system"
+
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -74,11 +84,15 @@ Supported PROGRAM values:
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.4 - GNU automake"
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
;;
-*)
@@ -87,14 +101,44 @@ Supported PROGRAM values:
exit 1
;;
- aclocal*)
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
fi
+ ;;
+esac
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+ aclocal*)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
@@ -102,13 +146,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autoconf)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
@@ -116,13 +155,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autoheader)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
@@ -140,13 +174,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
automake*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
@@ -156,14 +185,9 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
autom4te)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
@@ -185,7 +209,7 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
bison|yacc)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
@@ -215,7 +239,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
lex|flex)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
@@ -237,13 +261,8 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
help2man)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
@@ -262,32 +281,30 @@ WARNING: \`$1' is missing on your system. You should only need it if
;;
makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
tar)
shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
@@ -323,8 +340,8 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
*)
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
@@ -334,3 +351,10 @@ WARNING: \`$1' is needed, and you do not seem to have it handy on your
esac
exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/mkinstalldirs b/mkinstalldirs
deleted file mode 100755
index d2d5f21..0000000
--- a/mkinstalldirs
+++ /dev/null
@@ -1,111 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman <friedman at prep.ai.mit.edu>
-# Created: 1993-05-16
-# Public domain
-
-errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case $1 in
- -h | --help | --h*) # -h for help
- echo "$usage" 1>&2
- exit 0
- ;;
- -m) # -m PERM arg
- shift
- test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
- dirmode=$1
- shift
- ;;
- --) # stop option processing
- shift
- break
- ;;
- -*) # unknown option
- echo "$usage" 1>&2
- exit 1
- ;;
- *) # first non-opt arg
- break
- ;;
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
- 0) exit 0 ;;
-esac
-
-case $dirmode in
- '')
- if mkdir -p -- . 2>/dev/null; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- fi
- ;;
- *)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- fi
- ;;
-esac
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case $pathcomp in
- -*) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
-
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# End:
-# mkinstalldirs ends here
diff --git a/nsapi_shib/Makefile.in b/nsapi_shib/Makefile.in
index 01dbbf2..0af2484 100644
--- a/nsapi_shib/Makefile.in
+++ b/nsapi_shib/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -107,6 +107,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -192,6 +194,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/nsapi_shib/nsapi_shib.cpp b/nsapi_shib/nsapi_shib.cpp
index d1efdc4..ea38feb 100644
--- a/nsapi_shib/nsapi_shib.cpp
+++ b/nsapi_shib/nsapi_shib.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* nsapi_shib.cpp
- *
+ *
* Shibboleth NSAPI filter
*/
@@ -44,8 +44,10 @@
#include <xmltooling/util/XMLHelper.h>
#include <xercesc/util/XMLUniDefs.hpp>
+#include <memory>
#include <fstream>
#include <sstream>
+#include <stdexcept>
#ifdef WIN32
# include <process.h>
@@ -139,22 +141,9 @@ extern "C" NSAPI_PUBLIC int nsapi_shib_init(pblock* pb, ::Session* sn, Request*
g_Config->RequestMapperManager.registerFactory(XML_REQUEST_MAPPER,&SunRequestMapFactory);
- const char* config=pblock_findval("shib-config",pb);
- if (!config)
- config=getenv("SHIBSP_CONFIG");
- if (!config)
- config=SHIBSP_CONFIG;
-
try {
- xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
- xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- g_Config->getServiceProvider()->init();
+ if (!g_Config->instantiate(pblock_findval("shib-config",pb), true))
+ throw runtime_error("unknown error");
}
catch (exception& ex) {
pblock_nvinsert("error",ex.what(),pb);
@@ -259,7 +248,7 @@ public:
if (level>=SPError)
log_error(LOG_FAILURE, "nsapi_shib", m_sn, m_rq, const_cast<char*>(msg.c_str()));
}
- const char* getQueryString() const {
+ const char* getQueryString() const {
return pblock_findval("query", m_rq->reqpb);
}
const char* getRequestBody() const {
@@ -468,7 +457,7 @@ public:
Lockable* lock() { return m_mapper->lock(); }
void unlock() { m_stKey->setData(NULL); m_propsKey->setData(NULL); m_mapper->unlock(); }
Settings getSettings(const HTTPRequest& request) const;
-
+
const PropertySet* getParent() const { return NULL; }
void setParent(const PropertySet*) {}
pair<bool,bool> getBool(const char* name, const char* ns=NULL) const;
diff --git a/nsapi_shib/nsapi_shib.rc b/nsapi_shib/nsapi_shib.rc
index 1c41f3d..6af4d84 100644
--- a/nsapi_shib/nsapi_shib.rc
+++ b/nsapi_shib/nsapi_shib.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth NSAPI Extension\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "nsapi_shib\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "nsapi_shib.dll\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/nsapi_shib/nsapi_shib.vcproj b/nsapi_shib/nsapi_shib.vcproj
index 8251b79..a1c457b 100644
--- a/nsapi_shib/nsapi_shib.vcproj
+++ b/nsapi_shib/nsapi_shib.vcproj
@@ -9,6 +9,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -75,8 +78,6 @@
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)""
- ProgramDatabaseFile=".\Release/nsapi_shib.pdb"
- ImportLibrary=".\Release/nsapi_shib.lib"
TargetMachine="1"
/>
<Tool
@@ -167,7 +168,6 @@
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(ConfigurationName)""
GenerateDebugInformation="true"
- ImportLibrary=".\Debug/nsapi_shib.lib"
TargetMachine="1"
/>
<Tool
@@ -195,6 +195,186 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/nsapi_shib.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="NDEBUG;_WINDOWS;WIN32"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2.lib xmltooling-lite1.lib ns-httpd30.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)""
+ ProgramDatabaseFile=".\Release/nsapi_shib.pdb"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/nsapi_shib.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="xerces-c_2D.lib xmltooling-lite1D.lib ns-httpd30.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)""
+ GenerateDebugInformation="true"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/odbc-store/Makefile.in b/odbc-store/Makefile.in
index c61af5f..aa61b65 100644
--- a/odbc-store/Makefile.in
+++ b/odbc-store/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -104,6 +104,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -189,6 +191,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/odbc-store/odbc-store.cpp b/odbc-store/odbc-store.cpp
index f64f091..8bb7989 100644
--- a/odbc-store/odbc-store.cpp
+++ b/odbc-store/odbc-store.cpp
@@ -67,8 +67,8 @@ using namespace std;
/* table definitions
CREATE TABLE version (
- major tinyint NOT NULL,
- minor tinyint NOT NULL
+ major int NOT NULL,
+ minor int NOT NULL
)
CREATE TABLE strings (
@@ -457,7 +457,7 @@ bool ODBCStorageService::createRow(const char* table, const char* context, const
}
m_log.debug("SQLPrepare succeeded. SQL: %s", q.c_str());
- SQLINTEGER b_ind = SQL_NTS;
+ SQLLEN b_ind = SQL_NTS;
sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_VARCHAR, 255, 0, const_cast<char*>(context), &b_ind);
if (!SQL_SUCCEEDED(sr)) {
m_log.error("SQLBindParam failed (context = %s)", context);
@@ -562,7 +562,7 @@ int ODBCStorageService::readRow(
return version; // nothing's changed, so just echo back the version
if (pvalue) {
- SQLINTEGER len;
+ SQLLEN len;
SQLCHAR buf[LONGDATA_BUFLEN];
while ((sr=SQLGetData(stmt,pexpiration ? 3 : 2,SQL_C_CHAR,buf,sizeof(buf),&len)) != SQL_NO_DATA) {
if (!SQL_SUCCEEDED(sr)) {
@@ -656,7 +656,7 @@ int ODBCStorageService::updateRow(const char *table, const char* context, const
}
m_log.debug("SQLPrepare succeeded. SQL: %s", q.c_str());
- SQLINTEGER b_ind = SQL_NTS;
+ SQLLEN b_ind = SQL_NTS;
if (value) {
if (strcmp(table, TEXT_TABLE)==0)
sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_LONGVARCHAR, strlen(value), 0, const_cast<char*>(value), &b_ind);
diff --git a/odbc-store/odbc-store.rc b/odbc-store/odbc-store.rc
index 1a64b78..ef40f0e 100644
--- a/odbc-store/odbc-store.rc
+++ b/odbc-store/odbc-store.rc
@@ -53,8 +53,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -69,14 +69,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
- VALUE "CompanyName", "Internet2"
- VALUE "FileDescription", "Shibboleth ODBC Storage Service Plugin"
- VALUE "FileVersion", "2, 0, 0, 0"
- VALUE "InternalName", "odbc-store"
- VALUE "LegalCopyright", "Copyright (C) 2007 Internet2"
- VALUE "OriginalFilename", "odbc-store.so"
- VALUE "ProductName", "Shibboleth 2.0"
- VALUE "ProductVersion", "2, 0, 0, 0"
+ VALUE "CompanyName", "Internet2\0"
+ VALUE "FileDescription", "Shibboleth ODBC Storage Service Plugin\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
+ VALUE "InternalName", "odbc-store\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
+ VALUE "OriginalFilename", "odbc-store.so\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/odbc-store/odbc-store.vcproj b/odbc-store/odbc-store.vcproj
index eea1ff0..1b6a307 100644
--- a/odbc-store/odbc-store.vcproj
+++ b/odbc-store/odbc-store.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -142,7 +145,6 @@
OutputFile="$(OutDir)\$(ProjectName).so"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
- GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -173,6 +175,166 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling1D.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling1.lib"
+ OutputFile="$(OutDir)\$(ProjectName).so"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/pkginfo b/pkginfo
index 6e122af..67f161a 100644
--- a/pkginfo
+++ b/pkginfo
@@ -1,5 +1,5 @@
PKG=SHIBsp
-VERSION=2.0
+VERSION=2.1
BASEDIR=/
NAME=shibboleth-sp
CATEGORY=application,security
diff --git a/schemas/Makefile.in b/schemas/Makefile.in
index 2a9dac2..a0771af 100644
--- a/schemas/Makefile.in
+++ b/schemas/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ -87,6 +87,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -172,6 +174,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/schemas/shibboleth-2.0-afp-mf-basic.xsd b/schemas/shibboleth-2.0-afp-mf-basic.xsd
index 8d4389f..24d1526 100644
--- a/schemas/shibboleth-2.0-afp-mf-basic.xsd
+++ b/schemas/shibboleth-2.0-afp-mf-basic.xsd
@@ -4,7 +4,8 @@
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic"
xmlns:afp="urn:mace:shibboleth:2.0:afp"
- elementFormDefault="qualified">
+ elementFormDefault="qualified"
+ version="2.1">
<import namespace="urn:mace:shibboleth:2.0:afp" schemaLocation="classpath:/schema/shibboleth-2.0-afp.xsd" />
@@ -78,7 +79,7 @@
<complexType name="NOT">
<annotation>
<documentation>
- A match function that performs a logical NOT on the resultof the contained matching function.
+ A match function that performs a logical NOT on the result of the contained matching function.
</documentation>
</annotation>
<complexContent>
@@ -192,7 +193,7 @@
<documentation>The string value to match.</documentation>
</annotation>
</attribute>
- <attribute name="ignoreCase" type="boolean" default="false">
+ <attribute name="ignoreCase" type="boolean">
<annotation>
<documentation>
A boolean flag indicating whether case should be ignored when evaluating the match.
@@ -252,7 +253,7 @@
<annotation>
<documentation>
A match function that matches an attribute value against the specified regular expression. This function
- evaluates to true if any value matches the given expression
+ evaluates to true if any value matches the given expression.
</documentation>
</annotation>
<complexContent>
@@ -271,7 +272,7 @@
</complexContent>
</complexType>
- <complexType name="AttributeTargetedRegexMatchType">
+ <complexType name="AttributeTargetedRegexMatchType" abstract="true">
<complexContent>
<extension base="basic:RegexMatchType">
<attribute name="attributeID" type="string">
@@ -327,7 +328,7 @@
</annotation>
</element>
</choice>
- <attribute name="language" type="string" default="javascript">
+ <attribute name="language" type="string">
<annotation>
<documentation>
The JSR-233 name for the scripting language that will be used. By default "javascript" is
@@ -354,12 +355,12 @@
<documentation>The ID of the attribute whose value should be matched.</documentation>
</annotation>
</attribute>
- <attribute name="minimum" type="nonNegativeInteger" default="0">
+ <attribute name="minimum" type="nonNegativeInteger">
<annotation>
<documentation>Minimum number of values an attribute may have.</documentation>
</annotation>
</attribute>
- <attribute name="maximum" type="positiveInteger" default="2147483647">
+ <attribute name="maximum" type="positiveInteger">
<annotation>
<documentation>Maximum number of values an attribute may have.</documentation>
</annotation>
diff --git a/schemas/shibboleth-2.0-afp-mf-saml.xsd b/schemas/shibboleth-2.0-afp-mf-saml.xsd
index 3203e25..921d778 100644
--- a/schemas/shibboleth-2.0-afp-mf-saml.xsd
+++ b/schemas/shibboleth-2.0-afp-mf-saml.xsd
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="urn:mace:shibboleth:2.0:afp:mf:saml" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:saml="urn:mace:shibboleth:2.0:afp:mf:saml" xmlns:afp="urn:mace:shibboleth:2.0:afp">
+ xmlns:saml="urn:mace:shibboleth:2.0:afp:mf:saml" xmlns:afp="urn:mace:shibboleth:2.0:afp" version="2.0">
<import namespace="urn:mace:shibboleth:2.0:afp" schemaLocation="classpath:/schema/shibboleth-2.0-afp.xsd" />
@@ -26,7 +26,7 @@
<complexType name="AttributeIssuerInEntityGroup">
<annotation>
<documentation>
- A match function that evaluates to true if the attribute producer is found in metadata and is a member
+ A match function that evaluates to true if the attribute issuer is found in metadata and is a member
of the given entity group.
</documentation>
</annotation>
@@ -50,7 +50,7 @@
<complexType name="AttributeScopeMatchesShibMDScope">
<annotation>
<documentation>
- A match function that ensures that an attributes value's scope matches a scope given in metadata for the entity or role.
+ A match function that ensures that an attribute value's scope matches a scope given in metadata for the entity or role.
</documentation>
</annotation>
<complexContent>
diff --git a/schemas/shibboleth-2.0-afp.xsd b/schemas/shibboleth-2.0-afp.xsd
index e132a4f..675f41f 100644
--- a/schemas/shibboleth-2.0-afp.xsd
+++ b/schemas/shibboleth-2.0-afp.xsd
@@ -34,17 +34,24 @@
<element ref="afp:PermitValueRule" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>
- Defines an attribute value filter that may be reused across multiple attribute rules.
+ Defines a permit value rule that may be reused across multiple attribute rules.
</documentation>
</annotation>
- </element>
+ </element>
+ <element ref="afp:DenyValueRule" minOccurs="0" maxOccurs="unbounded">
+ <annotation>
+ <documentation>
+ Defines a deny value rule that may be reused across multiple attribute rules.
+ </documentation>
+ </annotation>
+ </element>
<element ref="afp:AttributeRule" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>
Defines an attribute rule that may be reused across multiple filter policies.
</documentation>
</annotation>
- </element>
+ </element>
<element ref="afp:AttributeFilterPolicy" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation>
@@ -89,7 +96,7 @@
<element name="PolicyRequirementRuleReference" type="afp:ReferenceType">
<annotation>
<documentation>
- Rerfence to a PolicyRequirement defined within this policy group or another.
+ Reference to a PolicyRequirement defined within this policy group or another.
</documentation>
</annotation>
</element>
@@ -105,7 +112,7 @@
<element name="AttributeRuleReference" type="afp:ReferenceType">
<annotation>
<documentation>
- Rerfence to a AttribtueRule defined within this policy group or another.
+ Reference to a AttributeRule defined within this policy group or another.
</documentation>
</annotation>
</element>
@@ -124,21 +131,26 @@
<complexContent>
<extension base="afp:IdentityType">
<choice>
- <element ref="afp:PermitValueRule">
- <annotation>
- <documentation>
- A filter for attribute values. If the filter evaluates to true the value is permitted,
- otherwise it is filtered out.
- </documentation>
- </annotation>
- </element>
- <element name="PermitValueRuleReference" type="afp:ReferenceType">
- <annotation>
- <documentation>
- Rerfence to a PermitValueRule defined within this policy group or another.
- </documentation>
- </annotation>
- </element>
+ <choice minOccurs="0">
+ <element ref="afp:PermitValueRule" />
+ <element name="PermitValueRuleReference" type="afp:ReferenceType">
+ <annotation>
+ <documentation>
+ Reference to a PermitValueRule defined within this policy group or another.
+ </documentation>
+ </annotation>
+ </element>
+ </choice>
+ <choice minOccurs="0">
+ <element ref="afp:DenyValueRule" />
+ <element name="DenyValueRuleReference" type="afp:ReferenceType">
+ <annotation>
+ <documentation>
+ Reference to a DenyValueRule defined within this policy group or another.
+ </documentation>
+ </annotation>
+ </element>
+ </choice>
</choice>
<attribute name="attributeID" type="string" use="required">
<annotation>
@@ -157,8 +169,14 @@
<element name="PermitValueRule" type="afp:MatchFunctorType">
<annotation>
<documentation>
- A filter for attribtue values. If the filter evaluates to true the value is permitted, otherwise it is
- filtered out.
+ A filter for attribute values. If the filter evaluates to true the value is permitted to be released.
+ </documentation>
+ </annotation>
+ </element>
+ <element name="DenyValueRule" type="afp:MatchFunctorType">
+ <annotation>
+ <documentation>
+ A filter for attribute values. If the filter evaluates to true the value is denied and may not be released.
</documentation>
</annotation>
</element>
diff --git a/schemas/shibboleth-2.0-attribute-map.xsd b/schemas/shibboleth-2.0-attribute-map.xsd
index 7f88ac1..3a72cda 100644
--- a/schemas/shibboleth-2.0-attribute-map.xsd
+++ b/schemas/shibboleth-2.0-attribute-map.xsd
@@ -2,7 +2,8 @@
<schema targetNamespace="urn:mace:shibboleth:2.0:attribute-map"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:am="urn:mace:shibboleth:2.0:attribute-map"
- elementFormDefault="qualified">
+ elementFormDefault="qualified"
+ version="2.1">
<annotation>
<documentation>
@@ -16,6 +17,12 @@
</restriction>
</simpleType>
+ <simpleType name="anyURI">
+ <restriction base="anyURI">
+ <minLength value="1"/>
+ </restriction>
+ </simpleType>
+
<simpleType name="listOfStrings">
<list itemType="am:string"/>
</simpleType>
@@ -94,7 +101,7 @@
</annotation>
<complexContent>
<extension base="am:AttributeDecoderType">
- <attribute name="scopeDelimiter" type="am:string" default="@">
+ <attribute name="scopeDelimiter" type="am:string">
<annotation>
<documentation>
The character(s) used to delimit the scoped information from the scope.
@@ -113,7 +120,34 @@
</annotation>
<complexContent>
<extension base="am:AttributeDecoderType">
- <attribute name="formatter" type="am:string" default="$Name!!$NameQualifier!!$SPNameQualifier">
+ <attribute name="formatter" type="am:string">
+ <annotation>
+ <documentation>
+ The pattern used to generate string versions of the attribute's values.
+ </documentation>
+ </annotation>
+ </attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="NameIDFromScopedAttributeDecoder">
+ <annotation>
+ <documentation>
+ Decoder for attributes with scoped values that produces a NameID attribute with
+ the scope dropped and the NameQualifiers defaulted.
+ </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="am:ScopedAttributeDecoder">
+ <attribute name="format" type="am:anyURI">
+ <annotation>
+ <documentation>
+ Value to use as the NameID Format.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="formatter" type="am:string">
<annotation>
<documentation>
The pattern used to generate string versions of the attribute's values.
diff --git a/schemas/shibboleth-2.0-native-sp-config.xsd b/schemas/shibboleth-2.0-native-sp-config.xsd
index ec8bf41..f9950db 100644
--- a/schemas/shibboleth-2.0-native-sp-config.xsd
+++ b/schemas/shibboleth-2.0-native-sp-config.xsd
@@ -8,7 +8,7 @@
elementFormDefault="qualified"
attributeFormDefault="unqualified"
blockDefault="substitution"
- version="2.0">
+ version="2.1">
<import namespace="urn:oasis:names:tc:SAML:2.0:assertion" schemaLocation="saml-schema-assertion-2.0.xsd"/>
<import namespace="urn:oasis:names:tc:SAML:2.0:protocol" schemaLocation="saml-schema-protocol-2.0.xsd"/>
@@ -71,7 +71,7 @@
<complexType>
<attribute name="address" type="conf:string" use="required"/>
<attribute name="port" type="unsignedInt" use="required"/>
- <attribute name="acl" type="conf:listOfStrings" default="127.0.0.1"/>
+ <attribute name="acl" type="conf:listOfStrings"/>
</complexType>
</element>
<element name="Listener" type="conf:PluggableType"/>
@@ -103,7 +103,7 @@
<any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="path" type="anyURI" use="required"/>
- <attribute name="fatal" type="boolean" default="true"/>
+ <attribute name="fatal" type="boolean"/>
<anyAttribute namespace="##any" processContents="lax"/>
</complexType>
</element>
@@ -123,7 +123,7 @@
<any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="id" type="ID" use="required"/>
- <attribute name="cleanupInterval" type="unsignedInt" default="900"/>
+ <attribute name="cleanupInterval" type="unsignedInt"/>
<anyAttribute namespace="##any" processContents="lax"/>
</restriction>
</complexContent>
@@ -141,7 +141,7 @@
<any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="StorageService" type="IDREF"/>
- <attribute name="cacheTimeout" type="unsignedInt" default="28800"/>
+ <attribute name="cacheTimeout" type="unsignedInt"/>
<anyAttribute namespace="##any" processContents="lax"/>
</restriction>
</complexContent>
@@ -166,7 +166,7 @@
<sequence/>
<attribute name="StorageService" type="IDREF"/>
<attribute name="context" type="conf:string"/>
- <attribute name="artifactTTL" type="unsignedInt" default="180"/>
+ <attribute name="artifactTTL" type="unsignedInt"/>
</complexType>
</element>
@@ -223,7 +223,7 @@
</element>
<any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
- <attribute name="normalizeRequest" type="boolean" default="true"/>
+ <attribute name="normalizeRequest" type="boolean"/>
<anyAttribute namespace="##other" processContents="lax"/>
</complexType>
</element>
@@ -368,7 +368,7 @@
</choice>
</sequence>
<attribute name="regex" type="conf:string" use="required"/>
- <attribute name="ignoreCase" type="boolean" default="true"/>
+ <attribute name="ignoreCase" type="boolean"/>
<attribute name="applicationId" type="conf:string"/>
<attributeGroup ref="conf:ContentSettings"/>
</complexType>
@@ -405,7 +405,7 @@
<element ref="conf:Query" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="regex" type="conf:string" use="required"/>
- <attribute name="ignoreCase" type="boolean" default="true"/>
+ <attribute name="ignoreCase" type="boolean"/>
<attribute name="applicationId" type="conf:string"/>
<attributeGroup ref="conf:ContentSettings"/>
</complexType>
@@ -483,7 +483,7 @@
</element>
<attributeGroup name="ApplicationGroup">
- <attribute name="homeURL" type="anyURI" default="/"/>
+ <attribute name="homeURL" type="anyURI"/>
<attribute name="REMOTE_USER" type="conf:listOfStrings"/>
<attribute name="unsetHeaders" type="conf:listOfStrings"/>
<attribute name="metadataAttributePrefix" type="conf:string"/>
@@ -537,18 +537,19 @@
</element>
</choice>
<attribute name="handlerURL" type="anyURI"/>
- <attribute name="handlerSSL" type="boolean" default="true"/>
+ <attribute name="handlerSSL" type="boolean"/>
<attribute name="exportLocation" type="conf:string"/>
- <attribute name="exportACL" type="conf:listOfStrings" default="127.0.0.1"/>
+ <attribute name="exportACL" type="conf:listOfStrings"/>
<attribute name="cookieName" type="conf:string"/>
<attribute name="cookieProps" type="conf:string"/>
- <attribute name="idpHistory" type="boolean" default="false"/>
+ <attribute name="cookieLifetime" type="unsignedInt"/>
+ <attribute name="idpHistory" type="boolean"/>
<attribute name="idpHistoryDays" type="unsignedInt"/>
- <attribute name="lifetime" type="unsignedInt" default="28800"/>
- <attribute name="timeout" type="unsignedInt" default="3600"/>
+ <attribute name="lifetime" type="unsignedInt"/>
+ <attribute name="timeout" type="unsignedInt"/>
<attribute name="maxTimeSinceAuthn" type="unsignedInt"/>
- <attribute name="checkAddress" type="boolean" default="true"/>
- <attribute name="consistentAddress" type="boolean" default="true"/>
+ <attribute name="checkAddress" type="boolean"/>
+ <attribute name="consistentAddress" type="boolean"/>
<anyAttribute namespace="##other" processContents="lax"/>
</complexType>
</element>
@@ -681,7 +682,7 @@
<element name="Rule" type="conf:PluggableType" minOccurs="1" maxOccurs="unbounded"/>
</sequence>
<attribute name="id" type="conf:string" use="required"/>
- <attribute name="validate" type="boolean" default="false"/>
+ <attribute name="validate" type="boolean"/>
<anyAttribute namespace="##any" processContents="lax"/>
</complexType>
</element>
diff --git a/selinux/Makefile.in b/selinux/Makefile.in
index 8fa8be7..0f6d823 100644
--- a/selinux/Makefile.in
+++ b/selinux/Makefile.in
@@ -44,7 +44,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
@@ -88,6 +88,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -173,6 +175,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/shibboleth.spec b/shibboleth.spec
index 3fc0ba6..89a86a1 100644
--- a/shibboleth.spec
+++ b/shibboleth.spec
@@ -1,7 +1,7 @@
Name: shibboleth
Summary: Open source system for attribute-based Web SSO
-Version: 2.0
-Release: 6
+Version: 2.1
+Release: 1
#Copyright: Internet2
Group: System Environment/Libraries
License: Apache style
@@ -11,7 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: openssl-devel
BuildRequires: xerces%{?xercesver}-c-devel >= 2.8.0
BuildRequires: xml-security-c-devel >= 1.4.0
-BuildRequires: zlib-devel, opensaml-devel >= 2.0
+BuildRequires: zlib-devel, opensaml-devel >= 2.1
%{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
%{!?_with_log4cpp:BuildRequires: log4shib-devel}
%{?_with_fastcgi:BuildRequires: fcgi-devel}
@@ -73,52 +73,50 @@ Shibboleth Library API documentation generated by doxygen.
$RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
%endif
-%check || :
-%{__make} check
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
-
-%post
-%ifnos solaris2.8 solaris2.9 solaris2.10
-/sbin/ldconfig
-%endif
-
-
# Plug the SP into Apache on a recognized system.
APACHE_CONFIG="no"
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then
- APACHE_CONFIG="apache.config"
+ APACHE_CONFIG="apache.config"
fi
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then
- APACHE_CONFIG="apache2.config"
+ APACHE_CONFIG="apache2.config"
fi
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then
- APACHE_CONFIG="apache22.config"
+ APACHE_CONFIG="apache22.config"
fi
if [ "$APACHE_CONFIG" != "no" ] ; then
- APACHE_CONFD="no"
- if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
- APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
- fi
- if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
- APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
- fi
- if [ "$APACHE_CONFD" != "no" ] ; then
- if [ ! -f $APACHE_CONFD/shib.conf ] ; then
+ APACHE_CONFD="no"
+ if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
+ APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
+ fi
+ if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
+ APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
+ fi
+ if [ "$APACHE_CONFD" != "no" ] ; then
+ %{__mkdir} -p $RPM_BUILD_ROOT$APACHE_CONFD
%if "%{_vendor}" == "suse"
- %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
- %{_sysconfdir}/%{name}/$APACHE_CONFIG \
- > $APACHE_CONFD/shib.conf
+ %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
+ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
+ > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
%else
- %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-2.0/g" \
- %{_sysconfdir}/%{name}/$APACHE_CONFIG \
- > $APACHE_CONFD/shib.conf
+ %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}-2.1/g" \
+ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
+ > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
%endif
- fi
- fi
+ fi
fi
+%check || :
+%{__make} check
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
+
+%post
+%ifnos solaris2.8 solaris2.9 solaris2.10
+/sbin/ldconfig
+%endif
+
# Install the shibd init.d scripts and service
%if "%{_vendor}" == "redhat"
if [ -d %{_sysconfdir}/init.d ] ; then
@@ -139,13 +137,6 @@ sh ./keygen.sh -b
/sbin/ldconfig
%endif
-# delete the Apache configuration if we're being removed
-[ "$1" = 0 ] || exit 0
-[ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
- %{__rm} -f %{_sysconfdir}/httpd/conf.d/shib.conf
-[ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
- %{__rm} -f %{_sysconfdir}/apache2/conf.d/shib.conf
-
# clear init.d state
%if "%{_vendor}" == "redhat"
chkconfig --del shibd
@@ -171,6 +162,11 @@ sh ./keygen.sh -b
%config(noreplace) %{_sysconfdir}/%{name}/*.xml
%config(noreplace) %{_sysconfdir}/%{name}/*.html
%config(noreplace) %{_sysconfdir}/%{name}/*.logger
+%if "%{_vendor}" == "suse"
+%config %{_sysconfdir}/apache2/conf.d/shib.conf
+%else
+%config %{_sysconfdir}/httpd/conf.d/shib.conf
+%endif
%{_sysconfdir}/%{name}/*.dist
%{_sysconfdir}/%{name}/apache*.config
%{_sysconfdir}/%{name}/shibd-redhat
@@ -201,6 +197,9 @@ sh ./keygen.sh -b
%doc %{_datadir}/doc/%{name}/api
%changelog
+* Tue Jun 10 2008 Scott Cantor <cantor.2 at osu.edu> - 2.1-1
+- Change shib.conf handling to treat as config file.
+
* Mon Mar 17 2008 Scott Cantor <cantor.2 at osu.edu> - 2.0-6
- Official release.
diff --git a/shibboleth.spec.in b/shibboleth.spec.in
index e716a24..2a9f809 100644
--- a/shibboleth.spec.in
+++ b/shibboleth.spec.in
@@ -1,7 +1,7 @@
Name: shibboleth
Summary: Open source system for attribute-based Web SSO
Version: @-VERSION-@
-Release: 6
+Release: 1
#Copyright: Internet2
Group: System Environment/Libraries
License: Apache style
@@ -11,7 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: openssl-devel
BuildRequires: xerces%{?xercesver}-c-devel >= 2.8.0
BuildRequires: xml-security-c-devel >= 1.4.0
-BuildRequires: zlib-devel, opensaml-devel >= 2.0
+BuildRequires: zlib-devel, opensaml-devel >= 2.1
%{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
%{!?_with_log4cpp:BuildRequires: log4shib-devel}
%{?_with_fastcgi:BuildRequires: fcgi-devel}
@@ -73,52 +73,50 @@ Shibboleth Library API documentation generated by doxygen.
$RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/native.logger
%endif
-%check || :
-%{__make} check
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
-
-%post
-%ifnos solaris2.8 solaris2.9 solaris2.10
-/sbin/ldconfig
-%endif
-
-
# Plug the SP into Apache on a recognized system.
APACHE_CONFIG="no"
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_13.so ] ; then
- APACHE_CONFIG="apache.config"
+ APACHE_CONFIG="apache.config"
fi
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_20.so ] ; then
- APACHE_CONFIG="apache2.config"
+ APACHE_CONFIG="apache2.config"
fi
if [ -f $RPM_BUILD_ROOT/%{_libdir}/%{name}/mod_shib_22.so ] ; then
- APACHE_CONFIG="apache22.config"
+ APACHE_CONFIG="apache22.config"
fi
if [ "$APACHE_CONFIG" != "no" ] ; then
- APACHE_CONFD="no"
- if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
- APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
- fi
- if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
- APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
- fi
- if [ "$APACHE_CONFD" != "no" ] ; then
- if [ ! -f $APACHE_CONFD/shib.conf ] ; then
+ APACHE_CONFD="no"
+ if [ -d %{_sysconfdir}/httpd/conf.d ] ; then
+ APACHE_CONFD="%{_sysconfdir}/httpd/conf.d"
+ fi
+ if [ -d %{_sysconfdir}/apache2/conf.d ] ; then
+ APACHE_CONFD="%{_sysconfdir}/apache2/conf.d"
+ fi
+ if [ "$APACHE_CONFD" != "no" ] ; then
+ %{__mkdir} -p $RPM_BUILD_ROOT$APACHE_CONFD
%if "%{_vendor}" == "suse"
- %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
- %{_sysconfdir}/%{name}/$APACHE_CONFIG \
- > $APACHE_CONFD/shib.conf
+ %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/packages\/%{name}/g" \
+ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
+ > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
%else
- %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}- at -VERSION-@/g" \
- %{_sysconfdir}/%{name}/$APACHE_CONFIG \
- > $APACHE_CONFD/shib.conf
+ %{__sed} "s/\/usr\/doc\/%{name}/\/usr\/share\/doc\/%{name}- at -VERSION-@/g" \
+ $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/$APACHE_CONFIG \
+ > $RPM_BUILD_ROOT$APACHE_CONFD/shib.conf
%endif
- fi
- fi
+ fi
fi
+%check || :
+%{__make} check
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
+
+%post
+%ifnos solaris2.8 solaris2.9 solaris2.10
+/sbin/ldconfig
+%endif
+
# Install the shibd init.d scripts and service
%if "%{_vendor}" == "redhat"
if [ -d %{_sysconfdir}/init.d ] ; then
@@ -139,13 +137,6 @@ sh ./keygen.sh -b
/sbin/ldconfig
%endif
-# delete the Apache configuration if we're being removed
-[ "$1" = 0 ] || exit 0
-[ -f %{_sysconfdir}/httpd/conf.d/shib.conf ] && \
- %{__rm} -f %{_sysconfdir}/httpd/conf.d/shib.conf
-[ -f %{_sysconfdir}/apache2/conf.d/shib.conf ] && \
- %{__rm} -f %{_sysconfdir}/apache2/conf.d/shib.conf
-
# clear init.d state
%if "%{_vendor}" == "redhat"
chkconfig --del shibd
@@ -171,6 +162,11 @@ sh ./keygen.sh -b
%config(noreplace) %{_sysconfdir}/%{name}/*.xml
%config(noreplace) %{_sysconfdir}/%{name}/*.html
%config(noreplace) %{_sysconfdir}/%{name}/*.logger
+%if "%{_vendor}" == "suse"
+%config %{_sysconfdir}/apache2/conf.d/shib.conf
+%else
+%config %{_sysconfdir}/httpd/conf.d/shib.conf
+%endif
%{_sysconfdir}/%{name}/*.dist
%{_sysconfdir}/%{name}/apache*.config
%{_sysconfdir}/%{name}/shibd-redhat
@@ -201,6 +197,9 @@ sh ./keygen.sh -b
%doc %{_datadir}/doc/%{name}/api
%changelog
+* Tue Jun 10 2008 Scott Cantor <cantor.2 at osu.edu> - 2.1-1
+- Change shib.conf handling to treat as config file.
+
* Mon Mar 17 2008 Scott Cantor <cantor.2 at osu.edu> - 2.0-6
- Official release.
diff --git a/shibd/Makefile.in b/shibd/Makefile.in
index 2f5a1f4..eb59ce5 100644
--- a/shibd/Makefile.in
+++ b/shibd/Makefile.in
@@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)"
@@ -98,6 +98,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -183,6 +185,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/shibd/shibd.cpp b/shibd/shibd.cpp
index c1eaf5f..b7a6956 100644
--- a/shibd/shibd.cpp
+++ b/shibd/shibd.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -124,27 +124,9 @@ int real_main(int preinit)
fprintf(stderr, "configuration is invalid, see console for specific problems\n");
return -1;
}
-
- if (!shar_config)
- shar_config=getenv("SHIBSP_CONFIG");
- if (!shar_config)
- shar_config=SHIBSP_CONFIG;
-
- try {
- 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);
- xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
- xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(shar_config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- conf.getServiceProvider()->init();
- }
- catch (exception& ex) {
- fprintf(stderr, "caught exception while loading configuration: %s\n", ex.what());
+
+ if (!conf.instantiate(shar_config)) {
+ fprintf(stderr, "configuration is invalid, check console for specific problems\n");
conf.term();
return -2;
}
@@ -289,26 +271,8 @@ int main(int argc, char *argv[])
return -1;
}
- if (!shar_config)
- shar_config=getenv("SHIBSP_CONFIG");
- if (!shar_config)
- shar_config=SHIBSP_CONFIG;
-
- try {
- 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);
- xercesc::DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();
- XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
- xercesc::DOMElement* dummy = dummydoc->createElementNS(NULL,path);
- auto_ptr_XMLCh src(shar_config);
- dummy->setAttributeNS(NULL,path,src.get());
- dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);
-
- conf.setServiceProvider(conf.ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));
- conf.getServiceProvider()->init();
- }
- catch (exception& ex) {
- fprintf(stderr, "caught exception while loading configuration: %s\n", ex.what());
+ if (!conf.instantiate(shar_config)) {
+ fprintf(stderr, "configuration is invalid, check console for specific problems\n");
conf.term();
return -2;
}
@@ -327,7 +291,7 @@ int main(int argc, char *argv[])
perror(pidfile); // keep running though
}
}
-
+
// Run the listener
if (!conf.getServiceProvider()->getListenerService()->run(&shibd_shutdown)) {
fprintf(stderr, "listener failed to enter listen loop\n");
diff --git a/shibd/shibd.rc b/shibd/shibd.rc
index d02b4b8..6f21f45 100644
--- a/shibd/shibd.rc
+++ b/shibd/shibd.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 2,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -47,14 +47,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Internet2\0"
VALUE "FileDescription", "Shibboleth Daemon Service\0"
- VALUE "FileVersion", "2, 0, 0, 0\0"
+ VALUE "FileVersion", "2, 1, 0, 0\0"
VALUE "InternalName", "shibd\0"
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "shibd.exe\0"
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/shibd/shibd.vcproj b/shibd/shibd.vcproj
index ac84e1e..f86cfad 100644
--- a/shibd/shibd.vcproj
+++ b/shibd/shibd.vcproj
@@ -10,6 +10,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -185,6 +188,179 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1.lib xmltooling1.lib xerces-c_2.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib log4shib1D.lib xmltooling1D.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/shibsp/AbstractSPRequest.cpp b/shibsp/AbstractSPRequest.cpp
index e7de1cd..ff5c98c 100644
--- a/shibsp/AbstractSPRequest.cpp
+++ b/shibsp/AbstractSPRequest.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,8 +16,8 @@
/**
* AbstractSPRequest.cpp
- *
- * Abstract base for SPRequest implementations
+ *
+ * Abstract base for SPRequest implementations
*/
#include "internal.h"
@@ -69,11 +69,11 @@ const Application& AbstractSPRequest::getApplication() const
m_app=m_sp->getApplication(getRequestSettings().first->getString("applicationId").second);
if (!m_app)
throw ConfigurationException("Unable to map request to application settings, check configuration.");
- }
+ }
return *m_app;
}
-Session* AbstractSPRequest::getSession(bool checkTimeout, bool ignoreAddress, bool cache) const
+Session* AbstractSPRequest::getSession(bool checkTimeout, bool ignoreAddress, bool cache)
{
// Only attempt this once.
if (cache && m_sessionTried)
@@ -82,7 +82,7 @@ Session* AbstractSPRequest::getSession(bool checkTimeout, bool ignoreAddress, bo
m_sessionTried = true;
// Need address checking and timeout settings.
- time_t timeout=0;
+ time_t timeout=3600;
if (checkTimeout || !ignoreAddress) {
const PropertySet* props=getApplication().getPropertySet("Sessions");
if (props) {
@@ -160,7 +160,7 @@ const char* AbstractSPRequest::getRequestURL() const
int port = getPort();
const char* scheme = getScheme();
m_url = string(scheme) + "://" + getHostname();
- if ((!strcmp(scheme,"http") && port!=80) || (!strcmp(scheme,"https") && port!=443)) {
+ if ((!strcmp(scheme,"http") && port!=80) || (!strcmp(scheme,"https") && port!=443)) {
ostringstream portstr;
portstr << port;
m_url += ":" + portstr.str();
@@ -174,7 +174,7 @@ const char* AbstractSPRequest::getParameter(const char* name) const
{
if (!m_parser)
m_parser=new CGIParser(*this);
-
+
pair<CGIParser::walker,CGIParser::walker> bounds=m_parser->getParameters(name);
return (bounds.first==bounds.second) ? NULL : bounds.first->second;
}
@@ -199,7 +199,7 @@ const char* AbstractSPRequest::getHandlerURL(const char* resource) const
if (!m_handlerURL.empty() && resource && !strcmp(getRequestURL(),resource))
return m_handlerURL.c_str();
-
+
#ifdef HAVE_STRCASECMP
if (!resource || (strncasecmp(resource,"http://",7) && strncasecmp(resource,"https://",8)))
#else
@@ -207,7 +207,7 @@ const char* AbstractSPRequest::getHandlerURL(const char* resource) const
#endif
throw ConfigurationException("Target resource was not an absolute URL.");
- bool ssl_only=false;
+ bool ssl_only=true;
const char* handler=NULL;
const PropertySet* props=m_app->getPropertySet("Sessions");
if (props) {
@@ -218,7 +218,7 @@ const char* AbstractSPRequest::getHandlerURL(const char* resource) const
if (p2.first)
handler=p2.second;
}
-
+
// Should never happen...
if (!handler || (*handler!='/' && strncmp(handler,"http:",5) && strncmp(handler,"https:",6)))
throw ConfigurationException(
diff --git a/shibsp/AbstractSPRequest.h b/shibsp/AbstractSPRequest.h
index adec1c0..6faf9ee 100644
--- a/shibsp/AbstractSPRequest.h
+++ b/shibsp/AbstractSPRequest.h
@@ -66,7 +66,7 @@ namespace shibsp {
const Application& getApplication() const;
- Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true) const;
+ Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true);
const char* getRequestURI() const {
return m_uri.c_str();
diff --git a/shibsp/Application.cpp b/shibsp/Application.cpp
index 9457bfd..8e41cab 100644
--- a/shibsp/Application.cpp
+++ b/shibsp/Application.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* Application.cpp
- *
+ *
* Interface to a Shibboleth Application instance.
*/
@@ -42,12 +42,19 @@ Application::~Application()
delete m_lock;
}
-pair<string,const char*> Application::getCookieNameProps(const char* prefix) const
+pair<string,const char*> Application::getCookieNameProps(const char* prefix, time_t* lifetime) const
{
static const char* defProps="; path=/";
-
+
+ if (lifetime)
+ *lifetime = 0;
const PropertySet* props=getPropertySet("Sessions");
if (props) {
+ if (lifetime) {
+ pair<bool,unsigned int> lt = props->getUnsignedInt("cookieLifetime");
+ if (lt.first)
+ *lifetime = lt.second;
+ }
pair<bool,const char*> p=props->getString("cookieProps");
if (!p.first)
p.second=defProps;
@@ -56,7 +63,7 @@ pair<string,const char*> Application::getCookieNameProps(const char* prefix) con
return make_pair(string(prefix) + p2.second,p.second);
return make_pair(string(prefix) + getHash(),p.second);
}
-
+
// Shouldn't happen, but just in case..
return pair<string,const char*>(prefix,defProps);
}
diff --git a/shibsp/Application.h b/shibsp/Application.h
index 9660e7a..c7352a2 100644
--- a/shibsp/Application.h
+++ b/shibsp/Application.h
@@ -114,9 +114,10 @@ namespace shibsp {
* Returns the name and cookie properties to use for this Application.
*
* @param prefix a value to prepend to the base cookie name
+ * @param lifetime if non-null, will be populated with a suggested lifetime for the cookie, or 0 if session-bound
* @return a pair containing the cookie name and the string to append to the cookie value
*/
- virtual std::pair<std::string,const char*> getCookieNameProps(const char* prefix) const;
+ virtual std::pair<std::string,const char*> getCookieNameProps(const char* prefix, time_t* lifetime=NULL) const;
#ifndef SHIBSP_LITE
/**
@@ -172,6 +173,14 @@ namespace shibsp {
virtual const PropertySet* getRelyingParty(const opensaml::saml2md::EntityDescriptor* provider) const=0;
/**
+ * Returns configuration properties governing security interactions with a named peer.
+ *
+ * @param entityID a peer name
+ * @return the applicable PropertySet
+ */
+ virtual const PropertySet* getRelyingParty(const XMLCh* entityID) const=0;
+
+ /**
* Returns any additional audience values associated with this Application.
*
* @return additional audience values associated with the Application, or NULL
diff --git a/shibsp/Makefile.am b/shibsp/Makefile.am
index cd1d348..703da9d 100644
--- a/shibsp/Makefile.am
+++ b/shibsp/Makefile.am
@@ -79,7 +79,8 @@ liteinclude_HEADERS = \
lite/SAMLConstants.h
mdinclude_HEADERS = \
- metadata/MetadataExt.h
+ metadata/MetadataExt.h \
+ metadata/MetadataProviderCriteria.h
reminclude_HEADERS = \
remoting/ddf.h \
@@ -153,6 +154,7 @@ libshibsp_lite_la_SOURCES = \
libshibsp_la_SOURCES = \
${common_sources} \
attribute/NameIDAttributeDecoder.cpp \
+ attribute/NameIDFromScopedAttributeDecoder.cpp \
attribute/ScopedAttributeDecoder.cpp \
attribute/StringAttributeDecoder.cpp \
attribute/filtering/impl/AttributeFilter.cpp \
@@ -183,6 +185,7 @@ libshibsp_la_SOURCES = \
attribute/resolver/impl/XMLAttributeExtractor.cpp \
binding/impl/ArtifactResolver.cpp \
binding/impl/SOAPClient.cpp \
+ metadata/DynamicMetadataProvider.cpp \
metadata/MetadataExtImpl.cpp \
metadata/MetadataExtSchemaValidators.cpp \
security/PKIXTrustEngine.cpp \
@@ -190,8 +193,8 @@ libshibsp_la_SOURCES = \
# this is different from the project version
# http://sources.redhat.com/autobook/autobook/autobook_91.html
-libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
-libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 1:0:0
+libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 2:0:0
+libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 2:0:0
libshibsp_lite_la_CPPFLAGS = -DSHIBSP_LITE
paths.h: ${srcdir}/paths.h.in Makefile ${top_builddir}/config.status
diff --git a/shibsp/Makefile.in b/shibsp/Makefile.in
index 59e2edc..7a04a6c 100644
--- a/shibsp/Makefile.in
+++ b/shibsp/Makefile.in
@@ -51,7 +51,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -135,10 +135,11 @@ am__objects_2 = AbstractSPRequest.lo Application.lo ServiceProvider.lo \
UnixListener.lo CGIParser.lo DOMPropertySet.lo SPConstants.lo \
TemplateParameters.lo
am_libshibsp_la_OBJECTS = $(am__objects_2) NameIDAttributeDecoder.lo \
- ScopedAttributeDecoder.lo StringAttributeDecoder.lo \
- AttributeFilter.lo ChainingAttributeFilter.lo \
- XMLAttributeFilter.lo MatchFunctor.lo AndMatchFunctor.lo \
- AnyMatchFunctor.lo NotMatchFunctor.lo OrMatchFunctor.lo \
+ NameIDFromScopedAttributeDecoder.lo ScopedAttributeDecoder.lo \
+ StringAttributeDecoder.lo AttributeFilter.lo \
+ ChainingAttributeFilter.lo XMLAttributeFilter.lo \
+ MatchFunctor.lo AndMatchFunctor.lo AnyMatchFunctor.lo \
+ NotMatchFunctor.lo OrMatchFunctor.lo \
AttributeIssuerStringFunctor.lo \
AttributeRequesterStringFunctor.lo \
AttributeScopeStringFunctor.lo AttributeValueStringFunctor.lo \
@@ -153,9 +154,9 @@ am_libshibsp_la_OBJECTS = $(am__objects_2) NameIDAttributeDecoder.lo \
AttributeScopeMatchesShibMDScopeFunctor.lo \
ChainingAttributeResolver.lo QueryAttributeResolver.lo \
ChainingAttributeExtractor.lo XMLAttributeExtractor.lo \
- ArtifactResolver.lo SOAPClient.lo MetadataExtImpl.lo \
- MetadataExtSchemaValidators.lo PKIXTrustEngine.lo \
- SecurityPolicy.lo
+ ArtifactResolver.lo SOAPClient.lo DynamicMetadataProvider.lo \
+ MetadataExtImpl.lo MetadataExtSchemaValidators.lo \
+ PKIXTrustEngine.lo SecurityPolicy.lo
libshibsp_la_OBJECTS = $(am_libshibsp_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -218,6 +219,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -303,6 +306,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
@@ -449,7 +455,8 @@ liteinclude_HEADERS = \
lite/SAMLConstants.h
mdinclude_HEADERS = \
- metadata/MetadataExt.h
+ metadata/MetadataExt.h \
+ metadata/MetadataProviderCriteria.h
reminclude_HEADERS = \
remoting/ddf.h \
@@ -523,6 +530,7 @@ libshibsp_lite_la_SOURCES = \
libshibsp_la_SOURCES = \
${common_sources} \
attribute/NameIDAttributeDecoder.cpp \
+ attribute/NameIDFromScopedAttributeDecoder.cpp \
attribute/ScopedAttributeDecoder.cpp \
attribute/StringAttributeDecoder.cpp \
attribute/filtering/impl/AttributeFilter.cpp \
@@ -553,6 +561,7 @@ libshibsp_la_SOURCES = \
attribute/resolver/impl/XMLAttributeExtractor.cpp \
binding/impl/ArtifactResolver.cpp \
binding/impl/SOAPClient.cpp \
+ metadata/DynamicMetadataProvider.cpp \
metadata/MetadataExtImpl.cpp \
metadata/MetadataExtSchemaValidators.cpp \
security/PKIXTrustEngine.cpp \
@@ -561,8 +570,8 @@ libshibsp_la_SOURCES = \
# this is different from the project version
# http://sources.redhat.com/autobook/autobook/autobook_91.html
-libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 1:0:0
-libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 1:0:0
+libshibsp_la_LDFLAGS = $(XMLSEC_LIBS) -version-info 2:0:0
+libshibsp_lite_la_LDFLAGS = $(LITE_LIBS) -version-info 2:0:0
libshibsp_lite_la_CPPFLAGS = -DSHIBSP_LITE
EXTRA_DIST = shibsp.vcproj shibsp-lite.vcproj paths.h.in resource.h shibsp.rc
BUILT_SOURCES = paths.h
@@ -669,6 +678,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ChainingSessionInitiator.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CookieSessionInitiator.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/DOMPropertySet.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/DynamicMetadataProvider.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/FormSessionInitiator.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ListenerService.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LocalLogoutInitiator.Plo at am__quote@
@@ -678,6 +688,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MetadataExtSchemaValidators.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MetadataGenerator.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NameIDAttributeDecoder.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NameIDFromScopedAttributeDecoder.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NotMatchFunctor.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/NumberOfAttributeValuesFunctor.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/OrMatchFunctor.Plo at am__quote@
@@ -1378,6 +1389,13 @@ NameIDAttributeDecoder.lo: attribute/NameIDAttributeDecoder.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NameIDAttributeDecoder.lo `test -f 'attribute/NameIDAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/NameIDAttributeDecoder.cpp
+NameIDFromScopedAttributeDecoder.lo: attribute/NameIDFromScopedAttributeDecoder.cpp
+ at am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT NameIDFromScopedAttributeDecoder.lo -MD -MP -MF "$(DEPDIR)/NameIDFromScopedAttributeDecoder.Tpo" -c -o NameIDFromScopedAttributeDecoder.lo `test -f 'attribute/NameIDFromScopedAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/NameIDFromScopedAttributeDecoder.cpp; \
+ at am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/NameIDFromScopedAttributeDecoder.Tpo" "$(DEPDIR)/NameIDFromScopedAttributeDecoder.Plo"; else rm -f "$(DEPDIR)/NameIDFromScopedAttributeDecoder.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='attribute/NameIDFromScopedAttributeDecoder.cpp' object='NameIDFromScopedAttributeDecoder.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o NameIDFromScopedAttributeDecoder.lo `test -f 'attribute/NameIDFromScopedAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/NameIDFromScopedAttributeDecoder.cpp
+
ScopedAttributeDecoder.lo: attribute/ScopedAttributeDecoder.cpp
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ScopedAttributeDecoder.lo -MD -MP -MF "$(DEPDIR)/ScopedAttributeDecoder.Tpo" -c -o ScopedAttributeDecoder.lo `test -f 'attribute/ScopedAttributeDecoder.cpp' || echo '$(srcdir)/'`attribute/ScopedAttributeDecoder.cpp; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/ScopedAttributeDecoder.Tpo" "$(DEPDIR)/ScopedAttributeDecoder.Plo"; else rm -f "$(DEPDIR)/ScopedAttributeDecoder.Tpo"; exit 1; fi
@@ -1588,6 +1606,13 @@ SOAPClient.lo: binding/impl/SOAPClient.cpp
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SOAPClient.lo `test -f 'binding/impl/SOAPClient.cpp' || echo '$(srcdir)/'`binding/impl/SOAPClient.cpp
+DynamicMetadataProvider.lo: metadata/DynamicMetadataProvider.cpp
+ at am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT DynamicMetadataProvider.lo -MD -MP -MF "$(DEPDIR)/DynamicMetadataProvider.Tpo" -c -o DynamicMetadataProvider.lo `test -f 'metadata/DynamicMetadataProvider.cpp' || echo '$(srcdir)/'`metadata/DynamicMetadataProvider.cpp; \
+ at am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/DynamicMetadataProvider.Tpo" "$(DEPDIR)/DynamicMetadataProvider.Plo"; else rm -f "$(DEPDIR)/DynamicMetadataProvider.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='metadata/DynamicMetadataProvider.cpp' object='DynamicMetadataProvider.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o DynamicMetadataProvider.lo `test -f 'metadata/DynamicMetadataProvider.cpp' || echo '$(srcdir)/'`metadata/DynamicMetadataProvider.cpp
+
MetadataExtImpl.lo: metadata/MetadataExtImpl.cpp
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MetadataExtImpl.lo -MD -MP -MF "$(DEPDIR)/MetadataExtImpl.Tpo" -c -o MetadataExtImpl.lo `test -f 'metadata/MetadataExtImpl.cpp' || echo '$(srcdir)/'`metadata/MetadataExtImpl.cpp; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MetadataExtImpl.Tpo" "$(DEPDIR)/MetadataExtImpl.Plo"; else rm -f "$(DEPDIR)/MetadataExtImpl.Tpo"; exit 1; fi
diff --git a/shibsp/SPConfig.cpp b/shibsp/SPConfig.cpp
index 65d5b74..7aaaf98 100644
--- a/shibsp/SPConfig.cpp
+++ b/shibsp/SPConfig.cpp
@@ -1,7 +1,7 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -17,8 +17,8 @@
/**
* SPConfig.cpp
- *
- * Library configuration
+ *
+ * Library configuration
*/
#include "internal.h"
@@ -60,13 +60,17 @@
# include <xmltooling/XMLToolingConfig.h>
#endif
+#include <ctime>
+#include <xercesc/util/XMLUniDefs.hpp>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/PathResolver.h>
#include <xmltooling/util/TemplateEngine.h>
+#include <xmltooling/util/XMLHelper.h>
using namespace shibsp;
using namespace opensaml;
using namespace xmltooling;
+using namespace std;
DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeException,shibsp);
DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeExtractionException,shibsp);
@@ -108,13 +112,19 @@ bool SPConfig::init(const char* catalog_path, const char* inst_prefix)
inst_prefix = getenv("SHIBSP_PREFIX");
if (!inst_prefix)
inst_prefix = SHIBSP_PREFIX;
-
+ std::string inst_prefix2;
+ while (*inst_prefix) {
+ inst_prefix2.push_back((*inst_prefix=='\\') ? ('/') : (*inst_prefix));
+ ++inst_prefix;
+ }
+
const char* loglevel=getenv("SHIBSP_LOGGING");
if (!loglevel)
loglevel = SHIBSP_LOGGING;
std::string ll(loglevel);
PathResolver localpr;
- XMLToolingConfig::getConfig().log_config(localpr.resolve(ll, PathResolver::XMLTOOLING_CFG_FILE, PACKAGE_NAME, inst_prefix).c_str());
+ localpr.setDefaultPrefix(inst_prefix2.c_str());
+ XMLToolingConfig::getConfig().log_config(localpr.resolve(ll, PathResolver::XMLTOOLING_CFG_FILE, PACKAGE_NAME).c_str());
Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
log.debug("%s library initialization started", PACKAGE_STRING);
@@ -136,12 +146,12 @@ bool SPConfig::init(const char* catalog_path, const char* inst_prefix)
log.fatal("failed to initialize XMLTooling library");
return false;
}
-#endif
+#endif
XMLToolingConfig::getConfig().getPathResolver()->setDefaultPackageName(PACKAGE_NAME);
- XMLToolingConfig::getConfig().getPathResolver()->setDefaultPrefix(inst_prefix);
+ XMLToolingConfig::getConfig().getPathResolver()->setDefaultPrefix(inst_prefix2.c_str());
XMLToolingConfig::getConfig().setTemplateEngine(new TemplateEngine());
XMLToolingConfig::getConfig().getTemplateEngine()->setTagPrefix("shibmlp");
-
+
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeException,shibsp);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeExtractionException,shibsp);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(AttributeFilteringException,shibsp);
@@ -195,6 +205,7 @@ bool SPConfig::init(const char* catalog_path, const char* inst_prefix)
if (isEnabled(OutOfProcess))
m_artifactResolver = new ArtifactResolver();
#endif
+ srand(static_cast<unsigned int>(std::time(NULL)));
log.info("%s library initialization complete", PACKAGE_STRING);
return true;
@@ -251,3 +262,53 @@ void SPConfig::term()
#endif
log.info("%s library shutdown complete", PACKAGE_STRING);
}
+
+bool SPConfig::instantiate(const char* config, bool rethrow)
+{
+#ifdef _DEBUG
+ NDC ndc("instantiate");
+#endif
+ if (!config)
+ config = getenv("SHIBSP_CONFIG");
+ if (!config)
+ config = SHIBSP_CONFIG;
+ try {
+ xercesc::DOMDocument* dummydoc;
+ if (*config == '"' || *config == '\'') {
+ throw ConfigurationException("The value of SHIBSP_CONFIG started with a quote.");
+ }
+ else if (*config != '<') {
+
+ // Mock up some XML.
+ string resolved(config);
+ stringstream snippet;
+ snippet
+ << "<Dummy path='"
+ << XMLToolingConfig::getConfig().getPathResolver()->resolve(resolved, PathResolver::XMLTOOLING_CFG_FILE)
+ << "' validate='1'/>";
+ dummydoc = XMLToolingConfig::getConfig().getParser().parse(snippet);
+ XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
+ setServiceProvider(ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER, dummydoc->getDocumentElement()));
+ }
+ else {
+ stringstream snippet(config);
+ dummydoc = XMLToolingConfig::getConfig().getParser().parse(snippet);
+ XercesJanitor<xercesc::DOMDocument> docjanitor(dummydoc);
+ static const XMLCh _type[] = UNICODE_LITERAL_4(t,y,p,e);
+ auto_ptr_char type(dummydoc->getDocumentElement()->getAttributeNS(NULL,_type));
+ if (type.get() && *type.get())
+ setServiceProvider(ServiceProviderManager.newPlugin(type.get(), dummydoc->getDocumentElement()));
+ else
+ throw ConfigurationException("The supplied XML bootstrapping configuration did not include a type attribute.");
+ }
+
+ getServiceProvider()->init();
+ return true;
+ }
+ catch (exception& ex) {
+ if (rethrow)
+ throw;
+ Category::getInstance(SHIBSP_LOGCAT".Config").fatal("caught exception while loading configuration: %s", ex.what());
+ }
+ return false;
+}
diff --git a/shibsp/SPConfig.h b/shibsp/SPConfig.h
index 81499cd..d58c3a4 100644
--- a/shibsp/SPConfig.h
+++ b/shibsp/SPConfig.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,8 +16,8 @@
/**
* @file shibsp/SPConfig.h
- *
- * Library configuration
+ *
+ * Library configuration
*/
#ifndef __shibsp_config_h__
@@ -75,7 +75,7 @@ namespace shibsp {
/**
* Returns the global configuration object for the library.
- *
+ *
* @return reference to the global library configuration object
*/
static SPConfig& getConfig();
@@ -98,10 +98,10 @@ namespace shibsp {
Logging = 512,
Handlers = 1024
};
-
+
/**
* Set a bitmask of subsystems to activate.
- *
+ *
* @param enabled bitmask of component constants
*/
void setFeatures(unsigned long enabled) {
@@ -110,69 +110,79 @@ namespace shibsp {
/**
* Test whether a subsystem is enabled.
- *
+ *
* @param feature subsystem/component to test
* @return true iff feature is enabled
*/
bool isEnabled(components_t feature) {
return (m_features & feature)>0;
}
-
+
/**
* Initializes library
- *
+ *
* Each process using the library MUST call this function exactly once
* before using any library classes.
- *
+ *
* @param catalog_path delimited set of schema catalog files to load
* @param inst_prefix installation prefix for software
- * @return true iff initialization was successful
+ * @return true iff initialization was successful
*/
virtual bool init(const char* catalog_path=NULL, const char* inst_prefix=NULL);
-
+
/**
* Shuts down library
- *
+ *
* Each process using the library SHOULD call this function exactly once
* before terminating itself.
*/
virtual void term();
-
+
/**
* Sets the global ServiceProvider instance.
* This method must be externally synchronized with any code that uses the object.
* Any previously set object is destroyed.
- *
+ *
* @param serviceProvider new ServiceProvider instance to store
*/
void setServiceProvider(ServiceProvider* serviceProvider);
-
+
/**
* Returns the global ServiceProvider instance.
- *
+ *
* @return global ServiceProvider or NULL
*/
ServiceProvider* getServiceProvider() const {
return m_serviceProvider;
}
+ /**
+ * Instantiates and installs a ServiceProvider instance based on an XML configuration string
+ * or a configuration pathname.
+ *
+ * @param config a snippet of XML to parse (it <strong>MUST</strong> contain a type attribute) or a pathname
+ * @param rethrow true iff caught exceptions should be rethrown instead of just returning the status
+ * @return true iff instantiation was successful
+ */
+ virtual bool instantiate(const char* config=NULL, bool rethrow=false);
+
#ifndef SHIBSP_LITE
/**
* Sets the global ArtifactResolver instance.
*
* <p>This method must be externally synchronized with any code that uses the object.
* Any previously set object is destroyed.
- *
+ *
* @param artifactResolver new ArtifactResolver instance to store
*/
void setArtifactResolver(opensaml::MessageDecoder::ArtifactResolver* artifactResolver) {
delete m_artifactResolver;
m_artifactResolver = artifactResolver;
}
-
+
/**
* Returns the global ArtifactResolver instance.
- *
+ *
* @return global ArtifactResolver or NULL
*/
opensaml::MessageDecoder::ArtifactResolver* getArtifactResolver() const {
@@ -182,7 +192,7 @@ namespace shibsp {
/** Separator for serialized values of multi-valued attributes. */
char attribute_value_delimeter;
-
+
/**
* Manages factories for AccessControl plugins.
*/
diff --git a/shibsp/SPRequest.h b/shibsp/SPRequest.h
index 97fadc6..cf2b7ed 100644
--- a/shibsp/SPRequest.h
+++ b/shibsp/SPRequest.h
@@ -79,7 +79,7 @@ namespace shibsp {
* @param cache true iff the request should hold the Session lock itself and unlock during cleanup
* @return pointer to Session, or NULL
*/
- virtual Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true) const=0;
+ virtual Session* getSession(bool checkTimeout=true, bool ignoreAddress=false, bool cache=true)=0;
/**
* Returns the effective base Handler URL for a resource,
diff --git a/shibsp/ServiceProvider.cpp b/shibsp/ServiceProvider.cpp
index df7cf81..91a8ab9 100644
--- a/shibsp/ServiceProvider.cpp
+++ b/shibsp/ServiceProvider.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* ServiceProvider.cpp
- *
+ *
* Interface to a Shibboleth ServiceProvider instance.
*/
@@ -87,7 +87,7 @@ namespace shibsp {
request.setContentType("text/html");
request.setResponseHeader("Expires","01-Jan-1997 12:00:00 GMT");
request.setResponseHeader("Cache-Control","private,no-store,no-cache");
-
+
if (!pathname.first && props) {
if (mderror)
pathname=props->getString("metadata");
@@ -104,17 +104,17 @@ namespace shibsp {
return request.sendResponse(str);
}
}
-
+
if (!strcmp(page,"access")) {
istringstream msg("Access Denied");
return request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED);
}
-
+
log.error("sendError could not process error template (%s)", page);
istringstream msg("Internal Server Error. Please contact the site administrator.");
return request.sendError(msg);
}
-
+
void SHIBSP_DLLLOCAL clearHeaders(SPRequest& request) {
request.clearHeader("Shib-Session-ID", "HTTP_SHIB_SESSION_ID");
request.clearHeader("Shib-Identity-Provider", "HTTP_SHIB_IDENTITY_PROVIDER");
@@ -172,7 +172,7 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
}
}
}
-
+
const char* handlerURL=request.getHandlerURL(targetURL.c_str());
if (!handlerURL)
throw ConfigurationException("Cannot determine handler from resource URL, check configuration.");
@@ -222,7 +222,7 @@ pair<bool,long> ServiceProvider::doAuthentication(SPRequest& request, bool handl
return make_pair(true,request.returnOK());
// No session, but we require one. Initiate a new session using the indicated method.
- const Handler* initiator=NULL;
+ const SessionInitiator* initiator=NULL;
if (requireSessionWith.first) {
initiator=app->getSessionInitiatorById(requireSessionWith.second);
if (!initiator) {
@@ -291,7 +291,7 @@ pair<bool,long> ServiceProvider::doAuthorization(SPRequest& request) const
catch (exception& e) {
log.warn("unable to obtain session to pass to access control provider: %s", e.what());
}
-
+
Locker acllock(settings.second);
switch (settings.second->authorized(request,session)) {
case AccessControl::shib_acl_true:
@@ -354,7 +354,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
else
return make_pair(false,0L); // just bail silently
}
-
+
request.setHeader("Shib-Application-ID", app->getId());
request.setHeader("Shib-Session-ID", session->getID());
@@ -373,7 +373,7 @@ pair<bool,long> ServiceProvider::doExport(SPRequest& request, bool requireSessio
hval = session->getAuthnContextDeclRef();
if (hval)
request.setHeader("Shib-AuthnContext-Decl", hval);
-
+
// Maybe export the assertion keys.
pair<bool,bool> exp=settings.first->getBool("exportAssertion");
if (exp.first && exp.second) {
@@ -505,7 +505,7 @@ pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
// Process incoming request.
pair<bool,bool> handlerSSL=sessionProps->getBool("handlerSSL");
-
+
// Make sure this is SSL, if it should be
if ((!handlerSSL.first || handlerSSL.second) && !request.isSecure())
throw opensaml::FatalProfileException("Blocked non-SSL access to Shibboleth handler.");
@@ -521,7 +521,7 @@ pair<bool,long> ServiceProvider::doHandler(SPRequest& request) const
// Did the handler run successfully?
if (hret.first)
return hret;
-
+
throw ConfigurationException("Configured Shibboleth handler failed to process the request.");
}
catch (exception& e) {
diff --git a/shibsp/SessionCache.h b/shibsp/SessionCache.h
index 18910bd..ad3af9d 100644
--- a/shibsp/SessionCache.h
+++ b/shibsp/SessionCache.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* @file shibsp/SessionCache.h
- *
+ *
* Caches and manages user sessions
*/
@@ -82,14 +82,14 @@ namespace shibsp {
/**
* Returns the address of the client associated with the session.
- *
+ *
* @return the client's network address
*/
virtual const char* getClientAddress() const=0;
/**
* Returns the entityID of the IdP that initiated the session.
- *
+ *
* @return the IdP's entityID
*/
virtual const char* getEntityID() const=0;
@@ -103,17 +103,17 @@ namespace shibsp {
/**
* Returns the UTC timestamp on the authentication event at the IdP.
- *
- * @return the UTC authentication timestamp
+ *
+ * @return the UTC authentication timestamp
*/
virtual const char* getAuthnInstant() const=0;
#ifndef SHIBSP_LITE
/**
* Returns the NameID associated with a session.
- *
+ *
* <p>SAML 1.x identifiers will be promoted to the 2.0 type.
- *
+ *
* @return a SAML 2.0 NameID associated with the session, if any
*/
virtual const opensaml::saml2::NameID* getNameID() const=0;
@@ -121,78 +121,78 @@ namespace shibsp {
/**
* Returns the SessionIndex provided with the session.
- *
+ *
* @return the SessionIndex from the original SSO assertion, if any
*/
virtual const char* getSessionIndex() const=0;
/**
* Returns a URI containing an AuthnContextClassRef provided with the session.
- *
+ *
* <p>SAML 1.x AuthenticationMethods will be returned as class references.
- *
+ *
* @return a URI identifying the authentication context class
*/
virtual const char* getAuthnContextClassRef() const=0;
/**
* Returns a URI containing an AuthnContextDeclRef provided with the session.
- *
+ *
* @return a URI identifying the authentication context declaration
*/
virtual const char* getAuthnContextDeclRef() const=0;
-
+
/**
* Returns the resolved attributes associated with the session.
- *
+ *
* @return an immutable array of attributes
*/
virtual const std::vector<Attribute*>& getAttributes() const=0;
/**
* Returns the resolved attributes associated with the session, indexed by ID
- *
+ *
* @return an immutable map of attributes keyed by attribute ID
*/
virtual const std::multimap<std::string,const Attribute*>& getIndexedAttributes() const=0;
-
+
/**
* Returns the identifiers of the assertion(s) cached by the session.
- *
+ *
* <p>The SSO assertion is guaranteed to be first in the set.
- *
+ *
* @return an immutable array of AssertionID values
*/
virtual const std::vector<const char*>& getAssertionIDs() const=0;
-
+
#ifndef SHIBSP_LITE
/**
* Adds additional attributes to the session.
- *
+ *
* @param attributes reference to an array of Attributes to cache (will be freed by cache)
*/
virtual void addAttributes(const std::vector<Attribute*>& attributes)=0;
/**
* Returns an assertion cached by the session.
- *
+ *
* @param id identifier of the assertion to retrieve
* @return pointer to assertion, or NULL
*/
virtual const opensaml::Assertion* getAssertion(const char* id) const=0;
-
+
/**
* Stores an assertion in the session.
- *
+ *
* @param assertion pointer to an assertion to cache (will be freed by cache)
*/
- virtual void addAssertion(opensaml::Assertion* assertion)=0;
+ virtual void addAssertion(opensaml::Assertion* assertion)=0;
#endif
};
-
+
/**
* Creates and manages user sessions
- *
+ *
* The cache abstracts a persistent (meaning across requests) cache of
* instances of the Session interface. Creation of new entries and entry
* lookup are confined to this interface to enable the implementation to
@@ -206,14 +206,14 @@ namespace shibsp {
SessionCache() {}
public:
virtual ~SessionCache() {}
-
+
#ifndef SHIBSP_LITE
/**
* Inserts a new session into the cache and binds the session to the outgoing
* client response.
- *
+ *
* <p>The SSO tokens and Attributes remain owned by the caller and are copied by the cache.
- *
+ *
* @param application reference to Application that owns the Session
* @param httpRequest request that initiated session
* @param httpResponse current response to client
@@ -246,7 +246,7 @@ namespace shibsp {
/**
* Determines whether the Session bound to a client request matches a set of input criteria.
- *
+ *
* @param application reference to Application that owns the Session
* @param request request in which to locate Session
* @param issuer required source of session(s)
@@ -270,7 +270,7 @@ namespace shibsp {
/**
* Returns the ID of the session bound to the specified client request, if possible.
- *
+ *
* @param application reference to Application that owns the Session
* @param request request from client containing session, or a reference to it
* @return ID of session, if any known, or an empty string
@@ -279,23 +279,48 @@ namespace shibsp {
/**
* Locates an existing session bound to a request.
- *
+ *
* <p>If the client address is supplied, then a check will be performed against
* the address recorded in the record.
- *
+ *
* @param application reference to Application that owns the Session
- * @param request request from client containing session, or a reference to it
+ * @param request request from client bound to session
* @param client_addr network address of client (if known)
* @param timeout inactivity timeout to enforce (0 for none, NULL to bypass check/update of last access)
* @return pointer to locked Session, or NULL
*/
virtual Session* find(
- const Application& application, const xmltooling::HTTPRequest& request, const char* client_addr=NULL, time_t* timeout=NULL
+ const Application& application,
+ const xmltooling::HTTPRequest& request,
+ const char* client_addr=NULL,
+ time_t* timeout=NULL
)=0;
/**
+ * Locates an existing session bound to a request.
+ *
+ * <p>If the client address is supplied, then a check will be performed against
+ * the address recorded in the record.
+ *
+ * <p>If a bound session is found to have expired, be invalid, etc., and if the request
+ * can be used to "clear" the session from subsequent client requests, then it may be cleared.
+ *
+ * @param application reference to Application that owns the Session
+ * @param request request from client bound to session
+ * @param client_addr network address of client (if known)
+ * @param timeout inactivity timeout to enforce (0 for none, NULL to bypass check/update of last access)
+ * @return pointer to locked Session, or NULL
+ */
+ virtual Session* find(
+ const Application& application,
+ xmltooling::HTTPRequest& request,
+ const char* client_addr=NULL,
+ time_t* timeout=NULL
+ );
+
+ /**
* Deletes an existing session bound to a request.
- *
+ *
* @param application reference to Application that owns the Session
* @param request request from client containing session, or a reference to it
* @param response optional response to client enabling removal of session or reference
diff --git a/shibsp/attribute/Attribute.cpp b/shibsp/attribute/Attribute.cpp
index a943272..d4301e4 100644
--- a/shibsp/attribute/Attribute.cpp
+++ b/shibsp/attribute/Attribute.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* shibsp/attribute/Attribute.cpp
- *
+ *
* A resolved attribute.
*/
@@ -41,23 +41,25 @@ namespace shibsp {
SHIBSP_DLLLOCAL Attribute* SimpleAttributeFactory(DDF& in) {
return new SimpleAttribute(in);
}
-
+
SHIBSP_DLLLOCAL Attribute* ScopedAttributeFactory(DDF& in) {
return new ScopedAttribute(in);
}
-
+
SHIBSP_DLLLOCAL Attribute* NameIDAttributeFactory(DDF& in) {
return new NameIDAttribute(in);
}
-
+
#ifndef SHIBSP_LITE
SHIBSP_DLLLOCAL PluginManager<AttributeDecoder,QName,const DOMElement*>::Factory StringAttributeDecoderFactory;
SHIBSP_DLLLOCAL PluginManager<AttributeDecoder,QName,const DOMElement*>::Factory ScopedAttributeDecoderFactory;
SHIBSP_DLLLOCAL PluginManager<AttributeDecoder,QName,const DOMElement*>::Factory NameIDAttributeDecoderFactory;
+ SHIBSP_DLLLOCAL PluginManager<AttributeDecoder,QName,const DOMElement*>::Factory NameIDFromScopedAttributeDecoderFactory;
static const XMLCh _StringAttributeDecoder[] = UNICODE_LITERAL_22(S,t,r,i,n,g,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
static const XMLCh _ScopedAttributeDecoder[] = UNICODE_LITERAL_22(S,c,o,p,e,d,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
static const XMLCh _NameIDAttributeDecoder[] = UNICODE_LITERAL_22(N,a,m,e,I,D,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
+ static const XMLCh _NameIDFromScopedAttributeDecoder[] = UNICODE_LITERAL_32(N,a,m,e,I,D,F,r,o,m,S,c,o,p,e,d,A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
static const XMLCh caseSensitive[] = UNICODE_LITERAL_13(c,a,s,e,S,e,n,s,i,t,i,v,e);
#endif
@@ -67,6 +69,7 @@ namespace shibsp {
QName shibsp::StringAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _StringAttributeDecoder);
QName shibsp::ScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _ScopedAttributeDecoder);
QName shibsp::NameIDAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDAttributeDecoder);
+QName shibsp::NameIDFromScopedAttributeDecoderType(shibspconstants::SHIB2ATTRIBUTEMAP_NS, _NameIDFromScopedAttributeDecoder);
void shibsp::registerAttributeDecoders()
{
@@ -74,6 +77,7 @@ void shibsp::registerAttributeDecoders()
conf.AttributeDecoderManager.registerFactory(StringAttributeDecoderType, StringAttributeDecoderFactory);
conf.AttributeDecoderManager.registerFactory(ScopedAttributeDecoderType, ScopedAttributeDecoderFactory);
conf.AttributeDecoderManager.registerFactory(NameIDAttributeDecoderType, NameIDAttributeDecoderFactory);
+ conf.AttributeDecoderManager.registerFactory(NameIDFromScopedAttributeDecoderType, NameIDFromScopedAttributeDecoderFactory);
}
AttributeDecoder::AttributeDecoder(const DOMElement *e) : m_caseSensitive(true)
diff --git a/shibsp/attribute/AttributeDecoder.h b/shibsp/attribute/AttributeDecoder.h
index 4d0fe94..7063ceb 100644
--- a/shibsp/attribute/AttributeDecoder.h
+++ b/shibsp/attribute/AttributeDecoder.h
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* @file shibsp/attribute/AttributeDecoder.h
- *
+ *
* Decodes SAML NameID/Attribute objects into resolved Attributes.
*/
@@ -47,10 +47,10 @@ namespace shibsp {
public:
virtual ~AttributeDecoder() {}
-
+
/**
* Decodes an XMLObject into a resolved Attribute.
- *
+ *
* @param ids array containing primary identifier in first position, followed by any aliases
* @param xmlObject XMLObject to decode
* @param assertingParty name of the party asserting the attribute
@@ -68,13 +68,16 @@ namespace shibsp {
/** Decodes into a SimpleAttribute. */
extern SHIBSP_API xmltooling::QName StringAttributeDecoderType;
-
- /** Decodes into a ScopedAttribute. */
+
+ /** Decodes scoped and NameID attributes into a ScopedAttribute. */
extern SHIBSP_API xmltooling::QName ScopedAttributeDecoderType;
- /** Decodes into a NameIDAttribute. */
+ /** Decodes NameID information into a NameIDAttribute. */
extern SHIBSP_API xmltooling::QName NameIDAttributeDecoderType;
+ /** Decodes scoped attributes into a NameIDAttribute. */
+ extern SHIBSP_API xmltooling::QName NameIDFromScopedAttributeDecoderType;
+
/** Registers built-in AttributeDecoders into the runtime. */
void registerAttributeDecoders();
};
diff --git a/shibsp/attribute/NameIDAttributeDecoder.cpp b/shibsp/attribute/NameIDAttributeDecoder.cpp
index 4ed2cda..440fa57 100644
--- a/shibsp/attribute/NameIDAttributeDecoder.cpp
+++ b/shibsp/attribute/NameIDAttributeDecoder.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* NameIDAttributeDecoder.cpp
- *
+ *
* Decodes SAML into NameIDAttributes
*/
@@ -48,10 +48,10 @@ namespace shibsp {
private:
void extract(
- const NameIDType* n, vector<NameIDAttribute::Value>& dest, const char* assertingParty=NULL, const char* relyingParty=NULL
+ const NameIDType* n, vector<NameIDAttribute::Value>& dest, const char* assertingParty, const char* relyingParty
) const;
void extract(
- const NameIdentifier* n, vector<NameIDAttribute::Value>& dest, const char* assertingParty=NULL, const char* relyingParty=NULL
+ const NameIdentifier* n, vector<NameIDAttribute::Value>& dest, const char* assertingParty, const char* relyingParty
) const;
auto_ptr_char m_formatter;
};
@@ -73,8 +73,8 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
vector<NameIDAttribute::Value>& dest = nameid->getValues();
vector<XMLObject*>::const_iterator v,stop;
- Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder");
-
+ Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder.NameID");
+
if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) {
const opensaml::saml2::Attribute* saml2attr = dynamic_cast<const opensaml::saml2::Attribute*>(xmlObject);
if (saml2attr) {
@@ -112,18 +112,18 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
for (; v!=stop; ++v) {
const NameIDType* n2 = dynamic_cast<const NameIDType*>(*v);
if (n2)
- extract(n2, dest);
+ extract(n2, dest, assertingParty, relyingParty);
else {
const NameIdentifier* n1=dynamic_cast<const NameIdentifier*>(*v);
if (n1)
- extract(n1, dest);
+ extract(n1, dest, assertingParty, relyingParty);
else if ((*v)->hasChildren()) {
const list<XMLObject*>& values = (*v)->getOrderedChildren();
for (list<XMLObject*>::const_iterator vv = values.begin(); vv!=values.end(); ++vv) {
if (n2=dynamic_cast<const NameIDType*>(*vv))
- extract(n2, dest);
+ extract(n2, dest, assertingParty, relyingParty);
else if (n1=dynamic_cast<const NameIdentifier*>(*vv))
- extract(n1, dest);
+ extract(n1, dest, assertingParty, relyingParty);
else
log.warn("skipping AttributeValue without a recognizable NameID/NameIdentifier");
}
@@ -140,7 +140,7 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
auto_ptr_char f(saml2name->getFormat());
log.debug("decoding NameIDAttribute (%s) from SAML 2 NameID with Format (%s)", ids.front().c_str(), f.get() ? f.get() : "unspecified");
}
- extract(saml2name, dest);
+ extract(saml2name, dest, assertingParty, relyingParty);
}
else {
const NameIdentifier* saml1name = dynamic_cast<const NameIdentifier*>(xmlObject);
@@ -152,7 +152,7 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
ids.front().c_str(), f.get() ? f.get() : "unspecified"
);
}
- extract(saml1name, dest);
+ extract(saml1name, dest, assertingParty, relyingParty);
}
else {
log.warn("XMLObject type not recognized by NameIDAttributeDecoder, no values returned");
@@ -177,21 +177,21 @@ void NameIDAttributeDecoder::extract(
val.m_Format = str;
delete[] str;
}
-
+
str = toUTF8(n->getNameQualifier());
if (str && *str)
val.m_NameQualifier = str;
else if (assertingParty)
val.m_NameQualifier = assertingParty;
delete[] str;
-
+
str = toUTF8(n->getSPNameQualifier());
if (str && *str)
val.m_SPNameQualifier = str;
else if (relyingParty)
val.m_SPNameQualifier = relyingParty;
delete[] str;
-
+
str = toUTF8(n->getSPProvidedID());
if (str) {
val.m_SPProvidedID = str;
@@ -221,7 +221,7 @@ void NameIDAttributeDecoder::extract(
else if (assertingParty)
val.m_NameQualifier = assertingParty;
delete[] str;
-
+
if (relyingParty)
val.m_SPNameQualifier = relyingParty;
}
diff --git a/shibsp/attribute/ScopedAttributeDecoder.cpp b/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp
similarity index 50%
copy from shibsp/attribute/ScopedAttributeDecoder.cpp
copy to shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp
index cdfacad..7e807b9 100644
--- a/shibsp/attribute/ScopedAttributeDecoder.cpp
+++ b/shibsp/attribute/NameIDFromScopedAttributeDecoder.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -15,14 +15,14 @@
*/
/**
- * ScopedAttributeDecoder.cpp
- *
- * Decodes SAML into ScopedAttributes
+ * NameIDFromNameIDFromScopedAttributeDecoder.cpp
+ *
+ * Decodes SAML "scoped" attributes into NameIDAttributes.
*/
#include "internal.h"
#include "attribute/AttributeDecoder.h"
-#include "attribute/ScopedAttribute.h"
+#include "attribute/NameIDAttribute.h"
#include <saml/saml1/core/Assertions.h>
#include <saml/saml2/core/Assertions.h>
@@ -34,21 +34,22 @@ using namespace xmltooling;
using namespace std;
namespace shibsp {
+ static XMLCh format[] = UNICODE_LITERAL_6(f,o,r,m,a,t);
+ static XMLCh formatter[] = UNICODE_LITERAL_9(f,o,r,m,a,t,t,e,r);
static const XMLCh Scope[] = UNICODE_LITERAL_5(S,c,o,p,e);
static const XMLCh scopeDelimeter[] = UNICODE_LITERAL_14(s,c,o,p,e,D,e,l,i,m,e,t,e,r);
- class SHIBSP_DLLLOCAL ScopedAttributeDecoder : virtual public AttributeDecoder
+ class SHIBSP_DLLLOCAL NameIDFromScopedAttributeDecoder : virtual public AttributeDecoder
{
public:
- ScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@') {
- if (e) {
- if (e->hasAttributeNS(NULL,scopeDelimeter)) {
- auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
- m_delimeter = *(d.get());
- }
+ NameIDFromScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@'),
+ m_format(e ? e->getAttributeNS(NULL,format) : NULL), m_formatter(e ? e->getAttributeNS(NULL,formatter) : NULL) {
+ if (e && e->hasAttributeNS(NULL,scopeDelimeter)) {
+ auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
+ m_delimeter = *(d.get());
}
}
- ~ScopedAttributeDecoder() {}
+ ~NameIDFromScopedAttributeDecoder() {}
shibsp::Attribute* decode(
const vector<string>& ids, const XMLObject* xmlObject, const char* assertingParty=NULL, const char* relyingParty=NULL
@@ -56,29 +57,34 @@ namespace shibsp {
private:
char m_delimeter;
+ auto_ptr_char m_format;
+ auto_ptr_char m_formatter;
};
- AttributeDecoder* SHIBSP_DLLLOCAL ScopedAttributeDecoderFactory(const DOMElement* const & e)
+ AttributeDecoder* SHIBSP_DLLLOCAL NameIDFromScopedAttributeDecoderFactory(const DOMElement* const & e)
{
- return new ScopedAttributeDecoder(e);
+ return new NameIDFromScopedAttributeDecoder(e);
}
};
-shibsp::Attribute* ScopedAttributeDecoder::decode(
+shibsp::Attribute* NameIDFromScopedAttributeDecoder::decode(
const vector<string>& ids, const XMLObject* xmlObject, const char* assertingParty, const char* relyingParty
) const
{
+
char* val;
char* scope;
const XMLCh* xmlscope;
QName scopeqname(NULL,Scope);
- auto_ptr<ScopedAttribute> scoped(new ScopedAttribute(ids, m_delimeter));
- scoped->setCaseSensitive(m_caseSensitive);
- vector< pair<string,string> >& dest = scoped->getValues();
+ auto_ptr<NameIDAttribute> nameid(
+ new NameIDAttribute(ids, (m_formatter.get() && *m_formatter.get()) ? m_formatter.get() : DEFAULT_NAMEID_FORMATTER)
+ );
+ nameid->setCaseSensitive(m_caseSensitive);
+ vector<NameIDAttribute::Value>& dest = nameid->getValues();
vector<XMLObject*>::const_iterator v,stop;
- Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder");
-
+ Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder.NameIDFromScoped");
+
if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) {
const opensaml::saml2::Attribute* saml2attr = dynamic_cast<const opensaml::saml2::Attribute*>(xmlObject);
if (saml2attr) {
@@ -88,7 +94,7 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
if (log.isDebugEnabled()) {
auto_ptr_char n(saml2attr->getName());
log.debug(
- "decoding ScopedAttribute (%s) from SAML 2 Attribute (%s) with %lu value(s)",
+ "decoding NameIDAttribute (%s) from SAML 2 Attribute (%s) with %lu value(s)",
ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size()
);
}
@@ -102,13 +108,13 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
if (log.isDebugEnabled()) {
auto_ptr_char n(saml1attr->getAttributeName());
log.debug(
- "decoding ScopedAttribute (%s) from SAML 1 Attribute (%s) with %lu value(s)",
+ "decoding NameIDAttribute (%s) from SAML 1 Attribute (%s) with %lu value(s)",
ids.front().c_str(), n.get() ? n.get() : "unnamed", values.size()
);
}
}
else {
- log.warn("XMLObject type not recognized by ScopedAttributeDecoder, no values returned");
+ log.warn("XMLObject type not recognized by NameIDFromScopedAttributeDecoder, no values returned");
return NULL;
}
}
@@ -117,26 +123,22 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
if (!(*v)->hasChildren()) {
val = toUTF8((*v)->getTextContent());
if (val && *val) {
+ dest.push_back(NameIDAttribute::Value());
+ NameIDAttribute::Value& destval = dest.back();
const AttributeExtensibleXMLObject* aexo=dynamic_cast<const AttributeExtensibleXMLObject*>(*v);
- xmlscope = aexo->getAttribute(scopeqname);
- if (xmlscope && *xmlscope) {
- scope = toUTF8(xmlscope);
- dest.push_back(pair<string,string>(val,scope));
- delete[] scope;
- }
- else {
- scope = strchr(val, m_delimeter);
- if (scope) {
+ xmlscope = aexo ? aexo->getAttribute(scopeqname) : NULL;
+ if (!xmlscope || !*xmlscope) {
+ // Terminate the value at the scope delimiter.
+ if (scope = strchr(val, m_delimeter))
*scope++ = 0;
- if (*scope)
- dest.push_back(pair<string,string>(val,scope));
- else
- log.warn("ignoring unscoped AttributeValue");
- }
- else {
- log.warn("ignoring unscoped AttributeValue");
- }
}
+ destval.m_Name = val;
+ if (m_format.get() && *m_format.get())
+ destval.m_Format = m_format.get();
+ if (assertingParty)
+ destval.m_NameQualifier = assertingParty;
+ if (relyingParty)
+ destval.m_SPNameQualifier = relyingParty;
}
else {
log.warn("skipping empty AttributeValue");
@@ -148,51 +150,9 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
}
}
- return dest.empty() ? NULL : scoped.release();
- }
-
- const NameID* saml2name = dynamic_cast<const NameID*>(xmlObject);
- if (saml2name) {
- if (log.isDebugEnabled()) {
- auto_ptr_char f(saml2name->getFormat());
- log.debug("decoding ScopedAttribute (%s) from SAML 2 NameID with Format (%s)", ids.front().c_str(), f.get() ? f.get() : "unspecified");
- }
- val = toUTF8(saml2name->getName());
- }
- else {
- const NameIdentifier* saml1name = dynamic_cast<const NameIdentifier*>(xmlObject);
- if (saml1name) {
- if (log.isDebugEnabled()) {
- auto_ptr_char f(saml1name->getFormat());
- log.debug(
- "decoding ScopedAttribute (%s) from SAML 1 NameIdentifier with Format (%s)",
- ids.front().c_str(), f.get() ? f.get() : "unspecified"
- );
- }
- val = toUTF8(saml1name->getName());
- }
- else {
- log.warn("XMLObject type not recognized by ScopedAttributeDecoder, no values returned");
- return NULL;
- }
+ return dest.empty() ? NULL : nameid.release();
}
- if (val && *val && *val!=m_delimeter) {
- scope = strchr(val, m_delimeter);
- if (scope) {
- *scope++ = 0;
- if (*scope)
- dest.push_back(pair<string,string>(val,scope));
- else
- log.warn("ignoring NameID with no scope");
- }
- else {
- log.warn("ignoring NameID with no scope delimiter (%c)", m_delimeter);
- }
- }
- else {
- log.warn("ignoring empty NameID");
- }
- delete[] val;
- return dest.empty() ? NULL : scoped.release();
+ log.warn("XMLObject type not recognized by NameIDFromScopedAttributeDecoder, no values returned");
+ return NULL;
}
diff --git a/shibsp/attribute/ScopedAttributeDecoder.cpp b/shibsp/attribute/ScopedAttributeDecoder.cpp
index cdfacad..2044d6b 100644
--- a/shibsp/attribute/ScopedAttributeDecoder.cpp
+++ b/shibsp/attribute/ScopedAttributeDecoder.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* ScopedAttributeDecoder.cpp
- *
+ *
* Decodes SAML into ScopedAttributes
*/
@@ -41,11 +41,9 @@ namespace shibsp {
{
public:
ScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@') {
- if (e) {
- if (e->hasAttributeNS(NULL,scopeDelimeter)) {
- auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
- m_delimeter = *(d.get());
- }
+ if (e && e->hasAttributeNS(NULL,scopeDelimeter)) {
+ auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
+ m_delimeter = *(d.get());
}
}
~ScopedAttributeDecoder() {}
@@ -77,8 +75,8 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
vector< pair<string,string> >& dest = scoped->getValues();
vector<XMLObject*>::const_iterator v,stop;
- Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder");
-
+ Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder.Scoped");
+
if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) {
const opensaml::saml2::Attribute* saml2attr = dynamic_cast<const opensaml::saml2::Attribute*>(xmlObject);
if (saml2attr) {
@@ -118,7 +116,7 @@ shibsp::Attribute* ScopedAttributeDecoder::decode(
val = toUTF8((*v)->getTextContent());
if (val && *val) {
const AttributeExtensibleXMLObject* aexo=dynamic_cast<const AttributeExtensibleXMLObject*>(*v);
- xmlscope = aexo->getAttribute(scopeqname);
+ xmlscope = aexo ? aexo->getAttribute(scopeqname) : NULL;
if (xmlscope && *xmlscope) {
scope = toUTF8(xmlscope);
dest.push_back(pair<string,string>(val,scope));
diff --git a/shibsp/attribute/StringAttributeDecoder.cpp b/shibsp/attribute/StringAttributeDecoder.cpp
index 0e075dd..ca86390 100644
--- a/shibsp/attribute/StringAttributeDecoder.cpp
+++ b/shibsp/attribute/StringAttributeDecoder.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* StringAttributeDecoder.cpp
- *
+ *
* Decodes SAML into SimpleAttributes
*/
@@ -61,7 +61,7 @@ shibsp::Attribute* StringAttributeDecoder::decode(
vector<string>& dest = simple->getValues();
vector<XMLObject*>::const_iterator v,stop;
- Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder");
+ Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder.String");
if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) {
const opensaml::saml2::Attribute* saml2attr = dynamic_cast<const opensaml::saml2::Attribute*>(xmlObject);
diff --git a/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp
index c2b193f..563e762 100644
--- a/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AttributeIssuerStringFunctor.cpp
@@ -28,6 +28,7 @@
namespace shibsp {
static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e);
+ static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
/**
* A match function that matches the attribute issuer's name against the specified value.
@@ -35,19 +36,25 @@ namespace shibsp {
class SHIBSP_DLLLOCAL AttributeIssuerStringFunctor : public MatchFunctor
{
const XMLCh* m_value;
+ bool m_ignoreCase;
public:
AttributeIssuerStringFunctor(const DOMElement* e) {
m_value = e ? e->getAttributeNS(NULL,value) : NULL;
if (!m_value || !*m_value)
throw ConfigurationException("AttributeIssuerString MatchFunctor requires non-empty value attribute.");
+ const XMLCh* flag = e ? e->getAttributeNS(NULL,ignoreCase) : NULL;
+ m_ignoreCase = (flag && (*flag == chLatin_t || *flag == chDigit_1));
}
bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
- return XMLString::equals(m_value, filterContext.getAttributeIssuer());
+ if (m_ignoreCase)
+ return (XMLString::compareIString(m_value, filterContext.getAttributeIssuer()) == 0);
+ else
+ return XMLString::equals(m_value, filterContext.getAttributeIssuer());
}
bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
- return XMLString::equals(m_value, filterContext.getAttributeIssuer());
+ return evaluatePolicyRequirement(filterContext);
}
};
diff --git a/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp
index fb8182b..5eecf7d 100644
--- a/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AttributeRequesterStringFunctor.cpp
@@ -28,6 +28,7 @@
namespace shibsp {
static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e);
+ static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
/**
* A match function that matches the attribute requester's name against the specified value.
@@ -35,19 +36,25 @@ namespace shibsp {
class SHIBSP_DLLLOCAL AttributeRequesterStringFunctor : public MatchFunctor
{
const XMLCh* m_value;
+ bool m_ignoreCase;
public:
AttributeRequesterStringFunctor(const DOMElement* e) {
m_value = e ? e->getAttributeNS(NULL,value) : NULL;
if (!m_value || !*m_value)
throw ConfigurationException("AttributeRequesterString MatchFunctor requires non-empty value attribute.");
+ const XMLCh* flag = e ? e->getAttributeNS(NULL,ignoreCase) : NULL;
+ m_ignoreCase = (flag && (*flag == chLatin_t || *flag == chDigit_1));
}
bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
- return XMLString::equals(m_value, filterContext.getAttributeRequester());
+ if (m_ignoreCase)
+ return (XMLString::compareIString(m_value, filterContext.getAttributeRequester()) == 0);
+ else
+ return XMLString::equals(m_value, filterContext.getAttributeRequester());
}
bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
- return XMLString::equals(m_value, filterContext.getAttributeRequester());
+ return evaluatePolicyRequirement(filterContext);
}
};
diff --git a/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp
index d9749fc..14a1bb1 100644
--- a/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AttributeScopeStringFunctor.cpp
@@ -32,6 +32,7 @@ using namespace std;
namespace shibsp {
static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D);
+ static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e);
/**
@@ -39,16 +40,25 @@ namespace shibsp {
*/
class SHIBSP_DLLLOCAL AttributeScopeStringFunctor : public MatchFunctor
{
- xmltooling::auto_ptr_char m_value;
xmltooling::auto_ptr_char m_attributeID;
+ char* m_value;
+ bool m_ignoreCase;
bool hasScope(const FilteringContext& filterContext) const;
public:
AttributeScopeStringFunctor(const DOMElement* e)
- : m_value(e ? e->getAttributeNS(NULL,value) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) {
- if (!m_value.get() || !*m_value.get())
+ : m_value(e ? xmltooling::toUTF8(e->getAttributeNS(NULL,value)) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) {
+ if (!m_value || !*m_value) {
+ delete[] m_value;
throw ConfigurationException("AttributeScopeString MatchFunctor requires non-empty value attribute.");
+ }
+ const XMLCh* flag = e ? e->getAttributeNS(NULL,ignoreCase) : NULL;
+ m_ignoreCase = (flag && (*flag == chLatin_t || *flag == chDigit_1));
+ }
+
+ virtual ~AttributeScopeStringFunctor() {
+ delete[] m_value;
}
bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
@@ -58,8 +68,17 @@ namespace shibsp {
}
bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
- if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId()))
- return XMLString::equals(attribute.getScope(index), m_value.get());
+ if (!m_attributeID.get() || !*m_attributeID.get() || XMLString::equals(m_attributeID.get(), attribute.getId())) {
+ if (m_ignoreCase) {
+#ifdef HAVE_STRCASECMP
+ return !strcasecmp(attribute.getScope(index), m_value);
+#else
+ return !stricmp(attribute.getScope(index), m_value);
+#endif
+ }
+ else
+ return !strcmp(attribute.getScope(index), m_value);
+ }
return hasScope(filterContext);
}
};
@@ -79,8 +98,19 @@ bool AttributeScopeStringFunctor::hasScope(const FilteringContext& filterContext
for (; attrs.first != attrs.second; ++attrs.first) {
count = attrs.first->second->valueCount();
for (size_t index = 0; index < count; ++index) {
- if (XMLString::equals(attrs.first->second->getScope(index), m_value.get()))
- return true;
+ if (m_ignoreCase) {
+#ifdef HAVE_STRCASECMP
+ if (!strcasecmp(attrs.first->second->getScope(index), m_value))
+ return true;
+#else
+ if (!stricmp(attrs.first->second->getScope(index), m_value))
+ return true;
+#endif
+ }
+ else {
+ if (!strcmp(attrs.first->second->getScope(index), m_value))
+ return true;
+ }
}
}
return false;
diff --git a/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp
index 0c2739c..707f318 100644
--- a/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AttributeValueStringFunctor.cpp
@@ -33,23 +33,35 @@ namespace shibsp {
static const XMLCh attributeID[] = UNICODE_LITERAL_11(a,t,t,r,i,b,u,t,e,I,D);
static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e);
+ static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
/**
* A match function that matches the value of an attribute against the specified value.
*/
class SHIBSP_DLLLOCAL AttributeValueStringFunctor : public MatchFunctor
{
- xmltooling::auto_ptr_char m_value;
xmltooling::auto_ptr_char m_attributeID;
+ char* m_value;
bool hasValue(const FilteringContext& filterContext) const;
bool matches(const Attribute& attribute, size_t index) const;
public:
AttributeValueStringFunctor(const DOMElement* e)
- : m_value(e ? e->getAttributeNS(NULL,value) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) {
- if (!m_value.get() || !*m_value.get())
+ : m_value(e ? xmltooling::toUTF8(e->getAttributeNS(NULL,value)) : NULL), m_attributeID(e ? e->getAttributeNS(NULL,attributeID) : NULL) {
+ if (!m_value || !*m_value) {
+ delete[] m_value;
throw ConfigurationException("AttributeValueString MatchFunctor requires non-empty value attribute.");
+ }
+ if (e && e->hasAttributeNS(NULL,ignoreCase)) {
+ xmltooling::logging::Category::getInstance(SHIBSP_LOGCAT".AttributeFilter").warn(
+ "ignoreCase property ignored by AttributeValueString MatchFunctor in favor of attribute's caseSensitive property"
+ );
+ }
+ }
+
+ virtual ~AttributeValueStringFunctor() {
+ delete[] m_value;
}
bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
@@ -93,11 +105,11 @@ bool AttributeValueStringFunctor::matches(const Attribute& attribute, size_t ind
if (!val)
return false;
if (attribute.isCaseSensitive())
- return !strcmp(m_value.get(), val);
+ return !strcmp(m_value, val);
#ifdef HAVE_STRCASECMP
- return !strcasecmp(m_value.get(), val);
+ return !strcasecmp(m_value, val);
#else
- return !stricmp(m_value.get(), val);
+ return !stricmp(m_value, val);
#endif
}
diff --git a/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp b/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp
index 69df276..3c8393e 100644
--- a/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AuthenticationMethodStringFunctor.cpp
@@ -28,6 +28,7 @@
namespace shibsp {
static const XMLCh value[] = UNICODE_LITERAL_5(v,a,l,u,e);
+ static const XMLCh ignoreCase[] = UNICODE_LITERAL_10(i,g,n,o,r,e,C,a,s,e);
/**
* Match functor that compares the user's authentication method against a given string.
@@ -35,20 +36,26 @@ namespace shibsp {
class SHIBSP_DLLLOCAL AuthenticationMethodStringFunctor : public MatchFunctor
{
const XMLCh* m_value;
+ bool m_ignoreCase;
public:
AuthenticationMethodStringFunctor(const DOMElement* e) : m_value(e ? e->getAttributeNS(NULL,value) : NULL) {
if (!m_value || !*m_value)
throw ConfigurationException("AuthenticationMethodString MatchFunctor requires non-empty value attribute.");
+ const XMLCh* flag = e ? e->getAttributeNS(NULL,ignoreCase) : NULL;
+ m_ignoreCase = (flag && (*flag == chLatin_t || *flag == chDigit_1));
}
bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
- return XMLString::equals(m_value, filterContext.getAuthnContextClassRef()) ||
- XMLString::equals(m_value, filterContext.getAuthnContextDeclRef());
+ if (m_ignoreCase)
+ return (XMLString::compareIString(m_value, filterContext.getAuthnContextClassRef()) == 0 ||
+ XMLString::compareIString(m_value, filterContext.getAuthnContextDeclRef()) == 0);
+ else
+ return XMLString::equals(m_value, filterContext.getAuthnContextClassRef()) ||
+ XMLString::equals(m_value, filterContext.getAuthnContextDeclRef());
}
bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
- return XMLString::equals(m_value, filterContext.getAuthnContextClassRef()) ||
- XMLString::equals(m_value, filterContext.getAuthnContextDeclRef());
+ return evaluatePolicyRequirement(filterContext);
}
};
diff --git a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
index 47857f2..b01cf1f 100644
--- a/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
+++ b/shibsp/attribute/filtering/impl/XMLAttributeFilter.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* XMLAttributeFilter.cpp
- *
+ *
* AttributeFilter based on an XML policy language.
*/
@@ -33,6 +33,7 @@
#include <xmltooling/util/XMLHelper.h>
#include <xercesc/util/XMLUniDefs.hpp>
+using shibspconstants::SHIB2ATTRIBUTEFILTER_NS;
using namespace shibsp;
using namespace opensaml::saml2md;
using namespace opensaml;
@@ -46,11 +47,13 @@ namespace shibsp {
#pragma warning( disable : 4250 )
#endif
+ // Each Policy has a functor for determining applicability and a map of
+ // attribute IDs to Accept/Deny functor pairs (which can include NULLs).
struct SHIBSP_DLLLOCAL Policy
{
Policy() : m_applies(NULL) {}
const MatchFunctor* m_applies;
- typedef multimap<string,const MatchFunctor*> rules_t;
+ typedef multimap< string,pair<const MatchFunctor*,const MatchFunctor*> > rules_t;
rules_t m_rules;
};
@@ -63,6 +66,7 @@ namespace shibsp {
m_document->release();
for_each(m_policyReqRules.begin(), m_policyReqRules.end(), cleanup_pair<string,MatchFunctor>());
for_each(m_permitValRules.begin(), m_permitValRules.end(), cleanup_pair<string,MatchFunctor>());
+ for_each(m_denyValRules.begin(), m_denyValRules.end(), cleanup_pair<string,MatchFunctor>());
}
void setDocument(DOMDocument* doc) {
@@ -75,16 +79,19 @@ namespace shibsp {
MatchFunctor* buildFunctor(
const DOMElement* e, const FilterPolicyContext& functorMap, const char* logname, bool standalone
);
- pair<string,const MatchFunctor*> buildAttributeRule(const DOMElement* e, const FilterPolicyContext& functorMap, bool standalone);
+ pair< string,pair<const MatchFunctor*,const MatchFunctor*> > buildAttributeRule(
+ const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
+ );
Category& m_log;
DOMDocument* m_document;
vector<Policy> m_policies;
- map< string,pair<string,const MatchFunctor*> > m_attrRules;
+ map< string,pair<string,pair<const MatchFunctor*,const MatchFunctor*> > > m_attrRules;
multimap<string,MatchFunctor*> m_policyReqRules;
multimap<string,MatchFunctor*> m_permitValRules;
+ multimap<string,MatchFunctor*> m_denyValRules;
};
-
+
class SHIBSP_DLLLOCAL XMLFilter : public AttributeFilter, public ReloadableXMLFile
{
public:
@@ -94,7 +101,7 @@ namespace shibsp {
~XMLFilter() {
delete m_impl;
}
-
+
void filterAttributes(const FilteringContext& context, vector<Attribute*>& attributes) const {
m_impl->filterAttributes(context, attributes);
}
@@ -114,11 +121,13 @@ namespace shibsp {
{
return new XMLFilter(e);
}
-
+
static const XMLCh AttributeFilterPolicyGroup[] = UNICODE_LITERAL_26(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r,P,o,l,i,c,y,G,r,o,u,p);
static const XMLCh AttributeFilterPolicy[] = UNICODE_LITERAL_21(A,t,t,r,i,b,u,t,e,F,i,l,t,e,r,P,o,l,i,c,y);
static const XMLCh AttributeRule[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,R,u,l,e);
static const XMLCh AttributeRuleReference[] = UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,R,u,l,e,R,e,f,e,r,e,n,c,e);
+ static const XMLCh DenyValueRule[] = UNICODE_LITERAL_13(D,e,n,y,V,a,l,u,e,R,u,l,e);
+ static const XMLCh DenyValueRuleReference[] = UNICODE_LITERAL_22(D,e,n,y,V,a,l,u,e,R,u,l,e,R,e,f,e,r,e,n,c,e);
static const XMLCh PermitValueRule[] = UNICODE_LITERAL_15(P,e,r,m,i,t,V,a,l,u,e,R,u,l,e);
static const XMLCh PermitValueRuleReference[] = UNICODE_LITERAL_24(P,e,r,m,i,t,V,a,l,u,e,R,u,l,e,R,e,f,e,r,e,n,c,e);
static const XMLCh PolicyRequirementRule[] = UNICODE_LITERAL_21(P,o,l,i,c,y,R,e,q,u,i,r,e,m,e,n,t,R,u,l,e);
@@ -133,31 +142,35 @@ XMLFilterImpl::XMLFilterImpl(const DOMElement* e, Category& log) : m_log(log), m
#ifdef _DEBUG
xmltooling::NDC ndc("XMLFilterImpl");
#endif
-
- if (!XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicyGroup))
+
+ if (!XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicyGroup))
throw ConfigurationException("XML AttributeFilter requires afp:AttributeFilterPolicyGroup at root of configuration.");
FilterPolicyContext reqFunctors(m_policyReqRules);
- FilterPolicyContext valFunctors(m_permitValRules);
+ FilterPolicyContext permFunctors(m_permitValRules);
+ FilterPolicyContext denyFunctors(m_denyValRules);
DOMElement* child = XMLHelper::getFirstChildElement(e);
while (child) {
- if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) {
+ if (XMLHelper::isNodeNamed(child, SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) {
buildFunctor(child, reqFunctors, "PolicyRequirementRule", true);
}
- else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) {
- buildFunctor(child, valFunctors, "PermitValueRule", true);
+ else if (XMLHelper::isNodeNamed(child, SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) {
+ buildFunctor(child, permFunctors, "PermitValueRule", true);
}
- else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) {
- buildAttributeRule(child, valFunctors, true);
+ else if (XMLHelper::isNodeNamed(child, SHIB2ATTRIBUTEFILTER_NS, DenyValueRule)) {
+ buildFunctor(child, denyFunctors, "DenyValueRule", true);
}
- else if (XMLHelper::isNodeNamed(child, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicy)) {
+ else if (XMLHelper::isNodeNamed(child, SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) {
+ buildAttributeRule(child, permFunctors, denyFunctors, true);
+ }
+ else if (XMLHelper::isNodeNamed(child, SHIB2ATTRIBUTEFILTER_NS, AttributeFilterPolicy)) {
e = XMLHelper::getFirstChildElement(child);
MatchFunctor* func = NULL;
- if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) {
+ if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRule)) {
func = buildFunctor(e, reqFunctors, "PolicyRequirementRule", false);
}
- else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRuleReference)) {
+ else if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, PolicyRequirementRuleReference)) {
auto_ptr_char ref(e->getAttributeNS(NULL, _ref));
if (ref.get() && *ref.get()) {
multimap<string,MatchFunctor*>::const_iterator prr = m_policyReqRules.find(ref.get());
@@ -169,15 +182,15 @@ XMLFilterImpl::XMLFilterImpl(const DOMElement* e, Category& log) : m_log(log), m
m_policies.back().m_applies = func;
e = XMLHelper::getNextSiblingElement(e);
while (e) {
- if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) {
- pair<string,const MatchFunctor*> rule = buildAttributeRule(e, valFunctors, false);
- if (rule.second)
+ if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeRule)) {
+ pair< string,pair<const MatchFunctor*,const MatchFunctor*> > rule = buildAttributeRule(e, permFunctors, denyFunctors, false);
+ if (rule.second.first || rule.second.second)
m_policies.back().m_rules.insert(Policy::rules_t::value_type(rule.first, rule.second));
}
- else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, AttributeRuleReference)) {
+ else if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, AttributeRuleReference)) {
auto_ptr_char ref(e->getAttributeNS(NULL, _ref));
if (ref.get() && *ref.get()) {
- map< string,pair<string,const MatchFunctor*> >::const_iterator ar = m_attrRules.find(ref.get());
+ map< string,pair< string,pair< const MatchFunctor*,const MatchFunctor*> > >::const_iterator ar = m_attrRules.find(ref.get());
if (ar != m_attrRules.end())
m_policies.back().m_rules.insert(Policy::rules_t::value_type(ar->second.first, ar->second.second));
else
@@ -234,19 +247,21 @@ MatchFunctor* XMLFilterImpl::buildFunctor(
return NULL;
}
-pair<string,const MatchFunctor*> XMLFilterImpl::buildAttributeRule(const DOMElement* e, const FilterPolicyContext& functorMap, bool standalone)
+pair< string,pair<const MatchFunctor*,const MatchFunctor*> > XMLFilterImpl::buildAttributeRule(
+ const DOMElement* e, const FilterPolicyContext& permMap, const FilterPolicyContext& denyMap, bool standalone
+ )
{
auto_ptr_char temp(e->getAttributeNS(NULL,_id));
const char* id = (temp.get() && *temp.get()) ? temp.get() : "";
if (standalone && !*id) {
m_log.warn("skipping stand-alone AttributeRule with no id");
- return make_pair(string(),(const MatchFunctor*)NULL);
+ return make_pair(string(),pair<const MatchFunctor*,const MatchFunctor*>(NULL,NULL));
}
else if (*id && m_attrRules.count(id)) {
if (standalone) {
m_log.warn("skipping duplicate stand-alone AttributeRule with id (%s)", id);
- return make_pair(string(),(const MatchFunctor*)NULL);
+ return make_pair(string(),pair<const MatchFunctor*,const MatchFunctor*>(NULL,NULL));
}
else
id = "";
@@ -256,28 +271,43 @@ pair<string,const MatchFunctor*> XMLFilterImpl::buildAttributeRule(const DOMElem
if (!attrID.get() || !*attrID.get())
m_log.warn("skipping AttributeRule with no attributeID");
+ MatchFunctor* perm=NULL;
+ MatchFunctor* deny=NULL;
+
e = XMLHelper::getFirstChildElement(e);
- MatchFunctor* func=NULL;
- if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) {
- func = buildFunctor(e, functorMap, "PermitValueRule", false);
+ if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, PermitValueRule)) {
+ perm = buildFunctor(e, permMap, "PermitValueRule", false);
+ e = XMLHelper::getNextSiblingElement(e);
}
- else if (e && XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEFILTER_NS, PermitValueRuleReference)) {
+ else if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, PermitValueRuleReference)) {
auto_ptr_char ref(e->getAttributeNS(NULL, _ref));
if (ref.get() && *ref.get()) {
multimap<string,MatchFunctor*>::const_iterator pvr = m_permitValRules.find(ref.get());
- func = (pvr!=m_permitValRules.end()) ? pvr->second : NULL;
+ perm = (pvr!=m_permitValRules.end()) ? pvr->second : NULL;
}
+ e = XMLHelper::getNextSiblingElement(e);
}
- if (func) {
+ if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, DenyValueRule)) {
+ deny = buildFunctor(e, denyMap, "DenyValueRule", false);
+ }
+ else if (e && XMLHelper::isNodeNamed(e, SHIB2ATTRIBUTEFILTER_NS, DenyValueRuleReference)) {
+ auto_ptr_char ref(e->getAttributeNS(NULL, _ref));
+ if (ref.get() && *ref.get()) {
+ multimap<string,MatchFunctor*>::const_iterator pvr = m_denyValRules.find(ref.get());
+ deny = (pvr!=m_denyValRules.end()) ? pvr->second : NULL;
+ }
+ }
+
+ if (perm || deny) {
if (*id)
- return m_attrRules[id] = pair<string,const MatchFunctor*>(attrID.get(), func);
+ return m_attrRules[id] = pair< string,pair<const MatchFunctor*,const MatchFunctor*> >(attrID.get(), pair<const MatchFunctor*,const MatchFunctor*>(perm,deny));
else
- return pair<string,const MatchFunctor*>(attrID.get(), func);
+ return pair< string,pair<const MatchFunctor*,const MatchFunctor*> >(attrID.get(), pair<const MatchFunctor*,const MatchFunctor*>(perm,deny));
}
- m_log.warn("skipping AttributeRule (%s), PermitValueRule invalid or missing", id);
- return make_pair(string(),(const MatchFunctor*)NULL);
+ m_log.warn("skipping AttributeRule (%s), permit and denial rule(s) invalid or missing", id);
+ return pair< string,pair<const MatchFunctor*,const MatchFunctor*> >(string(),pair<const MatchFunctor*,const MatchFunctor*>(NULL,NULL));
}
void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector<Attribute*>& attributes) const
@@ -293,100 +323,139 @@ void XMLFilterImpl::filterAttributes(const FilteringContext& context, vector<Att
return;
}
- size_t count,index;
+ // We have to evaluate every policy that applies against each attribute before deciding what to keep.
- // Test each Policy.
+ // For efficiency, we build an array of the policies that apply in advance.
+ vector<const Policy*> applicablePolicies;
for (vector<Policy>::const_iterator p=m_policies.begin(); p!=m_policies.end(); ++p) {
- if (p->m_applies->evaluatePolicyRequirement(context)) {
- // Loop over the attributes and look for possible rules to run.
- for (vector<Attribute*>::size_type a=0; a<attributes.size();) {
- bool ruleFound = false;
- Attribute* attr = attributes[a];
- pair<Policy::rules_t::const_iterator,Policy::rules_t::const_iterator> rules = p->m_rules.equal_range(attr->getId());
- if (rules.first != rules.second) {
- ruleFound = true;
- // Run each rule in sequence.
- m_log.debug(
- "applying filtering rule(s) for attribute (%s) from (%s)",
- attr->getId(), issuer.get() ? issuer.get() : "unknown source"
- );
- for (; rules.first!=rules.second; ++rules.first) {
- count = attr->valueCount();
- for (index=0; index < count;) {
- // The return value tells us whether to index past the accepted value, or stay put and decrement the count.
- if (rules.first->second->evaluatePermitValue(context, *attr, index)) {
- index++;
- }
- else {
- m_log.warn(
- "removed value at position (%lu) of attribute (%s) from (%s)",
- index, attr->getId(), issuer.get() ? issuer.get() : "unknown source"
- );
- attr->removeValue(index);
- count--;
- }
- }
- }
- }
+ if (p->m_applies->evaluatePolicyRequirement(context))
+ applicablePolicies.push_back(&(*p));
+ }
- rules = p->m_rules.equal_range("*");
- if (rules.first != rules.second) {
- // Run each rule in sequence.
- if (!ruleFound) {
- m_log.debug(
- "applying wildcard rule(s) for attribute (%s) from (%s)",
- attr->getId(), issuer.get() ? issuer.get() : "unknown source"
- );
- ruleFound = true;
- }
- for (; rules.first!=rules.second; ++rules.first) {
- count = attr->valueCount();
- for (index=0; index < count;) {
- // The return value tells us whether to index past the accepted value, or stay put and decrement the count.
- if (rules.first->second->evaluatePermitValue(context, *attr, index)) {
- index++;
- }
- else {
- m_log.warn(
- "removed value at position (%lu) of attribute (%s) from (%s)",
- index, attr->getId(), issuer.get() ? issuer.get() : "unknown source"
- );
- attr->removeValue(index);
- count--;
- }
- }
- }
- }
+ // For further efficiency, we declare arrays to store the applicable rules for an Attribute.
+ vector< pair<const MatchFunctor*,const MatchFunctor*> > applicableRules;
+ vector< pair<const MatchFunctor*,const MatchFunctor*> > wildcardRules;
- if (!ruleFound || attr->valueCount() == 0) {
- if (!ruleFound) {
- // No rule found, so we're filtering it out.
- m_log.warn(
- "no rule found, removing all values of attribute (%s) from (%s)",
- attr->getId(), issuer.get() ? issuer.get() : "unknown source"
- );
- }
- delete attr;
- attributes.erase(attributes.begin() + a);
- }
- else {
- ++a;
- }
+ // Store off the wildcards ahead of time.
+ for (vector<const Policy*>::const_iterator pol=applicablePolicies.begin(); pol!=applicablePolicies.end(); ++pol) {
+ pair<Policy::rules_t::const_iterator,Policy::rules_t::const_iterator> rules = (*pol)->m_rules.equal_range("*");
+ for (; rules.first!=rules.second; ++rules.first)
+ wildcardRules.push_back(rules.first->second);
+ }
+
+ // To track what to keep without removing anything from the original set until the end, we maintain
+ // a map of each Attribute object to a boolean array with true flags indicating what to delete.
+ // A single dimension array tracks attributes being removed entirely.
+ vector<bool> deletedAttributes(attributes.size(), false);
+ map< Attribute*, vector<bool> > deletedPositions;
+
+ // Loop over each attribute to filter them.
+ for (vector<Attribute*>::size_type a=0; a<attributes.size(); ++a) {
+ Attribute* attr = attributes[a];
+
+ // Clear the rule store.
+ applicableRules.clear();
+
+ // Look for rules to run in each policy.
+ for (vector<const Policy*>::const_iterator pol=applicablePolicies.begin(); pol!=applicablePolicies.end(); ++pol) {
+ pair<Policy::rules_t::const_iterator,Policy::rules_t::const_iterator> rules = (*pol)->m_rules.equal_range(attr->getId());
+ for (; rules.first!=rules.second; ++rules.first)
+ applicableRules.push_back(rules.first->second);
+ }
+
+ // If no rules found, apply wildcards.
+ const vector< pair<const MatchFunctor*,const MatchFunctor*> >& rulesToRun = applicableRules.empty() ? wildcardRules : applicableRules;
+
+ // If no rules apply, remove the attribute entirely.
+ if (rulesToRun.empty()) {
+ m_log.warn(
+ "no rule found, removing attribute (%s) from (%s)",
+ attr->getId(), issuer.get() ? issuer.get() : "unknown source"
+ );
+ deletedAttributes[a] = true;
+ continue;
+ }
+
+ // Run each permit/deny rule.
+ m_log.debug(
+ "applying filtering rule(s) for attribute (%s) from (%s)",
+ attr->getId(), issuer.get() ? issuer.get() : "unknown source"
+ );
+
+ bool kickit;
+
+ // Examine each value.
+ for (size_t count = attr->valueCount(), index = 0; index < count; ++index) {
+
+ // Assume we're kicking it out.
+ kickit=true;
+
+ for (vector< pair<const MatchFunctor*,const MatchFunctor*> >::const_iterator r=rulesToRun.begin(); r!=rulesToRun.end(); ++r) {
+ // If there's a permit rule that passes, don't kick it.
+ if (r->first && r->first->evaluatePermitValue(context, *attr, index))
+ kickit = false;
+ if (!kickit && r->second && r->second->evaluatePermitValue(context, *attr, index))
+ kickit = true;
+ }
+
+ // If we're kicking it, record that in the tracker.
+ if (kickit) {
+ m_log.warn(
+ "removed value at position (%lu) of attribute (%s) from (%s)",
+ index, attr->getId(), issuer.get() ? issuer.get() : "unknown source"
+ );
+ deletedPositions[attr].resize(index+1);
+ deletedPositions[attr][index] = true;
}
}
}
+
+ // Final step: go over the deletedPositions matrix and apply the actual changes. In order to delete
+ // any attributes that end up with no values, we have to do it by looping over the originals.
+ for (vector<Attribute*>::size_type a=0; a<attributes.size();) {
+ Attribute* attr = attributes[a];
+
+ if (deletedAttributes[a]) {
+ delete attr;
+ deletedAttributes.erase(deletedAttributes.begin() + a);
+ attributes.erase(attributes.begin() + a);
+ continue;
+ }
+ else if (deletedPositions.count(attr) > 0) {
+ // To do the removal, we loop over the bits backwards so that the
+ // underlying value sequence doesn't get distorted by any removals.
+ // Index has to be offset by one because size_type is unsigned.
+ const vector<bool>& row = deletedPositions[attr];
+ for (vector<bool>::size_type index = row.size(); index > 0; --index) {
+ if (row[index-1])
+ attr->removeValue(index-1);
+ }
+
+ // Check for no values.
+ if (attr->valueCount() == 0) {
+ m_log.warn(
+ "no values left, removing attribute (%s) from (%s)",
+ attr->getId(), issuer.get() ? issuer.get() : "unknown source"
+ );
+ delete attr;
+ attributes.erase(attributes.begin() + a);
+ continue;
+ }
+ }
+ ++a;
+ }
}
pair<bool,DOMElement*> XMLFilter::load()
{
// Load from source using base class.
pair<bool,DOMElement*> raw = ReloadableXMLFile::load();
-
+
// If we own it, wrap it.
XercesJanitor<DOMDocument> docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL);
XMLFilterImpl* impl = new XMLFilterImpl(raw.second, m_log);
-
+
// If we held the document, transfer it to the impl. If we didn't, it's a no-op.
impl->setDocument(docjanitor.release());
diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp
index 6c23764..de77496 100644
--- a/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp
+++ b/shibsp/attribute/resolver/impl/ChainingAttributeExtractor.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* ChainingAttributeExtractor.cpp
- *
+ *
* Chains together multiple AttributeExtractor plugins.
*/
@@ -43,7 +43,7 @@ namespace shibsp {
virtual ~ChainingAttributeExtractor() {
for_each(m_extractors.begin(), m_extractors.end(), xmltooling::cleanup<AttributeExtractor>());
}
-
+
Lockable* lock() {
return this;
}
@@ -63,7 +63,7 @@ namespace shibsp {
(*i)->getAttributeIds(attributes);
}
}
-
+
private:
vector<AttributeExtractor*> m_extractors;
};
@@ -97,7 +97,7 @@ ChainingAttributeExtractor::ChainingAttributeExtractor(const DOMElement* e)
m_extractors.push_back(conf.AttributeExtractorManager.newPlugin(type.get(),e));
}
catch (exception& ex) {
- Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor").error(
+ Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor.Chaining").error(
"caught exception processing embedded AttributeExtractor element: %s", ex.what()
);
}
diff --git a/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp
index c1b3805..90e3776 100644
--- a/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp
+++ b/shibsp/attribute/resolver/impl/ChainingAttributeResolver.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* ChainingAttributeResolver.cpp
- *
+ *
* Chains together multiple AttributeResolver plugins.
*/
@@ -93,7 +93,7 @@ namespace shibsp {
virtual ~ChainingAttributeResolver() {
for_each(m_resolvers.begin(), m_resolvers.end(), xmltooling::cleanup<AttributeResolver>());
}
-
+
Lockable* lock() {
return this;
}
@@ -125,7 +125,7 @@ namespace shibsp {
(*i)->getAttributeIds(attributes);
}
}
-
+
private:
vector<AttributeResolver*> m_resolvers;
};
@@ -159,7 +159,7 @@ ChainingAttributeResolver::ChainingAttributeResolver(const DOMElement* e)
m_resolvers.push_back(conf.AttributeResolverManager.newPlugin(type.get(),e));
}
catch (exception& ex) {
- Category::getInstance(SHIBSP_LOGCAT".AttributeResolver").error(
+ Category::getInstance(SHIBSP_LOGCAT".AttributeResolver.Chaining").error(
"caught exception processing embedded AttributeResolver element: %s", ex.what()
);
}
diff --git a/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp b/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp
index 04ad7bd..e6e231e 100644
--- a/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp
+++ b/shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* QueryAttributeResolver.cpp
- *
+ *
* AttributeResolver based on SAML queries.
*/
@@ -31,6 +31,7 @@
#include "attribute/resolver/AttributeResolver.h"
#include "attribute/resolver/ResolutionContext.h"
#include "binding/SOAPClient.h"
+#include "metadata/MetadataProviderCriteria.h"
#include "util/SPConstants.h"
#include <saml/exceptions.h>
@@ -69,7 +70,7 @@ namespace shibsp {
m_class = XMLString::transcode(session.getAuthnContextClassRef());
m_decl = XMLString::transcode(session.getAuthnContextDeclRef());
}
-
+
QueryContext(
const Application& application,
const EntityDescriptor* issuer,
@@ -97,7 +98,7 @@ namespace shibsp {
}
}
}
-
+
~QueryContext() {
if (m_session) {
XMLString::release((XMLCh**)&m_protocol);
@@ -109,7 +110,7 @@ namespace shibsp {
for_each(m_attributes.begin(), m_attributes.end(), xmltooling::cleanup<shibsp::Attribute>());
for_each(m_assertions.begin(), m_assertions.end(), xmltooling::cleanup<opensaml::Assertion>());
}
-
+
bool doQuery() const {
return m_query;
}
@@ -124,7 +125,7 @@ namespace shibsp {
m_metadata = m_app.getMetadataProvider(false);
if (m_metadata) {
m_metadata->lock();
- return m_entity = m_metadata->getEntityDescriptor(MetadataProvider::Criteria(m_session->getEntityID())).first;
+ return m_entity = m_metadata->getEntityDescriptor(MetadataProviderCriteria(m_app, m_session->getEntityID())).first;
}
}
return NULL;
@@ -164,7 +165,7 @@ namespace shibsp {
vector<shibsp::Attribute*> m_attributes;
vector<opensaml::Assertion*> m_assertions;
};
-
+
class SHIBSP_DLLLOCAL QueryResolver : public AttributeResolver
{
public:
@@ -176,7 +177,7 @@ namespace shibsp {
Lockable* lock() {return this;}
void unlock() {}
-
+
ResolutionContext* createResolutionContext(
const Application& application,
const EntityDescriptor* issuer,
@@ -213,15 +214,15 @@ namespace shibsp {
{
return new QueryResolver(e);
}
-
+
};
-QueryResolver::QueryResolver(const DOMElement* e) : m_log(Category::getInstance(SHIBSP_LOGCAT".AttributeResolver"))
+QueryResolver::QueryResolver(const DOMElement* e) : m_log(Category::getInstance(SHIBSP_LOGCAT".AttributeResolver.Query"))
{
#ifdef _DEBUG
xmltooling::NDC ndc("QueryResolver");
#endif
-
+
DOMElement* child = XMLHelper::getFirstChildElement(e);
while (child) {
try {
diff --git a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
index f5f1cf2..eeead9f 100644
--- a/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
+++ b/shibsp/attribute/resolver/impl/XMLAttributeExtractor.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* XMLAttributeExtractor.cpp
- *
+ *
* AttributeExtractor based on an XML mapping file.
*/
@@ -97,17 +97,17 @@ namespace shibsp {
attrmap_t m_attrMap;
vector<string> m_attributeIds;
};
-
+
class XMLExtractor : public AttributeExtractor, public ReloadableXMLFile
{
public:
- XMLExtractor(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor")), m_impl(NULL) {
+ XMLExtractor(const DOMElement* e) : ReloadableXMLFile(e, Category::getInstance(SHIBSP_LOGCAT".AttributeExtractor.XML")), m_impl(NULL) {
load();
}
~XMLExtractor() {
delete m_impl;
}
-
+
void extractAttributes(
const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, vector<Attribute*>& attributes
) const;
@@ -132,7 +132,7 @@ namespace shibsp {
{
return new XMLExtractor(e);
}
-
+
static const XMLCh _AttributeDecoder[] = UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,D,e,c,o,d,e,r);
static const XMLCh Attributes[] = UNICODE_LITERAL_10(A,t,t,r,i,b,u,t,e,s);
static const XMLCh _id[] = UNICODE_LITERAL_2(i,d);
@@ -146,7 +146,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) : m_log(l
#ifdef _DEBUG
xmltooling::NDC ndc("XMLExtractorImpl");
#endif
-
+
if (!XMLHelper::isNodeNamed(e, shibspconstants::SHIB2ATTRIBUTEMAP_NS, Attributes))
throw ConfigurationException("XML AttributeExtractor requires am:Attributes at root of configuration.");
@@ -220,7 +220,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) : m_log(l
#endif
m_log.info("creating mapping for Attribute %s%s%s", n.get(), *f.get() ? ", Format/Namespace:" : "", f.get());
}
-
+
decl.first = decoder;
decl.second.push_back(id.get());
m_attributeIds.push_back(id.get());
@@ -248,7 +248,7 @@ XMLExtractorImpl::XMLExtractorImpl(const DOMElement* e, Category& log) : m_log(l
start = pos ? pos+1 : NULL;
}
}
-
+
child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME);
}
}
@@ -528,12 +528,12 @@ pair<bool,DOMElement*> XMLExtractor::load()
{
// Load from source using base class.
pair<bool,DOMElement*> raw = ReloadableXMLFile::load();
-
+
// If we own it, wrap it.
XercesJanitor<DOMDocument> docjanitor(raw.first ? raw.second->getOwnerDocument() : NULL);
XMLExtractorImpl* impl = new XMLExtractorImpl(raw.second, m_log);
-
+
// If we held the document, transfer it to the impl. If we didn't, it's a no-op.
impl->setDocument(docjanitor.release());
diff --git a/shibsp/binding/impl/SOAPClient.cpp b/shibsp/binding/impl/SOAPClient.cpp
index 656a2c8..ad3d3cb 100644
--- a/shibsp/binding/impl/SOAPClient.cpp
+++ b/shibsp/binding/impl/SOAPClient.cpp
@@ -67,6 +67,7 @@ void SOAPClient::send(const soap11::Envelope& env, const char* from, MetadataCre
// Reset criteria back.
to.setKeyAlgorithm(NULL);
to.setKeySize(0);
+ to.getKeyNames().clear();
if (cred) {
// Check for message.
@@ -133,6 +134,7 @@ void SOAPClient::prepareTransport(SOAPTransport& transport)
if (authType.first)
m_criteria->getKeyNames().insert(authType.second);
const Credential* cred = m_credResolver->resolve(m_criteria);
+ m_criteria->getKeyNames().clear();
if (cred) {
if (!transport.setCredential(cred))
log.error("failed to load Credential into SOAPTransport");
diff --git a/shibsp/handler/impl/AbstractHandler.cpp b/shibsp/handler/impl/AbstractHandler.cpp
index 3f2e0da..cd9039c 100644
--- a/shibsp/handler/impl/AbstractHandler.cpp
+++ b/shibsp/handler/impl/AbstractHandler.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,8 +16,8 @@
/**
* AbstractHandler.cpp
- *
- * Base class for handlers based on a DOMPropertySet.
+ *
+ * Base class for handlers based on a DOMPropertySet.
*/
#include "internal.h"
@@ -31,8 +31,6 @@
#include "util/SPConstants.h"
#ifndef SHIBSP_LITE
-# include <saml/SAMLConfig.h>
-# include <saml/binding/SAMLArtifact.h>
# include <saml/saml1/core/Protocols.h>
# include <saml/saml2/core/Protocols.h>
# include <saml/saml2/metadata/Metadata.h>
@@ -67,12 +65,28 @@ namespace shibsp {
SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory MetadataGeneratorFactory;
SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory StatusHandlerFactory;
SHIBSP_DLLLOCAL PluginManager< Handler,string,pair<const DOMElement*,const char*> >::Factory SessionHandlerFactory;
+
+ void SHIBSP_DLLLOCAL generateRandomHex(std::string& buf, unsigned int len) {
+ static char DIGITS[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
+ int r;
+ unsigned char b1,b2;
+ buf.erase();
+ for (unsigned int i=0; i<len; i+=4) {
+ r = rand();
+ b1 = (0x00FF & r);
+ b2 = (0xFF00 & r) >> 8;
+ buf += (DIGITS[(0xF0 & b1) >> 4 ]);
+ buf += (DIGITS[0x0F & b1]);
+ buf += (DIGITS[(0xF0 & b2) >> 4 ]);
+ buf += (DIGITS[0x0F & b2]);
+ }
+ }
};
void SHIBSP_API shibsp::registerHandlers()
{
SPConfig& conf=SPConfig::getConfig();
-
+
conf.AssertionConsumerServiceManager.registerFactory(SAML1_PROFILE_BROWSER_ARTIFACT, SAML1ConsumerFactory);
conf.AssertionConsumerServiceManager.registerFactory(SAML1_PROFILE_BROWSER_POST, SAML1ConsumerFactory);
conf.AssertionConsumerServiceManager.registerFactory(SAML20_BINDING_HTTP_POST, SAML2ConsumerFactory);
@@ -256,16 +270,20 @@ void AbstractHandler::preserveRelayState(const Application& application, HTTPRes
if (!strcmp(mech.second, "cookie")) {
// Here we store the state in a cookie and send a fixed
// value so we can recognize it on the way back.
- if (relayState != "cookie") {
+ if (relayState.find("cookie:") != 0) {
const URLEncoder* urlenc = XMLToolingConfig::getConfig().getURLEncoder();
pair<string,const char*> shib_cookie=application.getCookieNameProps("_shibstate_");
string stateval = urlenc->encode(relayState.c_str()) + shib_cookie.second;
+ // Generate a random key for the cookie name instead of the fixed name.
+ string rsKey;
+ generateRandomHex(rsKey,5);
+ shib_cookie.first = "_shibstate_" + rsKey;
response.setCookie(shib_cookie.first.c_str(),stateval.c_str());
- relayState = "cookie";
+ relayState = "cookie:" + rsKey;
}
}
else if (strstr(mech.second,"ss:")==mech.second) {
- if (relayState.find("ss:")!=0) {
+ if (relayState.find("ss:") != 0) {
mech.second+=3;
if (*mech.second) {
if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
@@ -273,8 +291,7 @@ void AbstractHandler::preserveRelayState(const Application& application, HTTPRes
StorageService* storage = application.getServiceProvider().getStorageService(mech.second);
if (storage) {
string rsKey;
- SAMLConfig::getConfig().generateRandomBytes(rsKey,10);
- rsKey = SAMLArtifact::toHex(rsKey);
+ generateRandomHex(rsKey,5);
if (!storage->createString("RelayState", rsKey.c_str(), relayState.c_str(), time(NULL) + 600))
throw IOException("Attempted to insert duplicate storage key.");
relayState = string(mech.second-3) + ':' + rsKey;
@@ -357,21 +374,29 @@ void AbstractHandler::recoverRelayState(
}
}
}
-
- if (relayState == "cookie") {
- // Pull the value from the "relay state" cookie.
- pair<string,const char*> relay_cookie = application.getCookieNameProps("_shibstate_");
- const char* state = request.getCookie(relay_cookie.first.c_str());
- if (state && *state) {
- // URL-decode the value.
- char* rscopy=strdup(state);
- XMLToolingConfig::getConfig().getURLEncoder()->decode(rscopy);
- relayState = rscopy;
- free(rscopy);
-
- if (clear)
- response.setCookie(relay_cookie.first.c_str(),relay_cookie.second);
- return;
+
+ // Look for cookie-backed state of the form "cookie:key".
+ if (strstr(state,"cookie:")==state) {
+ state += 7;
+ if (*state) {
+ // Pull the value from the "relay state" cookie.
+ pair<string,const char*> relay_cookie = application.getCookieNameProps("_shibstate_");
+ relay_cookie.first = string("_shibstate_") + state;
+ state = request.getCookie(relay_cookie.first.c_str());
+ if (state && *state) {
+ // URL-decode the value.
+ char* rscopy=strdup(state);
+ XMLToolingConfig::getConfig().getURLEncoder()->decode(rscopy);
+ relayState = rscopy;
+ free(rscopy);
+
+ if (clear) {
+ string exp(relay_cookie.second);
+ exp += "; expires=Mon, 01 Jan 2001 00:00:00 GMT";
+ response.setCookie(relay_cookie.first.c_str(), exp.c_str());
+ }
+ return;
+ }
}
relayState.erase();
diff --git a/shibsp/handler/impl/AssertionConsumerService.cpp b/shibsp/handler/impl/AssertionConsumerService.cpp
index f4863cd..8f3b008 100644
--- a/shibsp/handler/impl/AssertionConsumerService.cpp
+++ b/shibsp/handler/impl/AssertionConsumerService.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,8 +16,8 @@
/**
* AssertionConsumerService.cpp
- *
- * Base class for handlers that create sessions by consuming SSO protocol responses.
+ *
+ * Base class for handlers that create sessions by consuming SSO protocol responses.
*/
#include "internal.h"
@@ -35,6 +35,7 @@
# include "attribute/resolver/AttributeExtractor.h"
# include "attribute/resolver/AttributeResolver.h"
# include "attribute/resolver/ResolutionContext.h"
+# include "metadata/MetadataProviderCriteria.h"
# include "security/SecurityPolicy.h"
# include <saml/SAMLConfig.h>
# include <saml/saml1/core/Assertions.h>
@@ -87,7 +88,7 @@ pair<bool,long> AssertionConsumerService::run(SPRequest& request, bool isHandler
{
string relayState;
SPConfig& conf = SPConfig::getConfig();
-
+
if (conf.isEnabled(SPConfig::OutOfProcess)) {
// When out of process, we run natively and directly process the message.
return processMessage(request.getApplication(), request, request);
@@ -112,7 +113,7 @@ void AssertionConsumerService::receive(DDF& in, ostream& out)
m_log.error("couldn't find application (%s) for new session", aid ? aid : "(missing)");
throw ConfigurationException("Unable to locate application for new session, deleted?");
}
-
+
// Unpack the request.
auto_ptr<HTTPRequest> req(getRequest(in));
@@ -137,7 +138,7 @@ pair<bool,long> AssertionConsumerService::processMessage(
pair<bool,const char*> policyId = getString("policyId", m_configNS.get()); // namespace-qualified if inside handler element
if (!policyId.first)
policyId = application.getString("policyId"); // unqualified in Application(s) element
-
+
// Access policy properties.
const PropertySet* settings = application.getServiceProvider().getPolicySettings(policyId.second);
pair<bool,bool> validate = settings->getBool("validate");
@@ -147,7 +148,7 @@ pair<bool,long> AssertionConsumerService::processMessage(
// Create the policy.
shibsp::SecurityPolicy policy(application, &m_role, validate.first && validate.second);
-
+
string relayState;
try {
@@ -159,7 +160,7 @@ pair<bool,long> AssertionConsumerService::processMessage(
implementProtocol(application, httpRequest, httpResponse, policy, settings, *msg.get());
auto_ptr_char issuer(policy.getIssuer() ? policy.getIssuer()->getName() : NULL);
-
+
// History cookie.
if (issuer.get() && *issuer.get())
maintainHistory(application, httpRequest, httpResponse, issuer.get());
@@ -181,7 +182,7 @@ void AssertionConsumerService::checkAddress(const Application& application, cons
{
if (!issuedTo || !*issuedTo)
return;
-
+
const PropertySet* props=application.getPropertySet("Sessions");
pair<bool,bool> checkAddress = props ? props->getBool("checkAddress") : make_pair(false,true);
if (!checkAddress.first)
@@ -327,7 +328,7 @@ ResolutionContext* AssertionConsumerService::resolveAttributes(
}
}
}
-
+
try {
AttributeResolver* resolver = application.getAttributeResolver();
if (resolver) {
@@ -367,7 +368,7 @@ ResolutionContext* AssertionConsumerService::resolveAttributes(
catch (exception& ex) {
m_log.error("attribute resolution failed: %s", ex.what());
}
-
+
if (!resolvedAttributes.empty()) {
// Attach global prefix if needed.
pair<bool,const char*> prefix = application.getString("attributePrefix");
@@ -410,8 +411,16 @@ void AssertionConsumerService::extractMessageDetails(const Assertion& assertion,
return;
}
m_log.debug("searching metadata for assertion issuer...");
- MetadataProvider::Criteria mc(policy.getIssuer()->getName(), &IDPSSODescriptor::ELEMENT_QNAME, protocol);
- pair<const EntityDescriptor*,const RoleDescriptor*> entity = policy.getMetadataProvider()->getEntityDescriptor(mc);
+ pair<const EntityDescriptor*,const RoleDescriptor*> entity;
+ shibsp::SecurityPolicy* sppol = dynamic_cast<shibsp::SecurityPolicy*>(&policy);
+ if (sppol) {
+ MetadataProviderCriteria mc(sppol->getApplication(), policy.getIssuer()->getName(), &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+ entity = policy.getMetadataProvider()->getEntityDescriptor(mc);
+ }
+ else {
+ MetadataProvider::Criteria mc(policy.getIssuer()->getName(), &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+ entity = policy.getMetadataProvider()->getEntityDescriptor(mc);
+ }
if (!entity.first) {
auto_ptr_char iname(policy.getIssuer()->getName());
m_log.warn("no metadata found, can't establish identity of issuer (%s)", iname.get());
@@ -436,7 +445,7 @@ void AssertionConsumerService::maintainHistory(
const PropertySet* sessionProps=application.getPropertySet("Sessions");
pair<bool,bool> idpHistory=sessionProps->getBool("idpHistory");
- if (!idpHistory.first || idpHistory.second) {
+ if (idpHistory.first && idpHistory.second) {
pair<bool,const char*> cookieProps=sessionProps->getString("cookieProps");
if (!cookieProps.first)
cookieProps.second=defProps;
diff --git a/shibsp/handler/impl/LogoutHandler.cpp b/shibsp/handler/impl/LogoutHandler.cpp
index 3ef1cd2..161dcc3 100644
--- a/shibsp/handler/impl/LogoutHandler.cpp
+++ b/shibsp/handler/impl/LogoutHandler.cpp
@@ -136,13 +136,13 @@ pair<bool,long> LogoutHandler::notifyFrontChannel(
loc = loc + (strchr(loc.c_str(),'?') ? '&' : '?') + "action=logout";
// Now we create a second URL representing the return location back to us.
+ ostringstream locstr;
const char* start = request.getRequestURL();
const char* end = strchr(start,'?');
string tempstr(start, end ? end-start : strlen(start));
- ostringstream locstr(tempstr);
// Add a signal that we're coming back from notification and the next index.
- locstr << "?notifying=1&index=" << index;
+ locstr << tempstr << "?notifying=1&index=" << index;
// Add return if set.
if (param)
diff --git a/shibsp/handler/impl/MetadataGenerator.cpp b/shibsp/handler/impl/MetadataGenerator.cpp
index 685c398..08e73e0 100644
--- a/shibsp/handler/impl/MetadataGenerator.cpp
+++ b/shibsp/handler/impl/MetadataGenerator.cpp
@@ -27,6 +27,10 @@
#include "handler/AbstractHandler.h"
#include "handler/RemotedHandler.h"
+#ifndef SHIBSP_LITE
+# include "metadata/MetadataProviderCriteria.h"
+#endif
+
#include <xercesc/framework/LocalFileInputSource.hpp>
#include <xercesc/framework/Wrapper4InputSource.hpp>
@@ -211,11 +215,11 @@ pair<bool,long> MetadataGenerator::processMessage(
if (entityID) {
MetadataProvider* m=application.getMetadataProvider();
Locker locker(m);
- MetadataProvider::Criteria mc(entityID);
+ MetadataProviderCriteria mc(application, entityID);
relyingParty = application.getRelyingParty(m->getEntityDescriptor(mc).first);
}
else {
- relyingParty = application.getRelyingParty(NULL);
+ relyingParty = &application;
}
EntityDescriptor* entity;
diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp
index be80cb1..d917407 100644
--- a/shibsp/handler/impl/SAML2Logout.cpp
+++ b/shibsp/handler/impl/SAML2Logout.cpp
@@ -31,6 +31,7 @@
#ifndef SHIBSP_LITE
# include "SessionCacheEx.h"
# include "security/SecurityPolicy.h"
+# include "metadata/MetadataProviderCriteria.h"
# include "util/TemplateParameters.h"
# include <fstream>
# include <saml/SAMLConfig.h>
@@ -284,7 +285,7 @@ pair<bool,long> SAML2Logout::doRequest(const Application& application, const HTT
// We need metadata to issue a response.
MetadataProvider* m = application.getMetadataProvider();
Locker metadataLocker(m);
- MetadataProvider::Criteria mc(request.getParameter("entityID"), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
+ MetadataProviderCriteria mc(application, request.getParameter("entityID"), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
pair<const EntityDescriptor*,const RoleDescriptor*> entity = m->getEntityDescriptor(mc);
if (!entity.first) {
throw MetadataException(
diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
index 400989c..e5a6bbb 100644
--- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp
+++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,7 +16,7 @@
/**
* SAML2LogoutInitiator.cpp
- *
+ *
* Triggers SP-initiated logout for SAML 2.0 sessions.
*/
@@ -30,6 +30,7 @@
#ifndef SHIBSP_LITE
# include "binding/SOAPClient.h"
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/SAMLConfig.h>
# include <saml/saml2/core/Protocols.h>
# include <saml/saml2/binding/SAML2SOAPClient.h>
@@ -53,7 +54,7 @@ namespace shibsp {
#pragma warning( push )
#pragma warning( disable : 4250 )
#endif
-
+
class SHIBSP_DLLLOCAL SAML2LogoutInitiator : public AbstractHandler, public LogoutHandler
{
public:
@@ -66,7 +67,7 @@ namespace shibsp {
}
#endif
}
-
+
void setParent(const PropertySet* parent);
void receive(DDF& in, ostream& out);
pair<bool,long> run(SPRequest& request, bool isHandler=true) const;
@@ -229,7 +230,7 @@ void SAML2LogoutInitiator::receive(DDF& in, ostream& out)
m_log.error("couldn't find application (%s) for logout", aid ? aid : "(missing)");
throw ConfigurationException("Unable to locate application for logout, deleted?");
}
-
+
// Unpack the request.
auto_ptr<HTTPRequest> req(getRequest(in));
@@ -237,7 +238,7 @@ void SAML2LogoutInitiator::receive(DDF& in, ostream& out)
DDF ret(NULL);
DDFJanitor jout(ret);
auto_ptr<HTTPResponse> resp(getResponse(ret));
-
+
Session* session = NULL;
try {
session = app->getServiceProvider().getSessionCache()->find(*app, *req.get(), NULL, NULL);
@@ -284,7 +285,7 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
// With a session in hand, we can create a LogoutRequest message, if we can find a compatible endpoint.
MetadataProvider* m = application.getMetadataProvider();
Locker metadataLocker(m);
- MetadataProvider::Criteria mc(session->getEntityID(), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
+ MetadataProviderCriteria mc(application, session->getEntityID(), &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
pair<const EntityDescriptor*,const RoleDescriptor*> entity = m->getEntityDescriptor(mc);
if (!entity.first) {
throw MetadataException(
@@ -339,8 +340,14 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
}
}
- if (!logoutResponse)
- ret = sendLogoutPage(application, httpRequest, httpResponse, false, "Identity provider did not respond to logout request.");
+ if (!logoutResponse) {
+ ret = sendLogoutPage(
+ application, httpRequest, httpResponse, false,
+ endpoints.empty() ?
+ "Identity provider does not support SAML 2 Single Logout protocol." :
+ "Identity provider did not respond to logout request."
+ );
+ }
else if (!logoutResponse->getStatus() || !logoutResponse->getStatus()->getStatusCode() ||
!XMLString::equals(logoutResponse->getStatus()->getStatusCode()->getValue(), saml2p::StatusCode::SUCCESS)) {
delete logoutResponse;
@@ -432,6 +439,9 @@ LogoutRequest* SAML2LogoutInitiator::buildRequest(
);
msg->setEncryptedID(encrypted.release());
}
+ else {
+ msg->setNameID(nameid->cloneNameID());
+ }
if (!encoder) {
// No encoder being used, so sign for SOAP client manually.
@@ -461,7 +471,7 @@ LogoutRequest* SAML2LogoutInitiator::buildRequest(
if (cr)
cr->setDigestAlgorithm(sigalg.second);
}
-
+
// Sign response while marshalling.
vector<xmlsignature::Signature*> sigs(1,sig);
msg->marshall((DOMDocument*)NULL,&sigs,cred);
diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp
index 9906907..7121176 100644
--- a/shibsp/handler/impl/SAML2SessionInitiator.cpp
+++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp
@@ -31,6 +31,7 @@
#include "util/SPConstants.h"
#ifndef SHIBSP_LITE
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/SAMLConfig.h>
# include <saml/saml2/core/Protocols.h>
# include <saml/saml2/metadata/EndpointManager.h>
@@ -244,11 +245,9 @@ pair<bool,long> SAML2SessionInitiator::run(SPRequest& request, string& entityID,
option = request.getParameter("target");
if (option)
target = option;
- if (acsByIndex.first && !acsByIndex.second) {
- // Since we're passing the ACS by value, we need to compute the return URL,
- // so we'll need the target resource for real.
- recoverRelayState(request.getApplication(), request, request, target, false);
- }
+
+ // Always need to recover target URL to compute handler below.
+ recoverRelayState(request.getApplication(), request, request, target, false);
pair<bool,bool> flag;
option = request.getParameter("isPassive");
@@ -532,7 +531,7 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
}
else {
// Use metadata to locate the IdP's SSO service.
- MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
+ MetadataProviderCriteria mc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
entity=m->getEntityDescriptor(mc);
if (!entity.first) {
m_log.warn("unable to locate metadata for provider (%s)", entityID);
@@ -610,8 +609,11 @@ pair<bool,long> SAML2SessionInitiator::doRequest(
cref->setReference(wideclass.get());
reqContext->getAuthnContextClassRefs().push_back(cref);
}
- if (authnContextComparison &&
- (!reqContext->getAuthnContextClassRefs().empty() || !reqContext->getAuthnContextDeclRefs().empty())) {
+
+ if (reqContext->getAuthnContextClassRefs().empty() && reqContext->getAuthnContextDeclRefs().empty()) {
+ req->setRequestedAuthnContext(NULL);
+ }
+ else if (authnContextComparison) {
auto_ptr_XMLCh widecomp(authnContextComparison);
reqContext->setComparison(widecomp.get());
}
diff --git a/shibsp/handler/impl/SessionHandler.cpp b/shibsp/handler/impl/SessionHandler.cpp
index ff5939b..789793c 100644
--- a/shibsp/handler/impl/SessionHandler.cpp
+++ b/shibsp/handler/impl/SessionHandler.cpp
@@ -157,7 +157,7 @@ pair<bool,long> SessionHandler::run(SPRequest& request, bool isHandler) const
count = 0;
}
}
- s << "<strong>" << a->second->getId() << "</strong>: ";
+ s << "<strong>" << a->first << "</strong>: ";
}
if (m_values) {
diff --git a/shibsp/handler/impl/Shib1SessionInitiator.cpp b/shibsp/handler/impl/Shib1SessionInitiator.cpp
index 38fb2d3..aeda3c7 100644
--- a/shibsp/handler/impl/Shib1SessionInitiator.cpp
+++ b/shibsp/handler/impl/Shib1SessionInitiator.cpp
@@ -31,6 +31,7 @@
#include "util/SPConstants.h"
#ifndef SHIBSP_LITE
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/saml2/metadata/Metadata.h>
# include <saml/saml2/metadata/EndpointManager.h>
#endif
@@ -224,7 +225,7 @@ pair<bool,long> Shib1SessionInitiator::doRequest(
// Use metadata to invoke the SSO service directly.
MetadataProvider* m=app.getMetadataProvider();
Locker locker(m);
- MetadataProvider::Criteria mc(entityID, &IDPSSODescriptor::ELEMENT_QNAME, shibspconstants::SHIB1_PROTOCOL_ENUM);
+ MetadataProviderCriteria mc(app, entityID, &IDPSSODescriptor::ELEMENT_QNAME, shibspconstants::SHIB1_PROTOCOL_ENUM);
pair<const EntityDescriptor*,const RoleDescriptor*> entity = m->getEntityDescriptor(mc);
if (!entity.first) {
m_log.warn("unable to locate metadata for provider (%s)", entityID);
diff --git a/shibsp/handler/impl/StatusHandler.cpp b/shibsp/handler/impl/StatusHandler.cpp
index 5f72c43..41e9f1f 100644
--- a/shibsp/handler/impl/StatusHandler.cpp
+++ b/shibsp/handler/impl/StatusHandler.cpp
@@ -31,6 +31,7 @@
using namespace shibsp;
#ifndef SHIBSP_LITE
# include "SessionCache.h"
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/version.h>
using namespace opensaml::saml2md;
using namespace opensaml;
@@ -426,10 +427,10 @@ pair<bool,long> StatusHandler::processMessage(
if (param) {
MetadataProvider* m = application.getMetadataProvider();
Locker mlock(m);
- relyingParty = application.getRelyingParty(m->getEntityDescriptor(MetadataProvider::Criteria(param)).first);
+ relyingParty = application.getRelyingParty(m->getEntityDescriptor(MetadataProviderCriteria(application, param)).first);
}
else {
- relyingParty = application.getRelyingParty(NULL);
+ relyingParty = &application;
}
s << "<Application id='" << application.getId() << "' entityID='" << relyingParty->getString("entityID").second << "'/>";
diff --git a/shibsp/handler/impl/TransformSessionInitiator.cpp b/shibsp/handler/impl/TransformSessionInitiator.cpp
index c265f7a..36759f3 100644
--- a/shibsp/handler/impl/TransformSessionInitiator.cpp
+++ b/shibsp/handler/impl/TransformSessionInitiator.cpp
@@ -31,6 +31,7 @@
#include "util/SPConstants.h"
#ifndef SHIBSP_LITE
+# include "metadata/MetadataProviderCriteria.h"
# include <saml/saml2/metadata/Metadata.h>
#endif
#include <xmltooling/XMLToolingConfig.h>
@@ -205,7 +206,7 @@ void TransformSessionInitiator::doRequest(const Application& application, string
MetadataProvider* m=application.getMetadataProvider();
Locker locker(m);
- MetadataProvider::Criteria mc(entityID.c_str(), &IDPSSODescriptor::ELEMENT_QNAME);
+ MetadataProviderCriteria mc(application, entityID.c_str(), &IDPSSODescriptor::ELEMENT_QNAME);
pair<const EntityDescriptor*,const RoleDescriptor*> entity;
if (!m_alwaysRun) {
// First check the original value, it might be valid already.
diff --git a/shibsp/impl/StorageServiceSessionCache.cpp b/shibsp/impl/StorageServiceSessionCache.cpp
index b687d33..cb51042 100644
--- a/shibsp/impl/StorageServiceSessionCache.cpp
+++ b/shibsp/impl/StorageServiceSessionCache.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -16,9 +16,9 @@
/**
* StorageServiceSessionCache.cpp
- *
+ *
* StorageService-based SessionCache implementation.
- *
+ *
* Instead of optimizing this plugin with a buffering scheme that keeps objects around
* and avoids extra parsing steps, I'm assuming that systems that require such can
* layer their own cache plugin on top of this version either by delegating to it
@@ -119,12 +119,44 @@ namespace shibsp {
return NULL;
}
+ Session* find(const Application& application, HTTPRequest& request, const char* client_addr=NULL, time_t* timeout=NULL) {
+ string id = active(application, request);
+ if (id.empty())
+ return NULL;
+ try {
+ Session* session = find(application, id.c_str(), client_addr, timeout);
+ if (session)
+ return session;
+ HTTPResponse* response = dynamic_cast<HTTPResponse*>(&request);
+ if (response) {
+ pair<string,const char*> shib_cookie = application.getCookieNameProps("_shibsession_");
+ string exp(shib_cookie.second);
+ exp += "; expires=Mon, 01 Jan 2001 00:00:00 GMT";
+ response->setCookie(shib_cookie.first.c_str(), exp.c_str());
+ }
+ }
+ catch (exception&) {
+ HTTPResponse* response = dynamic_cast<HTTPResponse*>(&request);
+ if (response) {
+ pair<string,const char*> shib_cookie = application.getCookieNameProps("_shibsession_");
+ string exp(shib_cookie.second);
+ exp += "; expires=Mon, 01 Jan 2001 00:00:00 GMT";
+ response->setCookie(shib_cookie.first.c_str(), exp.c_str());
+ }
+ throw;
+ }
+ return NULL;
+ }
+
void remove(const Application& application, const HTTPRequest& request, HTTPResponse* response=NULL) {
pair<string,const char*> shib_cookie = application.getCookieNameProps("_shibsession_");
const char* session_id = request.getCookie(shib_cookie.first.c_str());
if (session_id && *session_id) {
- if (response)
- response->setCookie(shib_cookie.first.c_str(), shib_cookie.second);
+ if (response) {
+ string exp(shib_cookie.second);
+ exp += "; expires=Mon, 01 Jan 2001 00:00:00 GMT";
+ response->setCookie(shib_cookie.first.c_str(), exp.c_str());
+ }
remove(application, session_id);
}
}
@@ -136,6 +168,7 @@ namespace shibsp {
unsigned long m_cacheTimeout;
#ifndef SHIBSP_LITE
StorageService* m_storage;
+ StorageService* m_storage_lite;
#endif
private:
@@ -151,7 +184,7 @@ namespace shibsp {
// inproc means we buffer sessions in memory
RWLock* m_lock;
map<string,StoredSession*> m_hashtable;
-
+
// management of buffered sessions
void dormant(const char* key);
static void* cleanup_fn(void*);
@@ -180,18 +213,18 @@ namespace shibsp {
if (nameid) {
// Parse and bind the document into an XMLObject.
istringstream instr(nameid);
- DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
+ DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
XercesJanitor<DOMDocument> janitor(doc);
auto_ptr<saml2::NameID> n(saml2::NameIDBuilder::buildNameID());
n->unmarshall(doc->getDocumentElement(), true);
janitor.release();
m_nameid = n.release();
}
-#endif
+#endif
if (cache->inproc)
m_lock = Mutex::create();
}
-
+
~StoredSession() {
delete m_lock;
m_obj.destroy();
@@ -201,7 +234,7 @@ namespace shibsp {
for_each(m_tokens.begin(), m_tokens.end(), cleanup_pair<string,Assertion>());
#endif
}
-
+
Lockable* lock() {
if (m_lock)
m_lock->lock();
@@ -274,7 +307,7 @@ namespace shibsp {
}
return m_ids;
}
-
+
void validate(const Application& application, const char* client_addr, time_t* timeout);
#ifndef SHIBSP_LITE
@@ -302,13 +335,18 @@ namespace shibsp {
time_t m_expires,m_lastAccess;
Mutex* m_lock;
};
-
+
SessionCache* SHIBSP_DLLLOCAL StorageServiceCacheFactory(const DOMElement* const & e)
{
return new SSCache(e);
}
}
+Session* SessionCache::find(const Application& application, HTTPRequest& request, const char* client_addr, time_t* timeout)
+{
+ return find(application, const_cast<const HTTPRequest&>(request), client_addr, timeout);
+}
+
void SHIBSP_API shibsp::registerSessionCaches()
{
SPConfig::getConfig().SessionCacheManager.registerFactory(STORAGESERVICE_SESSION_CACHE, StorageServiceCacheFactory);
@@ -362,7 +400,7 @@ void StoredSession::validate(const Application& application, const char* client_
if (!timeout)
return;
-
+
if (!SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
DDF in("touch::"STORAGESERVICE_SESSION_CACHE"::SessionCache"), out;
DDFJanitor jin(in);
@@ -370,7 +408,7 @@ void StoredSession::validate(const Application& application, const char* client_
in.addmember("key").string(getID());
in.addmember("version").integer(m_obj["version"].integer());
if (*timeout) {
- // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps.
+ // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps.
#ifndef HAVE_GMTIME_R
struct tm* ptime=gmtime(timeout);
#else
@@ -420,7 +458,7 @@ void StoredSession::validate(const Application& application, const char* client_
if (*timeout > 0 && now - lastAccess >= *timeout) {
m_cache->m_log.info("session timed out (ID: %s)", getID());
throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
- }
+ }
// Update storage expiration, if possible.
try {
@@ -429,7 +467,7 @@ void StoredSession::validate(const Application& application, const char* client_
catch (exception& ex) {
m_cache->m_log.error("failed to update session expiration: %s", ex.what());
}
-
+
if (ver > curver) {
// We got an updated record back.
DDF newobj;
@@ -462,7 +500,7 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
throw ConfigurationException("Session modification requires a StorageService.");
m_cache->m_log.debug("adding attributes to session (%s)", getID());
-
+
int ver;
do {
DDF attr;
@@ -473,13 +511,13 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
attr = (*a)->marshall();
attrs.add(attr);
}
-
+
// Tentatively increment the version.
m_obj["version"].integer(m_obj["version"].integer()+1);
-
+
ostringstream str;
str << m_obj;
- string record(str.str());
+ string record(str.str());
try {
ver = m_cache->m_storage->updateText(getID(), "session", record.c_str(), 0, m_obj["version"].integer()-1);
@@ -489,7 +527,7 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
m_obj["version"].integer(m_obj["version"].integer()-1);
vector<Attribute*>::size_type count = attributes.size();
while (count--)
- attrs.last().destroy();
+ attrs.last().destroy();
throw;
}
@@ -498,7 +536,7 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
m_obj["version"].integer(m_obj["version"].integer()-1);
vector<Attribute*>::size_type count = attributes.size();
while (count--)
- attrs.last().destroy();
+ attrs.last().destroy();
}
if (!ver) {
// Fatal problem with update.
@@ -512,7 +550,7 @@ void StoredSession::addAttributes(const vector<Attribute*>& attributes)
m_cache->m_log.error("readText failed on StorageService for session (%s)", getID());
throw IOException("Unable to read back stored session.");
}
-
+
// Reset object.
DDF newobj;
istringstream in(record);
@@ -554,18 +592,18 @@ const Assertion* StoredSession::getAssertion(const char* id) const
map<string,Assertion*>::const_iterator i = m_tokens.find(id);
if (i!=m_tokens.end())
return i->second;
-
+
string tokenstr;
if (!m_cache->m_storage->readText(getID(), id, &tokenstr, NULL))
throw FatalProfileException("Assertion not found in cache.");
// Parse and bind the document into an XMLObject.
istringstream instr(tokenstr);
- DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
+ DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(instr);
XercesJanitor<DOMDocument> janitor(doc);
auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
janitor.release();
-
+
Assertion* token = dynamic_cast<Assertion*>(xmlObject.get());
if (!token)
throw FatalProfileException("Request for cached assertion returned an unknown object type.");
@@ -600,7 +638,7 @@ void StoredSession::addAssertion(Assertion* assertion)
tokenstr << *assertion;
if (!m_cache->m_storage->createText(getID(), id.get(), tokenstr.str().c_str(), exp))
throw IOException("Attempted to insert duplicate assertion ID into session.");
-
+
int ver;
do {
DDF token = DDF(NULL).string(id.get());
@@ -608,10 +646,10 @@ void StoredSession::addAssertion(Assertion* assertion)
// Tentatively increment the version.
m_obj["version"].integer(m_obj["version"].integer()+1);
-
+
ostringstream str;
str << m_obj;
- string record(str.str());
+ string record(str.str());
try {
ver = m_cache->m_storage->updateText(getID(), "session", record.c_str(), 0, m_obj["version"].integer()-1);
@@ -626,7 +664,7 @@ void StoredSession::addAssertion(Assertion* assertion)
if (ver <= 0) {
token.destroy();
m_obj["version"].integer(m_obj["version"].integer()-1);
- }
+ }
if (!ver) {
// Fatal problem with update.
m_cache->m_log.error("updateText failed on StorageService for session (%s)", getID());
@@ -642,7 +680,7 @@ void StoredSession::addAssertion(Assertion* assertion)
m_cache->m_storage->deleteText(getID(), id.get());
throw IOException("Unable to read back stored session.");
}
-
+
// Reset object.
DDF newobj;
istringstream in(record);
@@ -655,7 +693,7 @@ void StoredSession::addAssertion(Assertion* assertion)
newobj["version"].integer(ver);
m_obj.destroy();
m_obj = newobj;
-
+
ver = -1;
}
} while (ver < 0); // negative indicates a sync issue so we retry
@@ -674,15 +712,16 @@ void StoredSession::addAssertion(Assertion* assertion)
#endif
SSCache::SSCache(const DOMElement* e)
- : m_log(Category::getInstance(SHIBSP_LOGCAT".SessionCache")), inproc(true), m_cacheTimeout(3600),
+ : m_log(Category::getInstance(SHIBSP_LOGCAT".SessionCache")), inproc(true), m_cacheTimeout(28800),
#ifndef SHIBSP_LITE
- m_storage(NULL),
+ m_storage(NULL), m_storage_lite(NULL),
#endif
m_root(e), m_inprocTimeout(900), m_lock(NULL), shutdown(false), shutdown_wait(NULL), cleanup_thread(NULL)
{
static const XMLCh cacheTimeout[] = UNICODE_LITERAL_12(c,a,c,h,e,T,i,m,e,o,u,t);
static const XMLCh inprocTimeout[] = UNICODE_LITERAL_13(i,n,p,r,o,c,T,i,m,e,o,u,t);
static const XMLCh _StorageService[] = UNICODE_LITERAL_14(S,t,o,r,a,g,e,S,e,r,v,i,c,e);
+ static const XMLCh _StorageServiceLite[] = UNICODE_LITERAL_18(S,t,o,r,a,g,e,S,e,r,v,i,c,e,L,i,t,e);
SPConfig& conf = SPConfig::getConfig();
inproc = conf.isEnabled(SPConfig::InProcess);
@@ -692,7 +731,7 @@ SSCache::SSCache(const DOMElement* e)
if (tag && *tag) {
m_cacheTimeout = XMLString::parseInt(tag);
if (!m_cacheTimeout)
- m_cacheTimeout=3600;
+ m_cacheTimeout=28800;
}
if (inproc) {
const XMLCh* tag=e->getAttributeNS(NULL,inprocTimeout);
@@ -715,6 +754,18 @@ SSCache::SSCache(const DOMElement* e)
}
if (!m_storage)
throw ConfigurationException("SessionCache unable to locate StorageService, check configuration.");
+
+ tag = e ? e->getAttributeNS(NULL,_StorageServiceLite) : NULL;
+ if (tag && *tag) {
+ auto_ptr_char ssid(tag);
+ m_storage_lite = conf.getServiceProvider()->getStorageService(ssid.get());
+ if (m_storage_lite)
+ m_log.info("bound to StorageServiceLite (%s)", ssid.get());
+ }
+ if (!m_storage_lite) {
+ m_log.info("No StorageServiceLite specified. Using standard StorageService.");
+ m_storage_lite = m_storage;
+ }
}
#endif
@@ -788,7 +839,7 @@ void SSCache::insert(const char* key, time_t expires, const char* name, const ch
// Since we can't guarantee uniqueness, check for an existing record.
string record;
time_t recordexp;
- int ver = m_storage->readText("NameID", name, &record, &recordexp);
+ int ver = m_storage_lite->readText("NameID", name, &record, &recordexp);
if (ver > 0) {
// Existing record, so we need to unmarshall it.
istringstream in(record);
@@ -813,13 +864,13 @@ void SSCache::insert(const char* key, time_t expires, const char* name, const ch
// Try and store it back...
if (ver > 0) {
- ver = m_storage->updateText("NameID", name, out.str().c_str(), max(expires, recordexp), ver);
+ ver = m_storage_lite->updateText("NameID", name, out.str().c_str(), max(expires, recordexp), ver);
if (ver <= 0) {
// Out of sync, or went missing, so retry.
return insert(key, expires, name, index);
}
}
- else if (!m_storage->createText("NameID", name, out.str().c_str(), expires)) {
+ else if (!m_storage_lite->createText("NameID", name, out.str().c_str(), expires)) {
// Hit a dup, so just retry, hopefully hitting the other branch.
return insert(key, expires, name, index);
}
@@ -859,7 +910,7 @@ void SSCache::insert(
if (strlen(name.get()) > 255)
const_cast<char*>(name.get())[255] = 0;
string pending;
- int ver = m_storage->readText("Logout", name.get(), &pending);
+ int ver = m_storage_lite->readText("Logout", name.get(), &pending);
if (ver > 0) {
DDF pendobj;
DDFJanitor jpend(pendobj);
@@ -885,6 +936,7 @@ void SSCache::insert(
// Store session properties in DDF.
DDF obj = DDF(key.get()).structure();
+ DDFJanitor entryobj(obj);
obj.addmember("version").integer(1);
obj.addmember("application_id").string(application.getId());
@@ -935,7 +987,7 @@ void SSCache::insert(
obj["assertions"].add(tokid);
}
}
-
+
if (attributes) {
DDF attr;
DDF attrlist = obj.addmember("attributes").list();
@@ -944,14 +996,14 @@ void SSCache::insert(
attrlist.add(attr);
}
}
-
+
ostringstream record;
record << obj;
-
+
m_log.debug("storing new session...");
if (!m_storage->createText(key.get(), "session", record.str().c_str(), now + m_cacheTimeout))
throw FatalProfileException("Attempted to create a session with a duplicate key.");
-
+
// Store the reverse mapping for logout.
try {
if (nameid)
@@ -997,8 +1049,10 @@ void SSCache::insert(
(nameid ? name.get() : "none") <<
") using (Protocol: " <<
(prot ? prot : "none") <<
+ ") from (AssertionID: " <<
+ (tokens ? obj["assertions"].first().string() : "none") <<
")";
-
+
if (attributes) {
xlog->log.infoStream() <<
"Cached the following attributes with session (ID: " <<
@@ -1011,9 +1065,23 @@ void SSCache::insert(
xlog->log.info("}");
}
- pair<string,const char*> shib_cookie = application.getCookieNameProps("_shibsession_");
+ time_t cookieLifetime = 0;
+ pair<string,const char*> shib_cookie = application.getCookieNameProps("_shibsession_", &cookieLifetime);
string k(key.get());
k += shib_cookie.second;
+
+ if (cookieLifetime > 0) {
+ cookieLifetime += now;
+#ifndef HAVE_GMTIME_R
+ ptime=gmtime(&cookieLifetime);
+#else
+ ptime=gmtime_r(&cookieLifetime,&res);
+#endif
+ char cookietimebuf[64];
+ strftime(cookietimebuf,64,"; expires=%a, %d %b %Y %H:%M:%S GMT",ptime);
+ k += cookietimebuf;
+ }
+
httpResponse.setCookie(shib_cookie.first.c_str(), k.c_str());
}
@@ -1084,7 +1152,7 @@ vector<string>::size_type SSCache::logout(
strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime);
time_t oldexp = 0;
- ver = m_storage->readText("Logout", name.get(), &record, &oldexp);
+ ver = m_storage_lite->readText("Logout", name.get(), &record, &oldexp);
if (ver > 0) {
istringstream lin(record);
lin >> obj;
@@ -1108,13 +1176,13 @@ vector<string>::size_type SSCache::logout(
lout << obj;
if (ver > 0) {
- ver = m_storage->updateText("Logout", name.get(), lout.str().c_str(), max(expires, oldexp), ver);
+ ver = m_storage_lite->updateText("Logout", name.get(), lout.str().c_str(), max(expires, oldexp), ver);
if (ver <= 0) {
// Out of sync, or went missing, so retry.
return logout(application, issuer, nameid, indexes, expires, sessionsKilled);
}
}
- else if (!m_storage->createText("Logout", name.get(), lout.str().c_str(), expires)) {
+ else if (!m_storage_lite->createText("Logout", name.get(), lout.str().c_str(), expires)) {
// Hit a dup, so just retry, hopefully hitting the other branch.
return logout(application, issuer, nameid, indexes, expires, sessionsKilled);
}
@@ -1124,7 +1192,7 @@ vector<string>::size_type SSCache::logout(
}
// Read in potentially matching sessions.
- ver = m_storage->readText("NameID", name.get(), &record);
+ ver = m_storage_lite->readText("NameID", name.get(), &record);
if (ver == 0) {
m_log.debug("no active sessions to logout for supplied issuer and subject");
return 0;
@@ -1180,19 +1248,19 @@ vector<string>::size_type SSCache::logout(
}
sessions = obj.next();
}
-
+
if (obj.first().isnull())
obj.destroy();
// If possible, write back the mapping record (this isn't crucial).
try {
if (obj.isnull()) {
- m_storage->deleteText("NameID", name.get());
+ m_storage_lite->deleteText("NameID", name.get());
}
else if (!sessionsKilled.empty()) {
ostringstream out;
out << obj;
- if (m_storage->updateText("NameID", name.get(), out.str().c_str(), 0, ver) <= 0)
+ if (m_storage_lite->updateText("NameID", name.get(), out.str().c_str(), 0, ver) <= 0)
m_log.warn("logout mapping record changed behind us, leaving it alone");
}
}
@@ -1207,7 +1275,7 @@ bool SSCache::stronglyMatches(const XMLCh* idp, const XMLCh* sp, const saml2::Na
{
if (!XMLString::equals(n1.getName(), n2.getName()))
return false;
-
+
const XMLCh* s1 = n1.getFormat();
const XMLCh* s2 = n2.getFormat();
if (!s1 || !*s1)
@@ -1216,7 +1284,7 @@ bool SSCache::stronglyMatches(const XMLCh* idp, const XMLCh* sp, const saml2::Na
s2 = saml2::NameID::UNSPECIFIED;
if (!XMLString::equals(s1,s2))
return false;
-
+
s1 = n1.getNameQualifier();
s2 = n2.getNameQualifier();
if (!s1 || !*s1)
@@ -1273,7 +1341,7 @@ Session* SSCache::find(const Application& application, const char* key, const ch
in.addmember("key").string(key);
in.addmember("application_id").string(application.getId());
if (timeout && *timeout) {
- // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps.
+ // On 64-bit Windows, time_t doesn't fit in a long, so I'm using ISO timestamps.
#ifndef HAVE_GMTIME_R
struct tm* ptime=gmtime(timeout);
#else
@@ -1284,7 +1352,7 @@ Session* SSCache::find(const Application& application, const char* key, const ch
strftime(timebuf,32,"%Y-%m-%dT%H:%M:%SZ",ptime);
in.addmember("timeout").string(timebuf);
}
-
+
try {
out=application.getServiceProvider().getListenerService()->send(in);
if (!out.isstruct()) {
@@ -1292,7 +1360,7 @@ Session* SSCache::find(const Application& application, const char* key, const ch
m_log.debug("session not found in remote cache");
return NULL;
}
-
+
// Wrap the results in a local entry and save it.
session = new StoredSession(this, out);
// The remote end has handled timeout issues, we handle address and expiration checks.
@@ -1310,22 +1378,22 @@ Session* SSCache::find(const Application& application, const char* key, const ch
throw ConfigurationException("SessionCache lookup requires a StorageService.");
m_log.debug("searching for session (%s)", key);
-
+
DDF obj;
time_t lastAccess;
string record;
int ver = m_storage->readText(key, "session", &record, &lastAccess);
if (!ver)
return NULL;
-
+
m_log.debug("reconstituting session and checking validity");
-
+
istringstream in(record);
in >> obj;
-
+
lastAccess -= m_cacheTimeout; // adjusts it back to the last time the record's timestamp was touched
time_t now=time(NULL);
-
+
if (timeout && *timeout > 0 && now - lastAccess >= *timeout) {
m_log.info("session timed out (ID: %s)", key);
remove(application, key);
@@ -1338,7 +1406,7 @@ Session* SSCache::find(const Application& application, const char* key, const ch
obj.destroy();
throw RetryableProfileException("Your session has expired, and you must re-authenticate.", namedparams(1, "entityID", eid2.c_str()));
}
-
+
if (timeout) {
// Update storage expiration, if possible.
try {
@@ -1390,7 +1458,7 @@ Session* SSCache::find(const Application& application, const char* key, const ch
remove(application, key);
throw;
}
-
+
return session;
}
@@ -1402,7 +1470,7 @@ void SSCache::remove(const Application& application, const char* key)
// Take care of local copy.
if (inproc)
dormant(key);
-
+
if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
// Remove the session from storage directly.
#ifndef SHIBSP_LITE
@@ -1423,7 +1491,7 @@ void SSCache::remove(const Application& application, const char* key)
in.structure();
in.addmember("key").string(key);
in.addmember("application_id").string(application.getId());
-
+
DDF out = application.getServiceProvider().getListenerService()->send(in);
out.destroy();
}
@@ -1451,7 +1519,7 @@ void SSCache::dormant(const char* key)
StoredSession* entry=i->second;
m_hashtable.erase(key);
entry->lock();
-
+
// unlock the cache
m_lock->unlock();
@@ -1468,15 +1536,16 @@ void SSCache::cleanup()
#endif
Mutex* mutex = Mutex::create();
-
+
// Load our configuration details...
static const XMLCh cleanupInterval[] = UNICODE_LITERAL_15(c,l,e,a,n,u,p,I,n,t,e,r,v,a,l);
const XMLCh* tag=m_root ? m_root->getAttributeNS(NULL,cleanupInterval) : NULL;
int rerun_timer = 900;
- if (tag && *tag)
+ if (tag && *tag) {
rerun_timer = XMLString::parseInt(tag);
- if (rerun_timer <= 0)
- rerun_timer = 900;
+ if (rerun_timer <= 0)
+ rerun_timer = 900;
+ }
mutex->lock();
@@ -1492,12 +1561,12 @@ void SSCache::cleanup()
// first pass is done holding a read-lock while we iterate over
// the cache. The second pass doesn't need a lock because
// the 'deletes' will lock the cache.
-
+
// Pass 1: iterate over the map and find all entries that have not been
// used in the allotted timeout.
vector<string> stale_keys;
time_t stale = time(NULL) - m_inprocTimeout;
-
+
m_log.debug("cleanup thread running");
m_lock->rdlock();
@@ -1510,10 +1579,10 @@ void SSCache::cleanup()
stale_keys.push_back(i->first);
}
m_lock->unlock();
-
+
if (!stale_keys.empty()) {
m_log.info("purging %d old sessions", stale_keys.size());
-
+
// Pass 2: walk through the list of stale entries and remove them from the cache
for (vector<string>::const_iterator j = stale_keys.begin(); j != stale_keys.end(); ++j)
dormant(j->c_str());
@@ -1532,7 +1601,7 @@ void SSCache::cleanup()
void* SSCache::cleanup_fn(void* cache_p)
{
#ifndef WIN32
- // First, let's block all signals
+ // First, let's block all signals
Thread::mask_all_signals();
#endif
@@ -1579,12 +1648,12 @@ void SSCache::receive(DDF& in, ostream& out)
DateTime dtobj(dt.get());
dtobj.parseDateTime();
timeout = dtobj.getEpoch();
-
+
if (timeout > 0 && now - lastAccess >= timeout) {
m_log.info("session timed out (ID: %s)", key);
remove(*app, key);
throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
- }
+ }
// Update storage expiration, if possible.
try {
@@ -1594,7 +1663,7 @@ void SSCache::receive(DDF& in, ostream& out)
m_log.error("failed to update session expiration: %s", ex.what());
}
}
-
+
// Send the record back.
out << record;
}
@@ -1625,11 +1694,11 @@ void SSCache::receive(DDF& in, ostream& out)
dtobj.parseDateTime();
timeout = dtobj.getEpoch();
}
-
+
if (timeout > 0 && now - lastAccess >= timeout) {
m_log.info("session timed out (ID: %s)", key);
throw RetryableProfileException("Your session has expired, and you must re-authenticate.");
- }
+ }
// Update storage expiration, if possible.
try {
@@ -1638,7 +1707,7 @@ void SSCache::receive(DDF& in, ostream& out)
catch (exception& ex) {
m_log.error("failed to update session expiration: %s", ex.what());
}
-
+
if (ver > curver) {
// Send the record back.
out << record;
diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index eeb3f38..fb16a21 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -124,6 +124,7 @@ namespace {
return (!m_credResolver && m_base) ? m_base->getCredentialResolver() : m_credResolver;
}
const PropertySet* getRelyingParty(const EntityDescriptor* provider) const;
+ const PropertySet* getRelyingParty(const XMLCh* entityID) const;
const vector<const XMLCh*>* getAudiences() const {
return (m_audiences.empty() && m_base) ? m_base->getAudiences() : &m_audiences;
}
@@ -977,6 +978,25 @@ const PropertySet* XMLApplication::getRelyingParty(const EntityDescriptor* provi
return this;
}
+const PropertySet* XMLApplication::getRelyingParty(const XMLCh* entityID) const
+{
+ if (!entityID)
+ return this;
+
+#ifdef HAVE_GOOD_STL
+ map<xstring,PropertySet*>::const_iterator i=m_partyMap.find(entityID);
+ if (i!=m_partyMap.end())
+ return i->second;
+#else
+ map<const XMLCh*,PropertySet*>::const_iterator i=m_partyMap.begin();
+ for (; i!=m_partyMap.end(); i++) {
+ if (XMLString::equals(i->first,entityID))
+ return i->second;
+ }
+#endif
+ return this;
+}
+
#endif
string XMLApplication::getNotificationURL(const char* resource, bool front, unsigned int index) const
@@ -1394,8 +1414,10 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, const XMLConfig* o
auto_ptr<XMLApplication> iapp(new XMLApplication(m_outer,child,defapp));
if (m_appmap.count(iapp->getId()))
log.crit("found conf:ApplicationOverride element with duplicate id attribute (%s), skipping it", iapp->getId());
- else
- m_appmap[iapp->getId()]=iapp.release();
+ else {
+ const char* iappid=iapp->getId();
+ m_appmap[iappid]=iapp.release();
+ }
child = XMLHelper::getNextSiblingElement(child,ApplicationOverride);
}
diff --git a/shibsp/internal.h b/shibsp/internal.h
index 1b5e9e5..6ccfbc3 100644
--- a/shibsp/internal.h
+++ b/shibsp/internal.h
@@ -43,6 +43,7 @@
#include "base.h"
#include "SPConfig.h"
+#include <memory>
#include <xmltooling/logging.h>
using namespace xmltooling::logging;
diff --git a/shibsp/metadata/DynamicMetadataProvider.cpp b/shibsp/metadata/DynamicMetadataProvider.cpp
new file mode 100644
index 0000000..42545a3
--- /dev/null
+++ b/shibsp/metadata/DynamicMetadataProvider.cpp
@@ -0,0 +1,277 @@
+/*
+ * Copyright 2001-2008 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * DynamicMetadataProvider.cpp
+ *
+ * Advanced implementation of a dynamic caching MetadataProvider.
+ */
+
+#include "internal.h"
+#include "exceptions.h"
+#include "ServiceProvider.h"
+#include "metadata/MetadataProviderCriteria.h"
+
+#include <saml/version.h>
+#include <saml/binding/SAMLArtifact.h>
+#include <saml/saml2/metadata/Metadata.h>
+#include <saml/saml2/metadata/DynamicMetadataProvider.h>
+
+#include <xmltooling/logging.h>
+#include <xmltooling/util/NDC.h>
+#include <xmltooling/security/Credential.h>
+#include <xmltooling/security/CredentialCriteria.h>
+#include <xmltooling/security/CredentialResolver.h>
+#include <xmltooling/security/X509TrustEngine.h>
+#include <xmltooling/soap/HTTPSOAPTransport.h>
+#include <xmltooling/util/XMLHelper.h>
+
+#include <xercesc/framework/Wrapper4InputSource.hpp>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+using namespace shibsp;
+using namespace opensaml;
+using namespace xmltooling::logging;
+using namespace xmltooling;
+using namespace std;
+
+namespace shibsp {
+ class SAML_DLLLOCAL DummyCredentialResolver : public CredentialResolver
+ {
+ public:
+ DummyCredentialResolver() {}
+ ~DummyCredentialResolver() {}
+
+ Lockable* lock() {return this;}
+ void unlock() {}
+
+ const Credential* resolve(const CredentialCriteria* criteria=NULL) const {return NULL;}
+ vector<const Credential*>::size_type resolve(
+ vector<const Credential*>& results, const CredentialCriteria* criteria=NULL
+ ) const {return 0;}
+ };
+
+ class SHIBSP_DLLLOCAL DynamicMetadataProvider : public saml2md::DynamicMetadataProvider
+ {
+ public:
+ DynamicMetadataProvider(const xercesc::DOMElement* e=NULL);
+
+ virtual ~DynamicMetadataProvider() {
+ delete m_trust;
+ }
+
+ protected:
+ saml2md::EntityDescriptor* resolve(const saml2md::MetadataProvider::Criteria& criteria) const;
+
+ private:
+ bool m_verifyHost,m_ignoreTransport;
+ X509TrustEngine* m_trust;
+ };
+
+
+ saml2md::MetadataProvider* SHIBSP_DLLLOCAL DynamicMetadataProviderFactory(const DOMElement* const & e)
+ {
+ return new DynamicMetadataProvider(e);
+ }
+
+ static const XMLCh ignoreTransport[] = UNICODE_LITERAL_15(i,g,n,o,r,e,T,r,a,n,s,p,o,r,t);
+ static const XMLCh _TrustEngine[] = UNICODE_LITERAL_11(T,r,u,s,t,E,n,g,i,n,e);
+ static const XMLCh type[] = UNICODE_LITERAL_4(t,y,p,e);
+ static const XMLCh verifyHost[] = UNICODE_LITERAL_10(v,e,r,i,f,y,H,o,s,t);
+};
+
+DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e)
+ : saml2md::DynamicMetadataProvider(e), m_verifyHost(true), m_ignoreTransport(false), m_trust(NULL)
+{
+ const XMLCh* flag = e ? e->getAttributeNS(NULL, verifyHost) : NULL;
+ if (flag && (*flag == chLatin_f || *flag == chDigit_0))
+ m_verifyHost = false;
+ flag = e ? e->getAttributeNS(NULL, ignoreTransport) : NULL;
+ if (flag && (*flag == chLatin_t || *flag == chDigit_1)) {
+ m_ignoreTransport = true;
+ return;
+ }
+
+ e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : NULL;
+ auto_ptr_char t2(e ? e->getAttributeNS(NULL,type) : NULL);
+ if (t2.get()) {
+ TrustEngine* trust = XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(t2.get(),e);
+ if (!(m_trust = dynamic_cast<X509TrustEngine*>(trust))) {
+ delete trust;
+ throw ConfigurationException("DynamicMetadataProvider requires an X509TrustEngine plugin.");
+ }
+ return;
+ }
+
+ throw ConfigurationException("DynamicMetadataProvider requires an X509TrustEngine plugin unless ignoreTransport is true.");
+}
+
+saml2md::EntityDescriptor* DynamicMetadataProvider::resolve(const saml2md::MetadataProvider::Criteria& criteria) const
+{
+#ifdef _DEBUG
+ xmltooling::NDC("resolve");
+#endif
+ Category& log=Category::getInstance(SHIBSP_LOGCAT".MetadataProvider.Dynamic");
+
+ string name;
+ if (criteria.entityID_ascii)
+ name = criteria.entityID_ascii;
+ else if (criteria.entityID_unicode) {
+ auto_ptr_char temp(criteria.entityID_unicode);
+ name = temp.get();
+ }
+ else if (criteria.artifact)
+ name = criteria.artifact->getSource();
+
+ // Establish networking properties based on calling application.
+ const MetadataProviderCriteria* mpc = dynamic_cast<const MetadataProviderCriteria*>(&criteria);
+ if (!mpc)
+ throw saml2md::MetadataException("Dynamic MetadataProvider requires Shibboleth-aware lookup criteria, check calling code.");
+ const PropertySet* relyingParty;
+ if (criteria.entityID_unicode)
+ relyingParty = mpc->application.getRelyingParty(criteria.entityID_unicode);
+ else {
+ auto_ptr_XMLCh temp2(name.c_str());
+ relyingParty = mpc->application.getRelyingParty(temp2.get());
+ }
+
+ // Prepare a transport object addressed appropriately.
+ SOAPTransport::Address addr(relyingParty->getString("entityID").second, name.c_str(), name.c_str());
+ const char* pch = strchr(addr.m_endpoint,':');
+ if (!pch)
+ throw IOException("entityID was not a URL.");
+ string scheme(addr.m_endpoint, pch-addr.m_endpoint);
+ SOAPTransport* transport=NULL;
+ try {
+ transport = XMLToolingConfig::getConfig().SOAPTransportManager.newPlugin(scheme.c_str(), addr);
+ }
+ catch (exception& ex) {
+ log.error("exception while building transport object to resolve URL: %s", ex.what());
+ throw IOException("Unable to resolve entityID with a known transport protocol.");
+ }
+ auto_ptr<SOAPTransport> transportwrapper(transport);
+
+ // Apply properties as directed.
+ transport->setVerifyHost(m_verifyHost);
+ DummyCredentialResolver dcr;
+ if (m_trust && !transport->setTrustEngine(m_trust, &dcr))
+ throw IOException("Unable to install X509TrustEngine into metadata resolver.");
+
+ Locker credlocker(NULL, false);
+ CredentialResolver* credResolver = NULL;
+ pair<bool,const char*> authType=relyingParty->getString("authType");
+ if (!authType.first || !strcmp(authType.second,"TLS")) {
+ credResolver = mpc->application.getCredentialResolver();
+ if (credResolver)
+ credlocker.assign(credResolver);
+ if (credResolver) {
+ CredentialCriteria cc;
+ cc.setUsage(Credential::TLS_CREDENTIAL);
+ authType = relyingParty->getString("keyName");
+ if (authType.first)
+ cc.getKeyNames().insert(authType.second);
+ const Credential* cred = credResolver->resolve(&cc);
+ cc.getKeyNames().clear();
+ if (cred) {
+ if (!transport->setCredential(cred))
+ log.error("failed to load Credential into metadata resolver");
+ }
+ else {
+ log.error("no TLS credential supplied");
+ }
+ }
+ else {
+ log.error("no CredentialResolver available for TLS");
+ }
+ }
+ else {
+ SOAPTransport::transport_auth_t type=SOAPTransport::transport_auth_none;
+ pair<bool,const char*> username=relyingParty->getString("authUsername");
+ pair<bool,const char*> password=relyingParty->getString("authPassword");
+ if (!username.first || !password.first)
+ log.error("transport authType (%s) specified but authUsername or authPassword was missing", authType.second);
+ else if (!strcmp(authType.second,"basic"))
+ type = SOAPTransport::transport_auth_basic;
+ else if (!strcmp(authType.second,"digest"))
+ type = SOAPTransport::transport_auth_digest;
+ else if (!strcmp(authType.second,"ntlm"))
+ type = SOAPTransport::transport_auth_ntlm;
+ else if (!strcmp(authType.second,"gss"))
+ type = SOAPTransport::transport_auth_gss;
+ else if (strcmp(authType.second,"none"))
+ log.error("unknown authType (%s) specified for RelyingParty", authType.second);
+ if (type > SOAPTransport::transport_auth_none) {
+ if (transport->setAuth(type,username.second,password.second))
+ log.debug("configured for transport authentication (method=%s, username=%s)", authType.second, username.second);
+ else
+ log.error("failed to configure transport authentication (method=%s)", authType.second);
+ }
+ }
+
+ pair<bool,unsigned int> timeout = relyingParty->getUnsignedInt("connectTimeout");
+ transport->setConnectTimeout(timeout.first ? timeout.second : 10);
+ timeout = relyingParty->getUnsignedInt("timeout");
+ transport->setTimeout(timeout.first ? timeout.second : 20);
+ mpc->application.getServiceProvider().setTransportOptions(*transport);
+
+ HTTPSOAPTransport* http = dynamic_cast<HTTPSOAPTransport*>(transport);
+ if (http) {
+ pair<bool,bool> flag = relyingParty->getBool("chunkedEncoding");
+ http->useChunkedEncoding(flag.first && flag.second);
+ http->setRequestHeader("Xerces-C", XERCES_FULLVERSIONDOT);
+ http->setRequestHeader("XML-Security-C", XSEC_FULLVERSIONDOT);
+ http->setRequestHeader("OpenSAML-C", OPENSAML_FULLVERSIONDOT);
+ http->setRequestHeader("User-Agent", PACKAGE_NAME);
+ http->setRequestHeader(PACKAGE_NAME, PACKAGE_VERSION);
+ }
+
+ try {
+ // Use an empty stream to trigger a body-less "GET" operation.
+ istringstream dummy;
+ transport->send(dummy);
+ istream& msg = transport->receive();
+
+ DOMDocument* doc=NULL;
+ StreamInputSource src(msg, "DynamicMetadataProvider");
+ Wrapper4InputSource dsrc(&src,false);
+ if (m_validate)
+ doc=XMLToolingConfig::getConfig().getValidatingParser().parse(dsrc);
+ else
+ doc=XMLToolingConfig::getConfig().getParser().parse(dsrc);
+
+ // Wrap the document for now.
+ XercesJanitor<DOMDocument> docjanitor(doc);
+
+ // Unmarshall objects, binding the document.
+ auto_ptr<XMLObject> xmlObject(XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true));
+ docjanitor.release();
+
+ // Make sure it's metadata.
+ saml2md::EntityDescriptor* entity = dynamic_cast<saml2md::EntityDescriptor*>(xmlObject.get());
+ if (!entity) {
+ throw saml2md::MetadataException(
+ "Root of metadata instance not recognized: $1", params(1,xmlObject->getElementQName().toString().c_str())
+ );
+ }
+ xmlObject.release();
+ return entity;
+ }
+ catch (XMLException& e) {
+ auto_ptr_char msg(e.getMessage());
+ log.error("Xerces error while resolving entityID (%s): %s", name.c_str(), msg.get());
+ throw saml2md::MetadataException(msg.get());
+ }
+}
diff --git a/shibsp/metadata/MetadataExtSchemaValidators.cpp b/shibsp/metadata/MetadataExtSchemaValidators.cpp
index e4a4e56..d175ba4 100644
--- a/shibsp/metadata/MetadataExtSchemaValidators.cpp
+++ b/shibsp/metadata/MetadataExtSchemaValidators.cpp
@@ -24,9 +24,12 @@
#include "exceptions.h"
#include "metadata/MetadataExt.h"
+#include <saml/SAMLConfig.h>
+#include <saml/saml2/metadata/MetadataProvider.h>
#include <xmltooling/validation/ValidatorSuite.h>
using namespace shibsp;
+using namespace opensaml::saml2md;
using namespace xmltooling;
using namespace std;
@@ -38,6 +41,8 @@ namespace shibsp {
BEGIN_XMLOBJECTVALIDATOR(SHIBSP_DLLLOCAL,KeyAuthority);
XMLOBJECTVALIDATOR_NONEMPTY(KeyAuthority,KeyInfo);
END_XMLOBJECTVALIDATOR;
+
+ SHIBSP_DLLLOCAL PluginManager<MetadataProvider,string,const DOMElement*>::Factory DynamicMetadataProviderFactory;
};
#define REGISTER_ELEMENT(cname) \
@@ -49,4 +54,6 @@ void shibsp::registerMetadataExtClasses() {
QName q;
REGISTER_ELEMENT(Scope);
REGISTER_ELEMENT(KeyAuthority);
+
+ opensaml::SAMLConfig::getConfig().MetadataProviderManager.registerFactory(DYNAMIC_METADATA_PROVIDER, DynamicMetadataProviderFactory);
}
diff --git a/shibsp/metadata/MetadataProviderCriteria.h b/shibsp/metadata/MetadataProviderCriteria.h
new file mode 100644
index 0000000..4020005
--- /dev/null
+++ b/shibsp/metadata/MetadataProviderCriteria.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2001-2008 Internet2
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file shibsp/metadata/MetadataProviderCriteria.h
+ *
+ * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
+ */
+
+#ifndef __shibsp_metaprovcrit_h__
+#define __shibsp_metaprovcrit_h__
+
+#include <shibsp/Application.h>
+#include <saml/saml2/metadata/MetadataProvider.h>
+
+namespace shibsp {
+
+ /**
+ * Extended criteria for metadata lookup for Shibboleth-aware metadata providers.
+ */
+ struct SHIBSP_API MetadataProviderCriteria : public opensaml::saml2md::MetadataProvider::Criteria
+ {
+ /**
+ * Constructor.
+ *
+ * @param app application performing the lookup
+ * @param id entityID to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ MetadataProviderCriteria(const Application& app, const XMLCh* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : opensaml::saml2md::MetadataProvider::Criteria(id, q, prot, valid), application(app) {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param app application performing the lookup
+ * @param id entityID to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ MetadataProviderCriteria(const Application& app, const char* id, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : opensaml::saml2md::MetadataProvider::Criteria(id, q, prot, valid), application(app) {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param app application performing the lookup
+ * @param a artifact to lookup
+ * @param q element/type of role, if any
+ * @param prot protocol support constant, if any
+ * @param valid true iff stale metadata should be ignored
+ */
+ MetadataProviderCriteria(const Application& app, const opensaml::SAMLArtifact* a, const xmltooling::QName* q=NULL, const XMLCh* prot=NULL, bool valid=true)
+ : opensaml::saml2md::MetadataProvider::Criteria(a, q, prot, valid), application(app) {
+ }
+
+ /** Controls whether stale metadata is ignored. */
+ const Application& application;
+ };
+};
+
+#endif /* __shibsp_metaprovcrit_h__ */
diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp
index c67492d..e211b20 100644
--- a/shibsp/remoting/impl/SocketListener.cpp
+++ b/shibsp/remoting/impl/SocketListener.cpp
@@ -305,7 +305,8 @@ DDF SocketListener::send(const DDF& in)
log->debug("send completed, reading response message");
// Read the message.
- if (recv(sock,(char*)&len,sizeof(len)) != sizeof(len)) {
+ while (recv(sock,(char*)&len,sizeof(len)) != sizeof(len)) {
+ if (errno == EINTR) continue; // Apparently this happens when a signal interrupts the blocking call.
log->error("error reading size of output message");
this->close(sock);
throw ListenerException("Failure receiving response to remoted message ($1).", params(1,in.name()));
@@ -315,9 +316,15 @@ DDF SocketListener::send(const DDF& in)
char buf[16384];
int size_read;
stringstream is;
- while (len && (size_read = recv(sock, buf, sizeof(buf))) > 0) {
- is.write(buf, size_read);
- len -= size_read;
+ while (len) {
+ size_read = recv(sock, buf, sizeof(buf));
+ if (size_read > 0) {
+ is.write(buf, size_read);
+ len -= size_read;
+ }
+ else if (errno != EINTR) {
+ break;
+ }
}
if (len) {
diff --git a/shibsp/shibsp-lite.vcproj b/shibsp/shibsp-lite.vcproj
index 2a1e205..48dc6af 100644
--- a/shibsp/shibsp-lite.vcproj
+++ b/shibsp/shibsp-lite.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -63,7 +66,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling-lite1D.lib wsock32.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0D.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
GenerateDebugInformation="true"
@@ -97,6 +100,88 @@
/>
</Configuration>
<Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;..\..\cpp-xmltooling"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WANT_TCP_SHAR;SHIBSP_LITE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;SHIBSP_LITE;_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xmltooling-lite1D.lib wsock32.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ProjectName)-$(ConfigurationName)"
@@ -141,10 +226,9 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling-lite1.lib wsock32.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(ConfigurationName)"
- GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -176,6 +260,87 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ProjectName)-$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;..;..\..\cpp-xmltooling"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WANT_TCP_SHAR;SHIBSP_LITE"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;SHIBSP_LITE"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xmltooling-lite1.lib wsock32.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -416,6 +581,10 @@
>
</File>
<File
+ RelativePath=".\ApplicationAwarePlugin.h"
+ >
+ </File>
+ <File
RelativePath=".\base.h"
>
</File>
diff --git a/shibsp/shibsp.rc b/shibsp/shibsp.rc
index a74a740..5f8cda8 100644
--- a/shibsp/shibsp.rc
+++ b/shibsp/shibsp.rc
@@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 2,0,0,0
+ FILEVERSION 1,1,0,0
+ PRODUCTVERSION 2,1,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -51,38 +51,38 @@ BEGIN
#else
VALUE "FileDescription", "Shibboleth SP Library\0"
#endif
- VALUE "FileVersion", "1, 0, 0, 0\0"
+ VALUE "FileVersion", "1, 1, 0, 0\0"
#ifdef SHIBSP_LITE
#ifdef _DEBUG
- VALUE "InternalName", "shibsp-lite1_0D\0"
+ VALUE "InternalName", "shibsp-lite1_1D\0"
#else
- VALUE "InternalName", "shibsp-lite1_0\0"
+ VALUE "InternalName", "shibsp-lite1_1\0"
#endif
#else
#ifdef _DEBUG
- VALUE "InternalName", "shibsp1_0D\0"
+ VALUE "InternalName", "shibsp1_1D\0"
#else
- VALUE "InternalName", "shibsp1_0\0"
+ VALUE "InternalName", "shibsp1_1\0"
#endif
#endif
- VALUE "LegalCopyright", "Copyright � 2007 Internet2\0"
+ VALUE "LegalCopyright", "Copyright � 2008 Internet2\0"
VALUE "LegalTrademarks", "\0"
#ifdef SHIBSP_LITE
#ifdef _DEBUG
- VALUE "OriginalFilename", "shibsp-lite1_0D.dll\0"
+ VALUE "OriginalFilename", "shibsp-lite1_1D.dll\0"
#else
- VALUE "OriginalFilename", "shibsp-lite1_0.dll\0"
+ VALUE "OriginalFilename", "shibsp-lite1_1.dll\0"
#endif
#else
#ifdef _DEBUG
- VALUE "OriginalFilename", "shibsp1_0D.dll\0"
+ VALUE "OriginalFilename", "shibsp1_1D.dll\0"
#else
- VALUE "OriginalFilename", "shibsp1_0.dll\0"
+ VALUE "OriginalFilename", "shibsp1_1.dll\0"
#endif
#endif
VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Shibboleth 2.0\0"
- VALUE "ProductVersion", "2, 0, 0, 0\0"
+ VALUE "ProductName", "Shibboleth 2.1\0"
+ VALUE "ProductVersion", "2, 1, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END
diff --git a/shibsp/shibsp.vcproj b/shibsp/shibsp.vcproj
index c8d78c2..bb58f7e 100644
--- a/shibsp/shibsp.vcproj
+++ b/shibsp/shibsp.vcproj
@@ -11,6 +11,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -63,7 +66,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xsec_1D.lib saml2D.lib xmltooling1D.lib wsock32.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0D.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(ConfigurationName);..\..\cpp-xmltooling\$(ConfigurationName)"
GenerateDebugInformation="true"
@@ -97,6 +100,88 @@
/>
</Configuration>
<Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WANT_TCP_SHAR"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BrowseInformation="1"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_UNICODE;UNICODE;_DEBUG"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib xerces-c_2D.lib xsec_1D.lib saml2D.lib xmltooling1D.lib wsock32.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1D.dll"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1D.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
@@ -140,10 +225,9 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="log4shib1.lib xerces-c_2.lib xsec_1.lib saml2.lib xmltooling1.lib wsock32.lib"
- OutputFile="$(OutDir)\$(ProjectName)1_0.dll"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(ConfigurationName);..\..\cpp-xmltooling\$(ConfigurationName)"
- GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
@@ -175,6 +259,86 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WANT_TCP_SHAR"
+ RuntimeLibrary="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib xerces-c_2.lib xsec_1.lib saml2.lib xmltooling1.lib wsock32.lib"
+ OutputFile="$(OutDir)\$(ProjectName)1_1.dll"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(TargetDir)$(ProjectName)1.lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
@@ -236,6 +400,10 @@
Name="metadata"
>
<File
+ RelativePath=".\metadata\DynamicMetadataProvider.cpp"
+ >
+ </File>
+ <File
RelativePath=".\metadata\MetadataExtImpl.cpp"
>
</File>
@@ -304,6 +472,10 @@
>
</File>
<File
+ RelativePath=".\attribute\NameIDFromScopedAttributeDecoder.cpp"
+ >
+ </File>
+ <File
RelativePath=".\attribute\ScopedAttributeDecoder.cpp"
>
</File>
@@ -575,6 +747,10 @@
>
</File>
<File
+ RelativePath=".\ApplicationAwarePlugin.h"
+ >
+ </File>
+ <File
RelativePath=".\base.h"
>
</File>
@@ -657,14 +833,6 @@
RelativePath=".\security\SecurityPolicy.h"
>
</File>
- <Filter
- Name="metadata"
- >
- <File
- RelativePath=".\metadata\MetadataExt.h"
- >
- </File>
- </Filter>
</Filter>
<Filter
Name="remoting"
@@ -782,6 +950,18 @@
>
</File>
</Filter>
+ <Filter
+ Name="metadata"
+ >
+ <File
+ RelativePath=".\metadata\MetadataExt.h"
+ >
+ </File>
+ <File
+ RelativePath=".\metadata\MetadataProviderCriteria.h"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="Resource Files"
diff --git a/shibsp/version.h b/shibsp/version.h
index 17ab6e3..8836d4a 100644
--- a/shibsp/version.h
+++ b/shibsp/version.h
@@ -39,7 +39,7 @@
#define SHIBSP_VERSION_MAJOR 1
#define SHIBSP_VERSION_MINOR 0
-#define SHIBSP_VERSION_REVISION 0
+#define SHIBSP_VERSION_REVISION 1
/** DO NOT MODIFY BELOW THIS LINE */
diff --git a/util/Makefile.in b/util/Makefile.in
index f672466..b9ced07 100644
--- a/util/Makefile.in
+++ b/util/Makefile.in
@@ -45,7 +45,7 @@ am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
$(top_srcdir)/acx_pthread.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
@@ -101,6 +101,8 @@ BUILD_AP22_FALSE = @BUILD_AP22_FALSE@
BUILD_AP22_TRUE = @BUILD_AP22_TRUE@
BUILD_FASTCGI_FALSE = @BUILD_FASTCGI_FALSE@
BUILD_FASTCGI_TRUE = @BUILD_FASTCGI_TRUE@
+BUILD_MEMCACHED_FALSE = @BUILD_MEMCACHED_FALSE@
+BUILD_MEMCACHED_TRUE = @BUILD_MEMCACHED_TRUE@
BUILD_NSAPI_FALSE = @BUILD_NSAPI_FALSE@
BUILD_NSAPI_TRUE = @BUILD_NSAPI_TRUE@
CC = @CC@
@@ -186,6 +188,9 @@ LOG4CPP_CONFIG = @LOG4CPP_CONFIG@
LOG4SHIB_CONFIG = @LOG4SHIB_CONFIG@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MEMCACHED_INCLUDE = @MEMCACHED_INCLUDE@
+MEMCACHED_LDFLAGS = @MEMCACHED_LDFLAGS@
+MEMCACHED_LIBS = @MEMCACHED_LIBS@
NSAPI_INCLUDE = @NSAPI_INCLUDE@
OBJEXT = @OBJEXT@
ODBC_CFLAGS = @ODBC_CFLAGS@
diff --git a/util/mdquery.cpp b/util/mdquery.cpp
index 00e1e49..33435cc 100644
--- a/util/mdquery.cpp
+++ b/util/mdquery.cpp
@@ -35,6 +35,7 @@
#include <shibsp/exceptions.h>
#include <shibsp/SPConfig.h>
#include <shibsp/ServiceProvider.h>
+#include <shibsp/metadata/MetadataProviderCriteria.h>
#include <shibsp/util/SPConstants.h>
#include <saml/saml2/metadata/Metadata.h>
#include <xmltooling/logging.h>
@@ -106,7 +107,7 @@ int main(int argc,char* argv[])
XMLToolingConfig::getConfig().log_config(getenv("SHIBSP_LOGGING") ? getenv("SHIBSP_LOGGING") : SHIBSP_LOGGING);
SPConfig& conf=SPConfig::getConfig();
- conf.setFeatures(SPConfig::Metadata | SPConfig::OutOfProcess);
+ conf.setFeatures(SPConfig::Metadata | SPConfig::Trust | SPConfig::OutOfProcess | SPConfig::Credentials);
if (!conf.init(path))
return -1;
@@ -153,7 +154,7 @@ int main(int argc,char* argv[])
}
app->getMetadataProvider()->lock();
- MetadataProvider::Criteria mc(entityID, NULL, NULL, strict);
+ MetadataProviderCriteria mc(*app, entityID, NULL, NULL, strict);
if (rname) {
const XMLCh* ns = rns ? XMLString::transcode(rns) : samlconstants::SAML20MD_NS;
auto_ptr_XMLCh n(rname);
diff --git a/util/mdquery.vcproj b/util/mdquery.vcproj
index 5992811..5240966 100644
--- a/util/mdquery.vcproj
+++ b/util/mdquery.vcproj
@@ -10,6 +10,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -185,6 +188,179 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib saml2.lib xmltooling1.lib xerces-c_2.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib saml2D.lib xmltooling1D.lib xerces-c_2D.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/util/resolvertest.cpp b/util/resolvertest.cpp
index 6e589f7..43a0e49 100644
--- a/util/resolvertest.cpp
+++ b/util/resolvertest.cpp
@@ -38,6 +38,7 @@
#include <shibsp/attribute/Attribute.h>
#include <shibsp/attribute/resolver/ResolutionContext.h>
#include <shibsp/handler/AssertionConsumerService.h>
+#include <shibsp/metadata/MetadataProviderCriteria.h>
#include <shibsp/util/SPConstants.h>
#include <saml/saml1/core/Assertions.h>
@@ -216,7 +217,7 @@ int main(int argc,char* argv[])
MetadataProvider* m=app->getMetadataProvider();
xmltooling::Locker mlocker(m);
- MetadataProvider::Criteria mc(i_param, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+ MetadataProviderCriteria mc(*app, i_param, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
pair<const EntityDescriptor*,const RoleDescriptor*> site=m->getEntityDescriptor(mc);
if (!site.first)
throw MetadataException("Unable to locate metadata for IdP ($1).", params(1,i_param));
@@ -287,7 +288,7 @@ int main(int argc,char* argv[])
MetadataProvider* m=app->getMetadataProvider();
xmltooling::Locker mlocker(m);
- MetadataProvider::Criteria mc(issuer, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
+ MetadataProviderCriteria mc(*app, issuer, &IDPSSODescriptor::ELEMENT_QNAME, protocol);
pair<const EntityDescriptor*,const RoleDescriptor*> site=m->getEntityDescriptor(mc);
if (!site.first) {
auto_ptr_char temp(issuer);
diff --git a/util/resolvertest.vcproj b/util/resolvertest.vcproj
index a8600d1..4ced967 100644
--- a/util/resolvertest.vcproj
+++ b/util/resolvertest.vcproj
@@ -10,6 +10,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -186,6 +189,180 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="true"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ RuntimeTypeInfo="true"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1.lib saml2.lib xmltooling1.lib xerces-c_2.lib"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;..;"..\..\cpp-opensaml2";"..\..\cpp-xmltooling""
+ PreprocessorDefinitions="_CONSOLE;WIN32;_DEBUG"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="true"
+ BrowseInformation="1"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="log4shib1D.lib saml2D.lib xmltooling1D.lib xerces-c_2D.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories="..\..\cpp-opensaml2\$(PlatformName)\$(ConfigurationName);..\..\cpp-xmltooling\$(PlatformName)\$(ConfigurationName)"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list