apparmor.d/apparmor.d/profiles-s-z/switcheroo-control
2023-12-04 18:52:10 +00:00

38 lines
1,006 B
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/switcheroo-control
profile switcheroo-control @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/dbus-strict>
capability sys_nice,
network netlink raw,
dbus bind bus=system name=net.hadess.SwitcherooControl,
dbus receive bus=system path=/net/hadess/SwitcherooControl
interface=org.freedesktop.DBus.Properties
member=GetAll
peer=(name=:*),
@{exec_path} mr,
@{run}/udev/data/+drm:card[0-9]-* r, # for screen outputs
@{run}/udev/data/+pci:* r,
@{run}/udev/data/c226:@{int} r, # for /dev/dri/card*
@{sys}/bus/ r,
@{sys}/class/ r,
@{sys}/class/drm/ r,
@{sys}/devices/pci[0-9]*/**/boot_vga r,
@{sys}/devices/{pci[0-9]*,virtual}/**/uevent r,
include if exists <local/switcheroo-control>
}