Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
libpkg: Set numeric uid/gid when adding archive entries
Mark Johnston committed 10 months ago
commit fd4e745254052f8cb306e41400c38acf101c68d1
parent b2ad8c9
1 file changed +14 -0
modified libpkg/packing.c
@@ -233,10 +233,24 @@ packing_append_file_attr(struct packing *pack, const char *filepath,
	if (uname != NULL && uname[0] != '\0') {
		archive_entry_set_uname(entry, uname);
	}
+
#ifdef __FreeBSD__
+
	/*
+
	 * Set this so that libarchive does not embed the current user's ID,
+
	 * breaking reproducibility.
+
	 */
+
	archive_entry_set_uid(entry, 65534 /* nobody */);
+
#endif

	if (gname != NULL && gname[0] != '\0') {
		archive_entry_set_gname(entry, gname);
	}
+
#ifdef __FreeBSD__
+
	/*
+
	 * Set this so that libarchive does not embed the current user's ID,
+
	 * breaking reproducibility.
+
	 */
+
	archive_entry_set_gid(entry, 65534 /* nobody */);
+
#endif

	if (fflags > 0)
		archive_entry_set_fflags(entry, fflags, 0);