-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathallow_usb_device_rule.h
28 lines (20 loc) · 992 Bytes
/
allow_usb_device_rule.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PERMISSION_BROKER_ALLOW_USB_DEVICE_RULE_H_
#define PERMISSION_BROKER_ALLOW_USB_DEVICE_RULE_H_
#include "permission_broker/usb_subsystem_udev_rule.h"
namespace permission_broker {
// AllowUsbDeviceRule encapsulates the policy that USB devices are allowed to be
// accessed. Any path passed to it that is owned by a device on the USB
// subsystem is |ALLOW|ed. All other paths are ignored.
class AllowUsbDeviceRule : public UsbSubsystemUdevRule {
public:
AllowUsbDeviceRule();
AllowUsbDeviceRule(const AllowUsbDeviceRule&) = delete;
AllowUsbDeviceRule& operator=(const AllowUsbDeviceRule&) = delete;
~AllowUsbDeviceRule() override = default;
Result ProcessUsbDevice(struct udev_device* device) override;
};
} // namespace permission_broker
#endif // PERMISSION_BROKER_ALLOW_USB_DEVICE_RULE_H_