2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2018-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of version 2 of the GNU General Public
|
|
|
|
# License published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/xdg-mime
|
|
|
|
profile xdg-mime @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/freedesktop.org>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} r,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
|
|
/{usr/,}bin/gawk rix,
|
|
|
|
/{usr/,}bin/cut rix,
|
|
|
|
/{usr/,}bin/basename rix,
|
|
|
|
/{usr/,}bin/{,e}grep rix,
|
|
|
|
/{usr/,}bin/which rix,
|
|
|
|
/{usr/,}bin/readlink rix,
|
|
|
|
/{usr/,}bin/mv rix,
|
|
|
|
/{usr/,}bin/head rix,
|
|
|
|
/{usr/,}bin/sed rix,
|
|
|
|
/{usr/,}bin/uname rix,
|
|
|
|
/{usr/,}bin/file rix,
|
|
|
|
|
|
|
|
/{usr/,}bin/mimetype rPx,
|
|
|
|
/{usr/,}bin/xprop rPx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# When xdg-mime is run as root, it wants to exec dbus-launch, and hence it creates the two
|
|
|
|
# following root processes:
|
|
|
|
# dbus-launch --autolaunch e0a30ad97cd6421c85247839ccef9db2 --binary-syntax --close-stderr
|
|
|
|
# /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
|
|
|
|
#
|
|
|
|
# Should this be allowed? Xdg-mime works fine without this.
|
|
|
|
#/{usr/,}bin/dbus-launch rCx -> dbus,
|
|
|
|
#/{usr/,}bin/dbus-send rCx -> dbus,
|
|
|
|
deny /{usr/,}bin/dbus-launch rx,
|
|
|
|
deny /{usr/,}bin/dbus-send rx,
|
|
|
|
|
|
|
|
owner @{HOME}/.config/mimeapps.list{,.new} rw,
|
|
|
|
|
|
|
|
owner @{HOME}/.Xauthority r,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
owner @{run}/user/[0-9]*/ r,
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
# For shell pwd
|
|
|
|
owner @{HOME}/ r,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
# file_inherit
|
|
|
|
/media/** rw,
|
|
|
|
|
|
|
|
|
2021-03-14 18:57:00 +01:00
|
|
|
profile dbus {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/dbus-launch mr,
|
|
|
|
/{usr/,}bin/dbus-send mr,
|
|
|
|
/{usr/,}bin/dbus-daemon rPUx,
|
|
|
|
|
|
|
|
# for dbus-launch
|
|
|
|
owner @{HOME}/.dbus/session-bus/[0-9a-f]*-[0-9] w,
|
|
|
|
|
|
|
|
@{HOME}/.Xauthority r,
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/xdg-mime>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|