fix: ensure filter directive get cleaned on build.
This commit is contained in:
parent
327c1dec33
commit
117e63d88f
2 changed files with 2 additions and 1 deletions
|
|
@ -11,3 +11,4 @@
|
||||||
@{lib}/security-misc/pam_faillock_not_if_x rPx,
|
@{lib}/security-misc/pam_faillock_not_if_x rPx,
|
||||||
@{lib}/security-misc/pam-abort-on-locked-password rPx,
|
@{lib}/security-misc/pam-abort-on-locked-password rPx,
|
||||||
@{lib}/security-misc/pam-info 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
|
// Useful to remove directive text applied on some condition only
|
||||||
func (o *Option) Clean(profile string) string {
|
func (o *Option) Clean(profile string) string {
|
||||||
reg := regexp.MustCompile(`\s*` + Keyword + o.Name + ` .*$`)
|
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) {
|
func RegisterDirective(d Directive) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue