build: update build for new bin & lib variables
This commit is contained in:
parent
64146be05a
commit
1f75dc9956
4 changed files with 3 additions and 24 deletions
|
|
@ -27,5 +27,3 @@
|
||||||
# Common places for binaries and libraries across distributions
|
# Common places for binaries and libraries across distributions
|
||||||
@{bin}=/{usr/,}{s,}bin
|
@{bin}=/{usr/,}{s,}bin
|
||||||
@{lib}=/{usr/,}lib{,exec,32,64}
|
@{lib}=/{usr/,}lib{,exec,32,64}
|
||||||
|
|
||||||
# Libexec path. Different in some distribution
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ var (
|
||||||
|
|
||||||
// Tunables
|
// Tunables
|
||||||
Tunables = map[string][]string{
|
Tunables = map[string][]string{
|
||||||
"libexec": {},
|
"bin": {"/{usr/,}{s,}bin"},
|
||||||
|
"lib": {"/{usr/,}lib{,exec,32,64}"},
|
||||||
"multiarch": {"*-linux-gnu*"},
|
"multiarch": {"*-linux-gnu*"},
|
||||||
"user_share_dirs": {"/home/*/.local/share"},
|
"user_share_dirs": {"/home/*/.local/share"},
|
||||||
"etc_ro": {"/{usr/,}etc/"},
|
"etc_ro": {"/{usr/,}etc/"},
|
||||||
|
|
|
||||||
|
|
@ -117,17 +117,9 @@ func Merge() error {
|
||||||
// Set the distribution specificities
|
// Set the distribution specificities
|
||||||
func Configure() (err error) {
|
func Configure() (err error) {
|
||||||
switch Distribution {
|
switch Distribution {
|
||||||
case "arch":
|
case "arch", "opensuse":
|
||||||
err = setLibexec("/{usr/,}lib")
|
|
||||||
|
|
||||||
case "opensuse":
|
|
||||||
err = setLibexec("/{usr/,}libexec")
|
|
||||||
|
|
||||||
case "debian", "ubuntu", "whonix":
|
case "debian", "ubuntu", "whonix":
|
||||||
if err := setLibexec("/{usr/,}libexec"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy Ubuntu specific profiles
|
// Copy Ubuntu specific profiles
|
||||||
if err := copyTo(DistDir.Join("ubuntu"), RootApparmord); err != nil {
|
if err := copyTo(DistDir.Join("ubuntu"), RootApparmord); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/arduino/go-paths-helper"
|
"github.com/arduino/go-paths-helper"
|
||||||
"github.com/roddhjav/apparmor.d/pkg/aa"
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -48,17 +47,6 @@ func getSupportedDistribution() string {
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
||||||
func setLibexec(libexec string) error {
|
|
||||||
aa.Tunables["libexec"] = []string{libexec}
|
|
||||||
file, err := RootApparmord.Join("tunables", "multiarch.d", "apparmor.d").Append()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer file.Close()
|
|
||||||
_, err = file.WriteString(`@{libexec}=` + libexec)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func copyTo(src *paths.Path, dst *paths.Path) error {
|
func copyTo(src *paths.Path, dst *paths.Path) error {
|
||||||
files, err := src.ReadDirRecursiveFiltered(nil, paths.FilterOutDirectories())
|
files, err := src.ReadDirRecursiveFiltered(nil, paths.FilterOutDirectories())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue