#include <RootGuardClient.hpp>
Classes | |
| struct | Request |
Public Member Functions | |
| Client () | |
| ~Client () | |
| Client (const Client &)=delete | |
| Client & | operator= (const Client &)=delete |
| sigc::signal< void(const Snapshot &)> & | signal_updated () noexcept |
| void | refresh () |
| void | start_service () |
| void | stop_service () |
| void | reload_policy () |
| void | restart_service () |
| void | set_immediate_protection (bool enabled) |
| void | restore_event (const Event &event) |
| void | remove_event (const Event &event) |
| void | save_application_rules (ApplicationRules rules) |
Private Types | |
| enum class | Action { Refresh , Start , Stop , Reload , Restart , SetProtection , Restore , Remove , SaveApplicationRules , Quit } |
Private Member Functions | |
| void | enqueue (Request request) |
| void | worker_loop () |
| void | on_dispatch () |
| Snapshot | collect_snapshot (const std::string &operation_message, bool operation_success) const |
| bool | run_request (const Request &request, std::string &message) const |
Private Attributes | |
| Glib::Dispatcher | dispatcher_ |
| sigc::signal< void(const Snapshot &)> | signal_updated_ |
| std::mutex | mutex_ |
| std::condition_variable | condition_ |
| std::deque< Request > | requests_ |
| Snapshot | pending_snapshot_ |
| bool | snapshot_ready_ {} |
| bool | stopping_ {} |
| std::thread | worker_ |
Definition at line 51 of file RootGuardClient.hpp.
|
strongprivate |
| Enumerator | |
|---|---|
| Refresh | |
| Start | |
| Stop | |
| Reload | |
| Restart | |
| SetProtection | |
| Restore | |
| Remove | |
| SaveApplicationRules | |
| Quit | |
Definition at line 72 of file RootGuardClient.hpp.
| BastionGuard::RootGuard::Client::Client | ( | ) |
Definition at line 298 of file RootGuardClient.cpp.
References dispatcher_, on_dispatch(), worker_, and worker_loop().
Referenced by Client(), and operator=().
| BastionGuard::RootGuard::Client::~Client | ( | ) |
Definition at line 304 of file RootGuardClient.cpp.
References condition_, mutex_, Quit, requests_, stopping_, and worker_.
|
delete |
References Client().
|
private |
Definition at line 363 of file RootGuardClient.cpp.
References BASTIONGUARD_ROOTGUARD_SERVICE_HELPER, and BastionGuard::RootGuard::Snapshot::service.
Referenced by worker_loop().
|
private |
Definition at line 345 of file RootGuardClient.cpp.
References BastionGuard::RootGuard::Client::Request::action, condition_, mutex_, Refresh, requests_, and stopping_.
Referenced by refresh(), reload_policy(), remove_event(), restart_service(), restore_event(), save_application_rules(), set_immediate_protection(), start_service(), and stop_service().
|
private |
Definition at line 537 of file RootGuardClient.cpp.
References mutex_, pending_snapshot_, signal_updated_, and snapshot_ready_.
Referenced by Client().
| void BastionGuard::RootGuard::Client::refresh | ( | ) |
Definition at line 322 of file RootGuardClient.cpp.
References enqueue(), and Refresh.
Referenced by RootGuardPage::dismiss_event(), RootGuardPage::on_auto_refresh(), operator=(), and RootGuardPage::RootGuardPage().
| void BastionGuard::RootGuard::Client::reload_policy | ( | ) |
Definition at line 325 of file RootGuardClient.cpp.
References enqueue(), and Reload.
Referenced by operator=(), and RootGuardPage::RootGuardPage().
| void BastionGuard::RootGuard::Client::remove_event | ( | const Event & | event | ) |
Definition at line 335 of file RootGuardClient.cpp.
References enqueue(), and Remove.
Referenced by operator=(), and RootGuardPage::remove_event().
| void BastionGuard::RootGuard::Client::restart_service | ( | ) |
Definition at line 326 of file RootGuardClient.cpp.
References enqueue(), and Restart.
Referenced by operator=(), and RootGuardPage::RootGuardPage().
| void BastionGuard::RootGuard::Client::restore_event | ( | const Event & | event | ) |
Definition at line 331 of file RootGuardClient.cpp.
References enqueue(), and Restore.
Referenced by operator=(), and RootGuardPage::restore_event().
|
private |
Definition at line 381 of file RootGuardClient.cpp.
References BastionGuard::RootGuard::Client::Request::action, BastionGuard::RootGuard::Client::Request::application_rules, BASTIONGUARD_PKEXEC, BASTIONGUARD_ROOTGUARD_ACTION_HELPER, BASTIONGUARD_ROOTGUARD_SERVICE_HELPER, BastionGuard::RootGuard::ApplicationRules::deniedExecutables, BastionGuard::RootGuard::Client::Request::enabled, BastionGuard::RootGuard::Client::Request::event, BastionGuard::RootGuard::is_system_service_path(), Refresh, Reload, Remove, Restart, Restore, SaveApplicationRules, SetProtection, Start, Stop, BastionGuard::RootGuard::ApplicationRules::trustedApplications, and BastionGuard::RootGuard::ApplicationRules::trustedExecutables.
Referenced by worker_loop().
| void BastionGuard::RootGuard::Client::save_application_rules | ( | ApplicationRules | rules | ) |
Definition at line 339 of file RootGuardClient.cpp.
References enqueue(), and SaveApplicationRules.
Referenced by operator=(), and RootGuardPage::save_application_rules().
| void BastionGuard::RootGuard::Client::set_immediate_protection | ( | bool | enabled | ) |
Definition at line 327 of file RootGuardClient.cpp.
References enqueue(), and SetProtection.
Referenced by RootGuardPage::on_protection_toggled(), and operator=().
|
noexcept |
Definition at line 317 of file RootGuardClient.cpp.
References signal_updated_.
Referenced by operator=(), and RootGuardPage::RootGuardPage().
| void BastionGuard::RootGuard::Client::start_service | ( | ) |
Definition at line 323 of file RootGuardClient.cpp.
References enqueue(), and Start.
Referenced by operator=(), and RootGuardPage::RootGuardPage().
| void BastionGuard::RootGuard::Client::stop_service | ( | ) |
Definition at line 324 of file RootGuardClient.cpp.
References enqueue(), and Stop.
Referenced by operator=(), and RootGuardPage::RootGuardPage().
|
private |
Definition at line 511 of file RootGuardClient.cpp.
References BastionGuard::RootGuard::Client::Request::action, collect_snapshot(), condition_, dispatcher_, mutex_, pending_snapshot_, Quit, requests_, run_request(), and snapshot_ready_.
Referenced by Client().
|
private |
Definition at line 103 of file RootGuardClient.hpp.
Referenced by enqueue(), worker_loop(), and ~Client().
|
private |
Definition at line 99 of file RootGuardClient.hpp.
Referenced by Client(), and worker_loop().
|
mutableprivate |
Definition at line 102 of file RootGuardClient.hpp.
Referenced by enqueue(), on_dispatch(), worker_loop(), and ~Client().
|
private |
Definition at line 105 of file RootGuardClient.hpp.
Referenced by on_dispatch(), and worker_loop().
|
private |
Definition at line 104 of file RootGuardClient.hpp.
Referenced by enqueue(), worker_loop(), and ~Client().
|
private |
Definition at line 100 of file RootGuardClient.hpp.
Referenced by on_dispatch(), and signal_updated().
|
private |
Definition at line 106 of file RootGuardClient.hpp.
Referenced by on_dispatch(), and worker_loop().
|
private |
Definition at line 107 of file RootGuardClient.hpp.
|
private |
Definition at line 108 of file RootGuardClient.hpp.