2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Fix capture of non-selinux systems

This commit is contained in:
Jarrod Johnson 2022-04-18 09:15:09 -04:00
parent 449b2662fa
commit f15802a9aa

View File

@ -97,7 +97,10 @@ class FileMasker():
filename = filename[1:]
filename = os.path.join('/run/imgutil/capin/', filename)
for tfilename in glob.glob(filename):
secontext = os.getxattr(tfilename, 'security.selinux')
try:
secontext = os.getxattr(tfilename, 'security.selinux')
except OSError:
secontext = None
if maskwith is None:
tmaskwith = tempfile.mkstemp()
os.close(tmaskwith[0])