Skip to content

Commit a1cce28

Browse files
authored
Merge pull request #181 from stackhpc/upstream/xena-2022-12-01
Synchronise xena with upstream
2 parents b5cd543 + 2b222ce commit a1cce28

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

kolla/image/build.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,18 @@ def make_an_archive(items, arcname, item_child_path=None):
497497
image.status = Status.CONNECTION_ERROR
498498
raise ArchivingError
499499
arc_path = os.path.join(image.path, '%s-archive' % arcname)
500+
501+
# NOTE(jneumann): Change ownership of files to root:root. This
502+
# avoids an issue introduced by the fix for git CVE-2022-24765,
503+
# which breaks PBR when the source checkout is not owned by the
504+
# user installing it. LP#1969096
505+
def reset_userinfo(tarinfo):
506+
tarinfo.uid = tarinfo.gid = 0
507+
tarinfo.uname = tarinfo.gname = "root"
508+
return tarinfo
509+
500510
with tarfile.open(arc_path, 'w') as tar:
501-
tar.add(items_path, arcname=arcname)
511+
tar.add(items_path, arcname=arcname, filter=reset_userinfo)
502512
return len(os.listdir(items_path))
503513

504514
self.logger.debug('Processing')

0 commit comments

Comments
 (0)