feat(abs): move some dbus abs to the session subfolder.

This commit is contained in:
Alexandre Pujol 2025-08-24 21:47:00 +02:00
parent d6885803cb
commit eb2def65a1
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
11 changed files with 35 additions and 24 deletions

View file

@ -20,6 +20,6 @@
member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials} member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials}
peer=(name=org.freedesktop.DBus, label="@{p_dbus_accessibility}"), peer=(name=org.freedesktop.DBus, label="@{p_dbus_accessibility}"),
include if exists <abstractions/bus/own-accessibility.d> include if exists <abstractions/bus/accessibility/own.d>
# vim:syntax=apparmor # vim:syntax=apparmor

View file

@ -1,16 +0,0 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/4.0>,
#aa:dbus common bus=session name=org.freedesktop.systemd1 label="@{p_systemd_user}"
dbus send bus=session path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd1.Manager
member=GetUnit
peer=(name="{@{busname},org.freedesktop.systemd1}", label="@{p_systemd_user}"),
include if exists <abstractions/bus/org.freedesktop.systemd1-session.d>
# vim:syntax=apparmor

View file

@ -0,0 +1,26 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023-2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/4.0>,
#aa:dbus common bus=session name=org.freedesktop.systemd1 label="@{p_systemd_user}"
dbus send bus=session path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd1.Manager
member=GetUnit
peer=(name="{@{busname},org.freedesktop.systemd1}", label="@{p_systemd_user}"),
dbus send bus=session path=/org/freedesktop/systemd1/unit/app_*
interface=org.freedesktop.DBus.Properties
member=GetAll
peer=(name=org.freedesktop.systemd1, label="@{p_systemd_user}"),
dbus send bus=session path=/org/freedesktop/systemd1
interface=org.freedesktop.systemd1.Manager
member=StartTransientUnit
peer=(name=org.freedesktop.systemd1, label="@{p_systemd_user}"),
include if exists <abstractions/bus/session/org.freedesktop.systemd1.d>
# vim:syntax=apparmor

View file

@ -20,6 +20,6 @@
member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials} member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials}
peer=(name=org.freedesktop.DBus, label="@{p_dbus_session}"), peer=(name=org.freedesktop.DBus, label="@{p_dbus_session}"),
include if exists <abstractions/bus/own-session.d> include if exists <abstractions/bus/session/own.d>
# vim:syntax=apparmor # vim:syntax=apparmor

View file

@ -20,6 +20,6 @@
member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials} member={GetConnectionUnixProcessID,GetConnectionUnixUser,GetConnectionCredentials}
peer=(name=org.freedesktop.DBus, label="@{p_dbus_system}"), peer=(name=org.freedesktop.DBus, label="@{p_dbus_system}"),
include if exists <abstractions/bus/own-system.d> include if exists <abstractions/bus/system/own.d>
# vim:syntax=apparmor # vim:syntax=apparmor

View file

@ -11,8 +11,8 @@ profile gdm-session @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/bus-session> include <abstractions/bus-session>
include <abstractions/bus-system> include <abstractions/bus-system>
include <abstractions/bus/org.freedesktop.systemd1-session>
include <abstractions/bus/org.gnome.DisplayManager> include <abstractions/bus/org.gnome.DisplayManager>
include <abstractions/bus/session/org.freedesktop.systemd1>
signal (receive) set=(hup term) peer=gdm-session-worker, signal (receive) set=(hup term) peer=gdm-session-worker,
signal (receive) set=(term) peer=gdm, signal (receive) set=(term) peer=gdm,

View file

@ -14,7 +14,7 @@ profile gnome-session-binary @{exec_path} flags=(attach_disconnected) {
include <abstractions/bus-system> include <abstractions/bus-system>
include <abstractions/bus/org.a11y> include <abstractions/bus/org.a11y>
include <abstractions/bus/org.freedesktop.login1.Session> include <abstractions/bus/org.freedesktop.login1.Session>
include <abstractions/bus/org.freedesktop.systemd1-session> include <abstractions/bus/session/org.freedesktop.systemd1>
include <abstractions/bus/org.gnome.Mutter.IdleMonitor> include <abstractions/bus/org.gnome.Mutter.IdleMonitor>
include <abstractions/bus/org.gnome.ScreenSaver> include <abstractions/bus/org.gnome.ScreenSaver>
include <abstractions/dconf-write> include <abstractions/dconf-write>

View file

@ -11,7 +11,7 @@ profile gsd-housekeeping @{exec_path} flags=(attach_disconnected) {
include <abstractions/base> include <abstractions/base>
include <abstractions/app-launcher-user> include <abstractions/app-launcher-user>
include <abstractions/bus-session> include <abstractions/bus-session>
include <abstractions/bus/org.freedesktop.systemd1-session> include <abstractions/bus/session/org.freedesktop.systemd1>
include <abstractions/bus/org.gnome.SessionManager> include <abstractions/bus/org.gnome.SessionManager>
include <abstractions/bus/org.gtk.vfs.MountTracker> include <abstractions/bus/org.gtk.vfs.MountTracker>
include <abstractions/consoles> include <abstractions/consoles>

View file

@ -10,7 +10,7 @@ include <tunables/global>
profile kcminit @{exec_path} { profile kcminit @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/bus-session> include <abstractions/bus-session>
include <abstractions/bus/org.freedesktop.systemd1-session> include <abstractions/bus/session/org.freedesktop.systemd1>
include <abstractions/gtk> include <abstractions/gtk>
include <abstractions/kde-strict> include <abstractions/kde-strict>

View file

@ -25,6 +25,7 @@ profile spotify @{exec_path} flags=(attach_disconnected) {
include <abstractions/bus/org.freedesktop.secrets> include <abstractions/bus/org.freedesktop.secrets>
include <abstractions/bus/org.gtk.vfs.MountTracker> include <abstractions/bus/org.gtk.vfs.MountTracker>
include <abstractions/bus/org.kde.StatusNotifierWatcher> include <abstractions/bus/org.kde.StatusNotifierWatcher>
include <abstractions/bus/session/org.freedesktop.systemd1>
include <abstractions/common/electron> include <abstractions/common/electron>
include <abstractions/devices-usb-read> include <abstractions/devices-usb-read>

View file

@ -111,7 +111,7 @@ func (d Dbus) own(rules map[string]string) aa.Rules {
res := aa.Rules{ res := aa.Rules{
&aa.Include{ &aa.Include{
IsMagic: true, Path: "abstractions/bus/own-" + rules["bus"], IsMagic: true, Path: "abstractions/bus/" + rules["bus"] + "/own",
}, },
&aa.Dbus{ &aa.Dbus{
Access: []string{"bind"}, Bus: rules["bus"], Name: rules["name"], Access: []string{"bind"}, Bus: rules["bus"], Name: rules["name"],