Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
syscontainers: set selinux label for files copied to the host
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Dec 6, 2017
1 parent 50b0df1 commit 2eb845b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Atomic/rpm_host_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import tempfile
import shutil
import hashlib
import selinux

RPM_NAME_PREFIX = "atomic-container"

Expand All @@ -25,6 +26,10 @@ def copyfile(src, dest):
return True
else:
shutil.copy2(src, dest)
try:
selinux.restorecon(dest)
except (TypeError, OSError):
pass
return True
return False

Expand Down Expand Up @@ -52,7 +57,7 @@ def file_checksum(path, blocksize=(1<<20)):
return h.hexdigest()

@staticmethod
def rm_add_files_to_host(old_installed_files_checksum, exports, prefix="/", files_template=None, values=None, rename_files=None):
def rm_add_files_to_host(old_installed_files_checksum, exports, prefix="/", files_template=None, values=None, rename_files=None, files_content=None):
# if any file was installed on the host delete it
if old_installed_files_checksum:
for path, checksum in old_installed_files_checksum.items():
Expand Down

0 comments on commit 2eb845b

Please sign in to comment.