diff --git a/apparmor.d/abstractions/trash b/apparmor.d/abstractions/trash.d/complete similarity index 96% rename from apparmor.d/abstractions/trash rename to apparmor.d/abstractions/trash.d/complete index 87a61cc8..c7072145 100644 --- a/apparmor.d/abstractions/trash +++ b/apparmor.d/abstractions/trash.d/complete @@ -27,5 +27,3 @@ # Removable media's trash location when the admin doesn't create the .Trash/ folder in the top lvl dir owner /{media,mnt}/*/*/.Trash-[0-9]*/{,**} rwl, - - include if exists diff --git a/apparmor.d/tunables/extend b/apparmor.d/tunables/etc.d/apparmor.d similarity index 90% rename from apparmor.d/tunables/extend rename to apparmor.d/tunables/etc.d/apparmor.d index e448d2cd..7460030a 100644 --- a/apparmor.d/tunables/extend +++ b/apparmor.d/tunables/etc.d/apparmor.d @@ -1,6 +1,6 @@ # apparmor.d - Full set of apparmor profiles # Extended system directories definition -# Copyright (C) 2021 Alexandre Pujol +# Copyright (C) 2021-2023 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only # To allow extended personalisation without breaking everything. @@ -30,5 +30,3 @@ # Integration with Ubuntu Core @{etc_rw}+=/etc/writable/ - -include if exists \ No newline at end of file diff --git a/apparmor.d/tunables/global b/apparmor.d/tunables/global deleted file mode 100644 index 2d003bf2..00000000 --- a/apparmor.d/tunables/global +++ /dev/null @@ -1,24 +0,0 @@ -# ------------------------------------------------------------------ -# -# Copyright (C) 2006-2009 Novell/SUSE -# Copyright (C) 2010-2014 Canonical Ltd. -# -# 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. -# -# ------------------------------------------------------------------ - -# All the tunables definitions that should be available to every profile -# should be included here - -include -include -include -include -include -include -include -include -include -include diff --git a/apparmor.d/tunables/xdg-user-dirs b/apparmor.d/tunables/home.d/apparmor.d similarity index 61% rename from apparmor.d/tunables/xdg-user-dirs rename to apparmor.d/tunables/home.d/apparmor.d index 6a701ca4..1c0e73bf 100644 --- a/apparmor.d/tunables/xdg-user-dirs +++ b/apparmor.d/tunables/home.d/apparmor.d @@ -1,6 +1,6 @@ # apparmor.d - Full set of apparmor profiles # Extended user XDG directories definition -# Copyright (C) 2021 Alexandre Pujol +# Copyright (C) 2021-2023 Alexandre Pujol # SPDX-License-Identifier: GPL-2.0-only # To allow extended personalisation by the user without breaking everything. @@ -9,29 +9,20 @@ # XDG_*_DIR variables are relative pathnames from the user home directory. # user_*_dirs variables are absolute path. -# Define the common set of XDG user directories (usually defined in -# /etc/xdg/user-dirs.defaults) -@{XDG_DESKTOP_DIR}="Desktop" -@{XDG_DOWNLOAD_DIR}="Downloads" -@{XDG_TEMPLATES_DIR}="Templates" -@{XDG_PUBLICSHARE_DIR}="Public" -@{XDG_DOCUMENTS_DIR}="Documents" -@{XDG_MUSIC_DIR}="Music" -@{XDG_PICTURES_DIR}="Pictures" -@{XDG_VIDEOS_DIR}="Videos" +# First part, second part in /etc/apparmor.d/tunables/xdg-user-dirs.d/apparmor.d # Extra user personal directories @{XDG_BOOKS_DIR}="Books" @{XDG_PROJECTS_DIR}="Projects" @{XDG_WORK_DIR}="Work" -@{XDG_SCREENSHOTS_DIR}="@{XDG_PICTURES_DIR}/Screenshots" @{XDG_SYNC_DIR}="Sync" @{XDG_TORRENTS_DIR}="Torrents" @{XDG_GAMES_DIR}=".games" @{XDG_VM_DIR}=".vm" @{XDG_VM_SHARES_DIR}="VM_Shares" -@{XDG_WALLPAPERS_DIR}="@{XDG_PICTURES_DIR}/Wallpapers" @{XDG_IMG_DIR}="images" +@{XDG_SCREENSHOTS_DIR}="Pictures/Screenshots" +@{XDG_WALLPAPERS_DIR}="Pictures/Wallpapers" # User personal keyrings @{XDG_SSH_DIR}=".ssh" @@ -61,22 +52,10 @@ # Other user directories @{user_books_dirs}=@{HOME}/@{XDG_BOOKS_DIR} @{MOUNTS}/@{XDG_BOOKS_DIR} -@{user_documents_dirs}=@{HOME}/@{XDG_DOCUMENTS_DIR} @{MOUNTS}/@{XDG_DOCUMENTS_DIR} -@{user_download_dirs}=@{HOME}/@{XDG_DOWNLOAD_DIR} @{MOUNTS}/@{XDG_DOWNLOAD_DIR} @{user_games_dirs}=@{HOME}/@{XDG_GAMES_DIR} @{MOUNTS}/@{XDG_GAMES_DIR} -@{user_music_dirs}=@{HOME}/@{XDG_MUSIC_DIR} @{MOUNTS}/@{XDG_MUSIC_DIR} -@{user_pictures_dirs}=@{HOME}/@{XDG_PICTURES_DIR} @{MOUNTS}/@{XDG_PICTURES_DIR} @{user_projects_dirs}=@{HOME}/@{XDG_PROJECTS_DIR} @{MOUNTS}/@{XDG_PROJECTS_DIR} -@{user_publicshare_dirs}=@{HOME}/@{XDG_PUBLICSHARE_DIR} @{MOUNTS}/@{XDG_PUBLICSHARE_DIR} @{user_sync_dirs}=@{HOME}/@{XDG_SYNC_DIR} @{MOUNTS}/*/@{XDG_SYNC_DIR} -@{user_templates_dirs}=@{HOME}/@{XDG_TEMPLATES_DIR} @{MOUNTS}/@{XDG_TEMPLATES_DIR} @{user_torrents_dirs}=@{HOME}/@{XDG_TORRENTS_DIR} @{MOUNTS}/@{XDG_TORRENTS_DIR} -@{user_videos_dirs}=@{HOME}/@{XDG_VIDEOS_DIR} @{MOUNTS}/@{XDG_VIDEOS_DIR} @{user_vm_dirs}=@{HOME}/@{XDG_VM_DIR} @{MOUNTS}/@{XDG_VM_DIR} -@{user_vm_shares}=@{HOME}/@{XDG_VM_SHARES_DIR} @{MOUNTS}/@{XDG_VM_SHARES_DIR} @{user_work_dirs}=@{HOME}/@{XDG_WORK_DIR} @{MOUNTS}/@{XDG_WORK_DIR} @{user_password_store_dirs}=@{HOME}/@{XDG_PASSWORD_STORE_DIR} @{MOUNTS}/@{XDG_PASSWORD_STORE_DIR} - -# Also, include files in tunables/xdg-user-dirs.d for site-specific adjustments -# to the various XDG directories -include diff --git a/apparmor.d/tunables/xdg-user-dirs.d/apparmor.d b/apparmor.d/tunables/xdg-user-dirs.d/apparmor.d new file mode 100644 index 00000000..5f944090 --- /dev/null +++ b/apparmor.d/tunables/xdg-user-dirs.d/apparmor.d @@ -0,0 +1,22 @@ +# apparmor.d - Full set of apparmor profiles +# Extended user XDG directories definition +# Copyright (C) 2021-2023 Alexandre Pujol +# SPDX-License-Identifier: GPL-2.0-only + +# To allow extended personalisation by the user without breaking everything. +# All apparmor profiles should always use the variables defined here. + +# XDG_*_DIR variables are relative pathnames from the user home directory. +# user_*_dirs variables are absolute path. + +# Second part. First part in /etc/apparmor.d/tunables/home.d/apparmor.d + +# Other user directories +@{user_documents_dirs}=@{HOME}/@{XDG_DOCUMENTS_DIR} @{MOUNTS}/@{XDG_DOCUMENTS_DIR} +@{user_download_dirs}=@{HOME}/@{XDG_DOWNLOAD_DIR} @{MOUNTS}/@{XDG_DOWNLOAD_DIR} +@{user_music_dirs}=@{HOME}/@{XDG_MUSIC_DIR} @{MOUNTS}/@{XDG_MUSIC_DIR} +@{user_pictures_dirs}=@{HOME}/@{XDG_PICTURES_DIR} @{MOUNTS}/@{XDG_PICTURES_DIR} +@{user_publicshare_dirs}=@{HOME}/@{XDG_PUBLICSHARE_DIR} @{MOUNTS}/@{XDG_PUBLICSHARE_DIR} +@{user_templates_dirs}=@{HOME}/@{XDG_TEMPLATES_DIR} @{MOUNTS}/@{XDG_TEMPLATES_DIR} +@{user_videos_dirs}=@{HOME}/@{XDG_VIDEOS_DIR} @{MOUNTS}/@{XDG_VIDEOS_DIR} +@{user_vm_shares}=@{HOME}/@{XDG_VM_SHARES_DIR} @{MOUNTS}/@{XDG_VM_SHARES_DIR}