21 #include "DeviceManager.hpp" 22 #include "Interface.hpp" 24 #include "Typedefs.hpp" 29 #include <unordered_map> 36 #include <sys/types.h> 40 class IPCServerPrivate;
60 static void checkAccessControlName(
const std::string& name);
110 static Section sectionFromString(
const std::string& section_string);
120 static std::string sectionToString(
const Section section);
141 static Privilege privilegeFromString(
const std::string& privilege_string);
151 static std::string privilegeToString(
const Privilege privilege);
203 bool hasPrivilege(Section section, Privilege privilege)
const;
212 void setPrivilege(Section section, Privilege privilege);
232 void load(std::istream& stream);
243 void save(std::ostream& stream)
const;
259 void merge(
const std::string& access_control_string);
274 std::size_t operator()(Section value)
const 276 return static_cast<std::size_t>(value);
286 std::unordered_map<Section, uint8_t, SectionHash> _access_control;
297 virtual ~IPCServer();
312 void DevicePresenceChanged(uint32_t
id,
315 const std::string& device_rule);
320 void DevicePolicyChanged(uint32_t
id,
323 const std::string& device_rule,
329 void PropertyParameterChanged(
const std::string& name,
330 const std::string& value_old,
331 const std::string& value_new);
336 void ExceptionMessage(
const std::string& context,
337 const std::string&
object,
338 const std::string& reason);
346 void addAllowedUID(uid_t uid,
const IPCServer::AccessControl& ac);
354 void addAllowedGID(gid_t gid,
const IPCServer::AccessControl& ac);
362 void addAllowedUsername(
const std::string& username,
const IPCServer::AccessControl& ac);
371 void addAllowedGroupname(
const std::string& groupname,
const IPCServer::AccessControl& ac);
374 std::unique_ptr<IPCServerPrivate> d_pointer;
Target
Enumeration of possible rule targets.
Definition: Rule.hpp:86
Receives messages from IPC clients. Provides USBGuard service.
Definition: IPCServer.hpp:46
Privilege
Possible privileges and their hexadecimal values.
Definition: IPCServer.hpp:125
Section
Possible sections for which privileges can be specified.
Definition: IPCServer.hpp:93
Limits access to the USBGuard IPC interface.
Definition: IPCServer.hpp:86
EventType
Type of event that took place on the device.
Definition: DeviceManager.hpp:51
Allows to receive signals and to communicate with the USBGuard daemon.
Definition: Interface.hpp:40