simply install virt-launcher policy without checking if it exist
modern version of semodule support installing/reinstaling/upgrading the modules
with the same install operation
@@ -136,11 +136,6 @@ func (se *SELinuxImpl) Restore(dir string) (err error) {
func (*SELinuxImpl) InstallPolicy(dir string) (err error) {
for _, policyName := range POLICY_FILES {
fileDest := dir + "/" + policyName + ".cil"
- modules, err := exec.Command("/usr/bin/chroot", "--mount", "/proc/1/ns/mnt", "exec", "--", "/usr/sbin/semodule", "-l").CombinedOutput()
- if err != nil {
- return fmt.Errorf("failed to retrive a list of installed modules, err: % v", err)
- }
- if !strings.Contains(string(modules), policyName) {
err := copyPolicy(policyName, dir)
if err != nil {
return fmt.Errorf("failed to copy policy %v - err: % v", fileDest, err)
@@ -150,7 +145,6 @@ func (*SELinuxImpl) InstallPolicy(dir string) (err error) {
return fmt.Errorf("failed to install policy %v - err: % v", fileDest, err)
}
}
- }
return nil
}
