Port fastcgi code to trunk.
authorScott Cantor <cantor.2@osu.edu>
Sat, 20 Oct 2007 05:31:06 +0000 (05:31 +0000)
committerScott Cantor <cantor.2@osu.edu>
Sat, 20 Oct 2007 05:31:06 +0000 (05:31 +0000)
Move loadable modules from libexec to lib/shibboleth.

22 files changed:
.cproject
Shibboleth.sln
adfs/Makefile.am
apache/Makefile.am
apache/mod_shib13.vcproj
configs/Makefile.am
configs/apache.config.in
configs/apache2.config.in
configs/apache22.config.in
configs/shibboleth2.xml.in
configure.ac
fastcgi/.gitignore [new file with mode: 0644]
fastcgi/Makefile.am [new file with mode: 0644]
fastcgi/shibauthorizer.cpp [new file with mode: 0644]
fastcgi/shibauthorizer.vcproj [new file with mode: 0644]
fastcgi/shibresponder.cpp [new file with mode: 0644]
fastcgi/shibresponder.vcproj [new file with mode: 0644]
isapi_shib/isapi_shib.vcproj
msi/scripts/shib_edit_config_files.vbs
nsapi_shib/Makefile.am
nsapi_shib/nsapi_shib.vcproj
odbc-store/Makefile.am

index 327af9d..eb08f9e 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -14,6 +14,7 @@
 </storageModule>\r
 <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
+\r
 <storageModule moduleId="org.eclipse.cdt.core.pathentry">\r
 <pathentry kind="out" path=""/>\r
 <pathentry excluding="util/|impl/|security/|metadata/|remoting/|remoting/impl/|attribute/|binding/|binding/impl/|attribute/resolver/|attribute/resolver/impl/|handler/|handler/impl/|attribute/filtering/|attribute/filtering/impl/|lite/" kind="src" path="shibsp"/>\r
@@ -40,6 +41,7 @@
 <pathentry kind="src" path="odbc-store"/>\r
 <pathentry kind="src" path="util"/>\r
 <pathentry kind="src" path="adfs"/>\r
+<pathentry kind="src" path="fastcgi"/>\r
 </storageModule>\r
 </cconfiguration>\r
 </storageModule>\r
index fa59987..c4616c3 100644 (file)
@@ -126,6 +126,30 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "resolvertest", "util\resolv
                {81F0F7A6-DC36-46EF-957F-F9E81D4403F6} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F6}
        EndProjectSection
 EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "fastcgi", "fastcgi", "{8E1AF2CF-24E1-4983-8681-394D89DF9AD2}"
+       ProjectSection(WebsiteProperties) = preProject
+               Debug.AspNetCompiler.Debug = "True"
+               Release.AspNetCompiler.Debug = "False"
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibauthorizer", "fastcgi\shibauthorizer.vcproj", "{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}"
+       ProjectSection(WebsiteProperties) = preProject
+               Debug.AspNetCompiler.Debug = "True"
+               Release.AspNetCompiler.Debug = "False"
+       EndProjectSection
+       ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shibresponder", "fastcgi\shibresponder.vcproj", "{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}"
+       ProjectSection(WebsiteProperties) = preProject
+               Debug.AspNetCompiler.Debug = "True"
+               Release.AspNetCompiler.Debug = "False"
+       EndProjectSection
+       ProjectSection(ProjectDependencies) = postProject
+               {81F0F7A6-DC36-46EF-957F-F9E81D4403F7} = {81F0F7A6-DC36-46EF-957F-F9E81D4403F7}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -184,6 +208,14 @@ Global
                {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Debug|Win32.Build.0 = Debug|Win32
                {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.ActiveCfg = Release|Win32
                {F13141B6-6C87-40BB-8D4E-5CC56EBB4C59}.Release|Win32.Build.0 = Release|Win32
+               {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}.Release|Win32.ActiveCfg = Release|Win32
+               {8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}.Release|Win32.Build.0 = Release|Win32
+               {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}.Release|Win32.ActiveCfg = Release|Win32
+               {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}.Release|Win32.Build.0 = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
@@ -194,10 +226,13 @@ Global
                {1396D80A-8672-4224-9B02-95F3F4207CDB} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050}
                {B44C0852-83B8-4FB2-A86E-097C9C8256D0} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050}
                {87C25D4E-8D19-4513-B0BA-BC668BC2DEE3} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050}
+               {8E1AF2CF-24E1-4983-8681-394D89DF9AD2} = {26BA8F84-6E42-41FA-9B13-5D3F4B5B2050}
                {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}
                {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}
+               {B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25} = {8E1AF2CF-24E1-4983-8681-394D89DF9AD2}
        EndGlobalSection
 EndGlobal
index 8c16b49..82913b5 100644 (file)
@@ -1,8 +1,6 @@
-## $Id$\r
-\r
 AUTOMAKE_OPTIONS = foreign\r
 \r
-plugindir = $(libexecdir)\r
+plugindir = $(libdir)/@PACKAGE@\r
 plugin_LTLIBRARIES = adfs.la adfs-lite.la\r
 \r
 adfs_la_LIBADD = \\r
index 2269592..805ebed 100644 (file)
@@ -1,9 +1,7 @@
-## $Id$
-
 AUTOMAKE_OPTIONS = foreign
 
 if BUILD_AP13
-modshib13dir = $(libexecdir)
+modshib13dir = $(libdir)/@PACKAGE@
 modshib13_LTLIBRARIES = mod_shib_13.la
 mod_shib_13_la_SOURCES = mod_shib_13.cpp
 mod_shib_13_la_CXXFLAGS = $(APXS_CFLAGS) -I$(APXS_INCLUDE)
@@ -17,7 +15,7 @@ install-exec-hook:
 endif
 
 if BUILD_AP20
-modshib20dir = $(libexecdir)
+modshib20dir = $(libdir)/@PACKAGE@
 modshib20_LTLIBRARIES = mod_shib_20.la
 mod_shib_20_la_SOURCES = mod_shib_20.cpp
 mod_shib_20_la_CXXFLAGS = $(APXS2_CFLAGS) -I$(APXS2_INCLUDE)
@@ -31,7 +29,7 @@ install-exec-hook:
 endif
 
 if BUILD_AP22
-modshib22dir = $(libexecdir)
+modshib22dir = $(libdir)/@PACKAGE@
 modshib22_LTLIBRARIES = mod_shib_22.la
 mod_shib_22_la_SOURCES = mod_shib_22.cpp
 mod_shib_22_la_CXXFLAGS = $(APXS22_CFLAGS) -I$(APXS22_INCLUDE)
index 9989077..c259b88 100644 (file)
@@ -53,7 +53,6 @@
                                StringPooling="true"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
-                               RuntimeTypeInfo="true"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
                                Detect64BitPortabilityProblems="true"
                                PreprocessorDefinitions="_WINDOWS;EAPI;WIN32;_DEBUG"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
-                               RuntimeTypeInfo="true"
                                BrowseInformation="1"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
index 4d798b4..6fb2487 100644 (file)
@@ -2,6 +2,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 
+pkglibdir = ${libdir}/@PACKAGE@
 pkglogdir = ${localstatedir}/log/@PACKAGE@
 pkgdocdir = ${datadir}/doc/@PACKAGE@
 shirelogdir = ${localstatedir}/log/httpd
@@ -51,7 +52,7 @@ do-build-file:
        rm -f ${FILE}.tmp
        sed < ${srcdir}/${FILE}.in > ${FILE}.tmp \
         -e 's:@-PREFIX-@:${prefix}:g' \
-        -e 's:@-LIBEXECDIR-@:${libexecdir}:g' \
+        -e 's:@-PKGLIBDIR-@:${pkglibdir}:g' \
         -e 's:@-PKGSYSCONFDIR-@:${pkgsysconfdir}:g' \
         -e 's:@-PKGXMLDIR-@:${pkgxmldir}:g' \
         -e 's:@-PKGDOCDIR-@:${pkgdocdir}:g' \
index bfe69ef..12e058e 100644 (file)
@@ -7,7 +7,7 @@
 #
 # Load the Shibboleth module.
 #
-LoadModule mod_shib @-LIBEXECDIR-@/mod_shib_13.so
+LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_13.so
 
 #
 # Global Configuration
index c9ff93b..09dd45d 100644 (file)
@@ -7,7 +7,7 @@
 #
 # Load the SHIBBOLETH module
 #
-LoadModule mod_shib @-LIBEXECDIR-@/mod_shib_20.so
+LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_20.so
 
 #
 # Global Configuration
index b913f88..134f8f2 100644 (file)
@@ -7,7 +7,7 @@
 #
 # Load the SHIBBOLETH module
 #
-LoadModule mod_shib @-LIBEXECDIR-@/mod_shib_22.so
+LoadModule mod_shib @-PKGLIBDIR-@/mod_shib_22.so
 
 #
 # Global Configuration
index 18a6ba3..ceafe44 100644 (file)
@@ -12,8 +12,8 @@
                
                <!--
                <Extensions>
-                       <Library path="@-LIBEXECDIR-@/adfs.so" fatal="true"/>
-                       <Library path="@-LIBEXECDIR-@/odbc-store.so" fatal="true"/>
+                       <Library path="@-PKGLIBDIR-@/adfs.so" fatal="true"/>
+                       <Library path="@-PKGLIBDIR-@/odbc-store.so" fatal="true"/>
                </Extensions>
                -->
     
@@ -44,7 +44,7 @@
 
                <!--
                <Extensions>
-                       <Library path="@-LIBEXECDIR-@/adfs-lite.so" fatal="true"/>
+                       <Library path="@-PKGLIBDIR-@/adfs-lite.so" fatal="true"/>
                </Extensions>
                -->
                
index 0e335ac..2ecdf6d 100644 (file)
@@ -294,6 +294,41 @@ if test ! "$WANT_NSAPI" = "no" ; then
     WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
 fi
 
+
+#
+# Build FastCGI support?
+#
+AC_MSG_CHECKING(for FastCGI support)
+AC_ARG_WITH(fastcgi,
+    AC_HELP_STRING([--with-fastcgi=DIR], [Build FastCGI support]),
+    [WANT_FASTCGI=$withval],[WANT_FASTCGI=no])
+AC_MSG_RESULT($WANT_FASTCGI)
+
+if test "$WANT_FASTCGI" != "no"; then
+    if test "$WANT_FASTCGI" != "yes"; then
+        if test x_$WANT_FASTCGI != x_/usr; then
+            FASTCGI_INCLUDE="-I$WANT_FASTCGI/include"
+            FASTCGI_LDFLAGS="-L$WANT_FASTCGI/lib"
+        fi
+    fi
+    AC_CHECK_HEADER([fcgio.h],,
+        AC_MSG_ERROR([unable to find FastCGI header files]))
+    FASTCGI_LIBS="-lfcgi -lfcgi++"
+fi
+
+AC_SUBST(FASTCGI_INCLUDE)
+AC_SUBST(FASTCGI_LDFLAGS)
+AC_SUBST(FASTCGI_LIBS)
+
+# always output the Makefile, even if you don't use it
+AC_CONFIG_FILES([fastcgi/Makefile])
+AM_CONDITIONAL(BUILD_FASTCGI,test ! "$WANT_FASTCGI" = "no")
+
+if test ! "$WANT_FASTCGI" = "no" ; then
+    WANT_SUBDIRS="$WANT_SUBDIRS fastcgi"
+fi
+
+
 #
 # If no --enable-apache-xx specified 
 # find a default and fake the specific parameters
diff --git a/fastcgi/.gitignore b/fastcgi/.gitignore
new file mode 100644 (file)
index 0000000..90c669f
--- /dev/null
@@ -0,0 +1,5 @@
+/*.user
+/shibauthorizer___Win32_Debug
+/shibresponder___Win32_Debug
+/shibauthorizer___Win32_Release
+/shibresponder___Win32_Release
diff --git a/fastcgi/Makefile.am b/fastcgi/Makefile.am
new file mode 100644 (file)
index 0000000..ba460a2
--- /dev/null
@@ -0,0 +1,23 @@
+AUTOMAKE_OPTIONS = foreign\r
+\r
+if BUILD_FASTCGI\r
+\r
+fastcgidir = $(libdir)/@PACKAGE@\r
+\r
+fastcgi_PROGRAMS = shibauthorizer shibresponder\r
+\r
+shibauthorizer_SOURCES = shibauthorizer.cpp\r
+shibauthorizer_CXXFLAGS = -I$(FASTCGI_INCLUDE)\r
+shibauthorizer_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS)\r
+shibauthorizer_LDADD = \\r
+  $(top_builddir)/shibsp/libshibsp-lite.la\r
+\r
+shibresponder_SOURCES = shibresponder.cpp\r
+shibresponder_CXXFLAGS = -I$(FASTCGI_INCLUDE)\r
+shibresponder_LDFLAGS = $(FASTCGI_LDFLAGS) $(FASTCGI_LIBS)\r
+shibresponder_LDADD = \\r
+  $(top_builddir)/shibsp/libshibsp-lite.la\r
+\r
+endif\r
+\r
+EXTRA_DIST = shibauthorizer.cpp shibresponder.cpp shibauthorizer.vcproj shibresponder.vcproj\r
diff --git a/fastcgi/shibauthorizer.cpp b/fastcgi/shibauthorizer.cpp
new file mode 100644 (file)
index 0000000..5395172
--- /dev/null
@@ -0,0 +1,411 @@
+/*\r
+ *  Copyright 2001-2007 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/* shibauthorizer.cpp - Shibboleth FastCGI Authorizer\r
+\r
+   Andre Cruz\r
+*/\r
+\r
+#define SHIBSP_LITE\r
+#include "config_win32.h"\r
+\r
+#define _CRT_NONSTDC_NO_DEPRECATE 1\r
+#define _CRT_SECURE_NO_DEPRECATE 1\r
+#define _SCL_SECURE_NO_WARNINGS 1\r
+\r
+#include <shibsp/AbstractSPRequest.h>\r
+#include <shibsp/SPConfig.h>\r
+#include <shibsp/ServiceProvider.h>\r
+#include <xmltooling/unicode.h>\r
+#include <xmltooling/XMLToolingConfig.h>\r
+#include <xmltooling/util/NDC.h>\r
+#include <xmltooling/util/XMLConstants.h>\r
+#include <xmltooling/util/XMLHelper.h>\r
+#include <xercesc/util/XMLUniDefs.hpp>\r
+\r
+#include <stdlib.h>\r
+#ifdef HAVE_UNISTD_H\r
+# include <unistd.h>\r
+# include <sys/mman.h>\r
+#endif\r
+#include <fcgio.h>\r
+\r
+using namespace shibsp;\r
+using namespace xmltooling;\r
+using namespace xercesc;\r
+using namespace std;\r
+\r
+static const XMLCh path[] =     UNICODE_LITERAL_4(p,a,t,h);\r
+static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);\r
+\r
+typedef enum {\r
+    SHIB_RETURN_OK,\r
+    SHIB_RETURN_KO,\r
+    SHIB_RETURN_DONE\r
+} shib_return_t;\r
+\r
+class ShibTargetFCGIAuth : public AbstractSPRequest\r
+{\r
+    FCGX_Request* m_req;\r
+    int m_port;\r
+    string m_scheme,m_hostname;\r
+    multimap<string,string> m_response_headers;\r
+public:\r
+    map<string,string> m_request_headers;\r
+\r
+    ShibTargetFCGIAuth(FCGX_Request* req, const char* scheme=NULL, const char* hostname=NULL, int port=0) : m_req(req) {\r
+        const char* server_name_str = hostname;\r
+        if (!server_name_str || !*server_name_str)\r
+            server_name_str = FCGX_GetParam("SERVER_NAME", req->envp);\r
+        m_hostname = server_name_str;\r
+\r
+        m_port = port;\r
+        if (!m_port) {\r
+            char* server_port_str = FCGX_GetParam("SERVER_PORT", req->envp);\r
+            m_port = strtol(server_port_str, &server_port_str, 10);\r
+            if (*server_port_str) {\r
+                cerr << "can't parse SERVER_PORT (" << FCGX_GetParam("SERVER_PORT", req->envp) << ")" << endl;\r
+                throw exception("Unable to determine server port.");\r
+            }\r
+        }\r
+\r
+        const char* server_scheme_str = scheme;\r
+        if (!server_scheme_str || !*server_scheme_str)\r
+            server_scheme_str = (m_port == 443 || m_port == 8443) ? "https" : "http";\r
+        m_scheme = server_scheme_str;\r
+    }\r
+\r
+    ~ShibTargetFCGIAuth() { }\r
+\r
+    const char* getScheme() const {\r
+        return m_scheme.c_str();\r
+    }\r
+    const char* getHostname() const {\r
+        return m_hostname.c_str();\r
+    }\r
+    int getPort() const {\r
+        return m_port;\r
+    }\r
+    const char* getRequestURI() const {\r
+        return FCGX_GetParam("REQUEST_URI", m_req->envp);\r
+    }\r
+    const char* getMethod() const {\r
+        return FCGX_GetParam("REQUEST_METHOD", m_req->envp);\r
+    }\r
+    string getContentType() const {\r
+        const char* s = FCGX_GetParam("CONTENT_TYPE", m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+    long getContentLength() const {\r
+        const char* s = FCGX_GetParam("CONTENT_LENGTH", m_req->envp);\r
+        return s ? atol(s) : 0;\r
+    }\r
+    string getRemoteAddr() const {\r
+        const char* s = FCGX_GetParam("REMOTE_ADDR", m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+    void log(SPLogLevel level, const string& msg) const {\r
+        AbstractSPRequest::log(level,msg);\r
+        if (level >= SPError)\r
+            cerr << "shib: " << msg;\r
+    }\r
+    void clearHeader(const char* rawname, const char* cginame) {\r
+        // no need, since request headers turn into actual environment variables\r
+    }\r
+    void setHeader(const char* name, const char* value) {\r
+        if (value)\r
+            m_request_headers[name] = value;\r
+        else\r
+            m_request_headers.erase(name);\r
+    }\r
+    virtual string getHeader(const char* name) const {\r
+        map<string,string>::const_iterator i = m_request_headers.find(name);\r
+        if (i != m_request_headers.end())\r
+            return i->second;\r
+        else\r
+            return "";\r
+    }\r
+    void setRemoteUser(const char* user) {\r
+        if (user)\r
+            m_request_headers["REMOTE_USER"] = user;\r
+        else\r
+            m_request_headers.erase("REMOTE_USER");\r
+    }\r
+    string getRemoteUser() const {\r
+        map<string,string>::const_iterator i = m_request_headers.find("REMOTE_USER");\r
+        if (i != m_request_headers.end())\r
+            return i->second;\r
+        else {\r
+            char* remote_user = FCGX_GetParam("REMOTE_USER", m_req->envp);\r
+            if (remote_user)\r
+                return remote_user;\r
+        }\r
+        return "";\r
+    }\r
+    void setResponseHeader(const char* name, const char* value) {\r
+        // Set for later.\r
+        if (value)\r
+            m_response_headers.insert(make_pair(name,value));\r
+        else\r
+            m_response_headers.erase(name);\r
+    }\r
+    const char* getQueryString() const {\r
+        return FCGX_GetParam("QUERY_STRING", m_req->envp);\r
+    }\r
+    const char* getRequestBody() const {\r
+        throw exception("getRequestBody not implemented by FastCGI authorizer.");\r
+    }\r
\r
+    long sendResponse(istream& in, long status) {\r
+        string hdr = string("Connection: close\r\n");\r
+        for (multimap<string,string>::const_iterator i=m_response_headers.begin(); i!=m_response_headers.end(); ++i)\r
+            hdr += i->first + ": " + i->second + "\r\n";\r
+\r
+        // We can't return 200 OK here or else the filter is bypassed\r
+        // so custom Shib errors will get turned into a generic page.\r
+        const char* codestr="Status: 500 Server Error";\r
+        switch (status) {\r
+            case XMLTOOLING_HTTP_STATUS_FORBIDDEN:   codestr="Status: 403 Forbidden"; break;\r
+            case XMLTOOLING_HTTP_STATUS_NOTFOUND:   codestr="Status: 404 Not Found"; break;\r
+        }\r
+        cout << codestr << "\r\n" << hdr << "\r\n";\r
+        char buf[1024];\r
+        while (in) {\r
+            in.read(buf,1024);\r
+            cout.write(buf, in.gcount());\r
+        }\r
+        return SHIB_RETURN_DONE;\r
+    }\r
+\r
+    long sendRedirect(const char* url) {\r
+        string hdr=string("Status: 302 Please Wait\r\nLocation: ") + url + "\r\n"\r
+          "Content-Type: text/html\r\n"\r
+          "Content-Length: 40\r\n"\r
+          "Expires: 01-Jan-1997 12:00:00 GMT\r\n"\r
+          "Cache-Control: private,no-store,no-cache\r\n";\r
+        for (multimap<string,string>::const_iterator i=m_response_headers.begin(); i!=m_response_headers.end(); ++i)\r
+            hdr += i->first + ": " + i->second + "\r\n";\r
+        hdr += "\r\n";\r
+\r
+        cout << hdr << "<HTML><BODY>Redirecting...</BODY></HTML>";\r
+        return SHIB_RETURN_DONE;\r
+    }\r
+\r
+    long returnDecline() { \r
+        return SHIB_RETURN_KO;\r
+    }\r
+\r
+    long returnOK() {\r
+        return SHIB_RETURN_OK;\r
+    }\r
+\r
+    const vector<string>& getClientCertificates() const {\r
+        static vector<string> g_NoCerts;\r
+        return g_NoCerts;\r
+    }\r
+};\r
+\r
+static void print_ok(const map<string,string>& headers)\r
+{\r
+    cout << "Status: 200 OK" << "\r\n";\r
+    for (map<string,string>::const_iterator iter = headers.begin(); iter != headers.end(); iter++) {\r
+        cout << "Variable-" << iter->first << ": " << iter->second << "\r\n";\r
+    }\r
+    cout << "\r\n";\r
+}\r
+\r
+static void print_error(const char* msg)\r
+{\r
+    cout << "Status: 500 Server Error" << "\r\n\r\n" << msg;\r
+}\r
+\r
+int main(void)\r
+{\r
+    const char* schemadir=getenv("SHIBSP_SCHEMAS");\r
+    if (!schemadir)\r
+        schemadir=SHIBSP_SCHEMAS;\r
+    const char* config=getenv("SHIBSP_CONFIG");\r
+    if (!config)\r
+        config=SHIBSP_CONFIG;\r
+\r
+    cerr << "SHIBSP_CONFIG = " << config << endl\r
+         << "SHIBSP_SCHEMAS = " << schemadir << endl;\r
+\r
+    SPConfig* g_Config=&SPConfig::getConfig();\r
+    g_Config->setFeatures(\r
+        SPConfig::Listener |\r
+        SPConfig::Caching |\r
+        SPConfig::RequestMapping |\r
+        SPConfig::InProcess |\r
+        SPConfig::Logging |\r
+        SPConfig::Handlers\r
+        );\r
+    if (!g_Config->init(schemadir)) {\r
+        cerr << "failed to initialize Shibboleth libraries" << endl;\r
+        exit(1);\r
+    }\r
+\r
+    try {\r
+        DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();\r
+        XercesJanitor<DOMDocument> docjanitor(dummydoc);\r
+        DOMElement* dummy = dummydoc->createElementNS(NULL,path);\r
+        auto_ptr_XMLCh src(config);\r
+        dummy->setAttributeNS(NULL,path,src.get());\r
+        dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);\r
+\r
+        g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));\r
+        g_Config->getServiceProvider()->init();\r
+    }\r
+    catch (exception& ex) {\r
+        g_Config->term();\r
+        cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl;\r
+        exit(1);\r
+    }\r
+\r
+    string g_ServerScheme;\r
+    string g_ServerName;\r
+    int g_ServerPort=0;\r
+\r
+    // Load "authoritative" URL fields.\r
+    char* var = getenv("SHIBSP_SERVER_NAME");\r
+    if (var)\r
+        g_ServerName = var;\r
+    var = getenv("SHIBSP_SERVER_SCHEME");\r
+    if (var)\r
+        g_ServerScheme = var;\r
+    var = getenv("SHIBSP_SERVER_PORT");\r
+    if (var)\r
+        g_ServerPort = atoi(var);\r
+\r
+    streambuf* cout_streambuf = cout.rdbuf();\r
+    streambuf* cerr_streambuf = cerr.rdbuf();\r
+\r
+    FCGX_Request request;\r
+\r
+    FCGX_Init();\r
+    FCGX_InitRequest(&request, 0, 0);\r
+    \r
+    cout << "Shibboleth initialization complete. Starting request loop." << endl;\r
+    while (FCGX_Accept_r(&request) == 0)\r
+    {\r
+        // Note that the default bufsize (0) will cause the use of iostream\r
+        // methods that require positioning (such as peek(), seek(),\r
+        // unget() and putback()) to fail (in favour of more efficient IO).\r
+        fcgi_streambuf cout_fcgi_streambuf(request.out);\r
+        fcgi_streambuf cerr_fcgi_streambuf(request.err);\r
+\r
+        cout.rdbuf(&cout_fcgi_streambuf);\r
+        cerr.rdbuf(&cerr_fcgi_streambuf);\r
+\r
+        try {\r
+            xmltooling::NDC ndc("FastCGI shibauthorizer");\r
+            ShibTargetFCGIAuth sta(&request, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);\r
+          \r
+            pair<bool,long> res = sta.getServiceProvider().doAuthentication(sta);\r
+            if (res.first) {\r
+#ifdef _DEBUG\r
+                cerr << "shib: doAuthentication handled the request" << endl;\r
+#endif\r
+                switch(res.second) {\r
+                    case SHIB_RETURN_OK:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+              \r
+                    case SHIB_RETURN_KO:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+\r
+                    case SHIB_RETURN_DONE:\r
+                        continue;\r
+              \r
+                    default:\r
+                        cerr << "shib: doAuthentication returned an unexpected result: " << res.second << endl;\r
+                        print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");\r
+                        continue;\r
+                }\r
+            }\r
+          \r
+            res = sta.getServiceProvider().doExport(sta);\r
+            if (res.first) {\r
+#ifdef _DEBUG\r
+                cerr << "shib: doExport handled request" << endl;\r
+#endif\r
+                switch(res.second) {\r
+                    case SHIB_RETURN_OK:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+              \r
+                    case SHIB_RETURN_KO:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+\r
+                    case SHIB_RETURN_DONE:\r
+                        continue;\r
+              \r
+                    default:\r
+                        cerr << "shib: doExport returned an unexpected result: " << res.second << endl;\r
+                        print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");\r
+                        continue;\r
+                }\r
+            }\r
+\r
+            res = sta.getServiceProvider().doAuthorization(sta);\r
+            if (res.first) {\r
+#ifdef _DEBUG\r
+                cerr << "shib: doAuthorization handled request" << endl;\r
+#endif\r
+                switch(res.second) {\r
+                    case SHIB_RETURN_OK:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+              \r
+                    case SHIB_RETURN_KO:\r
+                        print_ok(sta.m_request_headers);\r
+                        continue;\r
+\r
+                    case SHIB_RETURN_DONE:\r
+                        continue;\r
+              \r
+                    default:\r
+                        cerr << "shib: doAuthorization returned an unexpected result: " << res.second << endl;\r
+                        print_error("<html><body>FastCGI Shibboleth authorizer returned an unexpected result.</body></html>");\r
+                        continue;\r
+                }\r
+            }\r
+\r
+            print_ok(sta.m_request_headers);\r
+          \r
+        }\r
+        catch (exception& e) {\r
+            cerr << "shib: FastCGI authorizer caught an exception: " << e.what() << endl;\r
+            print_error("<html><body>FastCGI Shibboleth authorizer caught an exception, check log for details.</body></html>");\r
+        }\r
+\r
+        // If the output streambufs had non-zero bufsizes and\r
+        // were constructed outside of the accept loop (i.e.\r
+        // their destructor won't be called here), they would\r
+        // have to be flushed here.\r
+    }\r
+    cout << "Request loop ended." << endl;\r
+\r
+    cout.rdbuf(cout_streambuf);\r
+    cerr.rdbuf(cerr_streambuf);\r
+\r
+    if (g_Config)\r
+        g_Config->term();\r
\r
+    return 0;\r
+}\r
diff --git a/fastcgi/shibauthorizer.vcproj b/fastcgi/shibauthorizer.vcproj
new file mode 100644 (file)
index 0000000..c82fe22
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="shibauthorizer"\r
+       ProjectGUID="{8CF7DDFA-EAA0-416E-853E-3DCB210C4AE0}"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory=".\shibauthorizer___Win32_$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\shibauthorizer___Win32_Release/shibauthorizer.tlb"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="xerces-c_2.lib xmltooling1.lib libfcgi.lib"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="&quot;..\..\cpp-xmltooling\$(ConfigurationName)&quot;,\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"\r
+                               ProgramDatabaseFile=".\shibauthorizer___Win32_Release/shibauthorizer.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory=".\shibauthorizer___Win32_$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\shibauthorizer___Win32_Debug/shibauthorizer.tlb"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               BrowseInformation="1"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="xerces-c_2D.lib xmltooling1D.lib libfcgi.lib"\r
+                               LinkIncremental="2"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="&quot;..\..\cpp-xmltooling\$(ConfigurationName)&quot;,\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile=".\shibauthorizer___Win32_Debug/shibauthorizer.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <File\r
+                       RelativePath="shibauthorizer.cpp"\r
+                       >\r
+                       <FileConfiguration\r
+                               Name="Release|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       AdditionalIncludeDirectories=""\r
+                                       PreprocessorDefinitions=""\r
+                               />\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       AdditionalIncludeDirectories=""\r
+                                       PreprocessorDefinitions=""\r
+                               />\r
+                       </FileConfiguration>\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/fastcgi/shibresponder.cpp b/fastcgi/shibresponder.cpp
new file mode 100644 (file)
index 0000000..4cab35d
--- /dev/null
@@ -0,0 +1,413 @@
+/*\r
+ *  Copyright 2001-2007 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/* shibresponder.cpp - Shibboleth FastCGI Responder/Handler\r
+\r
+   Andre Cruz\r
+*/\r
+\r
+#define SHIBSP_LITE\r
+#include "config_win32.h"\r
+\r
+#define _CRT_NONSTDC_NO_DEPRECATE 1\r
+#define _CRT_SECURE_NO_DEPRECATE 1\r
+#define _SCL_SECURE_NO_WARNINGS 1\r
+\r
+#include <shibsp/AbstractSPRequest.h>\r
+#include <shibsp/SPConfig.h>\r
+#include <shibsp/ServiceProvider.h>\r
+#include <xmltooling/unicode.h>\r
+#include <xmltooling/XMLToolingConfig.h>\r
+#include <xmltooling/util/NDC.h>\r
+#include <xmltooling/util/XMLConstants.h>\r
+#include <xmltooling/util/XMLHelper.h>\r
+#include <xercesc/util/XMLUniDefs.hpp>\r
+\r
+#include <stdlib.h>\r
+#ifdef HAVE_UNISTD_H\r
+# include <unistd.h>\r
+# include <sys/mman.h>\r
+#endif\r
+#include <fcgio.h>\r
+\r
+using namespace shibsp;\r
+using namespace xmltooling;\r
+using namespace xercesc;\r
+using namespace std;\r
+\r
+static const XMLCh path[] =     UNICODE_LITERAL_4(p,a,t,h);\r
+static const XMLCh validate[] = UNICODE_LITERAL_8(v,a,l,i,d,a,t,e);\r
+\r
+typedef enum {\r
+    SHIB_RETURN_OK,\r
+    SHIB_RETURN_KO,\r
+    SHIB_RETURN_DONE\r
+} shib_return_t;\r
+\r
+class ShibTargetFCGI : public AbstractSPRequest\r
+{\r
+    FCGX_Request* m_req;\r
+    const char* m_body;\r
+    multimap<string,string> m_headers;\r
+    int m_port;\r
+    string m_scheme,m_hostname;\r
+\r
+public:\r
+    ShibTargetFCGI(FCGX_Request* req, char* post_data, const char* scheme=NULL, const char* hostname=NULL, int port=0)\r
+        : m_req(req), m_body(post_data) {\r
+\r
+        const char* server_name_str = hostname;\r
+        if (!server_name_str || !*server_name_str)\r
+            server_name_str = FCGX_GetParam("SERVER_NAME", req->envp);\r
+        m_hostname = server_name_str;\r
+\r
+        m_port = port;\r
+        if (!m_port) {\r
+            char* server_port_str = FCGX_GetParam("SERVER_PORT", req->envp);\r
+            m_port = strtol(server_port_str, &server_port_str, 10);\r
+            if (*server_port_str) {\r
+                cerr << "can't parse SERVER_PORT (" << FCGX_GetParam("SERVER_PORT", req->envp) << ")" << endl;\r
+                throw exception("Unable to determine server port.");\r
+            }\r
+        }\r
+\r
+        const char* server_scheme_str = scheme;\r
+        if (!server_scheme_str || !*server_scheme_str)\r
+            server_scheme_str = (m_port == 443 || m_port == 8443) ? "https" : "http";\r
+        m_scheme = server_scheme_str;\r
+    }\r
+\r
+    ~ShibTargetFCGI() { }\r
+\r
+    const char* getScheme() const {\r
+        return m_scheme.c_str();\r
+    }\r
+    const char* getHostname() const {\r
+        return m_hostname.c_str();\r
+    }\r
+    int getPort() const {\r
+        return m_port;\r
+    }\r
+    const char* getRequestURI() const {\r
+        return FCGX_GetParam("REQUEST_URI", m_req->envp);\r
+    }\r
+    const char* getMethod() const {\r
+        return FCGX_GetParam("REQUEST_METHOD", m_req->envp);\r
+    }\r
+    string getContentType() const {\r
+        const char* s = FCGX_GetParam("CONTENT_TYPE", m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+    long getContentLength() const {\r
+        const char* s = FCGX_GetParam("CONTENT_LENGTH", m_req->envp);\r
+        return s ? atol(s) : 0;\r
+    }\r
+    string getRemoteUser() const {\r
+        const char* s = FCGX_GetParam("REMOTE_USER", m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+    string getRemoteAddr() const {\r
+        const char* s = FCGX_GetParam("REMOTE_ADDR", m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+    void log(SPLogLevel level, const string& msg) const {\r
+        AbstractSPRequest::log(level,msg);\r
+        if (level >= SPError)\r
+            cerr << "shib: " << msg;\r
+    }\r
+\r
+    string getHeader(const char* name) const {\r
+        string hdr("HTTP_");\r
+        for (; *name; ++name) {\r
+            if (*name=='-')\r
+                hdr += '_';\r
+            else\r
+                hdr += toupper(*name);\r
+        }\r
+        char* s = FCGX_GetParam(hdr.c_str(), m_req->envp);\r
+        return s ? s : "";\r
+    }\r
+\r
+    void setResponseHeader(const char* name, const char* value) {\r
+        // Set for later.\r
+        if (value)\r
+            m_headers.insert(make_pair(name,value));\r
+        else\r
+            m_headers.erase(name);\r
+    }\r
+\r
+    const char* getQueryString() const {\r
+        return FCGX_GetParam("QUERY_STRING", m_req->envp);\r
+    }\r
+\r
+    const char* getRequestBody() const {\r
+        return m_body;\r
+    }\r
+\r
+    long sendResponse(istream& in, long status) {\r
+        string hdr = string("Connection: close\r\n");\r
+        for (multimap<string,string>::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i)\r
+            hdr += i->first + ": " + i->second + "\r\n";\r
+\r
+        const char* codestr="Status: 200 OK";\r
+        switch (status) {\r
+            case XMLTOOLING_HTTP_STATUS_ERROR:    codestr="Status: 500 Server Error"; break;\r
+            case XMLTOOLING_HTTP_STATUS_FORBIDDEN:codestr="Status: 403 Forbidden"; break;\r
+            case XMLTOOLING_HTTP_STATUS_NOTFOUND: codestr="Status: 404 Not Found"; break;\r
+        }\r
+        cout << codestr << "\r\n" << hdr << "\r\n";\r
+        char buf[1024];\r
+        while (in) {\r
+            in.read(buf,1024);\r
+            cout.write(buf, in.gcount());\r
+        }\r
+        return SHIB_RETURN_DONE;\r
+    }\r
+\r
+    long sendRedirect(const char* url) {\r
+        string hdr=string("Status: 302 Please Wait\r\nLocation: ") + url + "\r\n"\r
+          "Content-Type: text/html\r\n"\r
+          "Content-Length: 40\r\n"\r
+          "Expires: 01-Jan-1997 12:00:00 GMT\r\n"\r
+          "Cache-Control: private,no-store,no-cache\r\n";\r
+        for (multimap<string,string>::const_iterator i=m_headers.begin(); i!=m_headers.end(); ++i)\r
+            hdr += i->first + ": " + i->second + "\r\n";\r
+        hdr += "\r\n";\r
+\r
+        cout << hdr << "<HTML><BODY>Redirecting...</BODY></HTML>";\r
+        return SHIB_RETURN_DONE;\r
+    }\r
+\r
+    long returnDecline() {\r
+        return SHIB_RETURN_KO;\r
+    }\r
+    long returnOK() {\r
+        return SHIB_RETURN_OK;\r
+    }\r
+\r
+    const vector<string>& getClientCertificates() const {\r
+        static vector<string> g_NoCerts;\r
+        return g_NoCerts;\r
+    }\r
+\r
+    // Not used in the extension.\r
+\r
+    virtual void clearHeader(const char* rawname, const char* cginame) {\r
+        throw exception("clearHeader not implemented by FastCGI responder.");\r
+    }\r
+  \r
+    virtual void setHeader(const char* name, const char* value) {\r
+        throw exception("setHeader not implemented by FastCGI responder.");\r
+    }\r
+\r
+    virtual void setRemoteUser(const char* user) {\r
+        throw exception("setRemoteUser not implemented by FastCGI responder.");\r
+    }\r
+};\r
+\r
+// Maximum number of bytes allowed to be read from stdin\r
+static const unsigned long STDIN_MAX = 1000000;\r
+\r
+static long gstdin(FCGX_Request* request, char** content)\r
+{\r
+    char* clenstr = FCGX_GetParam("CONTENT_LENGTH", request->envp);\r
+    unsigned long clen = STDIN_MAX;\r
+\r
+    if (clenstr) {\r
+        clen = strtol(clenstr, &clenstr, 10);\r
+        if (*clenstr) {\r
+            cerr << "can't parse CONTENT_LENGTH (" << FCGX_GetParam("CONTENT_LENGTH", request->envp) << ")" << endl;\r
+            clen = STDIN_MAX;\r
+        }\r
+\r
+        // *always* put a cap on the amount of data that will be read\r
+        if (clen > STDIN_MAX)\r
+            clen = STDIN_MAX;\r
+\r
+        *content = new char[clen];\r
+\r
+        cin.read(*content, clen);\r
+        clen = cin.gcount();\r
+    }\r
+    else {\r
+        // *never* read stdin when CONTENT_LENGTH is missing or unparsable\r
+        *content = 0;\r
+        clen = 0;\r
+    }\r
+\r
+    // Chew up any remaining stdin - this shouldn't be necessary\r
+    // but is because mod_fastcgi doesn't handle it correctly.\r
+\r
+    // ignore() doesn't set the eof bit in some versions of glibc++\r
+    // so use gcount() instead of eof()...\r
+    do cin.ignore(1024); while (cin.gcount() == 1024);\r
+\r
+    return clen;\r
+}\r
+\r
+static void print_ok() {\r
+    cout << "Status: 200 OK" << "\r\n\r\n";\r
+}\r
+\r
+static void print_error(const char* msg) {\r
+    cout << "Status: 500 Server Error" << "\r\n\r\n" << msg;\r
+}\r
+\r
+int main(void)\r
+{\r
+    const char* schemadir=getenv("SHIBSP_SCHEMAS");\r
+    if (!schemadir)\r
+        schemadir=SHIBSP_SCHEMAS;\r
+    const char* config=getenv("SHIBSP_CONFIG");\r
+    if (!config)\r
+        config=SHIBSP_CONFIG;\r
+\r
+    cerr << "SHIBSP_CONFIG = " << config << endl\r
+         << "SHIBSP_SCHEMAS = " << schemadir << endl;\r
+\r
+    SPConfig* g_Config=&SPConfig::getConfig();\r
+    g_Config->setFeatures(\r
+        SPConfig::Listener |\r
+        SPConfig::Caching |\r
+        SPConfig::RequestMapping |\r
+        SPConfig::InProcess |\r
+        SPConfig::Logging |\r
+        SPConfig::Handlers\r
+        );\r
+    if (!g_Config->init(schemadir)) {\r
+        cerr << "failed to initialize Shibboleth libraries" << endl;\r
+        exit(1);\r
+    }\r
+\r
+    try {\r
+        DOMDocument* dummydoc=XMLToolingConfig::getConfig().getParser().newDocument();\r
+        XercesJanitor<DOMDocument> docjanitor(dummydoc);\r
+        DOMElement* dummy = dummydoc->createElementNS(NULL,path);\r
+        auto_ptr_XMLCh src(config);\r
+        dummy->setAttributeNS(NULL,path,src.get());\r
+        dummy->setAttributeNS(NULL,validate,xmlconstants::XML_ONE);\r
+\r
+        g_Config->setServiceProvider(g_Config->ServiceProviderManager.newPlugin(XML_SERVICE_PROVIDER,dummy));\r
+        g_Config->getServiceProvider()->init();\r
+    }\r
+    catch (exception& ex) {\r
+        g_Config->term();\r
+        cerr << "exception while initializing Shibboleth configuration: " << ex.what() << endl;\r
+        exit(1);\r
+    }\r
+\r
+    string g_ServerScheme;\r
+    string g_ServerName;\r
+    int g_ServerPort=0;\r
+\r
+    // Load "authoritative" URL fields.\r
+    char* var = getenv("SHIBSP_SERVER_NAME");\r
+    if (var)\r
+        g_ServerName = var;\r
+    var = getenv("SHIBSP_SERVER_SCHEME");\r
+    if (var)\r
+        g_ServerScheme = var;\r
+    var = getenv("SHIBSP_SERVER_PORT");\r
+    if (var)\r
+        g_ServerPort = atoi(var);\r
+\r
+    streambuf* cin_streambuf  = cin.rdbuf();\r
+    streambuf* cout_streambuf = cout.rdbuf();\r
+    streambuf* cerr_streambuf = cerr.rdbuf();\r
+\r
+    FCGX_Request request;\r
+\r
+    FCGX_Init();\r
+    FCGX_InitRequest(&request, 0, 0);\r
+    \r
+    cout << "Shibboleth initialization complete. Starting request loop." << endl;\r
+    while (FCGX_Accept_r(&request) == 0) {\r
+        // Note that the default bufsize (0) will cause the use of iostream\r
+        // methods that require positioning (such as peek(), seek(),\r
+        // unget() and putback()) to fail (in favour of more efficient IO).\r
+        fcgi_streambuf cin_fcgi_streambuf(request.in);\r
+        fcgi_streambuf cout_fcgi_streambuf(request.out);\r
+        fcgi_streambuf cerr_fcgi_streambuf(request.err);\r
+\r
+        cin.rdbuf(&cin_fcgi_streambuf);\r
+        cout.rdbuf(&cout_fcgi_streambuf);\r
+        cerr.rdbuf(&cerr_fcgi_streambuf);\r
+\r
+        // Although FastCGI supports writing before reading,\r
+        // many http clients (browsers) don't support it (so\r
+        // the connection deadlocks until a timeout expires!).\r
+        char* content;\r
+        gstdin(&request, &content);\r
+\r
+        try {\r
+            xmltooling::NDC ndc("FastCGI shibresponder");\r
+            ShibTargetFCGI stf(&request, content, g_ServerScheme.c_str(), g_ServerName.c_str(), g_ServerPort);\r
+          \r
+            pair<bool,long> res = stf.getServiceProvider().doHandler(stf);\r
+            if (res.first) {\r
+#ifdef _DEBUG\r
+                cerr << "shib: doHandler handled the request" << endl;\r
+#endif\r
+                switch(res.second) {\r
+                    case SHIB_RETURN_OK:\r
+                        print_ok();\r
+                        break;\r
+              \r
+                    case SHIB_RETURN_KO:\r
+                        cerr << "shib: doHandler failed to handle the request" << endl;\r
+                        print_error("<html><body>FastCGI Shibboleth responder should only be used for Shibboleth protocol requests.</body></html>");\r
+                        break;\r
+\r
+                    case SHIB_RETURN_DONE:\r
+                        // response already handled\r
+                        break;\r
+              \r
+                    default:\r
+                        cerr << "shib: doHandler returned an unexpected result: " << res.second << endl;\r
+                        print_error("<html><body>FastCGI Shibboleth responder returned an unexpected result.</body></html>");\r
+                        break;\r
+                }\r
+            }\r
+            else {\r
+                cerr << "shib: doHandler failed to handle request." << endl;\r
+                print_error("<html><body>FastCGI Shibboleth responder failed to process request.</body></html>");\r
+            }          \r
+          \r
+        }\r
+        catch (exception& e) {\r
+            cerr << "shib: FastCGI responder caught an exception: " << e.what() << endl;\r
+            print_error("<html><body>FastCGI Shibboleth responder caught an exception, check log for details.</body></html>");\r
+        }\r
+\r
+        delete[] content;\r
+\r
+        // If the output streambufs had non-zero bufsizes and\r
+        // were constructed outside of the accept loop (i.e.\r
+        // their destructor won't be called here), they would\r
+        // have to be flushed here.\r
+    }\r
+\r
+    cout << "Request loop ended." << endl;\r
+\r
+    cin.rdbuf(cin_streambuf);\r
+    cout.rdbuf(cout_streambuf);\r
+    cerr.rdbuf(cerr_streambuf);\r
+\r
+    if (g_Config)\r
+        g_Config->term();\r
\r
+    return 0;\r
+}\r
diff --git a/fastcgi/shibresponder.vcproj b/fastcgi/shibresponder.vcproj
new file mode 100644 (file)
index 0000000..cb50d89
--- /dev/null
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="shibresponder"\r
+       ProjectGUID="{B2423DCE-048D-4BAA-9AB9-F5D1FCDD3D25}"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory=".\shibresponder___Win32_$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\shibresponder___Win32_Release/shibresponder.tlb"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="2"\r
+                               InlineFunctionExpansion="1"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="2"\r
+                               EnableFunctionLevelLinking="true"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="NDEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="xerces-c_2.lib xmltooling1.lib libfcgi.lib"\r
+                               LinkIncremental="1"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="&quot;..\..\cpp-xmltooling\$(ConfigurationName)&quot;,\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"\r
+                               ProgramDatabaseFile=".\shibresponder___Win32_Release/shibresponder.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory=".\shibresponder___Win32_$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"\r
+                       UseOfMFC="0"\r
+                       ATLMinimizesCRunTimeLibraryUsage="false"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TypeLibraryName=".\shibresponder___Win32_Debug/shibresponder.tlb"\r
+                               HeaderFileName=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories=".;..;&quot;..\..\cpp-xmltooling&quot;"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               BrowseInformation="1"\r
+                               WarningLevel="3"\r
+                               SuppressStartupBanner="true"\r
+                               DebugInformationFormat="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               PreprocessorDefinitions="_DEBUG"\r
+                               Culture="1033"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="xerces-c_2D.lib xmltooling1D.lib libfcgi.lib"\r
+                               LinkIncremental="2"\r
+                               SuppressStartupBanner="true"\r
+                               AdditionalLibraryDirectories="&quot;..\..\cpp-xmltooling\$(ConfigurationName)&quot;,\fcgi-2.4.0-VC8\libfcgi\$(ConfigurationName)"\r
+                               GenerateDebugInformation="true"\r
+                               ProgramDatabaseFile=".\shibresponder___Win32_Debug/shibresponder.pdb"\r
+                               SubSystem="1"\r
+                               TargetMachine="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <File\r
+                       RelativePath="shibresponder.cpp"\r
+                       >\r
+                       <FileConfiguration\r
+                               Name="Release|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       AdditionalIncludeDirectories=""\r
+                                       PreprocessorDefinitions=""\r
+                               />\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32"\r
+                               >\r
+                               <Tool\r
+                                       Name="VCCLCompilerTool"\r
+                                       AdditionalIncludeDirectories=""\r
+                                       PreprocessorDefinitions=""\r
+                               />\r
+                       </FileConfiguration>\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
index 1908d9b..216a23c 100644 (file)
@@ -53,7 +53,6 @@
                                StringPooling="true"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
-                               RuntimeTypeInfo="true"
                                BrowseInformation="1"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
                                PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0400"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
-                               RuntimeTypeInfo="true"
                                BrowseInformation="1"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
index 8ac6204..9e07d66 100644 (file)
@@ -93,7 +93,7 @@ if (Err = 0) then
   ConfigFile = DistDir & "shibboleth2.xml.in"
   ReplaceInFile ConfigFile, "@-PKGXMLDIR-@", ConvertedDir & "/share/xml/shibboleth"
   ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
   ReplaceInFile ConfigFile, "@-LOGDIR-@", ConvertedDir & "/var/log/shibboleth"
   ReplaceInFile ConfigFile, "@-PREFIX-@", ConvertedDir
   ReplaceInFile ConfigFile, "   <UnixListener address=""@-PKGRUNDIR-@/shibd.sock""/>", "<!-- <UnixListener address=""@-PKGRUNDIR-@/shibd.sock""/> -->"
@@ -131,7 +131,7 @@ if (Err = 0) then
   ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
   ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
   ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "apache.config")) then
     FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache.config", false
   End If
@@ -145,7 +145,7 @@ if (Err = 0) then
   ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
   ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
   ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "apache2.config")) then
     FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache2.config", false
   End If
@@ -159,7 +159,7 @@ if (Err = 0) then
   ReplaceInFile ConfigFile, "catalog.xml:", "catalog.xml;"
   ReplaceInFile ConfigFile, "@-PKGDOCDIR-@", ConvertedDir & "/share/doc/shibboleth"
   ReplaceInFile ConfigFile, "@-PKGSYSCONFDIR-@", ConvertedDir & "/etc/shibboleth"
-  ReplaceInFile ConfigFile, "@-LIBEXECDIR-@", ConvertedDir & "/libexec"
+  ReplaceInFile ConfigFile, "@-PKGLIBDIR-@", ConvertedDir & "/lib/shibboleth"
   If (NOT FileSystemObj.FileExists(ConfigDir & "apache22.config")) then
     FileSystemObj.CopyFile ConfigFile, ConfigDir & "apache22.config", false
   End If
index 8362f1f..50be4cb 100644 (file)
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign
 
 if BUILD_NSAPI
-nsapi_shibdir = $(libexecdir)
+nsapi_shibdir = $(libdir)/@PACKAGE@
 nsapi_shib_LTLIBRARIES = nsapi_shib.la
 nsapi_shib_la_SOURCES = nsapi_shib.cpp
 nsapi_shib_la_CXXFLAGS = $(NSAPI_INCLUDE)
@@ -15,4 +15,3 @@ install-exec-hook:
 endif
 
 EXTRA_DIST = nsapi_shib.vcproj resource.h nsapi_shib.rc nsapi_shib.cpp
-
index 7701483..8251b79 100644 (file)
@@ -53,7 +53,6 @@
                                StringPooling="true"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
-                               RuntimeTypeInfo="true"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
                                Detect64BitPortabilityProblems="true"
                                PreprocessorDefinitions="_WINDOWS;WIN32;_DEBUG"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
-                               RuntimeTypeInfo="true"
                                BrowseInformation="1"
                                WarningLevel="3"
                                SuppressStartupBanner="true"
index f6c9ebc..c18fe5b 100644 (file)
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = foreign
 
-plugindir = $(libexecdir)
+plugindir = $(libdir)/@PACKAGE@
 plugin_LTLIBRARIES = odbc-store.la
 
 AM_CFLAGS = $(ODBC_CFLAGS)