From a341c44021ad5b77ed4d0e5e3241abf6f4854a81 Mon Sep 17 00:00:00 2001 From: cantor Date: Wed, 30 Jan 2008 18:25:05 +0000 Subject: [PATCH] Path resolution for Unix socket. Remove remaining absolute paths from config. Change main config to an unbuilt file. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2712 cb58f699-b61c-0410-a6fe-9272a202ed29 --- configs/Makefile.am | 7 +------ configs/{shibboleth2.xml.in => shibboleth2.xml} | 10 ++++------ msi/scripts/shib_edit_config_files.vbs | 21 +++++++-------------- shibsp/remoting/impl/UnixListener.cpp | 3 ++- 4 files changed, 14 insertions(+), 27 deletions(-) rename configs/{shibboleth2.xml.in => shibboleth2.xml} (97%) diff --git a/configs/Makefile.am b/configs/Makefile.am index 6e70da7..fb6cd71 100644 --- a/configs/Makefile.am +++ b/configs/Makefile.am @@ -22,7 +22,6 @@ pkgsysconf_DATA = \ # installed as "foo" if "foo" does not already exist. In other words, # the config files will not overwrite existing versions. BUILTCONFIGFILES = \ - shibboleth2.xml \ native.logger \ shibd.logger \ attribute-map.xml \ @@ -31,6 +30,7 @@ BUILTCONFIGFILES = \ # While BUILTCONFIGFILES are processed, these are not; so we should pull # them from SRCDIR. CONFIGFILES = \ + shibboleth2.xml \ example-metadata.xml \ console.logger \ syslog.logger \ @@ -87,9 +87,6 @@ shibd.logger: ${srcdir}/shibd.logger.in Makefile ${top_builddir}/config.status native.logger: ${srcdir}/native.logger.in Makefile ${top_builddir}/config.status $(MAKE) do-build-file FILE=$@ -shibboleth2.xml: ${srcdir}/shibboleth2.xml.in Makefile ${top_builddir}/config.status - $(MAKE) do-build-file FILE=$@ - attribute-map.xml: ${srcdir}/attribute-map.xml.in Makefile ${top_builddir}/config.status $(MAKE) do-build-file FILE=$@ @@ -127,12 +124,10 @@ CLEANFILES = \ shibd-osx.plist \ shibd.logger \ native.logger \ - shibboleth2.xml \ attribute-map.xml \ attribute-policy.xml EXTRA_DIST = \ - shibboleth2.xml.in \ attribute-map.xml.in \ attribute-policy.xml.in \ native.logger.in \ diff --git a/configs/shibboleth2.xml.in b/configs/shibboleth2.xml similarity index 97% rename from configs/shibboleth2.xml.in rename to configs/shibboleth2.xml index 4c4412f..d96e8d3 100644 --- a/configs/shibboleth2.xml.in +++ b/configs/shibboleth2.xml @@ -3,12 +3,10 @@ xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="urn:mace:shibboleth:2.0:native:sp:config @-PKGXMLDIR-@/shibboleth-2.0-native-sp-config.xsd" - logger="@-PKGSYSCONFDIR-@/syslog.logger" clockSkew="180"> + logger="syslog.logger" clockSkew="180"> - + - + - + diff --git a/msi/scripts/shib_edit_config_files.vbs b/msi/scripts/shib_edit_config_files.vbs index 21c3bbf..2b10f67 100644 --- a/msi/scripts/shib_edit_config_files.vbs +++ b/msi/scripts/shib_edit_config_files.vbs @@ -80,20 +80,6 @@ if (Err = 0) then End If FileSystemObj.MoveFile ConfigFile, DistDir & "attribute-policy.xml" - ConfigFile = DistDir & "shibboleth2.xml.in" - ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth" - ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth" - ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth" - ReplaceInFile ConfigFile, " ", "" - ReplaceInFile ConfigFile, "", "" - If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth2.xml")) then - FileSystemObj.CopyFile ConfigFile, ConfigDir & "shibboleth2.xml", false - End If - If (FileSystemObj.FileExists(DistDir & "shibboleth2.xml")) then - FileSystemObj.DeleteFile DistDir & "shibboleth2.xml", true - End If - FileSystemObj.MoveFile ConfigFile, DistDir & "shibboleth2.xml" - ConfigFile = DistDir & "shibd.logger.in" ReplaceInFile ConfigFile, "@-PKGLOGDIR-@", ConvertedDir & "/var/log/shibboleth" If (NOT FileSystemObj.FileExists(ConfigDir & "shibd.logger")) then @@ -162,6 +148,13 @@ if (Err = 0) then End If FileSystemObj.MoveFile ConfigFile, DistDir & "apache22.config" + ConfigFile = DistDir & "shibboleth2.xml" + ReplaceInFile ConfigFile, " ", "" + ReplaceInFile ConfigFile, "", "" + If (NOT FileSystemObj.FileExists(ConfigDir & "shibboleth2.xml")) then + FileSystemObj.CopyFile ConfigFile, ConfigDir & "shibboleth2.xml", false + End If + 'Now just copy the other non-edited files over as well (if possible) If (NOT FileSystemObj.FileExists(ConfigDir & "accessError.html")) then diff --git a/shibsp/remoting/impl/UnixListener.cpp b/shibsp/remoting/impl/UnixListener.cpp index d9a9b8b..7004287 100644 --- a/shibsp/remoting/impl/UnixListener.cpp +++ b/shibsp/remoting/impl/UnixListener.cpp @@ -25,6 +25,7 @@ #include #include +#include #ifdef HAVE_UNISTD_H # include @@ -81,11 +82,11 @@ namespace shibsp { UnixListener::UnixListener(const DOMElement* e) : SocketListener(e), m_address("/var/run/shar-socket"), m_bound(false) { - // We're stateless, but we need to load the configuration. const XMLCh* tag=e->getAttributeNS(NULL,address); if (tag && *tag) { auto_ptr_char a(tag); m_address=a.get(); + XMLToolingConfig::getConfig().getPathResolver()->resolve(m_address, PathResolver::XMLTOOLING_RUN_FILE); } } -- 2.1.4