Debian can't bind abstract classes
authorScott Cantor <cantor.2@osu.edu>
Wed, 11 Jan 2012 17:46:24 +0000 (17:46 +0000)
committerScott Cantor <cantor.2@osu.edu>
Wed, 11 Jan 2012 17:46:24 +0000 (17:46 +0000)
shibsp/attribute/filtering/impl/AndMatchFunctor.cpp
shibsp/attribute/filtering/impl/OrMatchFunctor.cpp
shibsp/impl/XMLAccessControl.cpp
shibsp/impl/XMLSecurityPolicyProvider.cpp

index 3930a6e..a1cc9cf 100644 (file)
 #include "attribute/filtering/MatchFunctor.h"
 #include "util/SPConstants.h"
 
+#include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xmltooling/util/XMLHelper.h>
 
 using namespace shibsp;
 using namespace xmltooling;
-using namespace boost::lambda;
 using namespace boost;
 using namespace std;
 
@@ -57,7 +55,7 @@ namespace shibsp {
                 return false;
             vector<const MatchFunctor*>::const_iterator i = find_if(
                 m_functors.begin(), m_functors.end(),
-                lambda::bind(&MatchFunctor::evaluatePolicyRequirement, _1, boost::ref(filterContext)) == false
+                boost::bind(&MatchFunctor::evaluatePolicyRequirement, _1, boost::cref(filterContext)) == false
                 );
             return (i == m_functors.end());
         }
@@ -67,7 +65,7 @@ namespace shibsp {
                 return false;
             vector<const MatchFunctor*>::const_iterator i = find_if(
                 m_functors.begin(), m_functors.end(),
-                lambda::bind(&MatchFunctor::evaluatePermitValue, _1, boost::ref(filterContext), boost::ref(attribute), index) == false
+                boost::bind(&MatchFunctor::evaluatePermitValue, _1, boost::cref(filterContext), boost::cref(attribute), index) == false
                 );
             return (i == m_functors.end());
         }
index 6018d13..463f2a4 100644 (file)
 #include "attribute/filtering/MatchFunctor.h"
 #include "util/SPConstants.h"
 
+#include <boost/bind.hpp>
 #include <boost/scoped_ptr.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 #include <xmltooling/util/XMLHelper.h>
 
 using namespace shibsp;
 using namespace xmltooling;
-using namespace boost::lambda;
 using namespace boost;
 using namespace std;
 
@@ -55,7 +53,7 @@ namespace shibsp {
         bool evaluatePolicyRequirement(const FilteringContext& filterContext) const {
             vector<const MatchFunctor*>::const_iterator i = find_if(
                 m_functors.begin(), m_functors.end(),
-                lambda::bind(&MatchFunctor::evaluatePolicyRequirement, _1, boost::ref(filterContext)) == true
+                boost::bind(&MatchFunctor::evaluatePolicyRequirement, _1, boost::cref(filterContext)) == true
                 );
             return (i != m_functors.end());
         }
@@ -63,7 +61,7 @@ namespace shibsp {
         bool evaluatePermitValue(const FilteringContext& filterContext, const Attribute& attribute, size_t index) const {
             vector<const MatchFunctor*>::const_iterator i = find_if(
                 m_functors.begin(), m_functors.end(),
-                lambda::bind(&MatchFunctor::evaluatePermitValue, _1, boost::ref(filterContext), boost::ref(attribute), index) == true
+                boost::bind(&MatchFunctor::evaluatePermitValue, _1, boost::cref(filterContext), boost::cref(attribute), index) == true
                 );
             return (i != m_functors.end());
         }
index 23463c8..059ab09 100644 (file)
@@ -33,9 +33,8 @@
 
 #include <algorithm>
 #include <boost/scoped_ptr.hpp>
+#include <boost/bind.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <xmltooling/unicode.h>
 #include <xmltooling/util/ReloadableXMLFile.h>
@@ -50,7 +49,6 @@
 
 using namespace shibsp;
 using namespace xmltooling;
-using namespace boost::lambda;
 using namespace boost;
 using namespace std;
 
@@ -373,9 +371,15 @@ AccessControl::aclresult_t Operator::authorized(const SPRequest& request, const
         case OP_AND:
         {
             // Look for a rule that returns non-true.
+            for (ptr_vector<AccessControl>::const_iterator i = m_operands.begin(); i != m_operands.end(); ++i) {
+                if (i->authorized(request,session) != shib_acl_true)
+                    return shib_acl_false;
+            }
+            return shib_acl_true;
+
             ptr_vector<AccessControl>::const_iterator i = find_if(
                 m_operands.begin(), m_operands.end(),
-                lambda::bind(&AccessControl::authorized, _1, boost::ref(request), session) != shib_acl_true
+                boost::bind(&AccessControl::authorized, _1, boost::cref(request), session) != shib_acl_true
                 );
             return (i != m_operands.end()) ? shib_acl_false : shib_acl_true;
         }
@@ -385,7 +389,7 @@ AccessControl::aclresult_t Operator::authorized(const SPRequest& request, const
             // Look for a rule that returns true.
             ptr_vector<AccessControl>::const_iterator i = find_if(
                 m_operands.begin(), m_operands.end(),
-                lambda::bind(&AccessControl::authorized, _1, boost::ref(request), session) == shib_acl_true
+                boost::bind(&AccessControl::authorized, _1, boost::cref(request), session) == shib_acl_true
                 );
             return (i != m_operands.end()) ? shib_acl_true : shib_acl_false;
         }
index e253ce9..76aa513 100644 (file)
@@ -218,7 +218,7 @@ XMLSecurityPolicyProviderImpl::XMLSecurityPolicyProviderImpl(const DOMElement* e
     e = XMLHelper::getFirstChildElement(e, Policy);
     while (e) {
         string id(XMLHelper::getAttrString(e, nullptr, _id));
-        policymap_t::referent_type& rules = m_policyMap[id];
+        policymap_t::mapped_type& rules = m_policyMap[id];
         boost::shared_ptr<DOMPropertySet> settings(new DOMPropertySet());
         settings->load(e, nullptr, &filter);
         rules.first = settings;