diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-27 02:19:54 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-04-27 02:19:54 +0000 |
| commit | 5b97122c840fabe27cbf7a3cc2e64823c58d2cb0 (patch) | |
| tree | 5e7ab2229c2006c5f179361d6f949055a0350bf7 /cpp/src/qpid/acl/AclData.cpp | |
| parent | 41cbf861df97e379210ecf0750ec9039bf941dd1 (diff) | |
| download | qpid-python-5b97122c840fabe27cbf7a3cc2e64823c58d2cb0.tar.gz | |
Reverting the change made in rev937119 as it seems to cause a core dump in RHEL5.
I haven't managed to pin point the issue. Once I do I may introduce the fix again with the required changes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@938298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/acl/AclData.cpp')
| -rw-r--r-- | cpp/src/qpid/acl/AclData.cpp | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/cpp/src/qpid/acl/AclData.cpp b/cpp/src/qpid/acl/AclData.cpp index f7143c33c1..a03d5b4d55 100644 --- a/cpp/src/qpid/acl/AclData.cpp +++ b/cpp/src/qpid/acl/AclData.cpp @@ -26,12 +26,22 @@ namespace acl { AclData::AclData():decisionMode(qpid::acl::DENY),transferAcl(false),aclSource("UNKNOWN") { - actionList.resize(qpid::acl::ACTIONSIZE); + for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){ + actionList[cnt]=0; + } + } void AclData::clear () { - actionList.clear(); + for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){ + if (actionList[cnt]){ + for (unsigned int cnt1=0; cnt1< qpid::acl::OBJECTSIZE; cnt1++) + delete actionList[cnt][cnt1]; + } + delete[] actionList[cnt]; + } + } bool AclData::matchProp(const std::string & src, const std::string& src1) @@ -52,21 +62,21 @@ AclResult AclData::lookup(const std::string& id, const Action& action, const Obj << " with params " << AclHelper::propertyMapToString(params)); AclResult aclresult = decisionMode; - if (!actionList[action].empty() && !actionList[action][objType].empty()) { - AclData::ActObjItr itrRule = actionList[action][objType].find(id); - if (itrRule == actionList[action][objType].end()) - itrRule = actionList[action][objType].find("*"); + if (actionList[action] && actionList[action][objType]) { + AclData::actObjItr itrRule = actionList[action][objType]->find(id); + if (itrRule == actionList[action][objType]->end()) + itrRule = actionList[action][objType]->find("*"); - if (itrRule != actionList[action][objType].end()) { + if (itrRule != actionList[action][objType]->end()) { QPID_LOG(debug, "ACL: checking the following rules for : " << itrRule->first ); //loop the vector - for (RuleSetItr i = itrRule->second.begin(); i < itrRule->second.end(); i++) { + for (ruleSetItr i = itrRule->second.begin(); i < itrRule->second.end(); i++) { QPID_LOG(debug, "ACL: checking rule " << i->toString()); // loop the names looking for match bool match = true; - for (PropertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++) { + for (propertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++) { //match name is exists first if (pMItr->first == acl::PROP_NAME) { if (matchProp(pMItr->second, name)){ @@ -78,7 +88,7 @@ AclResult AclData::lookup(const std::string& id, const Action& action, const Obj << pMItr->second << "' given in the rule"); } } else if (params) { //match pMItr against params - PropertyMapItr paramItr = params->find(pMItr->first); + propertyMapItr paramItr = params->find(pMItr->first); if (paramItr == params->end()) { match = false; QPID_LOG(debug, "ACL: the given parameter map in lookup doesn't contain the property '" @@ -162,24 +172,24 @@ AclResult AclData::lookup(const std::string& id, const Action& action, const Obj << " with routing key " << RoutingKey); AclResult aclresult = decisionMode; - - if (!actionList[action].empty() && !actionList[action][objType].empty()) { - AclData::ActObjItr itrRule = actionList[action][objType].find(id); + + if (actionList[action] && actionList[action][objType]){ + AclData::actObjItr itrRule = actionList[action][objType]->find(id); - if (itrRule == actionList[action][objType].end()) - itrRule = actionList[action][objType].find("*"); + if (itrRule == actionList[action][objType]->end()) + itrRule = actionList[action][objType]->find("*"); - if (itrRule != actionList[action][objType].end() ) { + if (itrRule != actionList[action][objType]->end() ) { QPID_LOG(debug, "ACL: checking the following rules for : " << itrRule->first ); //loop the vector - for (RuleSetItr i=itrRule->second.begin(); i<itrRule->second.end(); i++) { + for (ruleSetItr i=itrRule->second.begin(); i<itrRule->second.end(); i++) { QPID_LOG(debug, "ACL: checking rule " << i->toString()); // loop the names looking for match bool match =true; - for (PropertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++) + for (propertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++) { //match name is exists first if (pMItr->first == acl::PROP_NAME){ |
