build: better way to handle debian hide file.
only needed as whonix needs special addition.
This commit is contained in:
parent
13d3b23a04
commit
41c0e57eca
4 changed files with 28 additions and 4 deletions
|
|
@ -5,11 +5,15 @@
|
|||
package cfg
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/roddhjav/apparmor.d/pkg/paths"
|
||||
"github.com/roddhjav/apparmor.d/pkg/util"
|
||||
)
|
||||
|
||||
// Default content of debian/apparmor.d.hide. Whonix has special addition.
|
||||
var Hide = `# This file is generated by "make", all edit will be lost.
|
||||
|
||||
/etc/apparmor.d/usr.bin.firefox
|
||||
|
|
@ -81,4 +85,16 @@ func (o Overwriter) Apply() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
type DebianHider struct {
|
||||
path *paths.Path
|
||||
}
|
||||
|
||||
// Initialize the file with content from Hide
|
||||
func (d DebianHider) Init() error {
|
||||
return d.path.WriteFile([]byte(Hide))
|
||||
}
|
||||
|
||||
// Initialize the file with content from Hide
|
||||
func (d DebianHider) Clean() error {
|
||||
return d.path.WriteFile([]byte("# This file is generated by \"make\", all edit will be lost.\n"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue