From 799b7784806b0c274dfc8991ce6fd61286f1724c Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Wed, 6 Dec 2023 19:19:55 +0000 Subject: [PATCH] feat(dbus): rename all new dbus abstractions. Use the dbus name as abstraction name. --- .../{wpa-supplicant => fi.w1.wpa_supplicant1} | 2 +- apparmor.d/abstractions/bus/login-session | 15 ---------- .../abstractions/bus/{atspi => org.a11y} | 8 +++-- .../abstractions/bus/{bluetooth => org.bluez} | 2 +- ...ccount-daemon => org.freedesktop.Accounts} | 2 +- .../bus/{avahi => org.freedesktop.Avahi} | 2 +- ...-manager => org.freedesktop.ModemManager1} | 2 +- ...manager => org.freedesktop.NetworkManager} | 7 ++++- ...fication => org.freedesktop.Notifications} | 2 +- .../{polkit => org.freedesktop.PolicyKit1} | 2 +- .../{rtkit => org.freedesktop.RealtimeKit1} | 2 +- .../bus/{udisk => org.freedesktop.UDisks2} | 2 +- .../bus/{upower => org.freedesktop.UPower} | 2 +- .../{hostname => org.freedesktop.hostname1} | 2 +- .../bus/{locale => org.freedesktop.locale1} | 2 +- .../bus/{login => org.freedesktop.login1} | 2 +- .../bus/org.freedesktop.login1.Session | 30 +++++++++++++++++++ ...desktop => org.freedesktop.portal.Desktop} | 3 +- .../abstractions/bus/org.freedesktop.systemd1 | 20 +++++++++++++ ...ssion => org.freedesktop.systemd1-session} | 2 +- .../{timedate => org.freedesktop.timedate1} | 2 +- ...nome-screensaver => org.gnome.ScreenSaver} | 2 +- ...ssion-manager => org.gnome.SessionManager} | 2 +- .../bus/{vfs/daemon => org.gtk.vfs.Daemon} | 4 +-- .../{vfs/metadata => org.gtk.vfs.Metadata} | 2 +- .../{vfs/mount => org.gtk.vfs.MountTracker} | 2 +- apparmor.d/abstractions/bus/systemd | 10 ------- 27 files changed, 84 insertions(+), 51 deletions(-) rename apparmor.d/abstractions/bus/{wpa-supplicant => fi.w1.wpa_supplicant1} (84%) delete mode 100644 apparmor.d/abstractions/bus/login-session rename apparmor.d/abstractions/bus/{atspi => org.a11y} (88%) rename apparmor.d/abstractions/bus/{bluetooth => org.bluez} (86%) rename apparmor.d/abstractions/bus/{account-daemon => org.freedesktop.Accounts} (92%) rename apparmor.d/abstractions/bus/{avahi => org.freedesktop.Avahi} (93%) rename apparmor.d/abstractions/bus/{modem-manager => org.freedesktop.ModemManager1} (87%) rename apparmor.d/abstractions/bus/{network-manager => org.freedesktop.NetworkManager} (81%) rename apparmor.d/abstractions/bus/{notification => org.freedesktop.Notifications} (81%) rename apparmor.d/abstractions/bus/{polkit => org.freedesktop.PolicyKit1} (93%) rename apparmor.d/abstractions/bus/{rtkit => org.freedesktop.RealtimeKit1} (90%) rename apparmor.d/abstractions/bus/{udisk => org.freedesktop.UDisks2} (92%) rename apparmor.d/abstractions/bus/{upower => org.freedesktop.UPower} (93%) rename apparmor.d/abstractions/bus/{hostname => org.freedesktop.hostname1} (88%) rename apparmor.d/abstractions/bus/{locale => org.freedesktop.locale1} (82%) rename apparmor.d/abstractions/bus/{login => org.freedesktop.login1} (93%) create mode 100644 apparmor.d/abstractions/bus/org.freedesktop.login1.Session rename apparmor.d/abstractions/bus/{desktop => org.freedesktop.portal.Desktop} (92%) create mode 100644 apparmor.d/abstractions/bus/org.freedesktop.systemd1 rename apparmor.d/abstractions/bus/{systemd-session => org.freedesktop.systemd1-session} (88%) rename apparmor.d/abstractions/bus/{timedate => org.freedesktop.timedate1} (82%) rename apparmor.d/abstractions/bus/{gnome-screensaver => org.gnome.ScreenSaver} (91%) rename apparmor.d/abstractions/bus/{session-manager => org.gnome.SessionManager} (96%) rename apparmor.d/abstractions/bus/{vfs/daemon => org.gtk.vfs.Daemon} (66%) rename apparmor.d/abstractions/bus/{vfs/metadata => org.gtk.vfs.Metadata} (88%) rename apparmor.d/abstractions/bus/{vfs/mount => org.gtk.vfs.MountTracker} (90%) delete mode 100644 apparmor.d/abstractions/bus/systemd diff --git a/apparmor.d/abstractions/bus/wpa-supplicant b/apparmor.d/abstractions/bus/fi.w1.wpa_supplicant1 similarity index 84% rename from apparmor.d/abstractions/bus/wpa-supplicant rename to apparmor.d/abstractions/bus/fi.w1.wpa_supplicant1 index fd82848c..6e84a87b 100644 --- a/apparmor.d/abstractions/bus/wpa-supplicant +++ b/apparmor.d/abstractions/bus/fi.w1.wpa_supplicant1 @@ -7,4 +7,4 @@ member={GetAll,PropertiesChanged} peer=(name=:*, label=wpa-supplicant), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/login-session b/apparmor.d/abstractions/bus/login-session deleted file mode 100644 index 50a94924..00000000 --- a/apparmor.d/abstractions/bus/login-session +++ /dev/null @@ -1,15 +0,0 @@ -# apparmor.d - Full set of apparmor profiles -# Copyright (C) 2023 Alexandre Pujol -# SPDX-License-Identifier: GPL-2.0-only - - dbus send bus=system path=/org/freedesktop/login1/session/auto - interface=org.freedesktop.DBus.Properties - member=GetAll - peer=(name=:*, label=systemd-logind), - - dbus send bus=system path=/org/freedesktop/login1/session/auto - interface=org.freedesktop.login1.Session - member=SetBrightness - peer=(name=:*, label=systemd-logind), - - include if exists diff --git a/apparmor.d/abstractions/bus/atspi b/apparmor.d/abstractions/bus/org.a11y similarity index 88% rename from apparmor.d/abstractions/bus/atspi rename to apparmor.d/abstractions/bus/org.a11y index 36eeefeb..f77012ce 100644 --- a/apparmor.d/abstractions/bus/atspi +++ b/apparmor.d/abstractions/bus/org.a11y @@ -29,7 +29,6 @@ member=Embed peer=(name=org.a11y.atspi.Registry, label=at-spi2-registryd), - # Session bus dbus send bus=session path=/org/a11y/bus @@ -37,4 +36,9 @@ member=GetAddress peer=(name=org.a11y.Bus, label="{at-spi-bus-launcher,dbus-daemon}"), - include if exists + dbus send bus=session path=/org/a11y/bus + interface=org.a11y.Bus + member=GetAddress + peer=(name=org.a11y.Bus), + + include if exists diff --git a/apparmor.d/abstractions/bus/bluetooth b/apparmor.d/abstractions/bus/org.bluez similarity index 86% rename from apparmor.d/abstractions/bus/bluetooth rename to apparmor.d/abstractions/bus/org.bluez index 0c10e954..dfe81812 100644 --- a/apparmor.d/abstractions/bus/bluetooth +++ b/apparmor.d/abstractions/bus/org.bluez @@ -7,4 +7,4 @@ member=PropertiesChanged peer=(name=:*, label=bluetoothd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/account-daemon b/apparmor.d/abstractions/bus/org.freedesktop.Accounts similarity index 92% rename from apparmor.d/abstractions/bus/account-daemon rename to apparmor.d/abstractions/bus/org.freedesktop.Accounts index 7ed63651..0b7930a6 100644 --- a/apparmor.d/abstractions/bus/account-daemon +++ b/apparmor.d/abstractions/bus/org.freedesktop.Accounts @@ -22,4 +22,4 @@ member=*Changed peer=(name=:*, label=accounts-daemon), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/avahi b/apparmor.d/abstractions/bus/org.freedesktop.Avahi similarity index 93% rename from apparmor.d/abstractions/bus/avahi rename to apparmor.d/abstractions/bus/org.freedesktop.Avahi index f5fb4c82..e84bb8fe 100644 --- a/apparmor.d/abstractions/bus/avahi +++ b/apparmor.d/abstractions/bus/org.freedesktop.Avahi @@ -22,4 +22,4 @@ member={ItemNew,AllForNow,CacheExhausted} peer=(name=:*, label=avahi-daemon), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/modem-manager b/apparmor.d/abstractions/bus/org.freedesktop.ModemManager1 similarity index 87% rename from apparmor.d/abstractions/bus/modem-manager rename to apparmor.d/abstractions/bus/org.freedesktop.ModemManager1 index 521251b5..69922b03 100644 --- a/apparmor.d/abstractions/bus/modem-manager +++ b/apparmor.d/abstractions/bus/org.freedesktop.ModemManager1 @@ -12,4 +12,4 @@ member=GetAll peer=(name=:*, label=ModemManager), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/network-manager b/apparmor.d/abstractions/bus/org.freedesktop.NetworkManager similarity index 81% rename from apparmor.d/abstractions/bus/network-manager rename to apparmor.d/abstractions/bus/org.freedesktop.NetworkManager index 5852f6be..529d01bb 100644 --- a/apparmor.d/abstractions/bus/network-manager +++ b/apparmor.d/abstractions/bus/org.freedesktop.NetworkManager @@ -32,4 +32,9 @@ member=CheckPermissions peer=(name=:*, label=NetworkManager), - include if exists + dbus receive bus=system path=/org/freedesktop/NetworkManager + interface=org.freedesktop.NetworkManager + member={DeviceAdded,DeviceRemoved,StateChanged} + peer=(name=:*, label=NetworkManager), + + include if exists diff --git a/apparmor.d/abstractions/bus/notification b/apparmor.d/abstractions/bus/org.freedesktop.Notifications similarity index 81% rename from apparmor.d/abstractions/bus/notification rename to apparmor.d/abstractions/bus/org.freedesktop.Notifications index f22661b8..74875991 100644 --- a/apparmor.d/abstractions/bus/notification +++ b/apparmor.d/abstractions/bus/org.freedesktop.Notifications @@ -7,4 +7,4 @@ member=GetAll peer=(name=:*, label=gjs-console), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/polkit b/apparmor.d/abstractions/bus/org.freedesktop.PolicyKit1 similarity index 93% rename from apparmor.d/abstractions/bus/polkit rename to apparmor.d/abstractions/bus/org.freedesktop.PolicyKit1 index e8544108..33860be2 100644 --- a/apparmor.d/abstractions/bus/polkit +++ b/apparmor.d/abstractions/bus/org.freedesktop.PolicyKit1 @@ -21,4 +21,4 @@ member=Changed peer=(name=:*, label=polkitd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/rtkit b/apparmor.d/abstractions/bus/org.freedesktop.RealtimeKit1 similarity index 90% rename from apparmor.d/abstractions/bus/rtkit rename to apparmor.d/abstractions/bus/org.freedesktop.RealtimeKit1 index cdfcd592..4f1d66f0 100644 --- a/apparmor.d/abstractions/bus/rtkit +++ b/apparmor.d/abstractions/bus/org.freedesktop.RealtimeKit1 @@ -17,4 +17,4 @@ member=MakeThread* peer=(name="{:*,org.freedesktop.RealtimeKit1}", label=rtkit-daemon), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/udisk b/apparmor.d/abstractions/bus/org.freedesktop.UDisks2 similarity index 92% rename from apparmor.d/abstractions/bus/udisk rename to apparmor.d/abstractions/bus/org.freedesktop.UDisks2 index c5b93375..c8a493b5 100644 --- a/apparmor.d/abstractions/bus/udisk +++ b/apparmor.d/abstractions/bus/org.freedesktop.UDisks2 @@ -22,4 +22,4 @@ member=Completed peer=(name=:*, label=udisksd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/upower b/apparmor.d/abstractions/bus/org.freedesktop.UPower similarity index 93% rename from apparmor.d/abstractions/bus/upower rename to apparmor.d/abstractions/bus/org.freedesktop.UPower index e9cc747a..ddf28c80 100644 --- a/apparmor.d/abstractions/bus/upower +++ b/apparmor.d/abstractions/bus/org.freedesktop.UPower @@ -21,4 +21,4 @@ member={Get,GetAll} peer=(name=:*, label=upowerd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/hostname b/apparmor.d/abstractions/bus/org.freedesktop.hostname1 similarity index 88% rename from apparmor.d/abstractions/bus/hostname rename to apparmor.d/abstractions/bus/org.freedesktop.hostname1 index 1161cf87..8aaa61df 100644 --- a/apparmor.d/abstractions/bus/hostname +++ b/apparmor.d/abstractions/bus/org.freedesktop.hostname1 @@ -12,4 +12,4 @@ member={Get,GetAll} peer=(name=org.freedesktop.hostname1), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/locale b/apparmor.d/abstractions/bus/org.freedesktop.locale1 similarity index 82% rename from apparmor.d/abstractions/bus/locale rename to apparmor.d/abstractions/bus/org.freedesktop.locale1 index f0dfd752..5c8e0517 100644 --- a/apparmor.d/abstractions/bus/locale +++ b/apparmor.d/abstractions/bus/org.freedesktop.locale1 @@ -7,4 +7,4 @@ member=GetAll peer=(name=:*, label=systemd-localed), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/login b/apparmor.d/abstractions/bus/org.freedesktop.login1 similarity index 93% rename from apparmor.d/abstractions/bus/login rename to apparmor.d/abstractions/bus/org.freedesktop.login1 index c3d7a0a1..f958300f 100644 --- a/apparmor.d/abstractions/bus/login +++ b/apparmor.d/abstractions/bus/org.freedesktop.login1 @@ -22,4 +22,4 @@ member={SessionNew,SessionRemoved,UserNew,UserRemoved,PrepareFor*} peer=(name=:*, label=systemd-logind), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/org.freedesktop.login1.Session b/apparmor.d/abstractions/bus/org.freedesktop.login1.Session new file mode 100644 index 00000000..04eb2c4c --- /dev/null +++ b/apparmor.d/abstractions/bus/org.freedesktop.login1.Session @@ -0,0 +1,30 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2023 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + + dbus send bus=system path=/org/freedesktop/login1 + interface=org.freedesktop.login1.Manager + member=GetSession + peer=(name=:*, label=systemd-logind), + + dbus send bus=system path=/org/freedesktop/login1/session/* + interface=org.freedesktop.DBus.Properties + member=GetAll + peer=(name=:*, label=systemd-logind), + + dbus send bus=system path=/org/freedesktop/login1/session/* + interface=org.freedesktop.login1.Session + member={ReleaseDevice,TakeControl,TakeDevice,SetBrightness} + peer=(name=:*, label=systemd-logind), + + dbus receive bus=system path=/org/freedesktop/login1/session/* + interface=org.freedesktop.DBus.Properties + member=PropertiesChanged + peer=(name=:*, label=systemd-logind), + + dbus receive bus=system path=/org/freedesktop/login1/session/* + interface=org.freedesktop.login1.Session + member=PauseDevice + peer=(name=:*, label=systemd-logind), + + include if exists diff --git a/apparmor.d/abstractions/bus/desktop b/apparmor.d/abstractions/bus/org.freedesktop.portal.Desktop similarity index 92% rename from apparmor.d/abstractions/bus/desktop rename to apparmor.d/abstractions/bus/org.freedesktop.portal.Desktop index 7907c159..fbf50be6 100644 --- a/apparmor.d/abstractions/bus/desktop +++ b/apparmor.d/abstractions/bus/org.freedesktop.portal.Desktop @@ -27,5 +27,4 @@ member={Read,ReadAll} peer=(name=:*, label=xdg-desktop-portal), - include if exists -# include + include if exists diff --git a/apparmor.d/abstractions/bus/org.freedesktop.systemd1 b/apparmor.d/abstractions/bus/org.freedesktop.systemd1 new file mode 100644 index 00000000..96fe2ed3 --- /dev/null +++ b/apparmor.d/abstractions/bus/org.freedesktop.systemd1 @@ -0,0 +1,20 @@ +# apparmor.d - Full set of apparmor profiles +# Copyright (C) 2023 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + + dbus send bus=system path=/org/freedesktop/systemd1 + interface=org.freedesktop.DBus.Properties + member={Get,GetAll} + peer=(name=org.freedesktop.systemd1, label="@{systemd}"), + + dbus send bus=session path=/org/freedesktop/systemd1 + interface=org.freedesktop.systemd1.Manager + member={GetUnit,StartUnit,StartTransientUnit} + peer=(name=org.freedesktop.systemd1, label="@{systemd}"), + + dbus send bus=session path=/org/freedesktop/systemd1 + interface=org.freedesktop.systemd1.Manager + member={GetUnit,StartUnit,StartTransientUnit} + peer=(name=org.freedesktop.systemd1), + + include if exists diff --git a/apparmor.d/abstractions/bus/systemd-session b/apparmor.d/abstractions/bus/org.freedesktop.systemd1-session similarity index 88% rename from apparmor.d/abstractions/bus/systemd-session rename to apparmor.d/abstractions/bus/org.freedesktop.systemd1-session index 3ae3abd4..d32be93d 100644 --- a/apparmor.d/abstractions/bus/systemd-session +++ b/apparmor.d/abstractions/bus/org.freedesktop.systemd1-session @@ -12,4 +12,4 @@ member=GetUnit peer=(name="{:*,org.freedesktop.systemd1}", label="@{systemd}"), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/timedate b/apparmor.d/abstractions/bus/org.freedesktop.timedate1 similarity index 82% rename from apparmor.d/abstractions/bus/timedate rename to apparmor.d/abstractions/bus/org.freedesktop.timedate1 index 8d092b95..39e5813b 100644 --- a/apparmor.d/abstractions/bus/timedate +++ b/apparmor.d/abstractions/bus/org.freedesktop.timedate1 @@ -7,4 +7,4 @@ member=GetAll peer=(name=:*, label=systemd-timedated), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/gnome-screensaver b/apparmor.d/abstractions/bus/org.gnome.ScreenSaver similarity index 91% rename from apparmor.d/abstractions/bus/gnome-screensaver rename to apparmor.d/abstractions/bus/org.gnome.ScreenSaver index 75e2fc8c..30b8b5a0 100644 --- a/apparmor.d/abstractions/bus/gnome-screensaver +++ b/apparmor.d/abstractions/bus/org.gnome.ScreenSaver @@ -17,4 +17,4 @@ member={ActiveChanged,WakeUpScreen} peer=(name=:*, label=gjs-console), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/session-manager b/apparmor.d/abstractions/bus/org.gnome.SessionManager similarity index 96% rename from apparmor.d/abstractions/bus/session-manager rename to apparmor.d/abstractions/bus/org.gnome.SessionManager index e5a34f6a..47b0e455 100644 --- a/apparmor.d/abstractions/bus/session-manager +++ b/apparmor.d/abstractions/bus/org.gnome.SessionManager @@ -47,4 +47,4 @@ member=StatusChanged peer=(name=:*, label=gnome-session-binary), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/vfs/daemon b/apparmor.d/abstractions/bus/org.gtk.vfs.Daemon similarity index 66% rename from apparmor.d/abstractions/bus/vfs/daemon rename to apparmor.d/abstractions/bus/org.gtk.vfs.Daemon index a669a472..d0f69d7a 100644 --- a/apparmor.d/abstractions/bus/vfs/daemon +++ b/apparmor.d/abstractions/bus/org.gtk.vfs.Daemon @@ -4,7 +4,7 @@ dbus send bus=session path=/org/gtk/vfs/Daemon interface=org.gtk.vfs.Daemon - member={ListMonitorImplementations,ListMountableInfo} + member={GetConnection,ListMonitorImplementations,ListMountableInfo} peer=(name=:*, label=gvfsd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/vfs/metadata b/apparmor.d/abstractions/bus/org.gtk.vfs.Metadata similarity index 88% rename from apparmor.d/abstractions/bus/vfs/metadata rename to apparmor.d/abstractions/bus/org.gtk.vfs.Metadata index 68edd36d..4303ab6b 100644 --- a/apparmor.d/abstractions/bus/vfs/metadata +++ b/apparmor.d/abstractions/bus/org.gtk.vfs.Metadata @@ -12,4 +12,4 @@ member=AttributeChanged peer=(name=:*, label=gvfsd-metadata), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/vfs/mount b/apparmor.d/abstractions/bus/org.gtk.vfs.MountTracker similarity index 90% rename from apparmor.d/abstractions/bus/vfs/mount rename to apparmor.d/abstractions/bus/org.gtk.vfs.MountTracker index 2b95ada4..2e49c2f4 100644 --- a/apparmor.d/abstractions/bus/vfs/mount +++ b/apparmor.d/abstractions/bus/org.gtk.vfs.MountTracker @@ -17,4 +17,4 @@ member=Mounted peer=(name=:*, label=gvfsd), - include if exists + include if exists diff --git a/apparmor.d/abstractions/bus/systemd b/apparmor.d/abstractions/bus/systemd deleted file mode 100644 index 63ce48bd..00000000 --- a/apparmor.d/abstractions/bus/systemd +++ /dev/null @@ -1,10 +0,0 @@ -# apparmor.d - Full set of apparmor profiles -# Copyright (C) 2023 Alexandre Pujol -# SPDX-License-Identifier: GPL-2.0-only - - dbus send bus=system path=/org/freedesktop/systemd1 - interface=org.freedesktop.DBus.Properties - member={Get,GetAll} - peer=(name=org.freedesktop.systemd1, label="@{systemd}"), - - include if exists