fix(build): add missing trash abs on Ubuntu.

This commit is contained in:
Alexandre Pujol 2023-04-23 17:27:49 +01:00
parent 789e1ddf8b
commit c2e4dfa07e
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
2 changed files with 85 additions and 1 deletions

View File

@ -113,12 +113,21 @@ func Configure() error {
return err return err
} }
case "ubuntu", "opensuse": case "opensuse":
aa.Tunables["libexec"] = []string{"/{usr/,}libexec"} aa.Tunables["libexec"] = []string{"/{usr/,}libexec"}
if err := setLibexec(); err != nil { if err := setLibexec(); err != nil {
return err return err
} }
case "ubuntu":
aa.Tunables["libexec"] = []string{"/{usr/,}libexec"}
if err := setLibexec(); err != nil {
return err
}
if err := paths.New("dists/ubuntu/trash").CopyTo(RootApparmord.Join("abstractions", "trash")); err != nil {
return err
}
case "debian", "whonix": case "debian", "whonix":
aa.Tunables["libexec"] = []string{"/{usr/,}libexec"} aa.Tunables["libexec"] = []string{"/{usr/,}libexec"}
if err := setLibexec(); err != nil { if err := setLibexec(); err != nil {

75
dists/ubuntu/trash Normal file
View File

@ -0,0 +1,75 @@
abi <abi/3.0>,
# requires <tunables/home>
owner @{HOME}/.config/trashrc rw,
owner @{HOME}/.config/trashrc.lock rwk,
owner @{HOME}/.config/#[0-9]*[0-9] rwk,
owner @{HOME}/.config/trashrc.* rwl -> @{HOME}/.config/#[0-9]*[0-9],
owner @{run}/user/@{uid}/#[0-9]*[0-9] rw,
owner @{run}/user/@{uid}/trash.so*.[0-9].slave-socket rwl -> @{run}/user/@{uid}/#[0-9]*[0-9],
# Home trash location
owner @{HOME}/.local/share/Trash/ rw,
owner @{HOME}/.local/share/Trash/#[0-9]*[0-9] rw,
owner @{HOME}/.local/share/Trash/directorysizes{,.*} rwl -> @{HOME}/.local/share/Trash/#[0-9]*[0-9],
owner @{HOME}/.local/share/Trash/files/{,**} rw,
owner @{HOME}/.local/share/Trash/info/ rw,
owner @{HOME}/.local/share/Trash/info/*.trashinfo{,.*} rw,
owner @{HOME}/.local/share/Trash/expunged/ rw,
owner @{HOME}/.local/share/Trash/expunged/[0-9]* rw,
owner @{HOME}/.local/share/Trash/expunged/[0-9]*/ rw,
owner @{HOME}/.local/share/Trash/expunged/[0-9]*/** rw,
# Partitions' trash location when the admin creates the .Trash/ folder in the top lvl dir
owner /media/*/.Trash/ rw,
owner /media/*/.Trash/@{uid}/ rw,
owner /media/*/.Trash/@{uid}/#[0-9]*[0-9] rw,
owner /media/*/.Trash/@{uid}/directorysizes{,.*} rwl -> /media/*/.Trash/@{uid}/#[0-9]*[0-9],
owner /media/*/.Trash/@{uid}/files/{,**} rw,
owner /media/*/.Trash/@{uid}/info/ rw,
owner /media/*/.Trash/@{uid}/info/*.trashinfo{,.*} rw,
owner /media/*/.Trash/@{uid}/expunged/ rw,
owner /media/*/.Trash/@{uid}/expunged/[0-9]* rw,
owner /media/*/.Trash/@{uid}/expunged/[0-9]*/ rw,
owner /media/*/.Trash/@{uid}/expunged/[0-9]*/** rw,
# Partitions' trash location when the admin doesn't create the .Trash/ folder in the top lvl dir
owner /media/*/.Trash-@{uid}/ rw,
owner /media/*/.Trash-@{uid}/#[0-9]*[0-9] rw,
owner /media/*/.Trash-@{uid}/directorysizes{,.*} rwl -> /media/*/.Trash-@{uid}/#[0-9]*[0-9],
owner /media/*/.Trash-@{uid}/files/{,**} rw,
owner /media/*/.Trash-@{uid}/info/ rw,
owner /media/*/.Trash-@{uid}/info/*.trashinfo{,.*} rw,
owner /media/*/.Trash-@{uid}/expunged/ rw,
owner /media/*/.Trash-@{uid}/expunged/[0-9]* rw,
owner /media/*/.Trash-@{uid}/expunged/[0-9]*/ rw,
owner /media/*/.Trash-@{uid}/expunged/[0-9]*/** rw,
# Removable media's trash location when the admin creates the .Trash/ folder in the top lvl dir
owner /media/*/*/.Trash/ rw,
owner /media/*/*/.Trash/@{uid}/ rw,
owner /media/*/*/.Trash/@{uid}/#[0-9]*[0-9] rw,
owner /media/*/*/.Trash/@{uid}/directorysizes{,.*} rwl -> /media/*/*/.Trash/@{uid}/#[0-9]*[0-9],
owner /media/*/*/.Trash/@{uid}/files/{,**} rw,
owner /media/*/*/.Trash/@{uid}/info/ rw,
owner /media/*/*/.Trash/@{uid}/info/*.trashinfo{,.*} rw,
owner /media/*/*/.Trash/@{uid}/expunged/ rw,
owner /media/*/*/.Trash/@{uid}/expunged/[0-9]* rw,
owner /media/*/*/.Trash/@{uid}/expunged/[0-9]*/ rw,
owner /media/*/*/.Trash/@{uid}/expunged/[0-9]*/** rw,
# Removable media's trash location when the admin doesn't create the .Trash/ folder in the top lvl dir
owner /media/*/*/.Trash-@{uid}/ rw,
owner /media/*/*/.Trash-@{uid}/#[0-9]*[0-9] rw,
owner /media/*/*/.Trash-@{uid}/directorysizes{,.*} rwl -> /media/*/*/.Trash-@{uid}/#[0-9]*[0-9],
owner /media/*/*/.Trash-@{uid}/files/{,**} rw,
owner /media/*/*/.Trash-@{uid}/info/ rw,
owner /media/*/*/.Trash-@{uid}/info/*.trashinfo{,.*} rw,
owner /media/*/*/.Trash-@{uid}/expunged/ rw,
owner /media/*/*/.Trash-@{uid}/expunged/[0-9]* rw,
owner /media/*/*/.Trash-@{uid}/expunged/[0-9]*/ rw,
owner /media/*/*/.Trash-@{uid}/expunged/[0-9]*/** rw,
include if exists <abstractions/trash.d>