MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3-linux / AuthorizationRejected

Method AuthorizationRejected

src/sessionmgr/sessionmgr-session.cpp:614–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

612}
613
614const std::string Session::AuthorizationRejected(const Authz::Request::Ptr azreq) const noexcept
615{
616 if (!be_prx || !be_target)
617 {
618 return "Access denied: Session no longer valid";
619 }
620
621 try
622 {
623 if (DBus::Object::Operation::PROPERTY_GET != azreq->operation)
624 {
625 // Don't log rejected property gets; they are not much useful
626 // and just adds lots of log noise
627 std::ostringstream errmsg;
628 errmsg << "Access denied to "
629 << (DBus::Object::Operation::METHOD_CALL == azreq->operation
630 ? "method"
631 : "property")
632 << " " << azreq->target << " on " << azreq->object_path
633 << " (caller: " << azreq->caller << ", user: "
634 << lookup_username(creds_qry->GetUID(azreq->caller))
635 << ", caller pid: "
636 << creds_qry->GetPID(azreq->caller) << ")";
637 sig_session->LogCritical(errmsg.str());
638 }
639 }
640 catch (...)
641 {
642 std::cerr << "EXCEPTION: "
643 << "Access denied:" << azreq << std::endl;
644 }
645 return "Access denied";
646}
647
648
649void Session::SetConfigName(const std::string &cfgname)

Callers

nothing calls this directly

Calls 3

lookup_usernameFunction · 0.85
LogCriticalMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected