2024-03-30 19:17:55 +01:00
|
|
|
// 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 (
|
2024-10-02 17:22:46 +02:00
|
|
|
"github.com/roddhjav/apparmor.d/pkg/prebuild"
|
2024-03-30 19:17:55 +01:00
|
|
|
"github.com/roddhjav/apparmor.d/pkg/util"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2024-10-09 00:44:13 +02:00
|
|
|
regHotfix = util.ToRegexRepl([]string{
|
2024-04-02 18:48:03 +02:00
|
|
|
`Cx`, `cx`,
|
2024-03-30 19:17:55 +01:00
|
|
|
`PUx`, `pux`,
|
|
|
|
`Px`, `px`,
|
|
|
|
`Ux`, `ux`,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
2024-10-09 00:44:13 +02:00
|
|
|
type Hotfix struct {
|
2024-10-02 17:22:46 +02:00
|
|
|
prebuild.Base
|
2024-03-30 19:17:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2024-10-09 00:44:13 +02:00
|
|
|
RegisterBuilder(&Hotfix{
|
2024-10-02 17:22:46 +02:00
|
|
|
Base: prebuild.Base{
|
2024-10-09 00:44:13 +02:00
|
|
|
Keyword: "hotfix",
|
|
|
|
Msg: "Temporary fix for #74, #80 & #235",
|
2024-03-30 19:17:55 +01:00
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-10-09 00:44:13 +02:00
|
|
|
func (b Hotfix) Apply(opt *Option, profile string) (string, error) {
|
|
|
|
return regHotfix.Replace(profile), nil
|
2024-03-30 19:17:55 +01:00
|
|
|
}
|