diff options
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 |
