Skip to content

Commit 03c3710

Browse files
authored
Merge pull request #183 from stackhpc/upstream/wallaby-2022-12-01
Synchronise wallaby with upstream
2 parents 6dd85b5 + e8c92df commit 03c3710

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
@@ -518,8 +518,18 @@ def make_an_archive(items, arcname, item_child_path=None):
518518
image.status = Status.CONNECTION_ERROR
519519
raise ArchivingError
520520
arc_path = os.path.join(image.path, '%s-archive' % arcname)
521+
522+
# NOTE(jneumann): Change ownership of files to root:root. This
523+
# avoids an issue introduced by the fix for git CVE-2022-24765,
524+
# which breaks PBR when the source checkout is not owned by the
525+
# user installing it. LP#1969096
526+
def reset_userinfo(tarinfo):
527+
tarinfo.uid = tarinfo.gid = 0
528+
tarinfo.uname = tarinfo.gname = "root"
529+
return tarinfo
530+
521531
with tarfile.open(arc_path, 'w') as tar:
522-
tar.add(items_path, arcname=arcname)
532+
tar.add(items_path, arcname=arcname, filter=reset_userinfo)
523533
return len(os.listdir(items_path))
524534

525535
self.logger.debug('Processing')

0 commit comments

Comments
 (0)