CPack/Deb: Restore setting of root as the owner of files

Refactoring in commit v3.10.0-rc1~220^2 (cmCPackDebGenerator: Use
libarchive to create .deb file) accidentally broke this for the
top-level archive.
This commit is contained in:
Andrew Fuller
2018-06-29 14:14:22 -07:00
committed by Brad King
parent 51e7d41507
commit 2774259100

View File

@@ -664,6 +664,12 @@ int cmCPackDebGenerator::createDeb()
cmGeneratedFileStream debStream;
debStream.Open(outputPath.c_str(), false, true);
cmArchiveWrite deb(debStream, cmArchiveWrite::CompressNone, "arbsd");
// uid/gid should be the one of the root user, and this root user has
// always uid/gid equal to 0.
deb.SetUIDAndGID(0u, 0u);
deb.SetUNAMEAndGNAME("root", "root");
if (!deb.Add(tlDir + "debian-binary", tlDir.length()) ||
!deb.Add(tlDir + "control.tar.gz", tlDir.length()) ||
!deb.Add(tlDir + "data.tar" + compression_suffix, tlDir.length())) {