From 5f1ac6e1b14595e8727497b9227ad239d60f2d86 Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Mon, 22 May 2023 03:14:18 -0600 Subject: [PATCH] fbt: Fix tar uid overflow when packaging (#2689) * fbt: Fix tar uid overflow when packaging * Fix trailing spaces --- scripts/sconsdist.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/sconsdist.py b/scripts/sconsdist.py index d2d1d2f49..461781136 100644 --- a/scripts/sconsdist.py +++ b/scripts/sconsdist.py @@ -271,7 +271,13 @@ class Main(App): self.note_dist_component( "update", "tgz", self.get_dist_path(bundle_tgz) ) - tar.add(bundle_dir, arcname=bundle_dir_name) + + # Strip uid and gid in case of overflow + def tar_filter(tarinfo): + tarinfo.uid = tarinfo.gid = 0 + return tarinfo + + tar.add(bundle_dir, arcname=bundle_dir_name, filter=tar_filter) return bundle_result