-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathallow_tty_device_rule.h
28 lines (20 loc) · 982 Bytes
/
allow_tty_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 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_ALLOW_TTY_DEVICE_RULE_H_
#define PERMISSION_BROKER_ALLOW_TTY_DEVICE_RULE_H_
#include "permission_broker/tty_subsystem_udev_rule.h"
namespace permission_broker {
// AllowTtyDeviceRule encapsulates the policy that TTY devices are allowed to be
// accessed. Any path passed to it that is owned by a device on the TTY
// subsystem is |ALLOW|'ed. All other paths are ignored.
class AllowTtyDeviceRule : public TtySubsystemUdevRule {
public:
AllowTtyDeviceRule();
AllowTtyDeviceRule(const AllowTtyDeviceRule&) = delete;
AllowTtyDeviceRule& operator=(const AllowTtyDeviceRule&) = delete;
~AllowTtyDeviceRule() override = default;
Result ProcessTtyDevice(udev_device* device) override;
};
} // namespace permission_broker
#endif // PERMISSION_BROKER_ALLOW_TTY_DEVICE_RULE_H_