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/AclReader.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/AclReader.cpp')
| -rw-r--r-- | cpp/src/qpid/acl/AclReader.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/cpp/src/qpid/acl/AclReader.cpp b/cpp/src/qpid/acl/AclReader.cpp index 966e69d9f5..2f59f4453f 100644 --- a/cpp/src/qpid/acl/AclReader.cpp +++ b/cpp/src/qpid/acl/AclReader.cpp @@ -101,7 +101,7 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) { << AclHelper::getAclResultStr(d->decisionMode)); foundmode = true; } else { - AclData::Rule rule((*i)->props); + AclData::rule rule((*i)->props); bool addrule = true; switch ((*i)->res) { @@ -138,15 +138,17 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) { acnt < acl::ACTIONSIZE; (*i)->actionAll ? acnt++ : acnt = acl::ACTIONSIZE) { - if (acnt == acl::ACT_PUBLISH) { + if (acnt == acl::ACT_PUBLISH) d->transferAcl = true; // we have transfer ACL - QPID_LOG(debug, "Transfer ACL enabled !"); - } - + actionstr << AclHelper::getActionStr((Action) acnt) << ","; - if (d->actionList[acnt].empty()){ - d->actionList[acnt] = AclData::AclAction(qpid::acl::OBJECTSIZE); + //find the Action, create if not exist + if (d->actionList[acnt] == NULL) { + d->actionList[acnt] = + new AclData::aclAction[qpid::acl::OBJECTSIZE]; + for (int j = 0; j < qpid::acl::OBJECTSIZE; j++) + d->actionList[acnt][j] = NULL; } // optimize this loop to limit to valid options only!! @@ -155,6 +157,11 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) { ocnt < acl::OBJECTSIZE; (*i)->objStatus != aclRule::VALUE ? ocnt++ : ocnt = acl::OBJECTSIZE) { + //find the Object, create if not exist + if (d->actionList[acnt][ocnt] == NULL) + d->actionList[acnt][ocnt] = + new AclData::actionObject; + // add users and Rule to object set bool allNames = false; // check to see if names.begin is '*' @@ -166,13 +173,13 @@ void AclReader::loadDecisionData(boost::shared_ptr<AclData> d) { itr != (allNames ? names.end() : (*i)->names.end()); itr++) { - AclData::ActObjItr itrRule = - d->actionList[acnt][ocnt].find(*itr); + AclData::actObjItr itrRule = + d->actionList[acnt][ocnt]->find(*itr); - if (itrRule == d->actionList[acnt][ocnt].end()) { - AclData::RuleSet rSet; + if (itrRule == d->actionList[acnt][ocnt]->end()) { + AclData::ruleSet rSet; rSet.push_back(rule); - d->actionList[acnt][ocnt].insert + d->actionList[acnt][ocnt]->insert (make_pair(std::string(*itr), rSet)); } else { // TODO add code to check for dead rules |
