mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2024-11-14 23:43:56 +01:00
fix: ensure filter directive get cleaned on build.
This commit is contained in:
parent
327c1dec33
commit
117e63d88f
@ -11,3 +11,4 @@
|
||||
@{lib}/security-misc/pam_faillock_not_if_x rPx,
|
||||
@{lib}/security-misc/pam-abort-on-locked-password rPx,
|
||||
@{lib}/security-misc/pam-info rPx,
|
||||
|
||||
|
@ -65,7 +65,7 @@ func NewOption(file *paths.Path, match []string) *Option {
|
||||
// Useful to remove directive text applied on some condition only
|
||||
func (o *Option) Clean(profile string) string {
|
||||
reg := regexp.MustCompile(`\s*` + Keyword + o.Name + ` .*$`)
|
||||
return reg.ReplaceAllString(profile, "")
|
||||
return strings.Replace(profile, o.Raw, reg.ReplaceAllString(o.Raw, ""), 1)
|
||||
}
|
||||
|
||||
func RegisterDirective(d Directive) {
|
||||
|
Loading…
Reference in New Issue
Block a user