mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
fix(build): ensure the build system has support for empty profile.
This commit is contained in:
parent
1bc63becaf
commit
fbf154b860
@ -35,8 +35,6 @@ type DirectiveFunc func(*paths.Path, string) string
|
||||
// # dbus: own bus=session name=org.freedesktop.FileManager1
|
||||
// # dbus: talk name=org.freedesktop.login1 label=systemd-logind
|
||||
func DirectiveDbus(file *paths.Path, profile string) string {
|
||||
const lenHeader = 12 // len("profile {\n ")
|
||||
|
||||
var p *aa.AppArmorProfile
|
||||
for _, match := range regDbus.FindAllStringSubmatch(profile, -1) {
|
||||
origin := match[0]
|
||||
@ -61,7 +59,7 @@ func DirectiveDbus(file *paths.Path, profile string) string {
|
||||
|
||||
generatedDbus := p.String()
|
||||
lenDbus := len(generatedDbus)
|
||||
generatedDbus = generatedDbus[lenHeader : lenDbus-3]
|
||||
generatedDbus = generatedDbus[:lenDbus-1]
|
||||
profile = strings.Replace(profile, origin, generatedDbus, -1)
|
||||
}
|
||||
return profile
|
||||
|
Loading…
Reference in New Issue
Block a user