-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdeny_claimed_hidraw_device_rule.h
More file actions
38 lines (28 loc) · 1.34 KB
/
deny_claimed_hidraw_device_rule.h
File metadata and controls
38 lines (28 loc) · 1.34 KB
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
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 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_DENY_CLAIMED_HIDRAW_DEVICE_RULE_H_
#define PERMISSION_BROKER_DENY_CLAIMED_HIDRAW_DEVICE_RULE_H_
#include "permission_broker/hidraw_subsystem_udev_rule.h"
namespace permission_broker {
// DenyClaimedHidrawDeviceRule encapsulates the policy that a HID device can
// only be accessed through the hidraw subsystem when no other device subsystems
// (apart from HID and USB themselves) are using the device.
class DenyClaimedHidrawDeviceRule : public HidrawSubsystemUdevRule {
public:
DenyClaimedHidrawDeviceRule();
~DenyClaimedHidrawDeviceRule() override = default;
Result ProcessHidrawDevice(struct udev_device *device) override;
// Indicates if a hidraw device should be inaccessible given the subsystem
// identifier of one of its siblings.
static bool ShouldSiblingSubsystemExcludeHidAccess(
struct udev_device* sibling);
static bool ShouldInputCapabilitiesExcludeHidAccess(
const char* abs_capabilities,
const char* rel_capabilities,
const char* key_capabilities);
private:
DISALLOW_COPY_AND_ASSIGN(DenyClaimedHidrawDeviceRule);
};
} // namespace permission_broker
#endif // PERMISSION_BROKER_DENY_CLAIMED_HIDRAW_DEVICE_RULE_H_