mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-12-28 16:06:54 +01:00
36 lines
678 B
Go
36 lines
678 B
Go
// 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 (
|
|
regHotfix = util.ToRegexRepl([]string{
|
|
`Cx`, `cx`,
|
|
`PUx`, `pux`,
|
|
`Px`, `px`,
|
|
`Ux`, `ux`,
|
|
})
|
|
)
|
|
|
|
type Hotfix struct {
|
|
prebuild.Base
|
|
}
|
|
|
|
func init() {
|
|
RegisterBuilder(&Hotfix{
|
|
Base: prebuild.Base{
|
|
Keyword: "hotfix",
|
|
Msg: "Temporary fix for #74, #80 & #235",
|
|
},
|
|
})
|
|
}
|
|
|
|
func (b Hotfix) Apply(opt *Option, profile string) (string, error) {
|
|
return regHotfix.Replace(profile), nil
|
|
}
|