apparmor.d/pkg/prebuild/builder/hotfix.go

37 lines
678 B
Go
Raw Normal View History

// apparmor.d - Full set of apparmor profiles
// Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
// SPDX-License-Identifier: GPL-2.0-only
package builder
import (
"github.com/roddhjav/apparmor.d/pkg/prebuild"
"github.com/roddhjav/apparmor.d/pkg/util"
)
var (
2024-10-09 00:44:13 +02:00
regHotfix = util.ToRegexRepl([]string{
`Cx`, `cx`,
`PUx`, `pux`,
`Px`, `px`,
`Ux`, `ux`,
})
)
2024-10-09 00:44:13 +02:00
type Hotfix struct {
prebuild.Base
}
func init() {
2024-10-09 00:44:13 +02:00
RegisterBuilder(&Hotfix{
Base: prebuild.Base{
2024-10-09 00:44:13 +02:00
Keyword: "hotfix",
Msg: "Temporary fix for #74, #80 & #235",
},
})
}
2024-10-09 00:44:13 +02:00
func (b Hotfix) Apply(opt *Option, profile string) (string, error) {
return regHotfix.Replace(profile), nil
}