| 1666 | } |
| 1667 | |
| 1668 | void |
| 1669 | AccessControlBuiltInImpl::RevokePermissions::process() |
| 1670 | { |
| 1671 | ACE_GUARD(ACE_Thread_Mutex, guard, lock_); |
| 1672 | |
| 1673 | const time_t current_date_time = time(0); |
| 1674 | tm* current_time_tm = gmtime(¤t_date_time); |
| 1675 | const time_t cur_utc_time = mktime(current_time_tm); |
| 1676 | |
| 1677 | for (ExpirationToHandle::iterator pos = expiration_to_handle_.begin(), limit = expiration_to_handle_.end(); |
| 1678 | pos != limit && pos->first < cur_utc_time;) { |
| 1679 | const ::DDS::Security::PermissionsHandle pm_handle = pos->second; |
| 1680 | ACPermsMap::iterator iter = impl_.local_ac_perms_.find(pm_handle); |
| 1681 | if (iter == impl_.local_ac_perms_.end()) { |
| 1682 | ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) AccessControlBuiltInImpl::RevokePermissions::process: ") |
| 1683 | ACE_TEXT("pm_handle %d not found!\n"), pm_handle)); |
| 1684 | } |
| 1685 | impl_.local_ac_perms_.erase(iter); |
| 1686 | if (DCPS::security_debug.bookkeeping) { |
| 1687 | ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {bookkeeping} ") |
| 1688 | ACE_TEXT("AccessControlBuiltInImpl::RevokePermissions::process local_ac_perms_ (total %B)\n"), |
| 1689 | impl_.local_ac_perms_.size())); |
| 1690 | } |
| 1691 | |
| 1692 | // If a listener exists, call on_revoke_permissions |
| 1693 | if (impl_.listener_ptr_ && !impl_.listener_ptr_->on_revoke_permissions(&impl_, pm_handle)) { |
| 1694 | ACE_DEBUG((LM_ERROR, ACE_TEXT("(%P|%t) AccessControlBuiltInImpl::RevokePermissions::process: ") |
| 1695 | ACE_TEXT("on_revoke_permissions failed for pm_handle %d!\n"), pm_handle)); |
| 1696 | } |
| 1697 | |
| 1698 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 1699 | ACE_DEBUG((LM_DEBUG, |
| 1700 | ACE_TEXT("(%P|%t) AccessControlBuiltInImpl::RevokePermissions::process: Completed...\n"))); |
| 1701 | } |
| 1702 | |
| 1703 | handle_to_expiration_.erase(pm_handle); |
| 1704 | if (DCPS::security_debug.bookkeeping) { |
| 1705 | ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {bookkeeping} ") |
| 1706 | ACE_TEXT("AccessControlBuiltInImpl::RevokePermissions::process handle_to_expiration_ (total %B)\n"), |
| 1707 | handle_to_expiration_.size())); |
| 1708 | } |
| 1709 | |
| 1710 | expiration_to_handle_.erase(pos++); |
| 1711 | if (DCPS::security_debug.bookkeeping) { |
| 1712 | ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {bookkeeping} ") |
| 1713 | ACE_TEXT("AccessControlBuiltInImpl::RevokePermissions::process expiration_to_handle_ (total %B)\n"), |
| 1714 | expiration_to_handle_.size())); |
| 1715 | } |
| 1716 | } |
| 1717 | |
| 1718 | if (!expiration_to_handle_.empty()) { |
| 1719 | const TimeDuration duration = std::min(TimeDuration(expiration_to_handle_.begin()->first - cur_utc_time), MAX_DURATION); |
| 1720 | revokation_event_->schedule(duration); |
| 1721 | } |
| 1722 | } |
| 1723 | |
| 1724 | SSL::SubjectName |
| 1725 | AccessControlBuiltInImpl::get_subject_name(DDS::Security::PermissionsHandle permissions_handle) const |